From e516792199946b86247f4c6e043219d9aa219b7d Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Sun, 17 Jun 2001 06:35:54 +0000 Subject: [PATCH] 2001-06-16 Dave Peticolas * src/guile/gnc.gwp: update for api change * src/scm/main.scm: update for api change * src/gnome/glade/newuser.glade: new file for new user glade xml * src/gnome/glade-support.[ch]: remove generated files * src/gnome/new-user-*.[ch]: remove old files * src/gnome/dialog-new-user.c: new file for new user dialog code. * src/gnome/druid-hierarchy.c: new file for account hierarchy creation druid code. Rename api calls to reflect the more general use of the druid. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4708 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 18 + po/POTFILES.in | 2 +- src/FileDialog.c | 7 +- src/gnc-ui.h | 2 + src/gnome/Makefile.am | 19 +- src/gnome/dialog-new-user.c | 130 +++ src/gnome/dialog-new-user.h | 32 + src/gnome/druid-hierarchy.c | 930 ++++++++++++++++++ .../{new-user-funs.h => druid-hierarchy.h} | 41 +- src/gnome/glade-support.c | 146 --- src/gnome/glade-support.h | 34 - src/gnome/glade/Makefile.am | 2 + src/gnome/glade/account.glade | 569 +++++++++++ src/gnome/glade/account_strings.c | 37 + src/gnome/glade/newuser.glade | 243 +++++ src/gnome/glade/newuser_strings.c | 13 + src/gnome/new-user-callbacks.c | 691 ------------- src/gnome/new-user-callbacks.h | 146 --- src/gnome/new-user-funs.c | 447 --------- src/gnome/new-user-interface.c | 670 ------------- src/gnome/new-user-interface.h | 7 - src/gnome/new-user.glade | 838 ---------------- src/gnome/top-level.c | 2 - src/scm/main.scm | 7 +- src/scm/prefs.scm | 2 +- 25 files changed, 1994 insertions(+), 3041 deletions(-) create mode 100644 src/gnome/dialog-new-user.c create mode 100644 src/gnome/dialog-new-user.h create mode 100644 src/gnome/druid-hierarchy.c rename src/gnome/{new-user-funs.h => druid-hierarchy.h} (53%) delete mode 100644 src/gnome/glade-support.c delete mode 100644 src/gnome/glade-support.h create mode 100644 src/gnome/glade/newuser.glade create mode 100644 src/gnome/glade/newuser_strings.c delete mode 100644 src/gnome/new-user-callbacks.c delete mode 100644 src/gnome/new-user-callbacks.h delete mode 100644 src/gnome/new-user-funs.c delete mode 100644 src/gnome/new-user-interface.c delete mode 100644 src/gnome/new-user-interface.h delete mode 100644 src/gnome/new-user.glade diff --git a/ChangeLog b/ChangeLog index 0a40c926533..93e924765dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2001-06-16 Dave Peticolas + + * src/guile/gnc.gwp: update for api change + + * src/scm/main.scm: update for api change + + * src/gnome/glade/newuser.glade: new file for new user glade xml + + * src/gnome/glade-support.[ch]: remove generated files + + * src/gnome/new-user-*.[ch]: remove old files + + * src/gnome/dialog-new-user.c: new file for new user dialog code. + + * src/gnome/druid-hierarchy.c: new file for account hierarchy + creation druid code. Rename api calls to reflect the more + general use of the druid. + 2001-06-16 Robert Graham Merkel * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * +\********************************************************************/ + +#include "config.h" + +#include +#include + +#include "dialog-new-user.h" +#include "dialog-utils.h" +#include "druid-hierarchy.h" +#include "druid-qif-import.h" +#include "global-options.h" +#include "gnc-ui.h" +#include "window-help.h" + + +static void gnc_ui_new_user_cancel_dialog (void); + + +void +gnc_set_first_startup (gboolean first_startup) +{ + gnc_set_boolean_option ("__new_user", "first_startup", first_startup); +} + +void +gnc_ui_new_user_dialog (void) +{ + GtkWidget *dialog; + GtkWidget *new_accounts_button; + GtkWidget *import_qif_button; + GtkWidget *tutorial_button; + GladeXML *xml; + gint result; + + xml = gnc_glade_xml_new ("newuser.glade", "New User Dialog"); + + dialog = glade_xml_get_widget (xml, "New User Dialog"); + + gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE); + + new_accounts_button = glade_xml_get_widget (xml, "new_accounts_button"); + import_qif_button = glade_xml_get_widget (xml, "import_qif_button"); + tutorial_button = glade_xml_get_widget (xml, "tutorial_button"); + + result = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + if (result != 0) + { + gnc_ui_new_user_cancel_dialog (); + gtk_widget_destroy (dialog); + gncp_new_user_finish (); + return; + } + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_accounts_button))) + { + gnc_ui_hierarchy_druid (); + gtk_widget_destroy (dialog); + return; + } + + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (import_qif_button))) + { + gnc_ui_qif_import_druid_make (); + } + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tutorial_button))) + { + helpWindow (NULL, NULL, HH_QUICKSTART); + } + + gncp_new_user_finish (); + gtk_widget_destroy (dialog); +} + +static void +gnc_ui_new_user_cancel_dialog (void) +{ + GtkWidget *dialog; + GtkWidget *toggle; + GladeXML *xml; + gint result; + + xml = gnc_glade_xml_new ("newuser.glade", "New User Cancel Dialog"); + + dialog = glade_xml_get_widget (xml, "New User Cancel Dialog"); + toggle = glade_xml_get_widget (xml, "run_again_toggle"); + + gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE); + + result = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + if (result == 0) + { + gboolean keepshowing = TRUE; + + keepshowing = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)); + + gnc_set_first_startup (keepshowing); + + gncp_new_user_finish (); + } +} + +void +gncp_new_user_finish (void) +{ + 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)"); +} diff --git a/src/gnome/dialog-new-user.h b/src/gnome/dialog-new-user.h new file mode 100644 index 00000000000..10e1fb9762a --- /dev/null +++ b/src/gnome/dialog-new-user.h @@ -0,0 +1,32 @@ +/********************************************************************\ + * dialog-new-user.h -- new user dialog for GnuCash * + * Copyright (C) 2001 Dave Peticolas * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * +\********************************************************************/ + +#ifndef DIALOG_NEW_USER_H +#define DIALOG_NEW_USER_H + +void gnc_ui_new_user_dialog (void); +void gnc_set_first_startup (gboolean first_startup); + +/* private */ +void gncp_new_user_finish (void); + +#endif diff --git a/src/gnome/druid-hierarchy.c b/src/gnome/druid-hierarchy.c new file mode 100644 index 00000000000..d8352655507 --- /dev/null +++ b/src/gnome/druid-hierarchy.c @@ -0,0 +1,930 @@ +/********************************************************************\ + * druid-hierarchy.c -- account hierarchy creation functionality * + * Copyright (C) 2001 Gnumatic, Inc. * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * +\********************************************************************/ + +#include "config.h" + +#include +#include +#include +#include + +#include "FileDialog.h" +#include "Group.h" +#include "dialog-new-user.h" +#include "dialog-utils.h" +#include "druid-hierarchy.h" +#include "druid-utils.h" +#include "gnc-amount-edit.h" +#include "gnc-commodity-edit.h" +#include "gnc-component-manager.h" +#include "gnc-dir.h" +#include "io-example-account.h" +#include "query-user.h" + + +static GtkWidget *hierarchy_window = NULL; +static AccountGroup *our_final_group = NULL; + + +static void on_balance_changed (GNCAmountEdit *gae); + + +static GtkWidget* +hierarchy_get_widget (const char *name) +{ + if (!hierarchy_window) return NULL; + + return gnc_glade_lookup_widget (hierarchy_window, name); +} + +static GtkCTree * +hierarchy_get_final_account_tree (void) +{ + return GTK_CTREE (hierarchy_get_widget ("final_account_ctree")); +} + +static void +delete_hierarchy_window (void) +{ + if (!hierarchy_window) return; + + gtk_widget_destroy (hierarchy_window); + hierarchy_window = NULL; +} + +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 GNCAmountEdit * +get_balance_editor (void) +{ + if (!hierarchy_window) return NULL; + + return gtk_object_get_data (GTK_OBJECT (hierarchy_window), "balance_editor"); +} + +static GtkCList* +get_account_types_clist (void) +{ + return GTK_CLIST(hierarchy_get_widget ("account_types_clist")); +} + +static GNCCommodityEdit * +get_commodity_editor(void) +{ + GtkWidget *tmp_wid = gtk_object_get_data (GTK_OBJECT (hierarchy_window), + "commod_editor"); + + if(!tmp_wid) + { + GNCCommodityEdit *cur_editor; + + cur_editor = GNC_COMMODITY_EDIT(gnc_commodity_edit_new()); + gtk_widget_show (GTK_WIDGET(cur_editor)); + gnc_commodity_edit_set_commodity (cur_editor, + gnc_locale_default_currency()); + gtk_object_set_data(GTK_OBJECT(hierarchy_window), + "commod_editor", cur_editor); + return cur_editor; + } + else + { + return GNC_COMMODITY_EDIT(tmp_wid); + } +} + +static void +gnc_hierarchy_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 void +block_amount_changed (void) +{ + GNCAmountEdit *balance_edit; + + balance_edit = get_balance_editor (); + if (!balance_edit) return; + + gtk_signal_handler_block_by_func + (GTK_OBJECT (balance_edit), + GTK_SIGNAL_FUNC(on_balance_changed), NULL); +} + +static void +unblock_amount_changed (void) +{ + GNCAmountEdit *balance_edit; + + balance_edit = get_balance_editor (); + if (!balance_edit) return; + + gtk_signal_handler_unblock_by_func + (GTK_OBJECT (balance_edit), + GTK_SIGNAL_FUNC(on_balance_changed), NULL); +} + +static gnc_numeric +get_final_balance (Account *account) +{ + GHashTable *hash; + gnc_numeric *balance; + char *fullname; + + if (!account || !hierarchy_window) return gnc_numeric_zero (); + + hash = gtk_object_get_data (GTK_OBJECT (hierarchy_window), "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 (); +} + +static void +set_final_balance (Account *account, gnc_numeric in_balance) +{ + GHashTable *hash; + gnc_numeric *balance; + char *fullname; + + if (!account || !hierarchy_window) return; + + hash = gtk_object_get_data (GTK_OBJECT (hierarchy_window), "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); + } +} + +static void +update_account_balance (GtkCTree *ctree, GtkCTreeNode *node) +{ + Account *account; + GNCAmountEdit *balance_edit; + gboolean result; + + balance_edit = get_balance_editor (); + + account = gtk_ctree_node_get_row_data (ctree, node); + if (!account) + return; + + block_amount_changed (); + result = gnc_amount_edit_evaluate (balance_edit); + 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); + + set_final_balance (account, balance); + } +} + +static void +on_balance_changed (GNCAmountEdit *gae) +{ + GtkCTree *ctree; + GtkCTreeNode *node; + + if (!GTK_WIDGET_SENSITIVE (GTK_WIDGET (gae))) + return; + + ctree = hierarchy_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); +} + +static void +on_choose_currency_prepare (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + if(!GPOINTER_TO_INT (gtk_object_get_data + (GTK_OBJECT(hierarchy_window), "commod_added"))) + { + gtk_object_set_data (GTK_OBJECT(hierarchy_window), + "commod_added", GINT_TO_POINTER (1)); + + gtk_box_pack_start(GTK_BOX(gnc_glade_lookup_widget + (hierarchy_window, "currency_chooser_vbox")), + GTK_WIDGET(get_commodity_editor()), FALSE, FALSE, 0); + } +} + +static gchar* +gnc_get_ea_locale_dir(const char *top_dir) +{ + static gchar *default_locale = "C"; + gchar *ret; + gchar *locale; + struct stat buf; + + locale = g_strdup(setlocale(LC_MESSAGES, NULL)); + + ret = g_strdup_printf("%s/%s", top_dir, locale); + + if(stat(ret, &buf) != 0 && (strlen (locale) > 2)) + { + g_free (ret); + locale[2] = '\0'; + ret = g_strdup_printf("%s/%s", top_dir, locale); + } + + if(stat(ret, &buf) != 0) + { + g_free (ret); + ret = g_strdup_printf("%s/%s", top_dir, default_locale); + } + + g_free(locale); + + return ret; +} + +static void +add_each_gea_to_clist (gpointer data, gpointer user_data) +{ + GncExampleAccount *gea = (GncExampleAccount*)data; + GtkCList *clist = GTK_CLIST (user_data); + gchar *rowdata[2]; + int row = 0; + + rowdata[0] = gea->title; + rowdata[1] = gea->short_description; + + row = gtk_clist_insert(clist, row, rowdata); + gtk_clist_set_row_data(clist, row, gea); +} + +static void +on_choose_account_types_prepare (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + gpointer added_ptr; + + added_ptr = gtk_object_get_data (GTK_OBJECT(hierarchy_window), + "account_list_added"); + + if (!GPOINTER_TO_INT(added_ptr)) + { + GSList *list; + GtkCList *clist; + gchar *locale_dir = gnc_get_ea_locale_dir (GNC_ACCOUNTS_DIR); + + gnc_suspend_gui_refresh (); + list = gnc_load_example_account_list (locale_dir); + gnc_resume_gui_refresh (); + + clist = get_account_types_clist (); + + gtk_clist_freeze (clist); + + g_slist_foreach (list, add_each_gea_to_clist, (gpointer)clist); + + gtk_clist_set_sort_column (clist, 0); + gtk_clist_sort (clist); + + gtk_clist_thaw (clist); + + g_slist_free (list); + g_free (locale_dir); + + gtk_object_set_data (GTK_OBJECT(hierarchy_window), + "account_list_added", + GINT_TO_POINTER(1)); + } +} + +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); +} + +static void +on_account_types_list_select_row (GtkCList *clist, + gint row, + gint column, + GdkEvent *event, + gpointer user_data) +{ + GtkLabel *datext = GTK_LABEL (hierarchy_get_widget + ("account_types_description_entry")); + GtkTree *datree = GTK_TREE (hierarchy_get_widget ("account_type_tree")); + GncExampleAccount *gea = gtk_clist_get_row_data (clist, row); + + if(gea->long_description != NULL) + gtk_label_set_text (datext, gea->long_description); + + gtk_tree_clear_items (datree, 0, g_list_length (datree->children)); + add_to_tree (datree, gea->group); +} + +static void +on_account_types_list_unselect_row (GtkCList *clist, + gint row, + gint column, + GdkEvent *event, + gpointer user_data) +{ + GtkLabel *datext = GTK_LABEL (hierarchy_get_widget + ("account_types_description_entry")); + GtkTree *datree = GTK_TREE (hierarchy_get_widget ("account_type_tree")); + + gtk_label_set_text (datext, ""); + + gtk_tree_clear_items (datree, 0, g_list_length (datree->children)); +} + +static void +select_all_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_clist_select_all (get_account_types_clist ()); +} + +static void +clear_all_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_clist_unselect_all (get_account_types_clist ()); +} + +typedef struct FinalInsertData_struct +{ + GtkCTree *tree; + GtkCTreeNode *node; + GtkCTreeNode *sibling; +} FinalInsertData; + +static gchar** +generate_account_titles (Account *act) +{ + gchar **ret; + + ret = g_new (gchar *, 3); + + ret[0] = (gchar*)xaccAccountGetName(act); + ret[1] = (gchar*)xaccAccountGetTypeStr(xaccAccountGetType(act)); + + { + gnc_numeric balance; + const char *string; + + balance = get_final_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; +} + +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); + + free_account_titles (titles); + + gtk_ctree_node_set_row_data (topdata->tree, node, toadd); + + 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; +} + +static void +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); +} + +static void +delete_our_final_group (void) +{ + if (our_final_group != NULL) + { + xaccFreeAccountGroup (our_final_group); + our_final_group = NULL; + } +} + +static Account* +clone_account (const Account* from, gnc_commodity *com) +{ + Account *ret; + + ret = xaccCloneAccountSimple (from); + + xaccAccountSetCurrency (ret, com); + + return ret; +} + +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 = 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); +} + +static AccountGroup * +hierarchy_merge_groups (GSList *dalist) +{ + GSList *mark; + gnc_commodity *com; + AccountGroup *ret = xaccMallocAccountGroup (); + + com = gnc_commodity_edit_get_commodity (get_commodity_editor ()); + + for (mark = dalist; mark; mark = mark->next) + { + GncExampleAccount *xea = mark->data; + + add_groups_to_with_random_guids (ret, xea->group, com); + } + + return ret; +} + +static void +on_final_account_prepare (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + GtkCList *clist; + GtkWidget *ctree; + GSList *actlist; + GList *dalist; + + clist = get_account_types_clist (); + ctree = GTK_WIDGET (hierarchy_get_final_account_tree ()); + + gtk_clist_clear (GTK_CLIST(ctree)); + + actlist = NULL; + 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)); + } + + gnc_suspend_gui_refresh (); + delete_our_final_group (); + our_final_group = hierarchy_merge_groups (actlist); + gnc_resume_gui_refresh (); + + insert_final_accounts (GTK_CTREE(ctree), our_final_group); + + gnc_clist_columns_autosize (GTK_CLIST(ctree)); + + { + GNCAmountEdit *balance_edit; + GtkWidget *entry; + + block_amount_changed (); + + balance_edit = 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), ""); + + unblock_amount_changed (); + + gtk_widget_set_sensitive (GTK_WIDGET (balance_edit), FALSE); + } +} + +static void +on_final_account_tree_select_row (GtkCTree *ctree, + GList *node, + gint column, + gpointer user_data) +{ + Account *account; + GNCAmountEdit *balance_edit; + GNCPrintAmountInfo print_info; + gnc_numeric balance; + + balance_edit = 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 = get_final_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)); + + 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), ""); + } + + unblock_amount_changed (); +} + +static void +on_final_account_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 = 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); + } +} + +static gboolean +on_final_account_next (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + GNCAmountEdit *balance_edit; + + balance_edit = 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; +} + +static void +cancel_everything_out(void) +{ + delete_our_final_group (); + delete_hierarchy_window (); + gncp_new_user_finish (); +} + +static void +on_cancel (GnomeDruid *gnomedruid, + gpointer user_data) +{ + cancel_everything_out (); +} + +static gpointer +starting_balance_helper (Account *account, gpointer data) +{ + gnc_numeric balance; + + balance = get_final_balance (account); + if (!gnc_numeric_zero_p (balance)) + gnc_account_create_opening_balance (account, balance, time (NULL)); + + return NULL; +} + +static void +on_finish (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + gnc_suspend_gui_refresh (); + + if (our_final_group) + xaccGroupForEachAccount (our_final_group, starting_balance_helper, + NULL, TRUE); + + delete_hierarchy_window (); + + gncp_new_user_finish (); + + gnc_set_first_startup (FALSE); + + if (our_final_group) + { + xaccGroupConcatGroup (gnc_book_get_group (gncGetCurrentBook ()), + our_final_group); + } + + gnc_resume_gui_refresh (); +} + +static GtkWidget * +gnc_create_hierarchy_druid (void) +{ + GtkWidget *balance_edit; + GtkWidget *dialog; + GtkWidget *druid; + GtkWidget *clist; + GtkWidget *box; + GHashTable *hash; + GladeXML *xml; + + xml = gnc_glade_xml_new ("account.glade", "Hierarchy Druid"); + + glade_xml_signal_connect + (xml, "on_choose_currency_prepare", + GTK_SIGNAL_FUNC (on_choose_currency_prepare)); + + glade_xml_signal_connect + (xml, "on_choose_account_types_prepare", + GTK_SIGNAL_FUNC (on_choose_account_types_prepare)); + + glade_xml_signal_connect + (xml, "on_account_types_list_select_row", + GTK_SIGNAL_FUNC (on_account_types_list_select_row)); + + glade_xml_signal_connect + (xml, "on_account_types_list_unselect_row", + GTK_SIGNAL_FUNC (on_account_types_list_unselect_row)); + + glade_xml_signal_connect + (xml, "on_final_account_prepare", + GTK_SIGNAL_FUNC (on_final_account_prepare)); + + glade_xml_signal_connect + (xml, "on_final_account_tree_select_row", + GTK_SIGNAL_FUNC (on_final_account_tree_select_row)); + + glade_xml_signal_connect + (xml, "on_final_account_tree_unselect_row", + GTK_SIGNAL_FUNC (on_final_account_tree_unselect_row)); + + glade_xml_signal_connect + (xml, "on_final_account_next", + GTK_SIGNAL_FUNC (on_final_account_next)); + + glade_xml_signal_connect + (xml, "select_all_clicked", GTK_SIGNAL_FUNC (select_all_clicked)); + + glade_xml_signal_connect + (xml, "clear_all_clicked", GTK_SIGNAL_FUNC (clear_all_clicked)); + + glade_xml_signal_connect (xml, "on_finish", GTK_SIGNAL_FUNC (on_finish)); + + glade_xml_signal_connect (xml, "on_cancel", GTK_SIGNAL_FUNC (on_cancel)); + + dialog = glade_xml_get_widget (xml, "Hierarchy Druid"); + + druid = glade_xml_get_widget (xml, "hierarchy_druid"); + gnc_druid_set_colors (GNOME_DRUID (druid)); + + 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_balance_changed), NULL); + + clist = glade_xml_get_widget (xml, "account_types_clist"); + gtk_clist_column_titles_passive (GTK_CLIST (clist)); + + box = glade_xml_get_widget (xml, "start_balance_box"); + 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_hierarchy_destroy_cb), NULL); + + return dialog; +} + +void +gnc_ui_hierarchy_druid (void) +{ + if (hierarchy_window) return; + + hierarchy_window = gnc_create_hierarchy_druid (); + + return; +} diff --git a/src/gnome/new-user-funs.h b/src/gnome/druid-hierarchy.h similarity index 53% rename from src/gnome/new-user-funs.h rename to src/gnome/druid-hierarchy.h index fde80e5e6d4..ab88e094aa2 100644 --- a/src/gnome/new-user-funs.h +++ b/src/gnome/druid-hierarchy.h @@ -1,5 +1,5 @@ /********************************************************************\ - * new-user-funs.h -- new user functionality for GnuCash * + * druid-hierarchy.h -- account hierarchy creation functionality * * Copyright (C) 2001 Gnumatic, Inc. * * * * This program is free software; you can redistribute it and/or * @@ -20,40 +20,9 @@ * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -#ifndef _NEW_USER_FUNS_H_ -#define _NEW_USER_FUNS_H_ +#ifndef DRUID_HIERARCHY_H +#define DRUID_HIERARCHY_H -#include +void gnc_ui_hierarchy_druid (void); -#include "gnc-amount-edit.h" -#include "gnc-commodity-edit.h" -#include "Group.h" - -int gnc_ui_show_new_user_window(gboolean new_user_dialog); -int gnc_ui_delete_new_user_window(void); -gboolean gnc_new_user_dialog_is_new_user(void); -GtkWidget* gnc_get_new_user_dialog(void); - -void gnc_ui_show_new_user_choice_window(void); - -int gnc_ui_show_nu_cancel_dialog(void); -int gnc_ui_delete_nu_cancel_dialog(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); -void gncp_new_user_finish (void); - -#endif /* NEW_USER_FUNS_H */ +#endif diff --git a/src/gnome/glade-support.c b/src/gnome/glade-support.c deleted file mode 100644 index 001d3eb2bad..00000000000 --- a/src/gnome/glade-support.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include - -#include - -#include "glade-support.h" - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* create_dummy_pixmap (GtkWidget *widget, - gboolean gnome_pixmap); - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -/* This is a dummy pixmap we use when a pixmap can't be found. */ -static char *dummy_pixmap_xpm[] = { -/* columns rows colors chars-per-pixel */ -"1 1 1 1", -" c None", -/* pixels */ -" ", -" " -}; - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* -create_dummy_pixmap (GtkWidget *widget, - gboolean gnome_pixmap) -{ - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; - GtkWidget *pixmap; - - if (gnome_pixmap) - { - return gnome_pixmap_new_from_xpm_d (dummy_pixmap_xpm); - } - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, - NULL, dummy_pixmap_xpm); - if (gdkpixmap == NULL) - g_error ("Couldn't create replacement pixmap."); - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); - return pixmap; -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename, - gboolean gnome_pixmap) -{ - GtkWidget *pixmap; - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; - gchar *pathname; - - if (!filename || !filename[0]) - return create_dummy_pixmap (widget, gnome_pixmap); - - pathname = gnome_pixmap_file (filename); - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return create_dummy_pixmap (widget, gnome_pixmap); - } - - if (gnome_pixmap) - { - pixmap = gnome_pixmap_new_from_file (pathname); - g_free (pathname); - return pixmap; - } - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask, - NULL, pathname); - if (gdkpixmap == NULL) - { - g_warning (_("Couldn't create pixmap from file: %s"), pathname); - g_free (pathname); - return create_dummy_pixmap (widget, gnome_pixmap); - } - g_free (pathname); - - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); - return pixmap; -} - -/* This is an internally used function to create imlib images. */ -GdkImlibImage* -create_image (const gchar *filename) -{ - GdkImlibImage *image; - gchar *pathname; - - pathname = gnome_pixmap_file (filename); - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return NULL; - } - - image = gdk_imlib_load_image (pathname); - g_free (pathname); - return image; -} - diff --git a/src/gnome/glade-support.h b/src/gnome/glade-support.h deleted file mode 100644 index d9bb0728a74..00000000000 --- a/src/gnome/glade-support.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#include - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget* lookup_widget (GtkWidget *widget, - const gchar *widget_name); - -/* get_widget() is deprecated. Use lookup_widget instead. */ -#define get_widget lookup_widget - - -/* - * Private Functions. - */ - -/* This is used to create the pixmaps in the interface. */ -GtkWidget* create_pixmap (GtkWidget *widget, - const gchar *filename, - gboolean gnome_pixmap); - -GdkImlibImage* create_image (const gchar *filename); - diff --git a/src/gnome/glade/Makefile.am b/src/gnome/glade/Makefile.am index ecb59efcff4..c03a7128d9f 100644 --- a/src/gnome/glade/Makefile.am +++ b/src/gnome/glade/Makefile.am @@ -5,6 +5,7 @@ glade_DATA = \ fincalc.glade \ find.glade \ help.glade \ + newuser.glade \ price.glade \ print.glade \ progress.glade \ @@ -22,6 +23,7 @@ STRING_FILES = \ fincalc_strings.c \ find_strings.c \ help_strings.c \ + newuser_strings.c \ price_strings.c \ print_strings.c \ progress_strings.c \ diff --git a/src/gnome/glade/account.glade b/src/gnome/glade/account.glade index 4dcf65bc12f..3b453a302b4 100644 --- a/src/gnome/glade/account.glade +++ b/src/gnome/glade/account.glade @@ -817,4 +817,573 @@ + + GtkWindow + Hierarchy Druid + 540 + 370 + New Account Hierarchy Setup + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_MOUSE + False + 640 + 480 + False + True + False + + + GnomeDruid + hierarchy_druid + + cancel + on_cancel + Sat, 16 Jun 2001 23:54:54 GMT + + + + GnomeDruidPageStart + start_page + New Account Hierarchy Setup + This druid will help you create a set of GnuCash +accounts for your assets (such as investments, +checking or savings accounts), liabilities (such +as loans) and different kinds of income and +expenses you might have. + +Click 'Cancel' if you do not wish to create any +new accounts now. + 255,255,255 + 0,0,0 + 25,25,112 + 255,255,255 + 255,255,255 + + + + GnomeDruidPageStandard + currency_choose_page + + prepare + on_choose_currency_prepare + Sat, 16 Jun 2001 23:27:41 GMT + + Choose Currency + 255,255,255 + 25,25,112 + 255,255,255 + + + GtkVBox + GnomeDruidPageStandard:vbox + vbox2 + 20 + False + 5 + + 0 + True + True + + + + GtkLabel + newUserChooseCurrencyDescrip + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkVBox + currency_chooser_vbox + False + 0 + + 0 + False + False + + + + Placeholder + + + + + + + GnomeDruidPageStandard + choose_account_types_page + + prepare + on_choose_account_types_prepare + Sat, 16 Jun 2001 23:59:57 GMT + + Choose accounts to create + 255,255,255 + 25,25,112 + 255,255,255 + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox1 + 5 + False + 5 + + 0 + True + True + + + + GtkLabel + pickAccountsDescriptionLabel + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkFrame + frame5 + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox7 + False + 0 + + + GtkScrolledWindow + scrolledwindow1 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCList + account_types_clist + True + + select_row + on_account_types_list_select_row + Sun, 17 Jun 2001 00:18:23 GMT + + + unselect_row + on_account_types_list_unselect_row + Sun, 17 Jun 2001 00:23:46 GMT + + 2 + 144,80 + GTK_SELECTION_MULTIPLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + newAccountTypesList_TypeLabel + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + newAccountTypesList_DescriptionLabel + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkHBox + hbox3 + 5 + False + 0 + + 0 + False + False + + + + GtkButton + select_all_button + True + + clicked + select_all_clicked + Sun, 17 Jun 2001 00:25:54 GMT + + + + 0 + True + False + + + + + GtkButton + clear_all_button + True + + clicked + clear_all_clicked + Sun, 17 Jun 2001 00:28:18 GMT + + + + 0 + True + False + + + + + + + + GtkHBox + hbox1 + False + 2 + + 0 + True + True + + + + GtkFrame + frame1 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkScrolledWindow + scrolledwindow2 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkViewport + viewport2 + GTK_SHADOW_IN + + + GtkLabel + account_types_description_entry + + GTK_JUSTIFY_LEFT + True + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkFrame + frame2 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkScrolledWindow + scrolledwindow3 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkViewport + viewport1 + GTK_SHADOW_IN + + + GtkTree + account_type_tree + GTK_SELECTION_SINGLE + GTK_TREE_VIEW_LINE + True + + + + + + + + + + GnomeDruidPageStandard + final_account_page + + prepare + on_final_account_prepare + Sun, 17 Jun 2001 00:30:49 GMT + + + next + on_final_account_next + Sun, 17 Jun 2001 05:40:45 GMT + + Enter opening balances + 255,255,255 + 25,25,112 + 255,255,255 + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox3 + 5 + False + 10 + + 0 + True + True + + + + GtkLabel + finalAccountLabel + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 1 + 1 + + 5 + False + False + + + + + GtkHBox + hbox4 + False + 2 + + 0 + True + True + + + + GtkScrolledWindow + scrolledwindow4 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCTree + final_account_ctree + True + + tree_select_row + on_final_account_tree_select_row + Sun, 17 Jun 2001 05:30:25 GMT + + + tree_unselect_row + on_final_account_tree_unselect_row + Sun, 17 Jun 2001 05:38:44 GMT + + 3 + 80,80,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CTree:title + cTreeAccountNameLabel + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CTree:title + cTreeTypeLabel + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CTree:title + cTreeOpeningBalanceLabel + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkVBox + vbox5 + False + 0 + + 0 + False + True + + + + GtkFrame + frame3 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + False + + + + GtkVBox + start_balance_box + 3 + False + 0 + + + Placeholder + + + + + + Placeholder + + + + + + + + GnomeDruidPageFinish + newUserDruidFinishPage + + finish + on_finish + Sat, 16 Jun 2001 23:41:40 GMT + + Finish Account Setup + Press `Finish' to create your new accounts. + +Press `Back' to review your selections. + +Press `Cancel' to close this dialog without creating any new accounts. + 25,25,112 + 255,255,255 + 255,255,255 + 0,0,0 + 255,255,255 + + + + diff --git a/src/gnome/glade/account_strings.c b/src/gnome/glade/account_strings.c index f9fdf5cbf45..c04c9c10e3b 100644 --- a/src/gnome/glade/account_strings.c +++ b/src/gnome/glade/account_strings.c @@ -29,3 +29,40 @@ gchar *s = N_("Use Opening Balances Equity account"); gchar *s = N_("Select Transfer Account"); gchar *s = N_("Transfer Account"); gchar *s = N_("Opening Balance"); +gchar *s = N_("New Account Hierarchy Setup"); +gchar *s = N_("New Account Hierarchy Setup"); +gchar *s = N_("This druid will help you create a set of GnuCash \n" + "accounts for your assets (such as investments, \n" + "checking or savings accounts), liabilities (such \n" + "as loans) and different kinds of income and \n" + "expenses you might have. \n" + "\n" + "Click 'Cancel' if you do not wish to create any \n" + "new accounts now."); +gchar *s = N_("Choose Currency"); +gchar *s = N_("Please choose the currency to use for new accounts."); +gchar *s = N_("Choose accounts to create"); +gchar *s = N_("Select categories that correspond to the ways that you will use GnuCash. \n" + "Each category you select will cause several accounts to be created. \n" + "Select the categories that are relevant to you. You can always create \n" + "additional accounts by hand later."); +gchar *s = N_("Account Types"); +gchar *s = N_("Description"); +gchar *s = N_("Select All"); +gchar *s = N_("Clear All"); +gchar *s = N_("Detailed Description"); +gchar *s = N_("Accounts"); +gchar *s = N_("Enter opening balances"); +gchar *s = N_("If you would like an account to have an opening balance, click on the account\n" + "and enter the starting balance in the box on the right. All accounts except Equity\n" + "accounts may have an opening balance."); +gchar *s = N_("Account Name"); +gchar *s = N_("Type"); +gchar *s = N_("Opening Balance"); +gchar *s = N_("Opening Balance"); +gchar *s = N_("Finish Account Setup"); +gchar *s = N_("Press `Finish' to create your new accounts.\n" + "\n" + "Press `Back' to review your selections.\n" + "\n" + "Press `Cancel' to close this dialog without creating any new accounts."); diff --git a/src/gnome/glade/newuser.glade b/src/gnome/glade/newuser.glade new file mode 100644 index 00000000000..a50e367e31f --- /dev/null +++ b/src/gnome/glade/newuser.glade @@ -0,0 +1,243 @@ + + + + + Glade + glade + + + + C + True + True + False + False + False + False + True + newuser_strings.c + + + + GnomeDialog + New User Dialog + Welcome to GnuCash 1.6! + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox1 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area2 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button1 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button3 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkFrame + frame4 + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + False + + + + GtkVBox + vbox6 + 3 + False + 0 + + + GtkRadioButton + new_accounts_button + True + + False + True + new_user_group + + 0 + False + False + + + + + GtkRadioButton + import_qif_button + True + + False + True + new_user_group + + 0 + False + False + + + + + GtkRadioButton + tutorial_button + True + + False + True + new_user_group + + 0 + False + False + + + + + + + + + GnomeDialog + New User Cancel Dialog + Canceling + GTK_WINDOW_DIALOG + GTK_WIN_POS_MOUSE + True + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog_vbox + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_DEFAULT_STYLE + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + ok_button + True + True + GNOME_STOCK_BUTTON_OK + + + + + GtkVBox + vbox1 + False + 5 + + 0 + True + True + + + + GtkLabel + newAccountCancelDialog_ShouldRunAgainLable + + GTK_JUSTIFY_CENTER + True + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkCheckButton + run_again_toggle + True + + True + True + + 0 + False + False + + + + + + + diff --git a/src/gnome/glade/newuser_strings.c b/src/gnome/glade/newuser_strings.c new file mode 100644 index 00000000000..20c16be58e2 --- /dev/null +++ b/src/gnome/glade/newuser_strings.c @@ -0,0 +1,13 @@ +/* + * Translatable strings file generated by Glade. + * Add this file to your project's POTFILES.in. + * DO NOT compile it as part of your application. + */ + +gchar *s = N_("Welcome to GnuCash 1.6!"); +gchar *s = N_("Create a new set of accounts"); +gchar *s = N_("Import my QIF files"); +gchar *s = N_("Open the new user tutorial"); +gchar *s = N_("Canceling"); +gchar *s = N_("Uncheck if you do not want this dialog to run if you start GnuCash up again. "); +gchar *s = N_("Run dialog for new user again?"); diff --git a/src/gnome/new-user-callbacks.c b/src/gnome/new-user-callbacks.c deleted file mode 100644 index 97c31bef76e..00000000000 --- a/src/gnome/new-user-callbacks.c +++ /dev/null @@ -1,691 +0,0 @@ -/********************************************************************\ - * new-user-callbacks.c - new user functionality for GnuCash * - * Copyright (C) 2001 Gnumatic, Inc. * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "FileDialog.h" -#include "dialog-utils.h" -#include "glade-support.h" -#include "gnc-book.h" -#include "gnc-commodity-edit.h" -#include "gnc-component-manager.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" -#include "global-options.h" - -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) -{ - gnc_set_boolean_option("__new_user", "first_startup", first_startup); -} - - -gboolean -on_newUserStartPage_next (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data) -{ - return FALSE; -} - - -gboolean -on_chooseAccountTypesPage_next (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data) -{ - /* must collect the file list here. */ - return FALSE; -} - - -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) -{ - gnc_suspend_gui_refresh (); - - if (our_final_group) - xaccGroupForEachAccount (our_final_group, starting_balance_helper, - NULL, TRUE); - - gnc_ui_delete_new_user_window(); - - gncp_new_user_finish(); - - set_first_startup(0); - - if(our_final_group) - { - xaccGroupConcatGroup(gnc_book_get_group(gncGetCurrentBook()), - our_final_group); - } - - gnc_resume_gui_refresh (); -} - -static void -cancel_everything_out(void) -{ - delete_our_final_group(); - - gnc_ui_delete_new_user_window(); - gnc_ui_delete_nu_cancel_dialog(); - - gncp_new_user_finish(); -} - -void -on_accountChooseDruidPage_cancel (GnomeDruid *gnomedruid, - gpointer user_data) -{ - if(gnc_new_user_dialog_is_new_user()) - { - gnc_ui_show_nu_cancel_dialog(); - } - else - { - cancel_everything_out(); - } -} - - -void -on_newAccountCancelDialog_OKButton_clicked - (GtkButton *button, - gpointer user_data) -{ - gboolean keepshowing = TRUE; - - keepshowing = gtk_toggle_button_get_active( - GTK_TOGGLE_BUTTON(lookup_widget( - GTK_WIDGET(button), - "newAccountCancelDialog_RunAgainToggle"))); - set_first_startup(keepshowing); - - cancel_everything_out(); -} - -void -on_newAccountCurrencyChoosePage_prepare (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data) -{ - if(!GPOINTER_TO_INT (gtk_object_get_data - (GTK_OBJECT(gnc_get_new_user_dialog()), - "commod_added"))) - { - gtk_object_set_data (GTK_OBJECT(gnc_get_new_user_dialog()), - "commod_added", GINT_TO_POINTER(1)); - - gtk_box_pack_start( - GTK_BOX(lookup_widget(GTK_WIDGET(gnomedruidpage), - "newAccountCurrencyChooser_vbox")), - GTK_WIDGET(gnc_get_new_user_commodity_editor()), FALSE, FALSE, 0); - } -} - -static void -add_each_gea_to_clist(gpointer data, gpointer user_data) -{ - GncExampleAccount *gea = (GncExampleAccount*)data; - GtkCList *clist = GTK_CLIST (user_data); - gchar *rowdata[2]; - int row = 0; - - rowdata[0] = gea->title; - rowdata[1] = gea->short_description; - - row = gtk_clist_insert(clist, row, rowdata); - gtk_clist_set_row_data(clist, row, gea); -} - -static gchar* -gnc_get_ea_locale_dir(const char *top_dir) -{ - static gchar *default_locale = "C"; - gchar *ret; - gchar *locale; - struct stat buf; - - locale = g_strdup(setlocale(LC_MESSAGES, NULL)); - - ret = g_strdup_printf("%s/%s", top_dir, locale); - - if(stat(ret, &buf) != 0 && (strlen (locale) > 2)) - { - g_free (ret); - locale[2] = '\0'; - ret = g_strdup_printf("%s/%s", top_dir, locale); - } - - if(stat(ret, &buf) != 0) - { - g_free (ret); - ret = g_strdup_printf("%s/%s", top_dir, default_locale); - } - - g_free(locale); - - return ret; -} - -void -on_chooseAccountTypesPage_prepare (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data) -{ - gpointer added_ptr; - - added_ptr = gtk_object_get_data(GTK_OBJECT(gnc_get_new_user_dialog()), - "account_list_added"); - if(!GPOINTER_TO_INT(added_ptr)) - { - GSList *list; - GtkCList *clist; - gchar *locale_dir = gnc_get_ea_locale_dir(GNC_ACCOUNTS_DIR); - - gnc_suspend_gui_refresh (); - list = gnc_load_example_account_list(locale_dir); - gnc_resume_gui_refresh (); - - clist = gnc_new_user_get_clist(); - - gtk_clist_freeze(clist); - - g_slist_foreach(list, add_each_gea_to_clist, (gpointer)clist); - - gtk_clist_set_sort_column(clist, 0); - gtk_clist_sort(clist); - - gtk_clist_thaw(clist); - - g_slist_free (list); - g_free(locale_dir); - - gtk_object_set_data(GTK_OBJECT(gnc_get_new_user_dialog()), - "account_list_added", - GINT_TO_POINTER(1)); - } -} - - -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, - gint row, - gint column, - GdkEvent *event, - gpointer user_data) -{ - GtkLabel *datext = - GTK_LABEL(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); - - if(gea->long_description != NULL) - { - gtk_label_set_text(datext, gea->long_description); - } - - gtk_tree_clear_items(datree, 0, g_list_length (datree->children)); - add_to_tree(datree, gea->group); -} - - -void -on_newAccountTypesList_unselect_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event, - gpointer user_data) -{ - GtkLabel *datext = - GTK_LABEL(gnc_new_user_get_widget("newAccountTypesDescription")); - GtkTree *datree = - GTK_TREE(gnc_new_user_get_widget("newAccountListTree")); - - gtk_label_set_text(datext, ""); - - gtk_tree_clear_items(datree, 0, g_list_length (datree->children)); -} - - -void -on_newAccountTree_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event, - gpointer user_data) -{ - /* need to put info in the box and account name here */ -} - - -void -on_newAccountSelectAllButton_clicked (GtkButton *button, - gpointer user_data) -{ -} - - -void -on_newAccountOKButton_clicked (GtkButton *button, - gpointer user_data) -{ -} - - -gboolean -on_newAccountCurrencyChoosePage_next (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data) -{ - return FALSE; -} - - -void -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] = (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; -} - -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); - - free_account_titles(titles); - - gtk_ctree_node_set_row_data (topdata->tree, node, toadd); - - 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; -} - -static 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(); - GtkWidget *ctree; - - ctree = gnc_new_user_get_widget("finalAccountCTree"); - - gtk_clist_clear(GTK_CLIST(ctree)); - - 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)); - } - - gnc_suspend_gui_refresh (); - delete_our_final_group(); - our_final_group = gnc_new_user_merge_groups(actlist); - gnc_resume_gui_refresh (); - - 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_tree_select_row (GtkCTree *ctree, - GList *node, - gint column, - 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; -} diff --git a/src/gnome/new-user-callbacks.h b/src/gnome/new-user-callbacks.h deleted file mode 100644 index 0edd3c889cc..00000000000 --- a/src/gnome/new-user-callbacks.h +++ /dev/null @@ -1,146 +0,0 @@ -/********************************************************************\ - * new-user-callbacks.h - new user functionality for GnuCash * - * Copyright (C) 2001 Gnumatic, Inc. * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -#ifndef _NEW_USER_CALLBACKS_H_ -#define _NEW_USER_CALLBACKS_H_ - -#include -#include - -gboolean -on_newUserStartPage_next (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data); - -gboolean -on_chooseAccountTypesPage_next (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data); - -void -on_newUserDruidFinishPage_finish (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data); - -void -on_accountChooseDruidPage_cancel (GnomeDruid *gnomedruid, - gpointer user_data); - -void -on_newAccountCancelDialog_OKButton_clicked - (GtkButton *button, - gpointer user_data); - -void -on_newAccountCurrencyChoosePage_prepare - (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data); - -void -on_chooseAccountTypesPage_prepare (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data); - -void -on_newAccountTypesList_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event, - gpointer user_data); - -void -on_newAccountTree_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event, - gpointer user_data); - -void -on_newAccountSelectAllButton_clicked (GtkButton *button, - gpointer user_data); - -void -on_newAccountOKButton_clicked (GtkButton *button, - gpointer user_data); - -gboolean -on_newAccountCurrencyChoosePage_next (GnomeDruidPage *gnomedruidpage, - gpointer arg1, - gpointer user_data); - -void -on_newAccountTypesList_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event, - gpointer user_data); - -void -on_newAccountsTypeList_SelectAllButton_clicked - (GtkButton *button, - gpointer user_data); - -void -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); - -#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); - diff --git a/src/gnome/new-user-funs.c b/src/gnome/new-user-funs.c deleted file mode 100644 index c4e640d638e..00000000000 --- a/src/gnome/new-user-funs.c +++ /dev/null @@ -1,447 +0,0 @@ -/********************************************************************\ - * new-user-funs.c -- new user functionality for GnuCash * - * Copyright (C) 2001 Gnumatic, Inc. * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License* - * along with this program; if not, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -#include "config.h" - -#include -#include -#include - -#include "druid-qif-import.h" -#include "druid-utils.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.h" -#include "gnc-ui-util.h" -#include "window-help.h" - -#include "Group.h" -#include "io-example-account.h" -#include "Account.h" - - -static GtkWidget *newUserDialog = NULL; -static GtkWidget *cancelDialog = NULL; - -static Account* -clone_account(const Account* from, gnc_commodity *com) -{ - Account *ret; - - ret = xaccCloneAccountSimple(from); - - xaccAccountSetCurrency (ret, com); - - return ret; -} - -GNCCommodityEdit * -gnc_get_new_user_commodity_editor(void) -{ - GtkWidget *tmp_wid = gtk_object_get_data(GTK_OBJECT(newUserDialog), - "commod_editor"); - - if(!tmp_wid) - { - GNCCommodityEdit *cur_editor = NULL; - 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()); - gtk_object_set_data(GTK_OBJECT(newUserDialog), "commod_editor", - cur_editor); - return cur_editor; - } - else - { - return GNC_COMMODITY_EDIT(tmp_wid); - } - -} - -GtkWidget* -gnc_get_new_user_dialog(void) -{ - return newUserDialog; -} - -GNCAmountEdit * -gnc_new_user_get_balance_editor(void) -{ - if (!newUserDialog) return NULL; - - return gtk_object_get_data (GTK_OBJECT (newUserDialog), "balance_editor"); -} - -gboolean -gnc_new_user_dialog_is_new_user(void) -{ - return (gboolean)gtk_object_get_data(GTK_OBJECT(newUserDialog), - "is_new_user_dialog"); -} - -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")); -} - -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 -createit(GtkWidget*(*creator)(), GtkWidget** placetoput) -{ - if(*placetoput != NULL) - { - return 0; - } - *placetoput = creator(); - gtk_widget_show(*placetoput); - return 1; -} - -static int -deleteit(GtkWidget** togetridof) -{ - if(*togetridof == NULL) - { - return 0; - } - gtk_widget_hide(*togetridof); - gtk_widget_destroy(GTK_WIDGET(*togetridof)); - *togetridof = NULL; - 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 *druid; - GtkWidget *clist; - GtkWidget *box; - GHashTable *hash; - - dialog = create_newUserDialog(); - - druid = lookup_widget (dialog, "newUserDruid"); - gnc_druid_set_colors (GNOME_DRUID (druid)); - - 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); - - clist = lookup_widget (dialog, "newAccountTypesList"); - gtk_clist_column_titles_passive (GTK_CLIST (clist)); - - 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(gboolean new_user_dialog) -{ - int ret = createit(gnc_create_newUserDialog, &newUserDialog); - if(ret) - { - gtk_object_set_data(GTK_OBJECT(newUserDialog), - "is_new_user_dialog", (gpointer)new_user_dialog); - } - return ret; -} - -int -gnc_ui_delete_new_user_window(void) -{ - return deleteit(&newUserDialog); -} - -int -gnc_ui_show_nu_cancel_dialog(void) -{ - return createit(create_addAccountCancelDialog, &cancelDialog); -} - -int -gnc_ui_delete_nu_cancel_dialog(void) -{ - return deleteit(&cancelDialog); -} - -void -gnc_ui_show_new_user_choice_window(void) -{ - GtkWidget *dialog; - GtkWidget *new_accounts_button; - GtkWidget *import_qif_button; - GtkWidget *tutorial_button; - gint result; - - dialog = create_newUserChoiceWindow (); - - gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE); - - new_accounts_button = lookup_widget (dialog, "new_accounts_button"); - import_qif_button = lookup_widget (dialog, "import_qif_button"); - tutorial_button = lookup_widget (dialog, "tutorial_button"); - - result = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - if (result != 0) - { - gnc_ui_show_nu_cancel_dialog(); - gtk_widget_destroy (dialog); - gncp_new_user_finish (); - return; - } - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_accounts_button))) - { - gnc_ui_show_new_user_window (1); - gtk_widget_destroy (dialog); - return; - } - - if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (import_qif_button))) - { - gnc_ui_qif_import_druid_make (); - } - else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tutorial_button))) - { - helpWindow (NULL, NULL, HH_QUICKSTART); - } - - gncp_new_user_finish (); - gtk_widget_destroy (dialog); -} - -void -gncp_new_user_finish (void) -{ - 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)"); -} diff --git a/src/gnome/new-user-interface.c b/src/gnome/new-user-interface.c deleted file mode 100644 index f963c99dc4a..00000000000 --- a/src/gnome/new-user-interface.c +++ /dev/null @@ -1,670 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include - -#include - -#include "new-user-callbacks.h" -#include "new-user-interface.h" -#include "glade-support.h" - -GtkWidget* -create_newUserDialog (void) -{ - GtkWidget *newUserDialog; - GtkWidget *newUserDruid; - GtkWidget *newUserStartPage; - GdkColor newUserStartPage_bg_color = { 0, 6425, 6425, 28784 }; - GdkColor newUserStartPage_textbox_color = { 0, 65535, 65535, 65535 }; - GdkColor newUserStartPage_logo_bg_color = { 0, 65535, 65535, 65535 }; - GdkColor newUserStartPage_title_color = { 0, 65535, 65535, 65535 }; - GtkWidget *newAccountCurrencyChoosePage; - GdkColor newAccountCurrencyChoosePage_bg_color = { 0, 6425, 6425, 28784 }; - GdkColor newAccountCurrencyChoosePage_logo_bg_color = { 0, 65535, 65535, 65535 }; - GdkColor newAccountCurrencyChoosePage_title_color = { 0, 65535, 65535, 65535 }; - GtkWidget *newAccountCurrencyChooser_vbox2; - GtkWidget *newUserChooseCurrencyDescrip; - GtkWidget *newAccountCurrencyChooser_vbox; - GtkWidget *chooseAccountTypesPage; - GdkColor chooseAccountTypesPage_bg_color = { 0, 6425, 6425, 28784 }; - GdkColor chooseAccountTypesPage_logo_bg_color = { 0, 65535, 65535, 65535 }; - GdkColor chooseAccountTypesPage_title_color = { 0, 65535, 65535, 65535 }; - GtkWidget *druid_vbox1; - GtkWidget *pickAccountsDescriptionLabel; - GtkWidget *frame5; - GtkWidget *vbox7; - GtkWidget *scrolledwindow1; - GtkWidget *newAccountTypesList; - GtkWidget *newAccountTypesList_TypeLabel; - GtkWidget *newAccountTypesList_DescriptionLabel; - GtkWidget *hbox3; - GtkWidget *newAccountsTypeList_SelectAllButton; - GtkWidget *newAccountsTypeList_ClearAllButton; - GtkWidget *hbox1; - GtkWidget *frame1; - GtkWidget *scrolledwindow2; - GtkWidget *viewport2; - GtkWidget *newAccountTypesDescription; - GtkWidget *frame2; - GtkWidget *scrolledwindow3; - GtkWidget *viewport1; - GtkWidget *newAccountListTree; - GtkWidget *finalAccountDruidPage; - GdkColor finalAccountDruidPage_bg_color = { 0, 6425, 6425, 28784 }; - GdkColor finalAccountDruidPage_logo_bg_color = { 0, 65535, 65535, 65535 }; - GdkColor finalAccountDruidPage_title_color = { 0, 65535, 65535, 65535 }; - GtkWidget *druid_vbox3; - GtkWidget *finalAccountLabel; - GtkWidget *hbox4; - GtkWidget *scrolledwindow4; - GtkWidget *finalAccountCTree; - GtkWidget *cTreeAccountNameLabel; - GtkWidget *cTreeTypeLabel; - GtkWidget *cTreeOpeningBalanceLabel; - GtkWidget *vbox5; - GtkWidget *frame3; - GtkWidget *startBalanceBox; - GtkWidget *newUserDruidFinishPage; - GdkColor newUserDruidFinishPage_bg_color = { 0, 6425, 6425, 28784 }; - GdkColor newUserDruidFinishPage_textbox_color = { 0, 65535, 65535, 65535 }; - GdkColor newUserDruidFinishPage_logo_bg_color = { 0, 65535, 65535, 65535 }; - GdkColor newUserDruidFinishPage_title_color = { 0, 65535, 65535, 65535 }; - - newUserDialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (newUserDialog, "newUserDialog"); - gtk_object_set_data (GTK_OBJECT (newUserDialog), "newUserDialog", newUserDialog); - gtk_widget_set_usize (newUserDialog, 540, 370); - gtk_window_set_title (GTK_WINDOW (newUserDialog), _("New Account Hierarchy Setup")); - gtk_window_set_position (GTK_WINDOW (newUserDialog), GTK_WIN_POS_MOUSE); - gtk_window_set_default_size (GTK_WINDOW (newUserDialog), 640, 480); - - newUserDruid = gnome_druid_new (); - gtk_widget_set_name (newUserDruid, "newUserDruid"); - gtk_widget_ref (newUserDruid); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newUserDruid", newUserDruid, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newUserDruid); - gtk_container_add (GTK_CONTAINER (newUserDialog), newUserDruid); - - newUserStartPage = gnome_druid_page_start_new (); - gtk_widget_set_name (newUserStartPage, "newUserStartPage"); - gtk_widget_ref (newUserStartPage); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newUserStartPage", newUserStartPage, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newUserStartPage); - gnome_druid_append_page (GNOME_DRUID (newUserDruid), GNOME_DRUID_PAGE (newUserStartPage)); - gnome_druid_set_page (GNOME_DRUID (newUserDruid), GNOME_DRUID_PAGE (newUserStartPage)); - gnome_druid_page_start_set_bg_color (GNOME_DRUID_PAGE_START (newUserStartPage), &newUserStartPage_bg_color); - gnome_druid_page_start_set_textbox_color (GNOME_DRUID_PAGE_START (newUserStartPage), &newUserStartPage_textbox_color); - gnome_druid_page_start_set_logo_bg_color (GNOME_DRUID_PAGE_START (newUserStartPage), &newUserStartPage_logo_bg_color); - gnome_druid_page_start_set_title_color (GNOME_DRUID_PAGE_START (newUserStartPage), &newUserStartPage_title_color); - gnome_druid_page_start_set_title (GNOME_DRUID_PAGE_START (newUserStartPage), _("New Account Hierarchy Setup")); - gnome_druid_page_start_set_text (GNOME_DRUID_PAGE_START (newUserStartPage), _("This druid will help you create a set of GnuCash \naccounts for your assets (such as investments, \nchecking or savings accounts), liabilities (such \nas loans) and different kinds of income and \nexpenses you might have. \n\nClick 'Cancel' if you do not wish to create any \nnew accounts now.")); - - newAccountCurrencyChoosePage = gnome_druid_page_standard_new_with_vals ("", NULL); - gtk_widget_set_name (newAccountCurrencyChoosePage, "newAccountCurrencyChoosePage"); - gtk_widget_ref (newAccountCurrencyChoosePage); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountCurrencyChoosePage", newAccountCurrencyChoosePage, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show_all (newAccountCurrencyChoosePage); - gnome_druid_append_page (GNOME_DRUID (newUserDruid), GNOME_DRUID_PAGE (newAccountCurrencyChoosePage)); - gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (newAccountCurrencyChoosePage), &newAccountCurrencyChoosePage_bg_color); - gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (newAccountCurrencyChoosePage), &newAccountCurrencyChoosePage_logo_bg_color); - gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (newAccountCurrencyChoosePage), &newAccountCurrencyChoosePage_title_color); - gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (newAccountCurrencyChoosePage), _("Choose Currency")); - - newAccountCurrencyChooser_vbox2 = GNOME_DRUID_PAGE_STANDARD (newAccountCurrencyChoosePage)->vbox; - gtk_widget_set_name (newAccountCurrencyChooser_vbox2, "newAccountCurrencyChooser_vbox2"); - gtk_widget_ref (newAccountCurrencyChooser_vbox2); - 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), 20); - - newUserChooseCurrencyDescrip = gtk_label_new (_("Please choose the currency to use for new accounts.")); - gtk_widget_set_name (newUserChooseCurrencyDescrip, "newUserChooseCurrencyDescrip"); - gtk_widget_ref (newUserChooseCurrencyDescrip); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newUserChooseCurrencyDescrip", newUserChooseCurrencyDescrip, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newUserChooseCurrencyDescrip); - gtk_box_pack_start (GTK_BOX (newAccountCurrencyChooser_vbox2), newUserChooseCurrencyDescrip, FALSE, FALSE, 0); - - newAccountCurrencyChooser_vbox = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (newAccountCurrencyChooser_vbox, "newAccountCurrencyChooser_vbox"); - gtk_widget_ref (newAccountCurrencyChooser_vbox); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountCurrencyChooser_vbox", newAccountCurrencyChooser_vbox, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountCurrencyChooser_vbox); - gtk_box_pack_start (GTK_BOX (newAccountCurrencyChooser_vbox2), newAccountCurrencyChooser_vbox, FALSE, FALSE, 0); - - chooseAccountTypesPage = gnome_druid_page_standard_new_with_vals ("", NULL); - gtk_widget_set_name (chooseAccountTypesPage, "chooseAccountTypesPage"); - gtk_widget_ref (chooseAccountTypesPage); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "chooseAccountTypesPage", chooseAccountTypesPage, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show_all (chooseAccountTypesPage); - gnome_druid_append_page (GNOME_DRUID (newUserDruid), GNOME_DRUID_PAGE (chooseAccountTypesPage)); - gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (chooseAccountTypesPage), &chooseAccountTypesPage_bg_color); - gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (chooseAccountTypesPage), &chooseAccountTypesPage_logo_bg_color); - gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (chooseAccountTypesPage), &chooseAccountTypesPage_title_color); - gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (chooseAccountTypesPage), _("Choose accounts to create")); - - druid_vbox1 = GNOME_DRUID_PAGE_STANDARD (chooseAccountTypesPage)->vbox; - gtk_widget_set_name (druid_vbox1, "druid_vbox1"); - gtk_widget_ref (druid_vbox1); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "druid_vbox1", druid_vbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (druid_vbox1); - gtk_container_set_border_width (GTK_CONTAINER (druid_vbox1), 5); - - pickAccountsDescriptionLabel = gtk_label_new (_("Select categories that correspond to the ways that you will use GnuCash. \nEach category you select will cause several accounts to be created. \nSelect the categories that are relevant to you. You can always create \nadditional accounts by hand later.")); - gtk_widget_set_name (pickAccountsDescriptionLabel, "pickAccountsDescriptionLabel"); - gtk_widget_ref (pickAccountsDescriptionLabel); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "pickAccountsDescriptionLabel", pickAccountsDescriptionLabel, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (pickAccountsDescriptionLabel); - gtk_box_pack_start (GTK_BOX (druid_vbox1), pickAccountsDescriptionLabel, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (pickAccountsDescriptionLabel), GTK_JUSTIFY_LEFT); - - frame5 = gtk_frame_new (NULL); - gtk_widget_set_name (frame5, "frame5"); - gtk_widget_ref (frame5); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "frame5", frame5, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame5); - gtk_box_pack_start (GTK_BOX (druid_vbox1), frame5, TRUE, TRUE, 0); - - vbox7 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox7, "vbox7"); - gtk_widget_ref (vbox7); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "vbox7", vbox7, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox7); - gtk_container_add (GTK_CONTAINER (frame5), vbox7); - - scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow1, "scrolledwindow1"); - gtk_widget_ref (scrolledwindow1); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "scrolledwindow1", scrolledwindow1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (scrolledwindow1); - gtk_box_pack_start (GTK_BOX (vbox7), scrolledwindow1, TRUE, TRUE, 0); - - newAccountTypesList = gtk_clist_new (2); - gtk_widget_set_name (newAccountTypesList, "newAccountTypesList"); - gtk_widget_ref (newAccountTypesList); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountTypesList", newAccountTypesList, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountTypesList); - gtk_container_add (GTK_CONTAINER (scrolledwindow1), newAccountTypesList); - gtk_clist_set_column_width (GTK_CLIST (newAccountTypesList), 0, 144); - gtk_clist_set_column_width (GTK_CLIST (newAccountTypesList), 1, 80); - gtk_clist_set_selection_mode (GTK_CLIST (newAccountTypesList), GTK_SELECTION_MULTIPLE); - gtk_clist_column_titles_show (GTK_CLIST (newAccountTypesList)); - - newAccountTypesList_TypeLabel = gtk_label_new (_("Account Types")); - gtk_widget_set_name (newAccountTypesList_TypeLabel, "newAccountTypesList_TypeLabel"); - gtk_widget_ref (newAccountTypesList_TypeLabel); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountTypesList_TypeLabel", newAccountTypesList_TypeLabel, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountTypesList_TypeLabel); - gtk_clist_set_column_widget (GTK_CLIST (newAccountTypesList), 0, newAccountTypesList_TypeLabel); - - newAccountTypesList_DescriptionLabel = gtk_label_new (_("Description")); - gtk_widget_set_name (newAccountTypesList_DescriptionLabel, "newAccountTypesList_DescriptionLabel"); - gtk_widget_ref (newAccountTypesList_DescriptionLabel); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountTypesList_DescriptionLabel", newAccountTypesList_DescriptionLabel, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountTypesList_DescriptionLabel); - gtk_clist_set_column_widget (GTK_CLIST (newAccountTypesList), 1, newAccountTypesList_DescriptionLabel); - - hbox3 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox3, "hbox3"); - gtk_widget_ref (hbox3); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "hbox3", hbox3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox7), hbox3, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (hbox3), 5); - - newAccountsTypeList_SelectAllButton = gtk_button_new_with_label (_("Select All")); - gtk_widget_set_name (newAccountsTypeList_SelectAllButton, "newAccountsTypeList_SelectAllButton"); - gtk_widget_ref (newAccountsTypeList_SelectAllButton); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountsTypeList_SelectAllButton", newAccountsTypeList_SelectAllButton, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountsTypeList_SelectAllButton); - gtk_box_pack_start (GTK_BOX (hbox3), newAccountsTypeList_SelectAllButton, TRUE, FALSE, 0); - - newAccountsTypeList_ClearAllButton = gtk_button_new_with_label (_("Clear All")); - gtk_widget_set_name (newAccountsTypeList_ClearAllButton, "newAccountsTypeList_ClearAllButton"); - gtk_widget_ref (newAccountsTypeList_ClearAllButton); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountsTypeList_ClearAllButton", newAccountsTypeList_ClearAllButton, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountsTypeList_ClearAllButton); - gtk_box_pack_start (GTK_BOX (hbox3), newAccountsTypeList_ClearAllButton, TRUE, 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, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (druid_vbox1), hbox1, TRUE, TRUE, 0); - - frame1 = gtk_frame_new (_("Detailed 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_container_add (GTK_CONTAINER (frame1), scrolledwindow2); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - - viewport2 = gtk_viewport_new (NULL, NULL); - gtk_widget_set_name (viewport2, "viewport2"); - gtk_widget_ref (viewport2); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "viewport2", viewport2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (viewport2); - gtk_container_add (GTK_CONTAINER (scrolledwindow2), viewport2); - - newAccountTypesDescription = gtk_label_new (""); - 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 (newAccountTypesDescription); - gtk_container_add (GTK_CONTAINER (viewport2), newAccountTypesDescription); - gtk_label_set_justify (GTK_LABEL (newAccountTypesDescription), GTK_JUSTIFY_LEFT); - gtk_label_set_line_wrap (GTK_LABEL (newAccountTypesDescription), TRUE); - - 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_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); - gtk_widget_set_name (viewport1, "viewport1"); - gtk_widget_ref (viewport1); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "viewport1", viewport1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (viewport1); - gtk_container_add (GTK_CONTAINER (scrolledwindow3), viewport1); - - newAccountListTree = gtk_tree_new (); - gtk_widget_set_name (newAccountListTree, "newAccountListTree"); - gtk_widget_ref (newAccountListTree); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newAccountListTree", newAccountListTree, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountListTree); - gtk_container_add (GTK_CONTAINER (viewport1), newAccountListTree); - - finalAccountDruidPage = gnome_druid_page_standard_new_with_vals ("", NULL); - gtk_widget_set_name (finalAccountDruidPage, "finalAccountDruidPage"); - gtk_widget_ref (finalAccountDruidPage); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "finalAccountDruidPage", finalAccountDruidPage, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show_all (finalAccountDruidPage); - gnome_druid_append_page (GNOME_DRUID (newUserDruid), GNOME_DRUID_PAGE (finalAccountDruidPage)); - gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (finalAccountDruidPage), &finalAccountDruidPage_bg_color); - gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (finalAccountDruidPage), &finalAccountDruidPage_logo_bg_color); - gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (finalAccountDruidPage), &finalAccountDruidPage_title_color); - gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (finalAccountDruidPage), _("Enter opening balances")); - - druid_vbox3 = GNOME_DRUID_PAGE_STANDARD (finalAccountDruidPage)->vbox; - gtk_widget_set_name (druid_vbox3, "druid_vbox3"); - gtk_widget_ref (druid_vbox3); - 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 an account to have an opening balance, click on the account\nand enter the starting balance in the box on the right. All accounts except Equity\naccounts may have an opening balance.")); - 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 (finalAccountLabel); - gtk_box_pack_start (GTK_BOX (druid_vbox3), finalAccountLabel, FALSE, FALSE, 5); - gtk_label_set_justify (GTK_LABEL (finalAccountLabel), GTK_JUSTIFY_LEFT); - gtk_misc_set_padding (GTK_MISC (finalAccountLabel), 1, 1); - - 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, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox4); - gtk_box_pack_start (GTK_BOX (druid_vbox3), hbox4, TRUE, TRUE, 0); - - scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow4, "scrolledwindow4"); - gtk_widget_ref (scrolledwindow4); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "scrolledwindow4", scrolledwindow4, - (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"); - gtk_widget_ref (finalAccountCTree); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "finalAccountCTree", finalAccountCTree, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (finalAccountCTree); - gtk_container_add (GTK_CONTAINER (scrolledwindow4), finalAccountCTree); - gtk_clist_set_column_width (GTK_CLIST (finalAccountCTree), 0, 80); - gtk_clist_set_column_width (GTK_CLIST (finalAccountCTree), 1, 80); - gtk_clist_set_column_width (GTK_CLIST (finalAccountCTree), 2, 80); - gtk_clist_column_titles_show (GTK_CLIST (finalAccountCTree)); - - cTreeAccountNameLabel = gtk_label_new (_("Account Name")); - gtk_widget_set_name (cTreeAccountNameLabel, "cTreeAccountNameLabel"); - gtk_widget_ref (cTreeAccountNameLabel); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "cTreeAccountNameLabel", cTreeAccountNameLabel, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cTreeAccountNameLabel); - gtk_clist_set_column_widget (GTK_CLIST (finalAccountCTree), 0, cTreeAccountNameLabel); - - cTreeTypeLabel = gtk_label_new (_("Type")); - gtk_widget_set_name (cTreeTypeLabel, "cTreeTypeLabel"); - gtk_widget_ref (cTreeTypeLabel); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "cTreeTypeLabel", cTreeTypeLabel, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cTreeTypeLabel); - gtk_clist_set_column_widget (GTK_CLIST (finalAccountCTree), 1, cTreeTypeLabel); - - cTreeOpeningBalanceLabel = gtk_label_new (_("Opening Balance")); - gtk_widget_set_name (cTreeOpeningBalanceLabel, "cTreeOpeningBalanceLabel"); - gtk_widget_ref (cTreeOpeningBalanceLabel); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "cTreeOpeningBalanceLabel", cTreeOpeningBalanceLabel, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cTreeOpeningBalanceLabel); - gtk_clist_set_column_widget (GTK_CLIST (finalAccountCTree), 2, cTreeOpeningBalanceLabel); - - vbox5 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox5, "vbox5"); - gtk_widget_ref (vbox5); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "vbox5", vbox5, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox5); - gtk_box_pack_start (GTK_BOX (hbox4), vbox5, FALSE, TRUE, 0); - - 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 (frame3); - gtk_box_pack_start (GTK_BOX (vbox5), frame3, FALSE, FALSE, 0); - - 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 (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"); - gtk_widget_ref (newUserDruidFinishPage); - gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "newUserDruidFinishPage", newUserDruidFinishPage, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newUserDruidFinishPage); - gnome_druid_append_page (GNOME_DRUID (newUserDruid), GNOME_DRUID_PAGE (newUserDruidFinishPage)); - gnome_druid_page_finish_set_bg_color (GNOME_DRUID_PAGE_FINISH (newUserDruidFinishPage), &newUserDruidFinishPage_bg_color); - gnome_druid_page_finish_set_textbox_color (GNOME_DRUID_PAGE_FINISH (newUserDruidFinishPage), &newUserDruidFinishPage_textbox_color); - gnome_druid_page_finish_set_logo_bg_color (GNOME_DRUID_PAGE_FINISH (newUserDruidFinishPage), &newUserDruidFinishPage_logo_bg_color); - gnome_druid_page_finish_set_title_color (GNOME_DRUID_PAGE_FINISH (newUserDruidFinishPage), &newUserDruidFinishPage_title_color); - gnome_druid_page_finish_set_title (GNOME_DRUID_PAGE_FINISH (newUserDruidFinishPage), _("Finish Account Setup")); - gnome_druid_page_finish_set_text (GNOME_DRUID_PAGE_FINISH (newUserDruidFinishPage), _("Press `Finish' to create your new accounts.\n\nPress `Back' to review your selections.\n\nPress `Cancel' to close this dialog without creating any new accounts.")); - - gtk_signal_connect (GTK_OBJECT (newUserDruid), "cancel", - GTK_SIGNAL_FUNC (on_accountChooseDruidPage_cancel), - NULL); - gtk_signal_connect (GTK_OBJECT (newUserStartPage), "next", - GTK_SIGNAL_FUNC (on_newUserStartPage_next), - NULL); - gtk_signal_connect (GTK_OBJECT (newAccountCurrencyChoosePage), "prepare", - GTK_SIGNAL_FUNC (on_newAccountCurrencyChoosePage_prepare), - NULL); - gtk_signal_connect (GTK_OBJECT (newAccountCurrencyChoosePage), "next", - GTK_SIGNAL_FUNC (on_newAccountCurrencyChoosePage_next), - NULL); - gtk_signal_connect (GTK_OBJECT (chooseAccountTypesPage), "next", - GTK_SIGNAL_FUNC (on_chooseAccountTypesPage_next), - NULL); - gtk_signal_connect (GTK_OBJECT (chooseAccountTypesPage), "prepare", - GTK_SIGNAL_FUNC (on_chooseAccountTypesPage_prepare), - NULL); - 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); - 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 (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), - NULL); - - return newUserDialog; -} - -GtkWidget* -create_addAccountCancelDialog (void) -{ - GtkWidget *addAccountCancelDialog; - GtkWidget *newAccountCancelDialog; - GtkWidget *vbox1; - GtkWidget *newAccountCancelDialog_ShouldRunAgainLable; - GtkWidget *newAccountCancelDialog_RunAgainToggle; - GtkWidget *dialog_action_area1; - GtkWidget *newAccountCancelDialog_OKButton; - - addAccountCancelDialog = gnome_dialog_new (_("Canceling"), NULL); - gtk_widget_set_name (addAccountCancelDialog, "addAccountCancelDialog"); - gtk_object_set_data (GTK_OBJECT (addAccountCancelDialog), "addAccountCancelDialog", addAccountCancelDialog); - GTK_WINDOW (addAccountCancelDialog)->type = GTK_WINDOW_DIALOG; - gtk_window_set_position (GTK_WINDOW (addAccountCancelDialog), GTK_WIN_POS_MOUSE); - gtk_window_set_modal (GTK_WINDOW (addAccountCancelDialog), TRUE); - gtk_window_set_policy (GTK_WINDOW (addAccountCancelDialog), FALSE, FALSE, FALSE); - - newAccountCancelDialog = GNOME_DIALOG (addAccountCancelDialog)->vbox; - gtk_widget_set_name (newAccountCancelDialog, "newAccountCancelDialog"); - gtk_object_set_data (GTK_OBJECT (addAccountCancelDialog), "newAccountCancelDialog", newAccountCancelDialog); - gtk_widget_show (newAccountCancelDialog); - - vbox1 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox1, "vbox1"); - gtk_widget_ref (vbox1); - gtk_object_set_data_full (GTK_OBJECT (addAccountCancelDialog), "vbox1", vbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox1); - gtk_box_pack_start (GTK_BOX (newAccountCancelDialog), vbox1, TRUE, TRUE, 0); - - newAccountCancelDialog_ShouldRunAgainLable = gtk_label_new (_("Uncheck if you do not want this dialog to run if you start GnuCash up again. ")); - gtk_widget_set_name (newAccountCancelDialog_ShouldRunAgainLable, "newAccountCancelDialog_ShouldRunAgainLable"); - gtk_widget_ref (newAccountCancelDialog_ShouldRunAgainLable); - gtk_object_set_data_full (GTK_OBJECT (addAccountCancelDialog), "newAccountCancelDialog_ShouldRunAgainLable", newAccountCancelDialog_ShouldRunAgainLable, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountCancelDialog_ShouldRunAgainLable); - gtk_box_pack_start (GTK_BOX (vbox1), newAccountCancelDialog_ShouldRunAgainLable, FALSE, FALSE, 0); - gtk_label_set_line_wrap (GTK_LABEL (newAccountCancelDialog_ShouldRunAgainLable), TRUE); - - newAccountCancelDialog_RunAgainToggle = gtk_check_button_new_with_label (_("Run dialog for new user again?")); - gtk_widget_set_name (newAccountCancelDialog_RunAgainToggle, "newAccountCancelDialog_RunAgainToggle"); - gtk_widget_ref (newAccountCancelDialog_RunAgainToggle); - gtk_object_set_data_full (GTK_OBJECT (addAccountCancelDialog), "newAccountCancelDialog_RunAgainToggle", newAccountCancelDialog_RunAgainToggle, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountCancelDialog_RunAgainToggle); - gtk_box_pack_start (GTK_BOX (vbox1), newAccountCancelDialog_RunAgainToggle, FALSE, FALSE, 0); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (newAccountCancelDialog_RunAgainToggle), TRUE); - - dialog_action_area1 = GNOME_DIALOG (addAccountCancelDialog)->action_area; - gtk_widget_set_name (dialog_action_area1, "dialog_action_area1"); - gtk_object_set_data (GTK_OBJECT (addAccountCancelDialog), "dialog_action_area1", dialog_action_area1); - gtk_widget_show (dialog_action_area1); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area1), 8); - - gnome_dialog_append_button (GNOME_DIALOG (addAccountCancelDialog), GNOME_STOCK_BUTTON_OK); - newAccountCancelDialog_OKButton = GTK_WIDGET (g_list_last (GNOME_DIALOG (addAccountCancelDialog)->buttons)->data); - gtk_widget_set_name (newAccountCancelDialog_OKButton, "newAccountCancelDialog_OKButton"); - gtk_widget_ref (newAccountCancelDialog_OKButton); - gtk_object_set_data_full (GTK_OBJECT (addAccountCancelDialog), "newAccountCancelDialog_OKButton", newAccountCancelDialog_OKButton, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (newAccountCancelDialog_OKButton); - GTK_WIDGET_SET_FLAGS (newAccountCancelDialog_OKButton, GTK_CAN_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (newAccountCancelDialog_OKButton), "clicked", - GTK_SIGNAL_FUNC (on_newAccountCancelDialog_OKButton_clicked), - NULL); - - return addAccountCancelDialog; -} - -GtkWidget* -create_newUserChoiceWindow (void) -{ - GtkWidget *newUserChoiceWindow; - GtkWidget *dialog_vbox1; - GtkWidget *frame4; - GtkWidget *vbox6; - GSList *new_user_group_group = NULL; - GtkWidget *new_accounts_button; - GtkWidget *import_qif_button; - GtkWidget *tutorial_button; - GtkWidget *dialog_action_area2; - GtkWidget *button1; - GtkWidget *button3; - - newUserChoiceWindow = gnome_dialog_new (_("Welcome to GnuCash 1.6!"), NULL); - gtk_widget_set_name (newUserChoiceWindow, "newUserChoiceWindow"); - gtk_object_set_data (GTK_OBJECT (newUserChoiceWindow), "newUserChoiceWindow", newUserChoiceWindow); - gtk_window_set_policy (GTK_WINDOW (newUserChoiceWindow), FALSE, FALSE, FALSE); - - dialog_vbox1 = GNOME_DIALOG (newUserChoiceWindow)->vbox; - gtk_widget_set_name (dialog_vbox1, "dialog_vbox1"); - gtk_object_set_data (GTK_OBJECT (newUserChoiceWindow), "dialog_vbox1", dialog_vbox1); - gtk_widget_show (dialog_vbox1); - - frame4 = gtk_frame_new (NULL); - gtk_widget_set_name (frame4, "frame4"); - gtk_widget_ref (frame4); - gtk_object_set_data_full (GTK_OBJECT (newUserChoiceWindow), "frame4", frame4, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame4); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), frame4, FALSE, FALSE, 0); - - vbox6 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox6, "vbox6"); - gtk_widget_ref (vbox6); - gtk_object_set_data_full (GTK_OBJECT (newUserChoiceWindow), "vbox6", vbox6, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox6); - gtk_container_add (GTK_CONTAINER (frame4), vbox6); - gtk_container_set_border_width (GTK_CONTAINER (vbox6), 3); - - new_accounts_button = gtk_radio_button_new_with_label (new_user_group_group, _("Create a new set of accounts")); - new_user_group_group = gtk_radio_button_group (GTK_RADIO_BUTTON (new_accounts_button)); - gtk_widget_set_name (new_accounts_button, "new_accounts_button"); - gtk_widget_ref (new_accounts_button); - gtk_object_set_data_full (GTK_OBJECT (newUserChoiceWindow), "new_accounts_button", new_accounts_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (new_accounts_button); - gtk_box_pack_start (GTK_BOX (vbox6), new_accounts_button, FALSE, FALSE, 0); - - import_qif_button = gtk_radio_button_new_with_label (new_user_group_group, _("Import my QIF files")); - new_user_group_group = gtk_radio_button_group (GTK_RADIO_BUTTON (import_qif_button)); - gtk_widget_set_name (import_qif_button, "import_qif_button"); - gtk_widget_ref (import_qif_button); - gtk_object_set_data_full (GTK_OBJECT (newUserChoiceWindow), "import_qif_button", import_qif_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (import_qif_button); - gtk_box_pack_start (GTK_BOX (vbox6), import_qif_button, FALSE, FALSE, 0); - - tutorial_button = gtk_radio_button_new_with_label (new_user_group_group, _("Open the new user tutorial")); - new_user_group_group = gtk_radio_button_group (GTK_RADIO_BUTTON (tutorial_button)); - gtk_widget_set_name (tutorial_button, "tutorial_button"); - gtk_widget_ref (tutorial_button); - gtk_object_set_data_full (GTK_OBJECT (newUserChoiceWindow), "tutorial_button", tutorial_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (tutorial_button); - gtk_box_pack_start (GTK_BOX (vbox6), tutorial_button, FALSE, FALSE, 0); - - dialog_action_area2 = GNOME_DIALOG (newUserChoiceWindow)->action_area; - gtk_widget_set_name (dialog_action_area2, "dialog_action_area2"); - gtk_object_set_data (GTK_OBJECT (newUserChoiceWindow), "dialog_action_area2", dialog_action_area2); - gtk_widget_show (dialog_action_area2); - gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area2), GTK_BUTTONBOX_END); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area2), 8); - - gnome_dialog_append_button (GNOME_DIALOG (newUserChoiceWindow), GNOME_STOCK_BUTTON_OK); - button1 = GTK_WIDGET (g_list_last (GNOME_DIALOG (newUserChoiceWindow)->buttons)->data); - gtk_widget_set_name (button1, "button1"); - gtk_widget_ref (button1); - gtk_object_set_data_full (GTK_OBJECT (newUserChoiceWindow), "button1", button1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (button1); - GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT); - - gnome_dialog_append_button (GNOME_DIALOG (newUserChoiceWindow), GNOME_STOCK_BUTTON_CANCEL); - button3 = GTK_WIDGET (g_list_last (GNOME_DIALOG (newUserChoiceWindow)->buttons)->data); - gtk_widget_set_name (button3, "button3"); - gtk_widget_ref (button3); - gtk_object_set_data_full (GTK_OBJECT (newUserChoiceWindow), "button3", button3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (button3); - GTK_WIDGET_SET_FLAGS (button3, GTK_CAN_DEFAULT); - - return newUserChoiceWindow; -} - diff --git a/src/gnome/new-user-interface.h b/src/gnome/new-user-interface.h deleted file mode 100644 index 31f1cbbec69..00000000000 --- a/src/gnome/new-user-interface.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -GtkWidget* create_newUserDialog (void); -GtkWidget* create_addAccountCancelDialog (void); -GtkWidget* create_newUserChoiceWindow (void); diff --git a/src/gnome/new-user.glade b/src/gnome/new-user.glade deleted file mode 100644 index bd1b8a22282..00000000000 --- a/src/gnome/new-user.glade +++ /dev/null @@ -1,838 +0,0 @@ - - - - - New-user - new-user - - . - pixmaps - C - True - True - True - False - False - new-user-interface.c - new-user-interface.h - new-user-callbacks.c - new-user-callbacks.h - glade-support.c - glade-support.h - new-user-translatable.c - - - - GtkWindow - newUserDialog - 540 - 370 - New Account Hierarchy Setup - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_MOUSE - False - 640 - 480 - False - True - False - - - GnomeDruid - newUserDruid - - cancel - on_accountChooseDruidPage_cancel - Wed, 10 Jan 2001 03:37:36 GMT - - - - GnomeDruidPageStart - newUserStartPage - - next - on_newUserStartPage_next - Tue, 09 Jan 2001 18:04:50 GMT - - New Account Hierarchy Setup - This druid will help you create a set of GnuCash -accounts for your assets (such as investments, -checking or savings accounts), liabilities (such -as loans) and different kinds of income and -expenses you might have. - -Click 'Cancel' if you do not wish to create any -new accounts now. - 255,255,255 - 0,0,0 - 25,25,112 - 255,255,255 - 255,255,255 - - - - GnomeDruidPageStandard - newAccountCurrencyChoosePage - - prepare - on_newAccountCurrencyChoosePage_prepare - Thu, 11 Jan 2001 23:30:52 GMT - - - next - on_newAccountCurrencyChoosePage_next - Wed, 11 Apr 2001 18:53:01 GMT - - Choose Currency - 255,255,255 - 25,25,112 - 255,255,255 - - - GtkVBox - GnomeDruidPageStandard:vbox - newAccountCurrencyChooser_vbox2 - 20 - False - 5 - - 0 - True - True - - - - GtkLabel - newUserChooseCurrencyDescrip - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkVBox - newAccountCurrencyChooser_vbox - False - 0 - - 0 - False - False - - - - Placeholder - - - - - - - GnomeDruidPageStandard - chooseAccountTypesPage - - next - on_chooseAccountTypesPage_next - Tue, 09 Jan 2001 18:05:14 GMT - - - prepare - on_chooseAccountTypesPage_prepare - Thu, 11 Jan 2001 23:31:39 GMT - - Choose accounts to create - 255,255,255 - 25,25,112 - 255,255,255 - - - GtkVBox - GnomeDruidPageStandard:vbox - druid-vbox1 - 5 - False - 5 - - 0 - True - True - - - - GtkLabel - pickAccountsDescriptionLabel - - GTK_JUSTIFY_LEFT - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkFrame - frame5 - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - - - - GtkVBox - vbox7 - False - 0 - - - GtkScrolledWindow - scrolledwindow1 - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - True - True - - - - GtkCList - newAccountTypesList - True - - select_row - on_newAccountTypesList_select_row - Thu, 12 Apr 2001 22:01:16 GMT - - - unselect_row - on_newAccountTypesList_unselect_row - Sat, 12 May 2001 09:23:47 GMT - - 2 - 144,80 - GTK_SELECTION_MULTIPLE - True - GTK_SHADOW_IN - - - GtkLabel - CList:title - newAccountTypesList_TypeLabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CList:title - newAccountTypesList_DescriptionLabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GtkHBox - hbox3 - 5 - False - 0 - - 0 - False - False - - - - GtkButton - newAccountsTypeList_SelectAllButton - True - - clicked - on_newAccountsTypeList_SelectAllButton_clicked - Thu, 12 Apr 2001 22:03:24 GMT - - - GTK_RELIEF_NORMAL - - 0 - True - False - - - - - GtkButton - newAccountsTypeList_ClearAllButton - True - - clicked - on_newAccountsTypeList_ClearAllButton_clicked - Thu, 19 Apr 2001 14:27:32 GMT - - - GTK_RELIEF_NORMAL - - 0 - True - False - - - - - - - - GtkHBox - hbox1 - False - 2 - - 0 - True - True - - - - GtkFrame - frame1 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - - - - GtkScrolledWindow - scrolledwindow2 - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - - GtkViewport - viewport2 - GTK_SHADOW_IN - - - GtkLabel - newAccountTypesDescription - - GTK_JUSTIFY_LEFT - True - 0.5 - 0.5 - 0 - 0 - - - - - - - GtkFrame - frame2 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - - - - GtkScrolledWindow - scrolledwindow3 - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - - GtkViewport - viewport1 - GTK_SHADOW_IN - - - GtkTree - newAccountListTree - GTK_SELECTION_SINGLE - GTK_TREE_VIEW_LINE - True - - - - - - - - - - GnomeDruidPageStandard - finalAccountDruidPage - - prepare - on_finalAccountDruidPage_prepare - Thu, 12 Apr 2001 22:49:49 GMT - - - next - on_finalAccountDruidPage_next - Sat, 12 May 2001 10:43:19 GMT - - Enter opening balances - 255,255,255 - 25,25,112 - 255,255,255 - - - GtkVBox - GnomeDruidPageStandard:vbox - druid-vbox3 - 5 - False - 10 - - 0 - True - True - - - - GtkLabel - finalAccountLabel - - GTK_JUSTIFY_LEFT - False - 0.5 - 0.5 - 1 - 1 - - 5 - False - False - - - - - GtkHBox - hbox4 - False - 2 - - 0 - True - True - - - - GtkScrolledWindow - scrolledwindow4 - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - True - True - - - - GtkCTree - finalAccountCTree - True - - tree_select_row - on_finalAccountCTree_tree_select_row - Thu, 07 Jun 2001 06:52:18 GMT - - - tree_unselect_row - on_finalAccountCTree_tree_unselect_row - Thu, 07 Jun 2001 06:52:23 GMT - - 3 - 80,80,80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_IN - - - GtkLabel - CTree:title - cTreeAccountNameLabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CTree:title - cTreeTypeLabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CTree:title - cTreeOpeningBalanceLabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GtkVBox - vbox5 - False - 0 - - 0 - False - True - - - - GtkFrame - frame3 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - False - False - - - - GtkVBox - startBalanceBox - 3 - False - 0 - - - Placeholder - - - - - - Placeholder - - - - - - - - GnomeDruidPageFinish - newUserDruidFinishPage - - finish - on_newUserDruidFinishPage_finish - Tue, 09 Jan 2001 18:08:04 GMT - - Finish Account Setup - Press `Finish' to create your new accounts. - -Press `Back' to review your selections. - -Press `Cancel' to close this dialog without creating any new accounts. - 25,25,112 - 255,255,255 - 255,255,255 - 0,0,0 - 255,255,255 - - - - - - GnomeDialog - addAccountCancelDialog - Canceling - GTK_WINDOW_DIALOG - GTK_WIN_POS_MOUSE - True - False - False - False - False - False - - - GtkVBox - GnomeDialog:vbox - newAccountCancelDialog - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_DEFAULT_STYLE - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - newAccountCancelDialog_OKButton - True - True - - clicked - on_newAccountCancelDialog_OKButton_clicked - Wed, 10 Jan 2001 03:47:18 GMT - - GNOME_STOCK_BUTTON_OK - - - - - GtkVBox - vbox1 - False - 5 - - 0 - True - True - - - - GtkLabel - newAccountCancelDialog_ShouldRunAgainLable - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkCheckButton - newAccountCancelDialog_RunAgainToggle - True - - True - True - - 0 - False - False - - - - - - - - GnomeDialog - newUserChoiceWindow - Welcome to GnuCash 1.6! - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area2 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button1 - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button3 - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - GtkFrame - frame4 - 0 - GTK_SHADOW_ETCHED_IN - - 0 - False - False - - - - GtkVBox - vbox6 - 3 - False - 0 - - - GtkRadioButton - new_accounts_button - True - - False - True - new_user_group - - 0 - False - False - - - - - GtkRadioButton - import_qif_button - True - - False - True - new_user_group - - 0 - False - False - - - - - GtkRadioButton - tutorial_button - True - - False - True - new_user_group - - 0 - False - False - - - - - - - - diff --git a/src/gnome/top-level.c b/src/gnome/top-level.c index c4a614cf993..3e040f4d7cb 100644 --- a/src/gnome/top-level.c +++ b/src/gnome/top-level.c @@ -70,8 +70,6 @@ #include "window-main.h" #include "window-acct-tree.h" #include "window-report.h" -#include "new-user-interface.h" -#include "new-user-funs.h" #include diff --git a/src/scm/main.scm b/src/scm/main.scm index 6d81bf11cba..89c7e720bc5 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -159,11 +159,10 @@ (if (and (not (gnc:account-file-to-load)) (not (string? (gnc:history-get-last))) - (equal? ((gnc:option-getter - (gnc:lookup-global-option "__new_user" "first_startup"))) - 1)) + (gnc:option-value + (gnc:lookup-global-option "__new_user" "first_startup"))) (begin - (gnc:show-new-user-choice-window) + (gnc:new-user-dialog) (gnc:start-ui-event-loop)) (begin (gnc:load-account-file) diff --git a/src/scm/prefs.scm b/src/scm/prefs.scm index a1c05d4fb14..7920f149b25 100644 --- a/src/scm/prefs.scm +++ b/src/scm/prefs.scm @@ -696,7 +696,7 @@ the current value of the path.") (gnc:register-configuration-option (gnc:make-internal-option - "__new_user" "first_startup" 1)) + "__new_user" "first_startup" #t)) (gnc:register-configuration-option (gnc:make-internal-option