2001-06-16 Dave Peticolas <dave@krondo.com>

* 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
This commit is contained in:
Dave Peticolas 2001-06-17 06:35:54 +00:00
parent f46bdf493f
commit e516792199
25 changed files with 1994 additions and 3041 deletions

View File

@ -1,3 +1,21 @@
2001-06-16 Dave Peticolas <dave@krondo.com>
* 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 <rgmerk@mira.net 2001-06-16 Robert Graham Merkel <rgmerk@mira.net
* po/POTFILES.in : remove references to deleted files. * po/POTFILES.in : remove references to deleted files.

View File

@ -31,6 +31,7 @@ src/gnome/glade/commodity_strings.c
src/gnome/glade/fincalc_strings.c src/gnome/glade/fincalc_strings.c
src/gnome/glade/find_strings.c src/gnome/glade/find_strings.c
src/gnome/glade/help_strings.c src/gnome/glade/help_strings.c
src/gnome/glade/newuser_strings.c
src/gnome/glade/price_strings.c src/gnome/glade/price_strings.c
src/gnome/glade/print_strings.c src/gnome/glade/print_strings.c
src/gnome/glade/progress_strings.c src/gnome/glade/progress_strings.c
@ -47,7 +48,6 @@ src/gnome/gnc-dateedit.c
src/gnome/gnc-html.c src/gnome/gnc-html.c
src/gnome/gnc-http.c src/gnome/gnc-http.c
src/gnome/gnc-network.c src/gnome/gnc-network.c
src/gnome/new-user-interface.c
src/gnome/print-session.c src/gnome/print-session.c
src/gnome/reconcile-list.c src/gnome/reconcile-list.c
src/gnome/window-acct-tree.c src/gnome/window-acct-tree.c

View File

@ -37,7 +37,6 @@
#include "gnc-event.h" #include "gnc-event.h"
#include "gnc-ui.h" #include "gnc-ui.h"
#include "messages.h" #include "messages.h"
#include "gnome/new-user-funs.h"
#include "guile/global-options.h" #include "guile/global-options.h"
/* FIXME: this is wrong. This file should not need this include. */ /* FIXME: this is wrong. This file should not need this include. */
@ -266,7 +265,7 @@ gncFileNew (void)
if(gnc_lookup_boolean_option("General", if(gnc_lookup_boolean_option("General",
"No account list setup on new file", "No account list setup on new file",
1)) TRUE))
{ {
gh_call2(gh_eval_str("gnc:hook-run-danglers"), gh_call2(gh_eval_str("gnc:hook-run-danglers"),
gh_eval_str("gnc:*book-opened-hook*"), gh_eval_str("gnc:*book-opened-hook*"),
@ -274,9 +273,9 @@ gncFileNew (void)
} }
else else
{ {
gnc_ui_show_new_user_window(0); gnc_ui_hierarchy_druid ();
} }
gnc_engine_resume_events (); gnc_engine_resume_events ();
gnc_gui_refresh_all (); gnc_gui_refresh_all ();
} }

View File

@ -103,6 +103,8 @@ gboolean gnc_get_username_password (gncUIWidget parent,
char **username, char **username,
char **password); char **password);
void gnc_ui_new_user_dialog (void);
void gnc_ui_hierarchy_druid (void);
/* Managing the GUI Windows *****************************************/ /* Managing the GUI Windows *****************************************/

View File

