mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-05-12 Dave Peticolas <dave@krondo.com>
* src/FileDialog.c (gncFileSaveAs): don't use a default filename * src/scm/report/hello-world.scm: put under utility menu * src/scm/report/welcome-to-gnucash.scm: don't show in menu * src/scm/report/iframe-url.scm: put under utility menu * src/scm/report.scm: add 'utility reports' menu * src/gnome/new-user-funs.c: add support for opening balances * src/gnome/gnc-amount-edit.c (gnc_amount_edit_evaluate): allow empty string as zero * src/gnome/new-user-callbacks.c: add support for opening balances * src/gnome/dialog-account.c (gnc_account_list_fill): fix warning (gnc_account_window_destroy_cb): destroy callback has no return (gnc_ui_to_account): reverse opening balance appropriately * src/engine/Account.c: change return type to const git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4172 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
455cc47410
commit
14b2d233ce
25
ChangeLog
25
ChangeLog
@ -1,3 +1,28 @@
|
||||
2001-05-12 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/FileDialog.c (gncFileSaveAs): don't use a default filename
|
||||
|
||||
* src/scm/report/hello-world.scm: put under utility menu
|
||||
|
||||
* src/scm/report/welcome-to-gnucash.scm: don't show in menu
|
||||
|
||||
* src/scm/report/iframe-url.scm: put under utility menu
|
||||
|
||||
* src/scm/report.scm: add 'utility reports' menu
|
||||
|
||||
* src/gnome/new-user-funs.c: add support for opening balances
|
||||
|
||||
* src/gnome/gnc-amount-edit.c (gnc_amount_edit_evaluate): allow
|
||||
empty string as zero
|
||||
|
||||
* src/gnome/new-user-callbacks.c: add support for opening balances
|
||||
|
||||
* src/gnome/dialog-account.c (gnc_account_list_fill): fix warning
|
||||
(gnc_account_window_destroy_cb): destroy callback has no return
|
||||
(gnc_ui_to_account): reverse opening balance appropriately
|
||||
|
||||
* src/engine/Account.c: change return type to const
|
||||
|
||||
2001-05-12 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/scm/report/pnl.scm, account-piecharts.scm,
|
||||
|
@ -551,7 +551,7 @@ gncFileSaveAs (void)
|
||||
GNCBackendError io_err = ERR_BACKEND_NO_ERR;
|
||||
|
||||
ENTER(" ");
|
||||
filename = fileBox(_("Save"), "*.gnc", gnc_history_get_last());
|
||||
filename = fileBox(_("Save"), "*.gnc", NULL);
|
||||
if (!filename) return;
|
||||
|
||||
/* Check to see if the user specified the same file as the current
|
||||
|
@ -1871,8 +1871,8 @@ account_type_name[NUM_ACCOUNT_TYPES] = {
|
||||
*/
|
||||
};
|
||||
|
||||
char *
|
||||
xaccAccountGetTypeStr(int type) {
|
||||
const char *
|
||||
xaccAccountGetTypeStr(GNCAccountType type) {
|
||||
if (0 > type) return "";
|
||||
if (NUM_ACCOUNT_TYPES <= type) return "";
|
||||
return _(account_type_name [type]);
|
||||
|
@ -105,7 +105,7 @@ typedef enum
|
||||
CREDITLINE = 14, /* line of credit */
|
||||
} GNCAccountType;
|
||||
|
||||
char * xaccAccountGetTypeStr (int type); /* GUI names */
|
||||
const char * xaccAccountGetTypeStr (GNCAccountType type); /* GUI names */
|
||||
|
||||
/* Conversion routines for the account types to/from strings.
|
||||
Critical for the text communication mechanisms. i.e. INCOME ->
|
||||
|
@ -391,6 +391,9 @@ gnc_ui_to_account(AccountWindow *aw)
|
||||
if (gnc_numeric_zero_p (balance))
|
||||
return;
|
||||
|
||||
if (gnc_reverse_balance (account))
|
||||
balance = gnc_numeric_neg (balance);
|
||||
|
||||
date = gnc_date_edit_get_date
|
||||
(GNC_DATE_EDIT (aw->opening_balance_date_edit));
|
||||
|
||||
@ -1257,7 +1260,7 @@ gnc_account_window_help_cb(GtkWidget *widget, gpointer data)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static void
|
||||
gnc_account_window_destroy_cb (GtkObject *object, gpointer data)
|
||||
{
|
||||
AccountWindow *aw = data;
|
||||
@ -1286,7 +1289,7 @@ gnc_account_window_destroy_cb (GtkObject *object, gpointer data)
|
||||
default:
|
||||
PERR ("unexpected dialog type\n");
|
||||
gnc_resume_gui_refresh ();
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
gnc_unregister_gui_component (aw->component_id);
|
||||
@ -1307,8 +1310,6 @@ gnc_account_window_destroy_cb (GtkObject *object, gpointer data)
|
||||
}
|
||||
|
||||
g_free (aw);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@ -1389,7 +1390,7 @@ gnc_account_list_fill(GtkCList *type_list)
|
||||
|
||||
for (row = 0; row < NUM_ACCOUNT_TYPES; row++)
|
||||
{
|
||||
text[0] = xaccAccountGetTypeStr(row);
|
||||
text[0] = (gchar *) xaccAccountGetTypeStr(row);
|
||||
gtk_clist_append(type_list, text);
|
||||
}
|
||||
}
|
||||
|
@ -257,6 +257,17 @@ gnc_amount_edit_evaluate (GNCAmountEdit *gae)
|
||||
return TRUE;
|
||||
|
||||
string = gtk_entry_get_text(GTK_ENTRY(gae->amount_entry));
|
||||
if (!string || *string == '\0')
|
||||
{
|
||||
gnc_numeric old_amount = gae->amount;
|
||||
|
||||
gnc_amount_edit_set_amount (gae, gnc_numeric_zero ());
|
||||
|
||||
if (!gnc_numeric_equal (gnc_numeric_zero (), old_amount))
|
||||
gtk_signal_emit (GTK_OBJECT (gae), amount_edit_signals [AMOUNT_CHANGED]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
error_loc = NULL;
|
||||
|
||||
|
@ -20,25 +20,25 @@
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "gnc-book.h"
|
||||
#include "new-user-callbacks.h"
|
||||
#include "new-user-interface.h"
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "glade-support.h"
|
||||
#include "new-user-funs.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnc-dir.h"
|
||||
#include "io-example-account.h"
|
||||
#include "FileDialog.h"
|
||||
#include <guile/gh.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "FileDialog.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "glade-support.h"
|
||||
#include "gnc-book.h"
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "gnc-dir.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "io-example-account.h"
|
||||
#include "new-user-callbacks.h"
|
||||
#include "new-user-funs.h"
|
||||
#include "new-user-interface.h"
|
||||
#include "query-user.h"
|
||||
|
||||
static int commodEditAdded = 0;
|
||||
|
||||
@ -73,7 +73,6 @@ on_newUserStartPage_next (GnomeDruidPage *gnomedruidpage,
|
||||
gpointer arg1,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -88,17 +87,32 @@ on_chooseAccountTypesPage_next (GnomeDruidPage *gnomedruidpage,
|
||||
}
|
||||
|
||||
|
||||
static gpointer
|
||||
starting_balance_helper (Account *account, gpointer data)
|
||||
{
|
||||
gnc_numeric balance;
|
||||
|
||||
balance = gnc_new_user_get_balance (account);
|
||||
if (!gnc_numeric_zero_p (balance))
|
||||
gnc_account_create_opening_balance (account, balance, time (NULL));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
on_newUserDruidFinishPage_finish (GnomeDruidPage *gnomedruidpage,
|
||||
gpointer arg1,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (our_final_group)
|
||||
xaccGroupForEachAccount (our_final_group, starting_balance_helper,
|
||||
NULL, TRUE);
|
||||
|
||||
gnc_ui_delete_new_user_window();
|
||||
gnc_ui_delete_nu_account_list();
|
||||
|
||||
|
||||
gh_eval_str("(gnc:default-ui-start)");
|
||||
|
||||
|
||||
/* now we need to load all the accounts into the program */
|
||||
|
||||
gh_eval_str("(gnc:show-main-window)");
|
||||
@ -108,8 +122,10 @@ on_newUserDruidFinishPage_finish (GnomeDruidPage *gnomedruidpage,
|
||||
|
||||
if(our_final_group)
|
||||
{
|
||||
xaccGroupConcatGroup(gnc_book_get_group(gncGetCurrentBook()),
|
||||
our_final_group);
|
||||
AccountGroup *group;
|
||||
|
||||
group = gnc_book_get_group(gncGetCurrentBook());
|
||||
xaccGroupConcatGroup(group, our_final_group);
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,6 +226,8 @@ on_chooseAccountTypesPage_prepare (GnomeDruidPage *gnomedruidpage,
|
||||
|
||||
gtk_clist_sort(clist);
|
||||
gtk_clist_thaw(clist);
|
||||
|
||||
g_slist_free (list);
|
||||
}
|
||||
|
||||
|
||||
@ -277,17 +295,33 @@ on_newAccountTypesList_select_row (GtkCList *clist,
|
||||
gtk_text_forward_delete(datext, gtk_text_get_length(datext));
|
||||
if(gea->long_description != NULL)
|
||||
{
|
||||
gtk_text_set_editable(datext, TRUE);
|
||||
gtk_text_insert(datext, NULL, NULL, NULL, gea->long_description, -1);
|
||||
gtk_text_set_editable(datext, FALSE);
|
||||
}
|
||||
gtk_text_thaw(datext);
|
||||
|
||||
gtk_tree_clear_items(datree, 0, 1000);
|
||||
gtk_tree_clear_items(datree, 0, g_list_length (datree->children) - 1);
|
||||
add_to_tree(datree, gea->group);
|
||||
}
|
||||
|
||||
printf("%s", "");
|
||||
|
||||
|
||||
void
|
||||
on_newAccountTypesList_unselect_row (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkText *datext =
|
||||
GTK_TEXT(gnc_new_user_get_widget("newAccountTypesDescription"));
|
||||
GtkTree *datree =
|
||||
GTK_TREE(gnc_new_user_get_widget("newAccountListTree"));
|
||||
|
||||
gtk_text_freeze(datext);
|
||||
gtk_text_set_point(datext, 0);
|
||||
gtk_text_forward_delete(datext, gtk_text_get_length(datext));
|
||||
gtk_text_thaw(datext);
|
||||
|
||||
gtk_tree_clear_items(datree, 0, g_list_length (datree->children) - 1);
|
||||
}
|
||||
|
||||
|
||||
@ -313,7 +347,6 @@ void
|
||||
on_newAccountOKButton_clicked (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -322,7 +355,6 @@ on_newAccountCurrencyChoosePage_next (GnomeDruidPage *gnomedruidpage,
|
||||
gpointer arg1,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -359,8 +391,26 @@ generate_account_titles(Account *act)
|
||||
ret = g_new(gchar *, 3);
|
||||
|
||||
ret[0] = (gchar*)xaccAccountGetName(act);
|
||||
ret[1] = xaccAccountTypeEnumAsString(xaccAccountGetType(act));
|
||||
ret[2] = "";
|
||||
ret[1] = (gchar*)xaccAccountGetTypeStr(xaccAccountGetType(act));
|
||||
|
||||
{
|
||||
gnc_numeric balance;
|
||||
const char *string;
|
||||
|
||||
balance = gnc_new_user_get_balance (act);
|
||||
|
||||
if (gnc_numeric_zero_p (balance))
|
||||
string = "";
|
||||
else
|
||||
{
|
||||
GNCPrintAmountInfo print_info;
|
||||
|
||||
print_info = gnc_account_value_print_info (act, FALSE);
|
||||
string = xaccPrintAmount (balance, print_info);
|
||||
}
|
||||
|
||||
ret[2] = (gchar*)string;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -379,14 +429,16 @@ add_to_ctree_final_account(Account* toadd, gpointer data)
|
||||
gchar **titles;
|
||||
|
||||
titles = generate_account_titles (toadd);
|
||||
|
||||
|
||||
node = gtk_ctree_insert_node(topdata->tree, topdata->node,
|
||||
topdata->sibling,
|
||||
titles, 0,
|
||||
NULL, NULL, NULL, NULL,
|
||||
FALSE, TRUE);
|
||||
/* don't know if this is safe, so commented out at the moment. FIXME! */
|
||||
/* free_account_titles(titles); */
|
||||
|
||||
free_account_titles(titles);
|
||||
|
||||
gtk_ctree_node_set_row_data (topdata->tree, node, toadd);
|
||||
|
||||
if(xaccGroupGetNumAccounts(xaccAccountGetChildren(toadd)) > 0)
|
||||
{
|
||||
@ -423,8 +475,11 @@ on_finalAccountDruidPage_prepare (GnomeDruidPage *gnomedruidpage,
|
||||
GList *dalist;
|
||||
GSList *actlist = NULL;
|
||||
GtkCList *clist = gnc_new_user_get_clist();
|
||||
GtkWidget *ctree;
|
||||
|
||||
gtk_clist_clear(GTK_CLIST(gnc_new_user_get_widget("finalAccountCTree")));
|
||||
ctree = gnc_new_user_get_widget("finalAccountCTree");
|
||||
|
||||
gtk_clist_clear(GTK_CLIST(ctree));
|
||||
|
||||
for(dalist = clist->selection; dalist; dalist = dalist->next)
|
||||
{
|
||||
@ -435,20 +490,183 @@ on_finalAccountDruidPage_prepare (GnomeDruidPage *gnomedruidpage,
|
||||
delete_our_final_group();
|
||||
our_final_group = gnc_new_user_merge_groups(actlist);
|
||||
|
||||
gnc_new_user_insert_final_accounts(
|
||||
GTK_CTREE(gnc_new_user_get_widget("finalAccountCTree")),
|
||||
our_final_group);
|
||||
}
|
||||
gnc_new_user_insert_final_accounts(GTK_CTREE(ctree), our_final_group);
|
||||
|
||||
gnc_clist_columns_autosize (GTK_CLIST(ctree));
|
||||
|
||||
{
|
||||
GNCAmountEdit *balance_edit;
|
||||
GtkWidget *entry;
|
||||
|
||||
gnc_new_user_block_amount_changed ();
|
||||
|
||||
balance_edit = gnc_new_user_get_balance_editor ();
|
||||
gnc_amount_edit_set_amount (balance_edit, gnc_numeric_zero ());
|
||||
|
||||
entry = gnc_amount_edit_gtk_entry (balance_edit);
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), "");
|
||||
|
||||
gnc_new_user_unblock_amount_changed ();
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (balance_edit), FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_finalAccountCTree_select_row (GtkCList *clist,
|
||||
gint row,
|
||||
on_finalAccountCTree_tree_select_row (GtkCTree *ctree,
|
||||
GList *node,
|
||||
gint column,
|
||||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
Account *account;
|
||||
GNCAmountEdit *balance_edit;
|
||||
GNCPrintAmountInfo print_info;
|
||||
gnc_numeric balance;
|
||||
|
||||
balance_edit = gnc_new_user_get_balance_editor ();
|
||||
|
||||
account = gtk_ctree_node_get_row_data (ctree, GTK_CTREE_NODE (node));
|
||||
if (!account || xaccAccountGetType (account) == EQUITY)
|
||||
{
|
||||
GtkWidget *entry;
|
||||
|
||||
entry = gnc_amount_edit_gtk_entry (balance_edit);
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), "");
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (balance_edit), FALSE);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (balance_edit), TRUE);
|
||||
|
||||
balance = gnc_new_user_get_balance (account);
|
||||
|
||||
if (gnc_reverse_balance (account))
|
||||
balance = gnc_numeric_neg (balance);
|
||||
|
||||
print_info = gnc_account_value_print_info (account, FALSE);
|
||||
gnc_amount_edit_set_print_info (balance_edit, print_info);
|
||||
gnc_amount_edit_set_fraction (balance_edit,
|
||||
xaccAccountGetCurrencySCU (account));
|
||||
|
||||
gnc_new_user_block_amount_changed ();
|
||||
|
||||
gnc_amount_edit_set_amount (balance_edit, balance);
|
||||
if (gnc_numeric_zero_p (balance))
|
||||
{
|
||||
GtkWidget *entry;
|
||||
|
||||
entry = gnc_amount_edit_gtk_entry (balance_edit);
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), "");
|
||||
}
|
||||
|
||||
gnc_new_user_unblock_amount_changed ();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
update_account_balance (GtkCTree *ctree, GtkCTreeNode *node)
|
||||
{
|
||||
Account *account;
|
||||
GNCAmountEdit *balance_edit;
|
||||
gboolean result;
|
||||
|
||||
balance_edit = gnc_new_user_get_balance_editor ();
|
||||
|
||||
account = gtk_ctree_node_get_row_data (ctree, node);
|
||||
if (!account)
|
||||
return;
|
||||
|
||||
gnc_new_user_block_amount_changed ();
|
||||
result = gnc_amount_edit_evaluate (balance_edit);
|
||||
gnc_new_user_unblock_amount_changed ();
|
||||
|
||||
if (result)
|
||||
{
|
||||
gnc_numeric balance;
|
||||
GNCPrintAmountInfo print_info;
|
||||
const char *string;
|
||||
|
||||
balance = gnc_amount_edit_get_amount (balance_edit);
|
||||
|
||||
print_info = gnc_account_value_print_info (account, FALSE);
|
||||
string = xaccPrintAmount (balance, print_info);
|
||||
|
||||
if (gnc_numeric_zero_p (balance))
|
||||
string = "";
|
||||
|
||||
gtk_ctree_node_set_text (ctree, GTK_CTREE_NODE (node), 2, string);
|
||||
|
||||
if (gnc_reverse_balance (account))
|
||||
balance = gnc_numeric_neg (balance);
|
||||
|
||||
gnc_new_user_set_balance (account, balance);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
on_finalAccountCTree_tree_unselect_row (GtkCTree *ctree,
|
||||
GList *node,
|
||||
gint column,
|
||||
gpointer user_data)
|
||||
{
|
||||
update_account_balance (ctree, GTK_CTREE_NODE (node));
|
||||
|
||||
{
|
||||
GNCAmountEdit *balance_edit;
|
||||
GtkWidget *entry;
|
||||
|
||||
balance_edit = gnc_new_user_get_balance_editor ();
|
||||
|
||||
entry = gnc_amount_edit_gtk_entry (balance_edit);
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), "");
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (balance_edit), FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
on_finalAccountBalanceEdit_changed (GNCAmountEdit *gae)
|
||||
{
|
||||
GtkCTree *ctree;
|
||||
GtkCTreeNode *node;
|
||||
|
||||
if (!GTK_WIDGET_SENSITIVE (GTK_WIDGET (gae)))
|
||||
return;
|
||||
|
||||
ctree = gnc_new_user_get_final_account_tree ();
|
||||
if (!ctree)
|
||||
return;
|
||||
|
||||
node = gtk_ctree_node_nth (ctree, GTK_CLIST(ctree)->focus_row);
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
update_account_balance (ctree, node);
|
||||
}
|
||||
|
||||
gboolean
|
||||
on_finalAccountDruidPage_next (GnomeDruidPage *gnomedruidpage,
|
||||
gpointer arg1,
|
||||
gpointer user_data)
|
||||
{
|
||||
GNCAmountEdit *balance_edit;
|
||||
|
||||
balance_edit = gnc_new_user_get_balance_editor ();
|
||||
|
||||
if (!gnc_amount_edit_evaluate (balance_edit))
|
||||
{
|
||||
GtkWidget *top;
|
||||
const char *message = _("You must enter a valid balance.");
|
||||
|
||||
top = gtk_widget_get_toplevel (GTK_WIDGET (gnomedruidpage));
|
||||
gnc_error_dialog_parented(GTK_WINDOW(top), message);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -124,3 +124,27 @@ on_finalAccountCTree_select_row (GtkCList *clist,
|
||||
#endif /* _NEW_USER_CALLBACKS_H_ */
|
||||
|
||||
|
||||
|
||||
void
|
||||
on_newAccountTypesList_unselect_row (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEvent *event,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_finalAccountCTree_tree_select_row (GtkCTree *ctree,
|
||||
GList *node,
|
||||
gint column,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_finalAccountCTree_tree_unselect_row (GtkCTree *ctree,
|
||||
GList *node,
|
||||
gint column,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean
|
||||
on_finalAccountDruidPage_next (GnomeDruidPage *gnomedruidpage,
|
||||
gpointer arg1,
|
||||
gpointer user_data);
|
||||
|
@ -20,17 +20,17 @@
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include <guile/gh.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "new-user-callbacks.h"
|
||||
#include "new-user-interface.h"
|
||||
#include "new-user-funs.h"
|
||||
#include "glade-support.h"
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-currency-edit.h"
|
||||
#include "gnc-ui-util.h"
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
#include "io-example-account.h"
|
||||
#include "Account.h"
|
||||
|
||||
#include <guile/gh.h>
|
||||
|
||||
static GtkWidget *newUserDialog = NULL;
|
||||
static GtkWidget *cancelDialog = NULL;
|
||||
@ -72,6 +71,14 @@ gnc_get_new_user_commodity_editor(void)
|
||||
return cur_editor;
|
||||
}
|
||||
|
||||
GNCAmountEdit *
|
||||
gnc_new_user_get_balance_editor(void)
|
||||
{
|
||||
if (!newUserDialog) return NULL;
|
||||
|
||||
return gtk_object_get_data (GTK_OBJECT (newUserDialog), "balance_editor");
|
||||
}
|
||||
|
||||
struct add_group_data_struct
|
||||
{
|
||||
AccountGroup *to;
|
||||
@ -152,6 +159,90 @@ gnc_new_user_get_clist(void)
|
||||
return GTK_CLIST(gnc_new_user_get_widget("newAccountTypesList"));
|
||||
}
|
||||
|
||||
GtkCTree *
|
||||
gnc_new_user_get_final_account_tree (void)
|
||||
{
|
||||
return GTK_CTREE(gnc_new_user_get_widget("finalAccountCTree"));
|
||||
}
|
||||
|
||||
void
|
||||
gnc_new_user_set_balance (Account *account, gnc_numeric in_balance)
|
||||
{
|
||||
GHashTable *hash;
|
||||
gnc_numeric *balance;
|
||||
char *fullname;
|
||||
|
||||
if (!account || !newUserDialog) return;
|
||||
|
||||
hash = gtk_object_get_data (GTK_OBJECT (newUserDialog), "balance_hash");
|
||||
if (!hash) return;
|
||||
|
||||
fullname = xaccAccountGetFullName (account, ':');
|
||||
|
||||
balance = g_hash_table_lookup (hash, fullname);
|
||||
if (balance)
|
||||
{
|
||||
*balance = in_balance;
|
||||
g_free (fullname);
|
||||
}
|
||||
else
|
||||
{
|
||||
balance = g_new (gnc_numeric, 1);
|
||||
*balance = in_balance;
|
||||
|
||||
g_hash_table_insert (hash, fullname, balance);
|
||||
}
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
gnc_new_user_get_balance (Account *account)
|
||||
{
|
||||
GHashTable *hash;
|
||||
gnc_numeric *balance;
|
||||
char *fullname;
|
||||
|
||||
if (!account || !newUserDialog) return gnc_numeric_zero ();
|
||||
|
||||
hash = gtk_object_get_data (GTK_OBJECT (newUserDialog), "balance_hash");
|
||||
if (!hash) return gnc_numeric_zero ();
|
||||
|
||||
fullname = xaccAccountGetFullName (account, ':');
|
||||
|
||||
balance = g_hash_table_lookup (hash, fullname);
|
||||
|
||||
g_free (fullname);
|
||||
|
||||
if (balance)
|
||||
return *balance;
|
||||
|
||||
return gnc_numeric_zero ();
|
||||
}
|
||||
|
||||
void
|
||||
gnc_new_user_block_amount_changed (void)
|
||||
{
|
||||
GNCAmountEdit *balance_edit;
|
||||
|
||||
balance_edit = gnc_new_user_get_balance_editor ();
|
||||
if (!balance_edit) return;
|
||||
|
||||
gtk_signal_handler_block_by_func
|
||||
(GTK_OBJECT (balance_edit),
|
||||
GTK_SIGNAL_FUNC(on_finalAccountBalanceEdit_changed), NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_new_user_unblock_amount_changed (void)
|
||||
{
|
||||
GNCAmountEdit *balance_edit;
|
||||
|
||||
balance_edit = gnc_new_user_get_balance_editor ();
|
||||
if (!balance_edit) return;
|
||||
|
||||
gtk_signal_handler_unblock_by_func
|
||||
(GTK_OBJECT (balance_edit),
|
||||
GTK_SIGNAL_FUNC(on_finalAccountBalanceEdit_changed), NULL);
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
static int
|
||||
@ -179,10 +270,67 @@ deleteit(GtkWidget** togetridof)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_hash_helper (gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
char *fullname = key;
|
||||
gnc_numeric *balance = value;
|
||||
|
||||
g_free (fullname);
|
||||
g_free (balance);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_new_user_destroy_cb (GtkObject *obj, gpointer user_data)
|
||||
{
|
||||
GHashTable *hash;
|
||||
|
||||
hash = gtk_object_get_data (obj, "balance_hash");
|
||||
if (hash)
|
||||
{
|
||||
g_hash_table_foreach (hash, destroy_hash_helper, NULL);
|
||||
g_hash_table_destroy (hash);
|
||||
gtk_object_set_data (obj, "balance_hash", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
gnc_create_newUserDialog (void)
|
||||
{
|
||||
GtkWidget *balance_edit;
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *box;
|
||||
GHashTable *hash;
|
||||
|
||||
dialog = create_newUserDialog();
|
||||
|
||||
balance_edit = gnc_amount_edit_new ();
|
||||
gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (balance_edit), TRUE);
|
||||
gtk_widget_show (balance_edit);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (balance_edit), "amount_changed",
|
||||
GTK_SIGNAL_FUNC(on_finalAccountBalanceEdit_changed),
|
||||
NULL);
|
||||
|
||||
box = lookup_widget (dialog, "startBalanceBox");
|
||||
gtk_box_pack_start (GTK_BOX (box), balance_edit, TRUE, TRUE, 0);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT(dialog), "balance_editor", balance_edit);
|
||||
|
||||
hash = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT(dialog), "balance_hash", hash);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(dialog), "destroy",
|
||||
GTK_SIGNAL_FUNC(gnc_new_user_destroy_cb), NULL);
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
int
|
||||
gnc_ui_show_new_user_window(void)
|
||||
{
|
||||
return createit(create_newUserDialog, &newUserDialog);
|
||||
return createit(gnc_create_newUserDialog, &newUserDialog);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "Group.h"
|
||||
|
||||
@ -37,9 +38,20 @@ int gnc_ui_delete_nu_cancel_dialog(void);
|
||||
int gnc_ui_show_nu_account_list(void);
|
||||
int gnc_ui_delete_nu_account_list(void);
|
||||
|
||||
void gnc_new_user_set_balance (Account *account, gnc_numeric balance);
|
||||
gnc_numeric gnc_new_user_get_balance (Account *account);
|
||||
|
||||
GtkCList* gnc_new_user_get_clist(void);
|
||||
GtkCTree * gnc_new_user_get_final_account_tree (void);
|
||||
GtkWidget* gnc_new_user_get_widget(const char *name);
|
||||
AccountGroup* gnc_new_user_merge_groups(GSList *dalist);
|
||||
GNCCommodityEdit * gnc_get_new_user_commodity_editor(void);
|
||||
GNCAmountEdit * gnc_new_user_get_balance_editor(void);
|
||||
|
||||
void gnc_new_user_block_amount_changed (void);
|
||||
void gnc_new_user_unblock_amount_changed (void);
|
||||
|
||||
/* private */
|
||||
void on_finalAccountBalanceEdit_changed (GNCAmountEdit *gae);
|
||||
|
||||
#endif /* NEW_USER_FUNS_H */
|
||||
|
@ -45,8 +45,10 @@ create_newUserDialog (void)
|
||||
GtkWidget *newAccountTypesList_TypeLabel;
|
||||
GtkWidget *newAccountTypesList_DescriptionLabel;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *frame1;
|
||||
GtkWidget *scrolledwindow2;
|
||||
GtkWidget *newAccountTypesDescription;
|
||||
GtkWidget *frame2;
|
||||
GtkWidget *scrolledwindow3;
|
||||
GtkWidget *viewport1;
|
||||
GtkWidget *newAccountListTree;
|
||||
@ -66,9 +68,8 @@ create_newUserDialog (void)
|
||||
GtkWidget *checkAccountList_TypeLabel;
|
||||
GtkWidget *checkAccountList_StartBalanceLabel;
|
||||
GtkWidget *vbox5;
|
||||
GtkWidget *checkAccount_AccountLabel;
|
||||
GtkWidget *checkAccount_StartBalanceLabel;
|
||||
GtkWidget *checkAccount_StartBalanceEntry;
|
||||
GtkWidget *frame3;
|
||||
GtkWidget *startBalanceBox;
|
||||
GtkWidget *newUserDruidFinishPage;
|
||||
GdkColor newUserDruidFinishPage_bg_color = { 0, 6425, 6425, 28784 };
|
||||
GdkColor newUserDruidFinishPage_textbox_color = { 0, 65535, 65535, 65535 };
|
||||
@ -124,7 +125,7 @@ create_newUserDialog (void)
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountCurrencyChooser_vbox2", newAccountCurrencyChooser_vbox2,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (newAccountCurrencyChooser_vbox2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (newAccountCurrencyChooser_vbox2), 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (newAccountCurrencyChooser_vbox2), 20);
|
||||
|
||||
newUserChooseCurrencyDescrip = gtk_label_new (_("Please choose the currency to use for new accounts."));
|
||||
gtk_widget_set_name (newUserChooseCurrencyDescrip, "newUserChooseCurrencyDescrip");
|
||||
@ -206,7 +207,7 @@ create_newUserDialog (void)
|
||||
gtk_widget_show (newAccountTypesList_DescriptionLabel);
|
||||
gtk_clist_set_column_widget (GTK_CLIST (newAccountTypesList), 1, newAccountTypesList_DescriptionLabel);
|
||||
|
||||
hbox1 = gtk_hbox_new (FALSE, 0);
|
||||
hbox1 = gtk_hbox_new (FALSE, 2);
|
||||
gtk_widget_set_name (hbox1, "hbox1");
|
||||
gtk_widget_ref (hbox1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "hbox1", hbox1,
|
||||
@ -214,13 +215,21 @@ create_newUserDialog (void)
|
||||
gtk_widget_show (hbox1);
|
||||
gtk_box_pack_start (GTK_BOX (druid_vbox1), hbox1, TRUE, TRUE, 0);
|
||||
|
||||
frame1 = gtk_frame_new (_("Long Description"));
|
||||
gtk_widget_set_name (frame1, "frame1");
|
||||
gtk_widget_ref (frame1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "frame1", frame1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), frame1, TRUE, TRUE, 0);
|
||||
|
||||
scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_set_name (scrolledwindow2, "scrolledwindow2");
|
||||
gtk_widget_ref (scrolledwindow2);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "scrolledwindow2", scrolledwindow2,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (scrolledwindow2);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow2, TRUE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (frame1), scrolledwindow2);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
newAccountTypesDescription = gtk_text_new (NULL, NULL);
|
||||
@ -232,13 +241,21 @@ create_newUserDialog (void)
|
||||
gtk_container_add (GTK_CONTAINER (scrolledwindow2), newAccountTypesDescription);
|
||||
GTK_WIDGET_UNSET_FLAGS (newAccountTypesDescription, GTK_CAN_FOCUS);
|
||||
|
||||
frame2 = gtk_frame_new (_("Accounts"));
|
||||
gtk_widget_set_name (frame2, "frame2");
|
||||
gtk_widget_ref (frame2);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "frame2", frame2,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame2);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), frame2, TRUE, TRUE, 0);
|
||||
|
||||
scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_set_name (scrolledwindow3, "scrolledwindow3");
|
||||
gtk_widget_ref (scrolledwindow3);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "scrolledwindow3", scrolledwindow3,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (scrolledwindow3);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow3, TRUE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (frame2), scrolledwindow3);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
viewport1 = gtk_viewport_new (NULL, NULL);
|
||||
@ -299,8 +316,9 @@ create_newUserDialog (void)
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "druid_vbox3", druid_vbox3,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (druid_vbox3);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (druid_vbox3), 5);
|
||||
|
||||
finalAccountLabel = gtk_label_new (_("If you would like the accounts to have a starting balance click on the account line and enter the starting balance in the text entry box on the right."));
|
||||
finalAccountLabel = gtk_label_new (_("If you would like the accounts to have an opening balance click on the account line and enter the starting balance in the box on the right."));
|
||||
gtk_widget_set_name (finalAccountLabel, "finalAccountLabel");
|
||||
gtk_widget_ref (finalAccountLabel);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "finalAccountLabel", finalAccountLabel,
|
||||
@ -309,10 +327,10 @@ create_newUserDialog (void)
|
||||
gtk_box_pack_start (GTK_BOX (druid_vbox3), finalAccountLabel, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (finalAccountLabel), GTK_JUSTIFY_FILL);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (finalAccountLabel), TRUE);
|
||||
gtk_misc_set_alignment (GTK_MISC (finalAccountLabel), 0.0800003, 0.08);
|
||||
gtk_misc_set_alignment (GTK_MISC (finalAccountLabel), 0.0200003, 7.45058e-09);
|
||||
gtk_misc_set_padding (GTK_MISC (finalAccountLabel), 1, 1);
|
||||
|
||||
hbox4 = gtk_hbox_new (FALSE, 0);
|
||||
hbox4 = gtk_hbox_new (FALSE, 2);
|
||||
gtk_widget_set_name (hbox4, "hbox4");
|
||||
gtk_widget_ref (hbox4);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "hbox4", hbox4,
|
||||
@ -327,6 +345,7 @@ create_newUserDialog (void)
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (scrolledwindow4);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), scrolledwindow4, TRUE, TRUE, 0);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
|
||||
finalAccountCTree = gtk_ctree_new (3, 0);
|
||||
gtk_widget_set_name (finalAccountCTree, "finalAccountCTree");
|
||||
@ -356,7 +375,7 @@ create_newUserDialog (void)
|
||||
gtk_widget_show (checkAccountList_TypeLabel);
|
||||
gtk_clist_set_column_widget (GTK_CLIST (finalAccountCTree), 1, checkAccountList_TypeLabel);
|
||||
|
||||
checkAccountList_StartBalanceLabel = gtk_label_new (_("Starting Balance"));
|
||||
checkAccountList_StartBalanceLabel = gtk_label_new (_("Opening Balance"));
|
||||
gtk_widget_set_name (checkAccountList_StartBalanceLabel, "checkAccountList_StartBalanceLabel");
|
||||
gtk_widget_ref (checkAccountList_StartBalanceLabel);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "checkAccountList_StartBalanceLabel", checkAccountList_StartBalanceLabel,
|
||||
@ -372,29 +391,22 @@ create_newUserDialog (void)
|
||||
gtk_widget_show (vbox5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), vbox5, FALSE, TRUE, 0);
|
||||
|
||||
checkAccount_AccountLabel = gtk_label_new (_("Account:"));
|
||||
gtk_widget_set_name (checkAccount_AccountLabel, "checkAccount_AccountLabel");
|
||||
gtk_widget_ref (checkAccount_AccountLabel);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "checkAccount_AccountLabel", checkAccount_AccountLabel,
|
||||
frame3 = gtk_frame_new (_("Opening Balance"));
|
||||
gtk_widget_set_name (frame3, "frame3");
|
||||
gtk_widget_ref (frame3);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "frame3", frame3,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (checkAccount_AccountLabel);
|
||||
gtk_box_pack_start (GTK_BOX (vbox5), checkAccount_AccountLabel, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox5), frame3, FALSE, FALSE, 0);
|
||||
|
||||
checkAccount_StartBalanceLabel = gtk_label_new (_("Enter Starting Balance"));
|
||||
gtk_widget_set_name (checkAccount_StartBalanceLabel, "checkAccount_StartBalanceLabel");
|
||||
gtk_widget_ref (checkAccount_StartBalanceLabel);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "checkAccount_StartBalanceLabel", checkAccount_StartBalanceLabel,
|
||||
startBalanceBox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_set_name (startBalanceBox, "startBalanceBox");
|
||||
gtk_widget_ref (startBalanceBox);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "startBalanceBox", startBalanceBox,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (checkAccount_StartBalanceLabel);
|
||||
gtk_box_pack_start (GTK_BOX (vbox5), checkAccount_StartBalanceLabel, FALSE, FALSE, 0);
|
||||
|
||||
checkAccount_StartBalanceEntry = gtk_entry_new_with_max_length (20);
|
||||
gtk_widget_set_name (checkAccount_StartBalanceEntry, "checkAccount_StartBalanceEntry");
|
||||
gtk_widget_ref (checkAccount_StartBalanceEntry);
|
||||
gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "checkAccount_StartBalanceEntry", checkAccount_StartBalanceEntry,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (checkAccount_StartBalanceEntry);
|
||||
gtk_box_pack_start (GTK_BOX (vbox5), checkAccount_StartBalanceEntry, FALSE, FALSE, 0);
|
||||
gtk_widget_show (startBalanceBox);
|
||||
gtk_container_add (GTK_CONTAINER (frame3), startBalanceBox);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (startBalanceBox), 3);
|
||||
|
||||
newUserDruidFinishPage = gnome_druid_page_finish_new ();
|
||||
gtk_widget_set_name (newUserDruidFinishPage, "newUserDruidFinishPage");
|
||||
@ -431,6 +443,9 @@ create_newUserDialog (void)
|
||||
gtk_signal_connect (GTK_OBJECT (newAccountTypesList), "select_row",
|
||||
GTK_SIGNAL_FUNC (on_newAccountTypesList_select_row),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (newAccountTypesList), "unselect_row",
|
||||
GTK_SIGNAL_FUNC (on_newAccountTypesList_unselect_row),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (newAccountsTypeList_SelectAllButton), "clicked",
|
||||
GTK_SIGNAL_FUNC (on_newAccountsTypeList_SelectAllButton_clicked),
|
||||
NULL);
|
||||
@ -440,8 +455,14 @@ create_newUserDialog (void)
|
||||
gtk_signal_connect (GTK_OBJECT (finalAccountDruidPage), "prepare",
|
||||
GTK_SIGNAL_FUNC (on_finalAccountDruidPage_prepare),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (finalAccountCTree), "select_row",
|
||||
GTK_SIGNAL_FUNC (on_finalAccountCTree_select_row),
|
||||
gtk_signal_connect (GTK_OBJECT (finalAccountDruidPage), "next",
|
||||
GTK_SIGNAL_FUNC (on_finalAccountDruidPage_next),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (finalAccountCTree), "tree_select_row",
|
||||
GTK_SIGNAL_FUNC (on_finalAccountCTree_tree_select_row),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (finalAccountCTree), "tree_unselect_row",
|
||||
GTK_SIGNAL_FUNC (on_finalAccountCTree_tree_unselect_row),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (newUserDruidFinishPage), "finish",
|
||||
GTK_SIGNAL_FUNC (on_newUserDruidFinishPage_finish),
|
||||
|
@ -85,7 +85,7 @@
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDruidPageStandard:vbox</child_name>
|
||||
<name>newAccountCurrencyChooser_vbox2</name>
|
||||
<border_width>5</border_width>
|
||||
<border_width>20</border_width>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>5</spacing>
|
||||
<child>
|
||||
@ -199,6 +199,11 @@
|
||||
<handler>on_newAccountTypesList_select_row</handler>
|
||||
<last_modification_time>Thu, 12 Apr 2001 22:01:16 GMT</last_modification_time>
|
||||
</signal>
|
||||
<signal>
|
||||
<name>unselect_row</name>
|
||||
<handler>on_newAccountTypesList_unselect_row</handler>
|
||||
<last_modification_time>Sat, 12 May 2001 09:23:47 GMT</last_modification_time>
|
||||
</signal>
|
||||
<columns>2</columns>
|
||||
<column_widths>144,80</column_widths>
|
||||
<selection_mode>GTK_SELECTION_MULTIPLE</selection_mode>
|
||||
@ -237,7 +242,7 @@
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox1</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<spacing>2</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
@ -245,12 +250,11 @@
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>scrolledwindow2</name>
|
||||
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
<class>GtkFrame</class>
|
||||
<name>frame1</name>
|
||||
<label>Long Description</label>
|
||||
<label_xalign>0</label_xalign>
|
||||
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
@ -258,20 +262,28 @@
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkText</class>
|
||||
<name>newAccountTypesDescription</name>
|
||||
<editable>False</editable>
|
||||
<text></text>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>scrolledwindow2</name>
|
||||
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
|
||||
<widget>
|
||||
<class>GtkText</class>
|
||||
<name>newAccountTypesDescription</name>
|
||||
<editable>False</editable>
|
||||
<text></text>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>scrolledwindow3</name>
|
||||
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
<class>GtkFrame</class>
|
||||
<name>frame2</name>
|
||||
<label>Accounts</label>
|
||||
<label_xalign>0</label_xalign>
|
||||
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
@ -279,16 +291,25 @@
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkViewport</class>
|
||||
<name>viewport1</name>
|
||||
<shadow_type>GTK_SHADOW_IN</shadow_type>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>scrolledwindow3</name>
|
||||
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
|
||||
<widget>
|
||||
<class>GtkTree</class>
|
||||
<name>newAccountListTree</name>
|
||||
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
|
||||
<view_mode>GTK_TREE_VIEW_LINE</view_mode>
|
||||
<view_line>True</view_line>
|
||||
<class>GtkViewport</class>
|
||||
<name>viewport1</name>
|
||||
<shadow_type>GTK_SHADOW_IN</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkTree</class>
|
||||
<name>newAccountListTree</name>
|
||||
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
|
||||
<view_mode>GTK_TREE_VIEW_LINE</view_mode>
|
||||
<view_line>True</view_line>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
@ -352,6 +373,11 @@
|
||||
<handler>on_finalAccountDruidPage_prepare</handler>
|
||||
<last_modification_time>Thu, 12 Apr 2001 22:49:49 GMT</last_modification_time>
|
||||
</signal>
|
||||
<signal>
|
||||
<name>next</name>
|
||||
<handler>on_finalAccountDruidPage_next</handler>
|
||||
<last_modification_time>Sat, 12 May 2001 10:43:19 GMT</last_modification_time>
|
||||
</signal>
|
||||
<title>Check and Enter Final Account Info</title>
|
||||
<title_color>255,255,255</title_color>
|
||||
<background_color>25,25,112</background_color>
|
||||
@ -361,6 +387,7 @@
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDruidPageStandard:vbox</child_name>
|
||||
<name>druid-vbox3</name>
|
||||
<border_width>5</border_width>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
@ -372,11 +399,11 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>finalAccountLabel</name>
|
||||
<label>If you would like the accounts to have a starting balance click on the account line and enter the starting balance in the text entry box on the right.</label>
|
||||
<label>If you would like the accounts to have an opening balance click on the account line and enter the starting balance in the box on the right.</label>
|
||||
<justify>GTK_JUSTIFY_FILL</justify>
|
||||
<wrap>True</wrap>
|
||||
<xalign>0.0800003</xalign>
|
||||
<yalign>0.08</yalign>
|
||||
<xalign>0.0200003</xalign>
|
||||
<yalign>7.45058e-09</yalign>
|
||||
<xpad>1</xpad>
|
||||
<ypad>1</ypad>
|
||||
<child>
|
||||
@ -390,7 +417,7 @@
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox4</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<spacing>2</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
@ -400,7 +427,7 @@
|
||||
<widget>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>scrolledwindow4</name>
|
||||
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
|
||||
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
@ -415,9 +442,14 @@
|
||||
<name>finalAccountCTree</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>select_row</name>
|
||||
<handler>on_finalAccountCTree_select_row</handler>
|
||||
<last_modification_time>Thu, 19 Apr 2001 17:26:51 GMT</last_modification_time>
|
||||
<name>tree_select_row</name>
|
||||
<handler>on_finalAccountCTree_tree_select_row</handler>
|
||||
<last_modification_time>Sat, 12 May 2001 09:28:43 GMT</last_modification_time>
|
||||
</signal>
|
||||
<signal>
|
||||
<name>tree_unselect_row</name>
|
||||
<handler>on_finalAccountCTree_tree_unselect_row</handler>
|
||||
<last_modification_time>Sat, 12 May 2001 09:42:20 GMT</last_modification_time>
|
||||
</signal>
|
||||
<columns>3</columns>
|
||||
<column_widths>285,118,80</column_widths>
|
||||
@ -455,7 +487,7 @@
|
||||
<class>GtkLabel</class>
|
||||
<child_name>CTree:title</child_name>
|
||||
<name>checkAccountList_StartBalanceLabel</name>
|
||||
<label>Starting Balance</label>
|
||||
<label>Opening Balance</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
@ -478,52 +510,32 @@
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>checkAccount_AccountLabel</name>
|
||||
<label>Account:</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
<class>GtkFrame</class>
|
||||
<name>frame3</name>
|
||||
<label>Opening Balance</label>
|
||||
<label_xalign>0</label_xalign>
|
||||
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>startBalanceBox</name>
|
||||
<border_width>3</border_width>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>checkAccount_StartBalanceLabel</name>
|
||||
<label>Enter Starting Balance</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>checkAccount_StartBalanceEntry</name>
|
||||
<can_focus>True</can_focus>
|
||||
<editable>True</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>20</text_max_length>
|
||||
<text></text>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -44,6 +44,7 @@
|
||||
(define gnc:menuname-income-expense
|
||||
(N_ "_Income & Expense"))
|
||||
(define gnc:menuname-taxes (N_ "_Taxes"))
|
||||
(define gnc:menuname-utility (N_ "_Utility"))
|
||||
(define gnc:pagename-general (N_ "General"))
|
||||
(define gnc:pagename-accounts (N_ "Accounts"))
|
||||
(define gnc:pagename-display (N_ "Display"))
|
||||
@ -65,6 +66,9 @@
|
||||
(define asset-liability-menu
|
||||
(gnc:make-menu gnc:menuname-asset-liability
|
||||
(list "_File" "New _Report" "")))
|
||||
(define utility-menu
|
||||
(gnc:make-menu gnc:menuname-utility
|
||||
(list "_File" "New _Report" "")))
|
||||
(define menu-hash (make-hash-table 23))
|
||||
|
||||
(define (add-report-menu-item name report)
|
||||
@ -113,6 +117,7 @@
|
||||
; (gnc:add-extension tax-menu)
|
||||
(gnc:add-extension income-expense-menu)
|
||||
(gnc:add-extension asset-liability-menu)
|
||||
(gnc:add-extension utility-menu)
|
||||
|
||||
;; push reports (new items added on top of menu)
|
||||
(hash-for-each add-report-menu-item *gnc:_report-templates_*)
|
||||
@ -121,8 +126,8 @@
|
||||
(gnc:add-extension
|
||||
(gnc:make-menu-item
|
||||
((menu-namer 'add-name) (_ "Welcome Extravaganza"))
|
||||
(_ "Welcome-to-gnucash screen")
|
||||
(list "_File" "New _Report" "")
|
||||
(_ "Welcome-to-GnuCash screen")
|
||||
(list "_File" "New _Report" gnc:menuname-utility "")
|
||||
(lambda ()
|
||||
(gnc:make-welcome-report)))))
|
||||
|
||||
|
@ -472,6 +472,10 @@ new, totally cool report, consult the mailing list %s.")
|
||||
;; report to the user.
|
||||
'menu-tip (N_ "A sample report with examples.")
|
||||
|
||||
;; A path describing where to put the report in the menu system.
|
||||
;; In this case, it's going under the utility menu.
|
||||
'menu-path (list gnc:menuname-utility)
|
||||
|
||||
;; The options generator function defined above.
|
||||
'options-generator options-generator
|
||||
|
||||
|
@ -31,6 +31,6 @@
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
'name (N_ "Frame URL")
|
||||
'menu-path (list gnc:menuname-utility)
|
||||
'options-generator options-generator
|
||||
'renderer renderer))
|
||||
|
||||
|
@ -217,9 +217,9 @@
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
'name (N_ "Multicolumn View")
|
||||
'menu-path (list gnc:menuname-utility)
|
||||
'renderer render-view
|
||||
'options-generator make-options
|
||||
'options-editor edit-options
|
||||
'options-cleanup-cb cleanup-options
|
||||
'options-changed-cb options-changed-cb))
|
||||
|
||||
|
@ -73,10 +73,9 @@
|
||||
(gnc:html-markup-p
|
||||
"I know this is ugly.")))
|
||||
doc))
|
||||
|
||||
|
||||
(gnc:define-report
|
||||
'name "Welcome to GnuCash 1.6"
|
||||
'in-menu? #f
|
||||
'options-generator options
|
||||
'renderer renderer))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user