diff --git a/src/gnome/new-user-callbacks.c b/src/gnome/new-user-callbacks.c index be2c4ae999..a1423fd1e8 100644 --- a/src/gnome/new-user-callbacks.c +++ b/src/gnome/new-user-callbacks.c @@ -28,6 +28,7 @@ #include +#include "gnc-book.h" #include "new-user-callbacks.h" #include "new-user-interface.h" #include "gnc-commodity-edit.h" @@ -36,10 +37,23 @@ #include "gnc-ui-util.h" #include "gnc-dir.h" #include "io-example-account.h" +#include "FileDialog.h" #include static int commodEditAdded = 0; +static AccountGroup *our_final_group = NULL; + +static void +delete_our_final_group(void) +{ + if(our_final_group != NULL) + { + xaccFreeAccountGroup(our_final_group); + our_final_group = NULL; + } +} + static void set_first_startup(int first_startup) { @@ -88,8 +102,15 @@ on_newUserDruidFinishPage_finish (GnomeDruidPage *gnomedruidpage, /* now we need to load all the accounts into the program */ gh_eval_str("(gnc:show-main-window)"); + gh_eval_str("(gnc:hook-run-danglers gnc:*book-opened-hook* #f)"); set_first_startup(0); + + if(our_final_group) + { + xaccGroupConcatGroup(gnc_book_get_group(gncGetCurrentBook()), + our_final_group); + } } @@ -114,6 +135,8 @@ on_newAccountCancelDialog_OKButton_clicked "newAccountCancelDialog_RunAgainToggle"))); set_first_startup(keepshowing); + + delete_our_final_group(); gnc_ui_delete_new_user_window(); gnc_ui_delete_nu_cancel_dialog(); @@ -121,9 +144,9 @@ on_newAccountCancelDialog_OKButton_clicked gh_eval_str("(gnc:default-ui-start)"); gh_eval_str("(gnc:show-main-window)"); + gh_eval_str("(gnc:hook-run-danglers gnc:*book-opened-hook* #f)"); } - void on_newAccountCurrencyChoosePage_prepare (GnomeDruidPage *gnomedruidpage, gpointer arg1, @@ -131,21 +154,14 @@ on_newAccountCurrencyChoosePage_prepare (GnomeDruidPage *gnomedruidpage, { /* need to load currency info here. In fact drop a gnc-commodity-edit widget here */ - GtkWidget *commodityWid; - GtkWidget *vbox; - if(!commodEditAdded) { commodEditAdded = 1; - commodityWid = gnc_commodity_edit_new(); - gtk_widget_show(commodityWid); - gnc_commodity_edit_set_commodity(GNC_COMMODITY_EDIT(commodityWid), - gnc_locale_default_currency()); - vbox = lookup_widget(GTK_WIDGET(gnomedruidpage), - "newAccountCurrencyChooser_vbox"); - - gtk_box_pack_start(GTK_BOX(vbox), commodityWid, FALSE, FALSE, 0); + gtk_box_pack_start( + GTK_BOX(lookup_widget(GTK_WIDGET(gnomedruidpage), + "newAccountCurrencyChooser_vbox")), + GTK_WIDGET(gnc_get_new_user_commodity_editor()), FALSE, FALSE, 0); } } @@ -172,6 +188,7 @@ on_chooseAccountTypesPage_prepare (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data) { + static gboolean addedAccountLists = 0; GSList *list; GtkCList *clist; @@ -179,13 +196,17 @@ on_chooseAccountTypesPage_prepare (GnomeDruidPage *gnomedruidpage, list = gnc_load_example_account_list(GNC_ACCOUNTS_DIR "/C"); - clist = GTK_CLIST(lookup_widget(GTK_WIDGET(gnomedruidpage), - "newAccountTypesList")); + clist = gnc_new_user_get_clist(); + gtk_clist_freeze(clist); gtk_clist_set_sort_column(clist, 0); - g_slist_foreach(list, add_each_gea_to_clist, (gpointer)clist); + if(!addedAccountLists) + { + g_slist_foreach(list, add_each_gea_to_clist, (gpointer)clist); + addedAccountLists = 1; + } gtk_clist_sort(clist); gtk_clist_thaw(clist); @@ -204,6 +225,38 @@ on_newUserDruidFinishPage_prepare (GnomeDruidPage *gnomedruidpage, /* need to fill up the account list info here */ } +static gpointer +add_to_tree_account(Account* toadd, gpointer data) +{ + GtkWidget *item; + GtkTree *tree = GTK_TREE(data); + + if(!toadd) + { + return NULL; + } + + item = gtk_tree_item_new_with_label(xaccAccountGetName(toadd)); + gtk_tree_insert(tree, item, 0); + gtk_widget_show(item); + + if(xaccGroupGetNumSubAccounts(xaccAccountGetChildren(toadd)) > 0) + { + GtkWidget *subtree = gtk_tree_new(); + gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), subtree); + gtk_tree_item_expand(GTK_TREE_ITEM(item)); + xaccGroupForEachAccount(xaccAccountGetChildren(toadd), + add_to_tree_account, subtree, FALSE); + } + + return NULL; +} + +static void +add_to_tree(GtkTree *tree, AccountGroup *grp) +{ + xaccGroupForEachAccount(grp, add_to_tree_account, tree, FALSE); +} void on_newAccountTypesList_select_row (GtkCList *clist, @@ -212,7 +265,29 @@ on_newAccountTypesList_select_row (GtkCList *clist, GdkEvent *event, gpointer user_data) { - /* need to fill in useful data on a select row */ + GtkText *datext = + GTK_TEXT(gnc_new_user_get_widget("newAccountTypesDescription")); + GtkTree *datree = + GTK_TREE(gnc_new_user_get_widget("newAccountListTree")); + GncExampleAccount *gea = + (GncExampleAccount*)gtk_clist_get_row_data(clist, row); + + gtk_text_freeze(datext); + gtk_text_set_point(datext, 0); + 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); + add_to_tree(datree, gea->group); + + printf("%s", ""); + } @@ -231,7 +306,6 @@ void on_newAccountSelectAllButton_clicked (GtkButton *button, gpointer user_data) { - } @@ -258,12 +332,118 @@ on_newAccountsTypeList_SelectAllButton_clicked (GtkButton *button, gpointer user_data) { + gtk_clist_select_all(gnc_new_user_get_clist()); +} +void +on_newAccountsTypeList_ClearAllButton_clicked + (GtkButton *button, + gpointer user_data) +{ + gtk_clist_unselect_all(gnc_new_user_get_clist()); +} + +struct FinalInsertData_struct +{ + GtkCTree *tree; + GtkCTreeNode *node; + GtkCTreeNode *sibling; +}; +typedef struct FinalInsertData_struct FinalInsertData; + +static gchar** +generate_account_titles(Account *act) +{ + gchar **ret; + + ret = g_new(gchar *, 3); + + ret[0] = (gchar*)xaccAccountGetName(act); + ret[1] = xaccAccountTypeEnumAsString(xaccAccountGetType(act)); + ret[2] = ""; + + return ret; +} + +static void +free_account_titles(gchar **tofree) +{ + g_free(tofree); +} + +static gpointer +add_to_ctree_final_account(Account* toadd, gpointer data) +{ + FinalInsertData *topdata = (FinalInsertData*)data; + GtkCTreeNode *node; + 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); */ + + if(xaccGroupGetNumAccounts(xaccAccountGetChildren(toadd)) > 0) + { + FinalInsertData nextdata; + nextdata.tree = topdata->tree; + nextdata.node = node; + nextdata.sibling = NULL; + + xaccGroupForEachAccount(xaccAccountGetChildren(toadd), + add_to_ctree_final_account, &nextdata, FALSE); + } + + topdata->sibling = node; + + return NULL; +} + +void +gnc_new_user_insert_final_accounts(GtkCTree *tree, AccountGroup *group) +{ + FinalInsertData data; + data.tree = tree; + data.node = NULL; + data.sibling = NULL; + + xaccGroupForEachAccount(group, add_to_ctree_final_account, &data, FALSE); +} + +void +on_finalAccountDruidPage_prepare (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + GList *dalist; + GSList *actlist = NULL; + GtkCList *clist = gnc_new_user_get_clist(); + + gtk_clist_clear(GTK_CLIST(gnc_new_user_get_widget("finalAccountCTree"))); + + for(dalist = clist->selection; dalist; dalist = dalist->next) + { + int row = GPOINTER_TO_INT(dalist->data); + actlist = g_slist_append(actlist, gtk_clist_get_row_data(clist, row)); + } + + 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); } + void -on_ctree1_select_row (GtkCList *clist, +on_finalAccountCTree_select_row (GtkCList *clist, gint row, gint column, GdkEvent *event, @@ -272,12 +452,3 @@ on_ctree1_select_row (GtkCList *clist, } - -void -on_finalAccountDruidPage_prepare (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data) -{ - -} - diff --git a/src/gnome/new-user-callbacks.h b/src/gnome/new-user-callbacks.h index 2247feb891..b9d10d874f 100644 --- a/src/gnome/new-user-callbacks.h +++ b/src/gnome/new-user-callbacks.h @@ -80,9 +80,6 @@ on_newAccountTree_select_row (GtkCList *clist, GdkEvent *event, gpointer user_data); - -#endif /* _NEW_USER_CALLBACKS_H_ */ - void on_newAccountSelectAllButton_clicked (GtkButton *button, gpointer user_data); @@ -109,13 +106,21 @@ on_newAccountsTypeList_SelectAllButton_clicked gpointer user_data); void -on_ctree1_select_row (GtkCList *clist, +on_finalAccountDruidPage_prepare (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data); +void +on_newAccountsTypeList_ClearAllButton_clicked + (GtkButton *button, + gpointer user_data); + +void +on_finalAccountCTree_select_row (GtkCList *clist, gint row, gint column, GdkEvent *event, gpointer user_data); -void -on_finalAccountDruidPage_prepare (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data); +#endif /* _NEW_USER_CALLBACKS_H_ */ + + diff --git a/src/gnome/new-user-funs.c b/src/gnome/new-user-funs.c index 3f52daeb97..57dbf8d66b 100644 --- a/src/gnome/new-user-funs.c +++ b/src/gnome/new-user-funs.c @@ -30,6 +30,14 @@ #include "new-user-callbacks.h" #include "new-user-interface.h" #include "new-user-funs.h" +#include "glade-support.h" +#include "gnc-currency-edit.h" +#include "gnc-ui-util.h" + +#include "Group.h" +#include "io-example-account.h" +#include "Account.h" +#include "AccountP.h" #include @@ -37,6 +45,115 @@ static GtkWidget *newUserDialog = NULL; static GtkWidget *cancelDialog = NULL; static GtkWidget *accountList = NULL; +static Account* +clone_account(const Account* from, gnc_commodity *com) +{ + Account *ret; + + ret = xaccCloneAccountSimple(from); + ret->currency = com; + + return ret; +} + +GNCCommodityEdit * +gnc_get_new_user_commodity_editor(void) +{ + static GNCCommodityEdit *cur_editor = NULL; + if(!cur_editor) + { + cur_editor = GNC_COMMODITY_EDIT(gnc_commodity_edit_new()); + gtk_widget_set_name (GTK_WIDGET(cur_editor), + "newAccountCurrencyChooser"); + gtk_widget_show(GTK_WIDGET(cur_editor)); + gnc_commodity_edit_set_commodity(cur_editor, + gnc_locale_default_currency()); + } + return cur_editor; +} + +struct add_group_data_struct +{ + AccountGroup *to; + gnc_commodity *com; +}; + +static gpointer +add_groups_for_each(Account *toadd, gpointer data) +{ + struct add_group_data_struct *dadata = + (struct add_group_data_struct*)data; + Account *foundact; + + foundact = xaccGetAccountFromName(dadata->to, xaccAccountGetName(toadd)); + + if(!foundact) + { + foundact = clone_account(toadd, dadata->com); + + xaccGroupInsertAccount(dadata->to, foundact); + } + + { + AccountGroup *addgrp = xaccAccountGetChildren(toadd); + + if(xaccGroupGetNumAccounts(addgrp) > 0) + { + struct add_group_data_struct downdata; + downdata.to = xaccAccountGetChildren(foundact); + downdata.com = dadata->com; + xaccGroupForEachAccount(addgrp, add_groups_for_each, + &downdata, FALSE); + } + } + return NULL; +} + +static void +add_groups_to_with_random_guids(AccountGroup *into, AccountGroup *from, + gnc_commodity *com) +{ + struct add_group_data_struct data; + data.to = into; + data.com = com; + + xaccGroupForEachAccount(from, add_groups_for_each, &data, FALSE); +} + + +AccountGroup* +gnc_new_user_merge_groups(GSList *dalist) +{ + GSList *mark; + gnc_commodity *com; + AccountGroup *ret = xaccMallocAccountGroup(); + + com = gnc_commodity_edit_get_commodity( + gnc_get_new_user_commodity_editor()); + + for(mark = dalist; mark; mark = mark->next) + { + add_groups_to_with_random_guids( + ret, ((GncExampleAccount*)mark->data)->group, com); + } + + return ret; +} + +GtkWidget* +gnc_new_user_get_widget(const char *name) +{ + return lookup_widget(newUserDialog, name); +} + +GtkCList* +gnc_new_user_get_clist(void) +{ + return GTK_CLIST(gnc_new_user_get_widget("newAccountTypesList")); +} + + +/***********************************************************************/ static int createit(GtkWidget*(*creator)(), GtkWidget** placetoput) { diff --git a/src/gnome/new-user-funs.h b/src/gnome/new-user-funs.h index 6974d97244..d1117be087 100644 --- a/src/gnome/new-user-funs.h +++ b/src/gnome/new-user-funs.h @@ -23,6 +23,11 @@ #ifndef _NEW_USER_FUNS_H_ #define _NEW_USER_FUNS_H_ +#include + +#include "gnc-commodity-edit.h" +#include "Group.h" + int gnc_ui_show_new_user_window(void); int gnc_ui_delete_new_user_window(void); @@ -32,4 +37,9 @@ int gnc_ui_delete_nu_cancel_dialog(void); int gnc_ui_show_nu_account_list(void); int gnc_ui_delete_nu_account_list(void); +GtkCList* gnc_new_user_get_clist(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); + #endif /* NEW_USER_FUNS_H */ diff --git a/src/gnome/new-user-interface.c b/src/gnome/new-user-interface.c index af9a075709..b001b47d81 100644 --- a/src/gnome/new-user-interface.c +++ b/src/gnome/new-user-interface.c @@ -46,7 +46,7 @@ create_newUserDialog (void) GtkWidget *newAccountTypesList_DescriptionLabel; GtkWidget *hbox1; GtkWidget *scrolledwindow2; - GtkWidget *accountTypesDescription; + GtkWidget *newAccountTypesDescription; GtkWidget *scrolledwindow3; GtkWidget *viewport1; GtkWidget *newAccountListTree; @@ -58,10 +58,10 @@ create_newUserDialog (void) GdkColor finalAccountDruidPage_logo_bg_color = { 0, 65535, 65535, 65535 }; GdkColor finalAccountDruidPage_title_color = { 0, 65535, 65535, 65535 }; GtkWidget *druid_vbox3; - GtkWidget *label6; + GtkWidget *finalAccountLabel; GtkWidget *hbox4; GtkWidget *scrolledwindow4; - GtkWidget *ctree1; + GtkWidget *finalAccountCTree; GtkWidget *checkAccountList_AccountNameLabel; GtkWidget *checkAccountList_TypeLabel; GtkWidget *checkAccountList_StartBalanceLabel; @@ -80,6 +80,7 @@ create_newUserDialog (void) gtk_object_set_data (GTK_OBJECT (newUserDialog), "newUserDialog", newUserDialog); gtk_widget_set_usize (newUserDialog, 540, 370); gtk_window_set_title (GTK_WINDOW (newUserDialog), _("New User Account setup")); + gtk_window_set_position (GTK_WINDOW (newUserDialog), GTK_WIN_POS_MOUSE); gtk_window_set_default_size (GTK_WINDOW (newUserDialog), 640, 480); accountChooseDruidPage = gnome_druid_new (); @@ -222,15 +223,14 @@ create_newUserDialog (void) gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow2, TRUE, TRUE, 0); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - accountTypesDescription = gtk_text_new (NULL, NULL); - gtk_widget_set_name (accountTypesDescription, "accountTypesDescription"); - gtk_widget_ref (accountTypesDescription); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "accountTypesDescription", accountTypesDescription, + newAccountTypesDescription = gtk_text_new (NULL, NULL); + gtk_widget_set_name (newAccountTypesDescription, "newAccountTypesDescription"); + gtk_widget_ref (newAccountTypesDescription); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountTypesDescription", newAccountTypesDescription, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (accountTypesDescription); - gtk_container_add (GTK_CONTAINER (scrolledwindow2), accountTypesDescription); - gtk_widget_set_sensitive (accountTypesDescription, FALSE); - GTK_WIDGET_UNSET_FLAGS (accountTypesDescription, GTK_CAN_FOCUS); + gtk_widget_show (newAccountTypesDescription); + gtk_container_add (GTK_CONTAINER (scrolledwindow2), newAccountTypesDescription); + GTK_WIDGET_UNSET_FLAGS (newAccountTypesDescription, GTK_CAN_FOCUS); scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_name (scrolledwindow3, "scrolledwindow3"); @@ -256,7 +256,6 @@ create_newUserDialog (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (newAccountListTree); gtk_container_add (GTK_CONTAINER (viewport1), newAccountListTree); - gtk_widget_set_sensitive (newAccountListTree, FALSE); hbox3 = gtk_hbox_new (FALSE, 0); gtk_widget_set_name (hbox3, "hbox3"); @@ -301,17 +300,17 @@ create_newUserDialog (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (druid_vbox3); - label6 = 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.")); - gtk_widget_set_name (label6, "label6"); - gtk_widget_ref (label6); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "label6", label6, + 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.")); + gtk_widget_set_name (finalAccountLabel, "finalAccountLabel"); + gtk_widget_ref (finalAccountLabel); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "finalAccountLabel", finalAccountLabel, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label6); - gtk_box_pack_start (GTK_BOX (druid_vbox3), label6, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_FILL); - gtk_label_set_line_wrap (GTK_LABEL (label6), TRUE); - gtk_misc_set_alignment (GTK_MISC (label6), 0.0800003, 0.08); - gtk_misc_set_padding (GTK_MISC (label6), 1, 1); + gtk_widget_show (finalAccountLabel); + 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_padding (GTK_MISC (finalAccountLabel), 1, 1); hbox4 = gtk_hbox_new (FALSE, 0); gtk_widget_set_name (hbox4, "hbox4"); @@ -329,17 +328,17 @@ create_newUserDialog (void) gtk_widget_show (scrolledwindow4); gtk_box_pack_start (GTK_BOX (hbox4), scrolledwindow4, TRUE, TRUE, 0); - ctree1 = gtk_ctree_new (3, 0); - gtk_widget_set_name (ctree1, "ctree1"); - gtk_widget_ref (ctree1); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "ctree1", ctree1, + finalAccountCTree = gtk_ctree_new (3, 0); + gtk_widget_set_name (finalAccountCTree, "finalAccountCTree"); + gtk_widget_ref (finalAccountCTree); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "finalAccountCTree", finalAccountCTree, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (ctree1); - gtk_container_add (GTK_CONTAINER (scrolledwindow4), ctree1); - gtk_clist_set_column_width (GTK_CLIST (ctree1), 0, 285); - gtk_clist_set_column_width (GTK_CLIST (ctree1), 1, 118); - gtk_clist_set_column_width (GTK_CLIST (ctree1), 2, 80); - gtk_clist_column_titles_show (GTK_CLIST (ctree1)); + gtk_widget_show (finalAccountCTree); + gtk_container_add (GTK_CONTAINER (scrolledwindow4), finalAccountCTree); + gtk_clist_set_column_width (GTK_CLIST (finalAccountCTree), 0, 285); + gtk_clist_set_column_width (GTK_CLIST (finalAccountCTree), 1, 118); + gtk_clist_set_column_width (GTK_CLIST (finalAccountCTree), 2, 80); + gtk_clist_column_titles_show (GTK_CLIST (finalAccountCTree)); checkAccountList_AccountNameLabel = gtk_label_new (_("Account Name")); gtk_widget_set_name (checkAccountList_AccountNameLabel, "checkAccountList_AccountNameLabel"); @@ -347,7 +346,7 @@ create_newUserDialog (void) gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "checkAccountList_AccountNameLabel", checkAccountList_AccountNameLabel, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (checkAccountList_AccountNameLabel); - gtk_clist_set_column_widget (GTK_CLIST (ctree1), 0, checkAccountList_AccountNameLabel); + gtk_clist_set_column_widget (GTK_CLIST (finalAccountCTree), 0, checkAccountList_AccountNameLabel); checkAccountList_TypeLabel = gtk_label_new (_("Type")); gtk_widget_set_name (checkAccountList_TypeLabel, "checkAccountList_TypeLabel"); @@ -355,7 +354,7 @@ create_newUserDialog (void) gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "checkAccountList_TypeLabel", checkAccountList_TypeLabel, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (checkAccountList_TypeLabel); - gtk_clist_set_column_widget (GTK_CLIST (ctree1), 1, checkAccountList_TypeLabel); + gtk_clist_set_column_widget (GTK_CLIST (finalAccountCTree), 1, checkAccountList_TypeLabel); checkAccountList_StartBalanceLabel = gtk_label_new (_("Starting Balance")); gtk_widget_set_name (checkAccountList_StartBalanceLabel, "checkAccountList_StartBalanceLabel"); @@ -363,7 +362,7 @@ create_newUserDialog (void) gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "checkAccountList_StartBalanceLabel", checkAccountList_StartBalanceLabel, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (checkAccountList_StartBalanceLabel); - gtk_clist_set_column_widget (GTK_CLIST (ctree1), 2, checkAccountList_StartBalanceLabel); + gtk_clist_set_column_widget (GTK_CLIST (finalAccountCTree), 2, checkAccountList_StartBalanceLabel); vbox5 = gtk_vbox_new (FALSE, 0); gtk_widget_set_name (vbox5, "vbox5"); @@ -435,11 +434,14 @@ create_newUserDialog (void) gtk_signal_connect (GTK_OBJECT (newAccountsTypeList_SelectAllButton), "clicked", GTK_SIGNAL_FUNC (on_newAccountsTypeList_SelectAllButton_clicked), NULL); + gtk_signal_connect (GTK_OBJECT (newAccountsTypeList_ClearAllButton), "clicked", + GTK_SIGNAL_FUNC (on_newAccountsTypeList_ClearAllButton_clicked), + NULL); gtk_signal_connect (GTK_OBJECT (finalAccountDruidPage), "prepare", GTK_SIGNAL_FUNC (on_finalAccountDruidPage_prepare), NULL); - gtk_signal_connect (GTK_OBJECT (ctree1), "select_row", - GTK_SIGNAL_FUNC (on_ctree1_select_row), + gtk_signal_connect (GTK_OBJECT (finalAccountCTree), "select_row", + GTK_SIGNAL_FUNC (on_finalAccountCTree_select_row), NULL); gtk_signal_connect (GTK_OBJECT (newUserDruidFinishPage), "finish", GTK_SIGNAL_FUNC (on_newUserDruidFinishPage_finish), diff --git a/src/gnome/new-user.glade b/src/gnome/new-user.glade index e797806c7f..0d174daf3d 100644 --- a/src/gnome/new-user.glade +++ b/src/gnome/new-user.glade @@ -29,7 +29,7 @@ 370 New User Account setup GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE + GTK_WIN_POS_MOUSE False 640 480 @@ -259,8 +259,7 @@ GtkText - accountTypesDescription - False + newAccountTypesDescription False @@ -287,7 +286,6 @@ GtkTree newAccountListTree - False GTK_SELECTION_SINGLE GTK_TREE_VIEW_LINE True @@ -329,6 +327,11 @@ GtkButton newAccountsTypeList_ClearAllButton True + + clicked + on_newAccountsTypeList_ClearAllButton_clicked + Thu, 19 Apr 2001 14:27:32 GMT + GTK_RELIEF_NORMAL @@ -368,7 +371,7 @@ GtkLabel - label6 + finalAccountLabel GTK_JUSTIFY_FILL True @@ -409,12 +412,12 @@ GtkCTree - ctree1 + finalAccountCTree True select_row - on_ctree1_select_row - Thu, 12 Apr 2001 22:48:53 GMT + on_finalAccountCTree_select_row + Thu, 19 Apr 2001 17:26:51 GMT 3 285,118,80