@ -14,6 +14,7 @@ libgncgnome_a_SOURCES = \
dialog-filebox.c \ dialog-filebox.c \
dialog-fincalc.c \ dialog-fincalc.c \
dialog-find-transactions.c \ dialog-find-transactions.c \
dialog-new-user.c \
dialog-options.c \ dialog-options.c \
dialog-price-editor.c \ dialog-price-editor.c \
dialog-print-check.c \ dialog-print-check.c \
@ -25,12 +26,12 @@ libgncgnome_a_SOURCES = \
dialog-userpass.c \ dialog-userpass.c \
dialog-utils.c \ dialog-utils.c \
druid-commodity.c \ druid-commodity.c \
druid-hierarchy.c \
druid-qif-import.c \ druid-qif-import.c \
druid-stock-split.c \ druid-stock-split.c \
druid-utils.c \ druid-utils.c \
extensions.c \ extensions.c \
file-history.c \ file-history.c \
glade-support.c \
gnc-amount-edit.c \ gnc-amount-edit.c \
gnc-commodity-edit.c \ gnc-commodity-edit.c \
gnc-currency-edit.c \ gnc-currency-edit.c \
@ -45,9 +46,6 @@ libgncgnome_a_SOURCES = \
gnc-splash.c \ gnc-splash.c \
gtkselect.c \ gtkselect.c \
mainwindow-account-tree.c \ mainwindow-account-tree.c \
new-user-callbacks.c \
new-user-funs.c \
new-user-interface.c \
print-session.c \ print-session.c \
query-user.c \ query-user.c \
reconcile-list.c \ reconcile-list.c \
@ -77,6 +75,7 @@ noinst_HEADERS = \
dialog-commodity.h \ dialog-commodity.h \
dialog-fincalc.h \ dialog-fincalc.h \
dialog-find-transactions.h \ dialog-find-transactions.h \
dialog-new-user.h \
dialog-options.h \ dialog-options.h \
dialog-print-check.h \ dialog-print-check.h \
dialog-progress.h \ dialog-progress.h \
@ -85,10 +84,10 @@ noinst_HEADERS = \
dialog-transfer.h \ dialog-transfer.h \
dialog-utils.h \ dialog-utils.h \
druid-commodity.h \ druid-commodity.h \
druid-hierarchy.h \
druid-qif-import.h \ druid-qif-import.h \
druid-utils.h \ druid-utils.h \
extensions.h \ extensions.h \
glade-support.h \
gnc-amount-edit.h \ gnc-amount-edit.h \
gnc-commodity-edit.h \ gnc-commodity-edit.h \
gnc-currency-edit.h \ gnc-currency-edit.h \
@ -104,9 +103,6 @@ noinst_HEADERS = \
gnc-splash.h \ gnc-splash.h \
gtkselect.h \ gtkselect.h \
mainwindow-account-tree.h \ mainwindow-account-tree.h \
new-user-callbacks.h \
new-user-funs.h \
new-user-interface.h \
print-session.h \ print-session.h \
query-user.h \ query-user.h \
reconcile-list.h \ reconcile-list.h \
@ -119,17 +115,12 @@ noinst_HEADERS = \
window-register.h \ window-register.h \
window-report.h window-report.h
GLADE_FILES = \
glade-support.c \
glade-support.h
EXTRA_DIST = \ EXTRA_DIST = \
.cvsignore \ .cvsignore \
gnc-dir.h.in \ gnc-dir.h.in \
gnucash.desktop \ gnucash.desktop \
gnucash.keys.in \ gnucash.keys.in \
gnucash.mime \ gnucash.mime
new-user.glade
CFLAGS = @CFLAGS@ \ CFLAGS = @CFLAGS@ \
${G_WRAP_COMPILE_ARGS} \ ${G_WRAP_COMPILE_ARGS} \

130
src/gnome/dialog-new-user.c Normal file
View File

@ -0,0 +1,130 @@
/********************************************************************\
* dialog-new-user.c -- new user dialog for GnuCash *
* Copyright (C) 2001 Dave Peticolas <dave@krondo.com> *
* *
* 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 <gnome.h>
#include <guile/gh.h>
#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)");
}

View File

@ -0,0 +1,32 @@
/********************************************************************\
* dialog-new-user.h -- new user dialog for GnuCash *
* Copyright (C) 2001 Dave Peticolas <dave@krondo.com> *
* *
* 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

930
src/gnome/druid-hierarchy.c Normal file
View File

@ -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 <gnome.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#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;
}

View File

@ -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. * * Copyright (C) 2001 Gnumatic, Inc. *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
@ -20,40 +20,9 @@
* Boston, MA 02111-1307, USA gnu@gnu.org * * Boston, MA 02111-1307, USA gnu@gnu.org *
\********************************************************************/ \********************************************************************/
#ifndef _NEW_USER_FUNS_H_ #ifndef DRUID_HIERARCHY_H
#define _NEW_USER_FUNS_H_ #define DRUID_HIERARCHY_H
#include <glib.h> void gnc_ui_hierarchy_druid (void);
#include "gnc-amount-edit.h" #endif
#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 */

View File

@ -1,146 +0,0 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <gnome.h>
#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;
}

View File

@ -1,34 +0,0 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#include <gnome.h>
/*
* 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);

View File

@ -5,6 +5,7 @@ glade_DATA = \
fincalc.glade \ fincalc.glade \
find.glade \ find.glade \
help.glade \ help.glade \
newuser.glade \
price.glade \ price.glade \
print.glade \ print.glade \
progress.glade \ progress.glade \
@ -22,6 +23,7 @@ STRING_FILES = \
fincalc_strings.c \ fincalc_strings.c \
find_strings.c \ find_strings.c \
help_strings.c \ help_strings.c \
newuser_strings.c \
price_strings.c \ price_strings.c \
print_strings.c \ print_strings.c \
progress_strings.c \ progress_strings.c \

View File

@ -817,4 +817,573 @@
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkWindow</class>
<name>Hierarchy Druid</name>
<width>540</width>
<height>370</height>
<title>New Account Hierarchy Setup</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_MOUSE</position>
<modal>False</modal>
<default_width>640</default_width>
<default_height>480</default_height>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GnomeDruid</class>
<name>hierarchy_druid</name>
<signal>
<name>cancel</name>
<handler>on_cancel</handler>
<last_modification_time>Sat, 16 Jun 2001 23:54:54 GMT</last_modification_time>
</signal>
<widget>
<class>GnomeDruidPageStart</class>
<name>start_page</name>
<title>New Account Hierarchy Setup</title>
<text>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.</text>
<title_color>255,255,255</title_color>
<text_color>0,0,0</text_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<textbox_color>255,255,255</textbox_color>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>currency_choose_page</name>
<signal>
<name>prepare</name>
<handler>on_choose_currency_prepare</handler>
<last_modification_time>Sat, 16 Jun 2001 23:27:41 GMT</last_modification_time>
</signal>
<title>Choose Currency</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>vbox2</name>
<border_width>20</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>newUserChooseCurrencyDescrip</name>
<label>Please choose the currency to use for new accounts.</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkVBox</class>
<name>currency_chooser_vbox</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>choose_account_types_page</name>
<signal>
<name>prepare</name>
<handler>on_choose_account_types_prepare</handler>
<last_modification_time>Sat, 16 Jun 2001 23:59:57 GMT</last_modification_time>
</signal>
<title>Choose accounts to create</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>druid-vbox1</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>pickAccountsDescriptionLabel</name>
<label>Select categories that correspond to the ways that you will use GnuCash.
Each category you select will cause several accounts to be created.
Select the categories that are relevant to you. You can always create
additional accounts by hand later.</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame5</name>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox7</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>account_types_clist</name>
<can_focus>True</can_focus>
<signal>
<name>select_row</name>
<handler>on_account_types_list_select_row</handler>
<last_modification_time>Sun, 17 Jun 2001 00:18:23 GMT</last_modification_time>
</signal>
<signal>
<name>unselect_row</name>
<handler>on_account_types_list_unselect_row</handler>
<last_modification_time>Sun, 17 Jun 2001 00:23:46 GMT</last_modification_time>
</signal>
<columns>2</columns>
<column_widths>144,80</column_widths>
<selection_mode>GTK_SELECTION_MULTIPLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>newAccountTypesList_TypeLabel</name>
<label>Account Types</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>newAccountTypesList_DescriptionLabel</name>
<label>Description</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox3</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkButton</class>
<name>select_all_button</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>select_all_clicked</handler>
<last_modification_time>Sun, 17 Jun 2001 00:25:54 GMT</last_modification_time>
</signal>
<label>Select All</label>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>clear_all_button</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>clear_all_clicked</handler>
<last_modification_time>Sun, 17 Jun 2001 00:28:18 GMT</last_modification_time>
</signal>
<label>Clear All</label>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox1</name>
<homogeneous>False</homogeneous>
<spacing>2</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkFrame</class>
<name>frame1</name>
<label>Detailed Description</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkViewport</class>
<name>viewport2</name>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<name>account_types_description_entry</name>
<label></label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>True</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame2</name>
<label>Accounts</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow3</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkViewport</class>
<name>viewport1</name>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkTree</class>
<name>account_type_tree</name>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<view_mode>GTK_TREE_VIEW_LINE</view_mode>
<view_line>True</view_line>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>final_account_page</name>
<signal>
<name>prepare</name>
<handler>on_final_account_prepare</handler>
<last_modification_time>Sun, 17 Jun 2001 00:30:49 GMT</last_modification_time>
</signal>
<signal>
<name>next</name>
<handler>on_final_account_next</handler>
<last_modification_time>Sun, 17 Jun 2001 05:40:45 GMT</last_modification_time>
</signal>
<title>Enter opening balances</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>druid-vbox3</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>10</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>finalAccountLabel</name>
<label>If you would like an account to have an opening balance, click on the account
and enter the starting balance in the box on the right. All accounts except Equity
accounts may have an opening balance.</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>1</xpad>
<ypad>1</ypad>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox4</name>
<homogeneous>False</homogeneous>
<spacing>2</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow4</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCTree</class>
<name>final_account_ctree</name>
<can_focus>True</can_focus>
<signal>
<name>tree_select_row</name>
<handler>on_final_account_tree_select_row</handler>
<last_modification_time>Sun, 17 Jun 2001 05:30:25 GMT</last_modification_time>
</signal>
<signal>
<name>tree_unselect_row</name>
<handler>on_final_account_tree_unselect_row</handler>
<last_modification_time>Sun, 17 Jun 2001 05:38:44 GMT</last_modification_time>
</signal>
<columns>3</columns>
<column_widths>80,80,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CTree:title</child_name>
<name>cTreeAccountNameLabel</name>
<label>Account Name</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CTree:title</child_name>
<name>cTreeTypeLabel</name>
<label>Type</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CTree:title</child_name>
<name>cTreeOpeningBalanceLabel</name>
<label>Opening Balance</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox5</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkFrame</class>
<name>frame3</name>
<label>Opening Balance</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>start_balance_box</name>
<border_width>3</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageFinish</class>
<name>newUserDruidFinishPage</name>
<signal>
<name>finish</name>
<handler>on_finish</handler>
<last_modification_time>Sat, 16 Jun 2001 23:41:40 GMT</last_modification_time>
</signal>
<title>Finish Account Setup</title>
<text>Press `Finish' to create your new accounts.
Press `Back' to review your selections.
Press `Cancel' to close this dialog without creating any new accounts.</text>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<textbox_color>255,255,255</textbox_color>
<text_color>0,0,0</text_color>
<title_color>255,255,255</title_color>
</widget>
</widget>
</widget>
</GTK-Interface> </GTK-Interface>

View File

@ -29,3 +29,40 @@ gchar *s = N_("Use Opening Balances Equity account");
gchar *s = N_("Select Transfer Account"); gchar *s = N_("Select Transfer Account");
gchar *s = N_("Transfer Account"); gchar *s = N_("Transfer Account");
gchar *s = N_("Opening Balance"); 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.");

View File

@ -0,0 +1,243 @@
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>Glade</name>
<program_name>glade</program_name>
<directory></directory>
<source_directory></source_directory>
<pixmaps_directory></pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<output_main_file>False</output_main_file>
<output_support_files>False</output_support_files>
<output_build_files>False</output_build_files>
<backup_source_files>False</backup_source_files>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>newuser_strings.c</translatable_strings_file>
</project>
<widget>
<class>GnomeDialog</class>
<name>New User Dialog</name>
<title>Welcome to GnuCash 1.6!</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox1</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area2</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button1</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button3</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame4</name>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox6</name>
<border_width>3</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkRadioButton</class>
<name>new_accounts_button</name>
<can_focus>True</can_focus>
<label>Create a new set of accounts</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>new_user_group</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>import_qif_button</name>
<can_focus>True</can_focus>
<label>Import my QIF files</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>new_user_group</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>tutorial_button</name>
<can_focus>True</can_focus>
<label>Open the new user tutorial</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>new_user_group</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>New User Cancel Dialog</name>
<title>Canceling</title>
<type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_MOUSE</position>
<modal>True</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog_vbox</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area1</name>
<layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>ok_button</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox1</name>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>newAccountCancelDialog_ShouldRunAgainLable</name>
<label>Uncheck if you do not want this dialog to run if you start GnuCash up again. </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>True</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>run_again_toggle</name>
<can_focus>True</can_focus>
<label>Run dialog for new user again?</label>
<active>True</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>

View File

@ -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?");

View File

@ -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 <glib.h>
#include <gnome.h>
#include <guile/gh.h>
#include <time.h>
#include <locale.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#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;
}

View File

@ -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 <gnome.h>
#include <glib.h>
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);

View File

@ -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 <gnome.h>
#include <guile/gh.h>
#include <stdio.h>
#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)");
}

View File

@ -1,670 +0,0 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <gnome.h>
#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;
}

View File

@ -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);

View File

@ -1,838 +0,0 @@
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>New-user</name>
<program_name>new-user</program_name>
<directory></directory>
<source_directory>.</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<use_widget_names>True</use_widget_names>
<output_main_file>False</output_main_file>
<output_build_files>False</output_build_files>
<main_source_file>new-user-interface.c</main_source_file>
<main_header_file>new-user-interface.h</main_header_file>
<handler_source_file>new-user-callbacks.c</handler_source_file>
<handler_header_file>new-user-callbacks.h</handler_header_file>
<support_source_file>glade-support.c</support_source_file>
<support_header_file>glade-support.h</support_header_file>
<translatable_strings_file>new-user-translatable.c</translatable_strings_file>
</project>
<widget>
<class>GtkWindow</class>
<name>newUserDialog</name>
<width>540</width>
<height>370</height>
<title>New Account Hierarchy Setup</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_MOUSE</position>
<modal>False</modal>
<default_width>640</default_width>
<default_height>480</default_height>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GnomeDruid</class>
<name>newUserDruid</name>
<signal>
<name>cancel</name>
<handler>on_accountChooseDruidPage_cancel</handler>
<last_modification_time>Wed, 10 Jan 2001 03:37:36 GMT</last_modification_time>
</signal>
<widget>
<class>GnomeDruidPageStart</class>
<name>newUserStartPage</name>
<signal>
<name>next</name>
<handler>on_newUserStartPage_next</handler>
<last_modification_time>Tue, 09 Jan 2001 18:04:50 GMT</last_modification_time>
</signal>
<title>New Account Hierarchy Setup</title>
<text>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.</text>
<title_color>255,255,255</title_color>
<text_color>0,0,0</text_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<textbox_color>255,255,255</textbox_color>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>newAccountCurrencyChoosePage</name>
<signal>
<name>prepare</name>
<handler>on_newAccountCurrencyChoosePage_prepare</handler>
<last_modification_time>Thu, 11 Jan 2001 23:30:52 GMT</last_modification_time>
</signal>
<signal>
<name>next</name>
<handler>on_newAccountCurrencyChoosePage_next</handler>
<last_modification_time>Wed, 11 Apr 2001 18:53:01 GMT</last_modification_time>
</signal>
<title>Choose Currency</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>newAccountCurrencyChooser_vbox2</name>
<border_width>20</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>newUserChooseCurrencyDescrip</name>
<label>Please choose the currency to use for new accounts.</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkVBox</class>
<name>newAccountCurrencyChooser_vbox</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>chooseAccountTypesPage</name>
<signal>
<name>next</name>
<handler>on_chooseAccountTypesPage_next</handler>
<last_modification_time>Tue, 09 Jan 2001 18:05:14 GMT</last_modification_time>
</signal>
<signal>
<name>prepare</name>
<handler>on_chooseAccountTypesPage_prepare</handler>
<last_modification_time>Thu, 11 Jan 2001 23:31:39 GMT</last_modification_time>
</signal>
<title>Choose accounts to create</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>druid-vbox1</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>pickAccountsDescriptionLabel</name>
<label>Select categories that correspond to the ways that you will use GnuCash.
Each category you select will cause several accounts to be created.
Select the categories that are relevant to you. You can always create
additional accounts by hand later.</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame5</name>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox7</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>newAccountTypesList</name>
<can_focus>True</can_focus>
<signal>
<name>select_row</name>
<handler>on_newAccountTypesList_select_row</handler>
<last_modification_time>Thu, 12 Apr 2001 22:01:16 GMT</last_modification_time>
</signal>
<signal>
<name>unselect_row</name>
<handler>on_newAccountTypesList_unselect_row</handler>
<last_modification_time>Sat, 12 May 2001 09:23:47 GMT</last_modification_time>
</signal>
<columns>2</columns>
<column_widths>144,80</column_widths>
<selection_mode>GTK_SELECTION_MULTIPLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>newAccountTypesList_TypeLabel</name>
<label>Account Types</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>newAccountTypesList_DescriptionLabel</name>
<label>Description</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox3</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkButton</class>
<name>newAccountsTypeList_SelectAllButton</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_newAccountsTypeList_SelectAllButton_clicked</handler>
<last_modification_time>Thu, 12 Apr 2001 22:03:24 GMT</last_modification_time>
</signal>
<label>Select All</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>newAccountsTypeList_ClearAllButton</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_newAccountsTypeList_ClearAllButton_clicked</handler>
<last_modification_time>Thu, 19 Apr 2001 14:27:32 GMT</last_modification_time>
</signal>
<label>Clear All</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox1</name>
<homogeneous>False</homogeneous>
<spacing>2</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkFrame</class>
<name>frame1</name>
<label>Detailed Description</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkViewport</class>
<name>viewport2</name>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<name>newAccountTypesDescription</name>
<label></label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>True</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame2</name>
<label>Accounts</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow3</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkViewport</class>
<name>viewport1</name>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkTree</class>
<name>newAccountListTree</name>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<view_mode>GTK_TREE_VIEW_LINE</view_mode>
<view_line>True</view_line>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>finalAccountDruidPage</name>
<signal>
<name>prepare</name>
<handler>on_finalAccountDruidPage_prepare</handler>
<last_modification_time>Thu, 12 Apr 2001 22:49:49 GMT</last_modification_time>
</signal>
<signal>
<name>next</name>
<handler>on_finalAccountDruidPage_next</handler>
<last_modification_time>Sat, 12 May 2001 10:43:19 GMT</last_modification_time>
</signal>
<title>Enter opening balances</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>druid-vbox3</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>10</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>finalAccountLabel</name>
<label>If you would like an account to have an opening balance, click on the account
and enter the starting balance in the box on the right. All accounts except Equity
accounts may have an opening balance.</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>1</xpad>
<ypad>1</ypad>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox4</name>
<homogeneous>False</homogeneous>
<spacing>2</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow4</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCTree</class>
<name>finalAccountCTree</name>
<can_focus>True</can_focus>
<signal>
<name>tree_select_row</name>
<handler>on_finalAccountCTree_tree_select_row</handler>
<last_modification_time>Thu, 07 Jun 2001 06:52:18 GMT</last_modification_time>
</signal>
<signal>
<name>tree_unselect_row</name>
<handler>on_finalAccountCTree_tree_unselect_row</handler>
<last_modification_time>Thu, 07 Jun 2001 06:52:23 GMT</last_modification_time>
</signal>
<columns>3</columns>
<column_widths>80,80,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CTree:title</child_name>
<name>cTreeAccountNameLabel</name>
<label>Account Name</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CTree:title</child_name>
<name>cTreeTypeLabel</name>
<label>Type</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CTree:title</child_name>
<name>cTreeOpeningBalanceLabel</name>
<label>Opening Balance</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox5</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkFrame</class>
<name>frame3</name>
<label>Opening Balance</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>startBalanceBox</name>
<border_width>3</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageFinish</class>
<name>newUserDruidFinishPage</name>
<signal>
<name>finish</name>
<handler>on_newUserDruidFinishPage_finish</handler>
<last_modification_time>Tue, 09 Jan 2001 18:08:04 GMT</last_modification_time>
</signal>
<title>Finish Account Setup</title>
<text>Press `Finish' to create your new accounts.
Press `Back' to review your selections.
Press `Cancel' to close this dialog without creating any new accounts.</text>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<textbox_color>255,255,255</textbox_color>
<text_color>0,0,0</text_color>
<title_color>255,255,255</title_color>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>addAccountCancelDialog</name>
<title>Canceling</title>
<type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_MOUSE</position>
<modal>True</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>newAccountCancelDialog</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area1</name>
<layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>newAccountCancelDialog_OKButton</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_newAccountCancelDialog_OKButton_clicked</handler>
<last_modification_time>Wed, 10 Jan 2001 03:47:18 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox1</name>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>newAccountCancelDialog_ShouldRunAgainLable</name>
<label>Uncheck if you do not want this dialog to run if you start GnuCash up again. </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>True</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>newAccountCancelDialog_RunAgainToggle</name>
<can_focus>True</can_focus>
<label>Run dialog for new user again?</label>
<active>True</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>newUserChoiceWindow</name>
<title>Welcome to GnuCash 1.6!</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox1</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area2</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button1</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button3</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame4</name>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox6</name>
<border_width>3</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkRadioButton</class>
<name>new_accounts_button</name>
<can_focus>True</can_focus>
<label>Create a new set of accounts</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>new_user_group</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>import_qif_button</name>
<can_focus>True</can_focus>
<label>Import my QIF files</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>new_user_group</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>tutorial_button</name>
<can_focus>True</can_focus>
<label>Open the new user tutorial</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>new_user_group</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>

View File

@ -70,8 +70,6 @@
#include "window-main.h" #include "window-main.h"
#include "window-acct-tree.h" #include "window-acct-tree.h"
#include "window-report.h" #include "window-report.h"
#include "new-user-interface.h"
#include "new-user-funs.h"
#include <g-wrap-runtime-guile.h> #include <g-wrap-runtime-guile.h>

View File

@ -159,11 +159,10 @@
(if (and (if (and
(not (gnc:account-file-to-load)) (not (gnc:account-file-to-load))
(not (string? (gnc:history-get-last))) (not (string? (gnc:history-get-last)))
(equal? ((gnc:option-getter (gnc:option-value
(gnc:lookup-global-option "__new_user" "first_startup"))) (gnc:lookup-global-option "__new_user" "first_startup")))
1))
(begin (begin
(gnc:show-new-user-choice-window) (gnc:new-user-dialog)
(gnc:start-ui-event-loop)) (gnc:start-ui-event-loop))
(begin (begin
(gnc:load-account-file) (gnc:load-account-file)

View File

@ -696,7 +696,7 @@ the current value of the path.")
(gnc:register-configuration-option (gnc:register-configuration-option
(gnc:make-internal-option (gnc:make-internal-option
"__new_user" "first_startup" 1)) "__new_user" "first_startup" #t))
(gnc:register-configuration-option (gnc:register-configuration-option
(gnc:make-internal-option (gnc:make-internal-option