From a74241ef878a0bce7ca9b8cc9b101db8cc7b1227 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Thu, 11 Jan 2001 22:32:22 +0000 Subject: [PATCH] James LewisMoss's patch adding a new-user gui. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3443 57a11ea4-9604-0410-9ed3-97b8803252fd --- debian/changelog | 4 +- debian/rules | 10 +- make-gnucash-patch.in | 2 +- po/POTFILES.in | 1 + src/doc/xml/account-v2.dtd | 24 + src/doc/xml/commodity-v2.dtd | 9 + src/doc/xml/defaults-v1.dtd | 1 + .../xml}/io-gncxml-version1.dtd | 4 +- src/doc/xml/io-gncxml-version2.dtd | 22 + src/doc/xml/preferences-v1.dtd | 1 + src/doc/xml/prices-v1.dtd | 1 + src/doc/xml/transactions-v2.dtd | 42 ++ src/doc/xml/types.dtd | 22 + src/engine/DateUtils.c | 4 +- src/engine/TransLog.c | 18 +- src/engine/date.c | 7 +- src/engine/sql/PostgresBackend.c | 4 +- src/gnome/Makefile.am | 14 +- src/gnome/new-user-callbacks.c | 108 +++++ src/gnome/new-user-callbacks.h | 40 ++ src/gnome/new-user-funs.c | 77 ++++ src/gnome/new-user-funs.h | 14 + src/gnome/new-user-interface.c | 365 +++++++++++++++ src/gnome/new-user-interface.h | 7 + src/gnome/new-user.glade | 422 ++++++++++++++++++ src/gnome/top-level.c | 22 +- src/scm/main.scm | 16 +- src/scm/prefs.scm | 4 + 28 files changed, 1234 insertions(+), 31 deletions(-) create mode 100644 src/doc/xml/account-v2.dtd create mode 100644 src/doc/xml/commodity-v2.dtd create mode 100644 src/doc/xml/defaults-v1.dtd rename src/{engine => doc/xml}/io-gncxml-version1.dtd (98%) create mode 100644 src/doc/xml/io-gncxml-version2.dtd create mode 100644 src/doc/xml/preferences-v1.dtd create mode 100644 src/doc/xml/prices-v1.dtd create mode 100644 src/doc/xml/transactions-v2.dtd create mode 100644 src/doc/xml/types.dtd create mode 100644 src/gnome/new-user-callbacks.c create mode 100644 src/gnome/new-user-callbacks.h create mode 100644 src/gnome/new-user-funs.c create mode 100644 src/gnome/new-user-funs.h create mode 100644 src/gnome/new-user-interface.c create mode 100644 src/gnome/new-user-interface.h create mode 100644 src/gnome/new-user.glade diff --git a/debian/changelog b/debian/changelog index 012ad45acd..910039febd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -gnucash (1.5.2.cvs20001227-0.1) unstable; urgency=low +gnucash (1.5.2.cvs20010110-test1-0.1) unstable; urgency=low - * local compile + * local cvs compile -- James LewisMoss Mon, 18 Dec 2000 19:33:43 -0500 diff --git a/debian/rules b/debian/rules index 91422033c3..a7069a658d 100644 --- a/debian/rules +++ b/debian/rules @@ -12,7 +12,11 @@ id= $(shell pwd)/debian/tmp #perlpriv = $(id)$(shell perl -V:installprivlib | perl -pe 's/.*\'(.*)\'.*/\1/;') #perlarch = $(id)$(shell perl -V:installarchlib | perl -pe 's/.*\'(.*)\'.*/\1/;') -Makefile: Makefile.in +configure: configure.in + automake + autoconf + +Makefile: Makefile.in configure dh_testdir $(checkdir) ./configure --prefix=/usr \ @@ -20,8 +24,8 @@ Makefile: Makefile.in --infodir=/usr/share/info \ --mandir=/usr/share/man -build: Makefile build-stamp -build-stamp: +build: build-stamp +build-stamp: Makefile dh_testdir $(checkdir) make diff --git a/make-gnucash-patch.in b/make-gnucash-patch.in index 40af5815af..f013c6c7ab 100644 --- a/make-gnucash-patch.in +++ b/make-gnucash-patch.in @@ -64,7 +64,7 @@ if (not defined($old)) { exit(1); } if (not -d "tmp") { - mkdir "tmp", 0755]; + mkdir "tmp", 0755; } chdir "tmp"; system("cvs -d `cat ../$new/CVS/Root` co gnucash"); diff --git a/po/POTFILES.in b/po/POTFILES.in index 5004a77a67..8998a9d006 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -26,6 +26,7 @@ src/gnome/glade-gnc-dialogs.c src/gnome/gnc-commodity-edit.c src/gnome/gnc-datedelta.c src/gnome/gnc-dateedit.c +src/gnome/new-user-interface.c src/gnome/print-session.c src/gnome/reconcile-list.c src/gnome/window-help.c diff --git a/src/doc/xml/account-v2.dtd b/src/doc/xml/account-v2.dtd new file mode 100644 index 0000000000..92ffca2c72 --- /dev/null +++ b/src/doc/xml/account-v2.dtd @@ -0,0 +1,24 @@ + +%types; + + + + + + + + + + + + + + + + + + + + + diff --git a/src/doc/xml/commodity-v2.dtd b/src/doc/xml/commodity-v2.dtd new file mode 100644 index 0000000000..65ea7e1e59 --- /dev/null +++ b/src/doc/xml/commodity-v2.dtd @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/src/doc/xml/defaults-v1.dtd b/src/doc/xml/defaults-v1.dtd new file mode 100644 index 0000000000..7b5e8011ec --- /dev/null +++ b/src/doc/xml/defaults-v1.dtd @@ -0,0 +1 @@ + diff --git a/src/engine/io-gncxml-version1.dtd b/src/doc/xml/io-gncxml-version1.dtd similarity index 98% rename from src/engine/io-gncxml-version1.dtd rename to src/doc/xml/io-gncxml-version1.dtd index d9541e10ab..5aa881c9e6 100644 --- a/src/engine/io-gncxml-version1.dtd +++ b/src/doc/xml/io-gncxml-version1.dtd @@ -1,5 +1,3 @@ - - @@ -76,4 +74,4 @@ -]> + diff --git a/src/doc/xml/io-gncxml-version2.dtd b/src/doc/xml/io-gncxml-version2.dtd new file mode 100644 index 0000000000..e0cbea88a5 --- /dev/null +++ b/src/doc/xml/io-gncxml-version2.dtd @@ -0,0 +1,22 @@ + + + + + + + + + +%defaults-v1; + +%prefs-v1; + +%prices-v1; + +%commodity-v2; + +%account-v2; + +%transactions-v2; + diff --git a/src/doc/xml/preferences-v1.dtd b/src/doc/xml/preferences-v1.dtd new file mode 100644 index 0000000000..db90185cf2 --- /dev/null +++ b/src/doc/xml/preferences-v1.dtd @@ -0,0 +1 @@ + diff --git a/src/doc/xml/prices-v1.dtd b/src/doc/xml/prices-v1.dtd new file mode 100644 index 0000000000..3094e643c3 --- /dev/null +++ b/src/doc/xml/prices-v1.dtd @@ -0,0 +1 @@ + diff --git a/src/doc/xml/transactions-v2.dtd b/src/doc/xml/transactions-v2.dtd new file mode 100644 index 0000000000..d9f1783b95 --- /dev/null +++ b/src/doc/xml/transactions-v2.dtd @@ -0,0 +1,42 @@ + +%types; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/doc/xml/types.dtd b/src/doc/xml/types.dtd new file mode 100644 index 0000000000..12463c4bf7 --- /dev/null +++ b/src/doc/xml/types.dtd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/engine/DateUtils.c b/src/engine/DateUtils.c index 845402c561..0ae57912a3 100644 --- a/src/engine/DateUtils.c +++ b/src/engine/DateUtils.c @@ -25,6 +25,8 @@ #include #include +#include + #include "config.h" #include "DateUtils.h" @@ -50,7 +52,7 @@ xaccDateUtilGetStamp (time_t thyme) stm->tm_sec ); - retval = strdup (buf); + retval = g_strdup (buf); return retval; } diff --git a/src/engine/TransLog.c b/src/engine/TransLog.c index 72c8e7915e..fc0f7584e3 100644 --- a/src/engine/TransLog.c +++ b/src/engine/TransLog.c @@ -28,6 +28,8 @@ #include #include +#include + #include "Account.h" #include "AccountP.h" #include "DateUtils.h" @@ -117,8 +119,8 @@ xaccLogSetBaseName (const char *basepath) { if (!basepath) return; - if (log_base_name) free (log_base_name); - log_base_name = strdup (basepath); + g_free (log_base_name); + log_base_name = g_strdup (basepath); if (trans_log) { xaccCloseLog(); @@ -138,7 +140,7 @@ xaccOpenLog (void) if (!gen_logs) return; if (trans_log) return; - if (!log_base_name) log_base_name = strdup ("translog"); + if (!log_base_name) log_base_name = g_strdup ("translog"); /* tag each filename with a timestamp */ timestamp = xaccDateUtilGetStampNow (); @@ -159,7 +161,7 @@ xaccOpenLog (void) return; } free (filename); - free (timestamp); + g_free (timestamp); /* use tab-separated fields */ fprintf (trans_log, "mod id time_now " \ @@ -234,9 +236,9 @@ xaccTransWriteLog (Transaction *trans, char flag) } fprintf (trans_log, "===== END\n"); - free (dnow); - free (dent); - free (dpost); + g_free (dnow); + g_free (dent); + g_free (dpost); /* get data out to the disk */ fflush (trans_log); @@ -288,7 +290,7 @@ xaccTransGetDateStr (Transaction *trans) printDate(buf, date->tm_mday, date->tm_mon+1, date->tm_year +1900); - return strdup (buf); + return g_strdup (buf); } char * diff --git a/src/engine/date.c b/src/engine/date.c index 67fab40823..1b4eca9454 100644 --- a/src/engine/date.c +++ b/src/engine/date.c @@ -27,13 +27,16 @@ #define _GNU_SOURCE +#include "config.h" + #include #include #include #include #include -#include "config.h" +#include + #include "date.h" #include "gnc-engine-util.h" @@ -161,7 +164,7 @@ xaccPrintDateSecs (time_t t) { char buff[100]; printDateSecs (buff, t); - return strdup (buff); + return g_strdup (buff); } const char * diff --git a/src/engine/sql/PostgresBackend.c b/src/engine/sql/PostgresBackend.c index ff48b313d0..0ab58db82c 100644 --- a/src/engine/sql/PostgresBackend.c +++ b/src/engine/sql/PostgresBackend.c @@ -12,6 +12,8 @@ #include #include +#include + #include "BackendP.h" #include "Group.h" #include "Session.h" @@ -804,7 +806,7 @@ pgend_session_begin (Session *sess, const char * sessionid) * format should be something like * postgres://some.host.com:portno/db_name */ - be->dbName = strdup ("gnc_bogus"); + be->dbName = g_strdup ("gnc_bogus"); be->connection = PQsetdbLogin (NULL, NULL, NULL, NULL, be->dbName, NULL, NULL); /* check the conmnection status */ diff --git a/src/gnome/Makefile.am b/src/gnome/Makefile.am index f20e2fad26..fa4b4a6c25 100644 --- a/src/gnome/Makefile.am +++ b/src/gnome/Makefile.am @@ -42,7 +42,10 @@ libgncgnome_a_SOURCES = \ gnc-html-history.c \ gnc-html-embedded.c \ window-help.c \ - window-report.c + window-report.c \ + new-user-callbacks.c \ + new-user-interface.c \ + new-user-funs.c gnomeappdir = ${datadir}/gnome/apps/Applications @@ -90,8 +93,10 @@ noinst_HEADERS = \ gnc-html-history.h \ gnc-html-embedded.h \ window-help.h \ - window-report.h - + window-report.h \ + new-user-callbacks.h \ + new-user-interface.h \ + new-user-funs.h GLADE_FILES = \ glade-gnc-dialogs.c \ @@ -107,7 +112,8 @@ EXTRA_DIST = \ gnc-dialogs.glade \ gnucash.desktop \ gnucash.keys.in \ - gnucash.mime + gnucash.mime \ + new-user.glade CFLAGS = @CFLAGS@ \ ${G_WRAP_COMPILE_ARGS} \ diff --git a/src/gnome/new-user-callbacks.c b/src/gnome/new-user-callbacks.c new file mode 100644 index 0000000000..9d6da710ea --- /dev/null +++ b/src/gnome/new-user-callbacks.c @@ -0,0 +1,108 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include + +#include "new-user-callbacks.h" +#include "new-user-interface.h" +#include "glade-support-gnc-dialogs.h" +#include "new-user-funs.h" + +#include + +static void +set_first_startup(int first_startup) +{ + gchar *todo; + + todo = g_strdup_printf("((gnc:option-setter " + " (gnc:lookup-global-option \"__new_user\" " + " \"first_startup\"))" + " %d)", first_startup); + gh_eval_str(todo); + g_free(todo); +} + + +gboolean +on_newUserStartPage_next (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + + /* Need to load the account lists here */ + + return FALSE; +} + + +gboolean +on_chooseAccountTypesPage_next (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + gnc_ui_show_nu_account_list(); + + /* need to fill up the account list info here */ + + return FALSE; +} + + + +void +on_newUserDruidFinishPage_finish (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data) +{ + gnc_ui_delete_new_user_window(); + gnc_ui_delete_nu_account_list(); + + gh_eval_str("(gnc:default-ui-start)"); + + /* now we need to load all the accounts into the program */ + + gh_eval_str("(gnc:show-main-window)"); + + set_first_startup(0); +} + + +void +on_accountChooseDruidPage_cancel (GnomeDruid *gnomedruid, + gpointer user_data) +{ + gnc_ui_show_nu_cancel_dialog(); +} + + +void +on_newAccountRunAgain_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + /* I'm not sure this is needed. FIXME: remove */ +} + + +void +on_newAccountCancelDialog_OKButton_clicked + (GtkButton *button, + gpointer user_data) +{ + gboolean keepshowing = TRUE; + + /* keepshowing = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_BOX(GTK_DIALOG(GTK_WIDGET(button)->parent)->vbox)->children[1])); */ + + set_first_startup(keepshowing); + + gnc_ui_delete_new_user_window(); + gnc_ui_delete_nu_cancel_dialog(); + gnc_ui_delete_nu_account_list(); + + gh_eval_str("(gnc:default-ui-start)"); + gh_eval_str("(gnc:show-main-window)"); +} + diff --git a/src/gnome/new-user-callbacks.h b/src/gnome/new-user-callbacks.h new file mode 100644 index 0000000000..04c604362a --- /dev/null +++ b/src/gnome/new-user-callbacks.h @@ -0,0 +1,40 @@ +#include + + +gboolean +on_newUserStartPage_next (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data); + +gboolean +on_chooseAccountTypesPage_next (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data); + +void +on_newUserDruidFinishPage_finish (GnomeDruidPage *gnomedruidpage, + gpointer arg1, + gpointer user_data); + +void +on_accountChooseDruidPage_cancel (GnomeDruid *gnomedruid, + gpointer user_data); + +void +on_newAccountRunAgain_toggled (GtkToggleButton *togglebutton, + gpointer user_data); + +void +on_newAccountCancelDialog_OKButton_clicked + (GtkButton *button, + gpointer user_data); + +void +on_newAccountCancelDialog_ApplyButton_clicked + (GtkButton *button, + gpointer user_data); + +void +on_newAccountCancelDialog_CancelButton_clicked + (GtkButton *button, + gpointer user_data); diff --git a/src/gnome/new-user-funs.c b/src/gnome/new-user-funs.c new file mode 100644 index 0000000000..383d52409f --- /dev/null +++ b/src/gnome/new-user-funs.c @@ -0,0 +1,77 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include "new-user-callbacks.h" +#include "new-user-interface.h" +#include "new-user-funs.h" + +#include + +static GtkWidget *newUserDialog = NULL; +static GtkWidget *cancelDialog = NULL; +static GtkWidget *accountList = 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(*togetridof); + *togetridof = NULL; + return 1; +} + +int +gnc_ui_show_new_user_window(void) +{ + return createit(create_newUserDialog, &newUserDialog); +} + +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); +} + +int +gnc_ui_show_nu_account_list(void) +{ + return createit(create_newAccountList, &accountList); +} + +int +gnc_ui_delete_nu_account_list(void) +{ + return deleteit(&accountList); +} diff --git a/src/gnome/new-user-funs.h b/src/gnome/new-user-funs.h new file mode 100644 index 0000000000..e6a1b6233e --- /dev/null +++ b/src/gnome/new-user-funs.h @@ -0,0 +1,14 @@ + +#ifndef _NEW_USER_FUNS_H_ +#define _NEW_USER_FUNS_H_ + +int gnc_ui_show_new_user_window(void); +int gnc_ui_delete_new_user_window(void); + +int gnc_ui_show_nu_cancel_dialog(void); +int gnc_ui_delete_nu_cancel_dialog(void); + +int gnc_ui_show_nu_account_list(void); +int gnc_ui_delete_nu_account_list(void); + +#endif /* NEW_USER_FUNS_H */ diff --git a/src/gnome/new-user-interface.c b/src/gnome/new-user-interface.c new file mode 100644 index 0000000000..2f868316eb --- /dev/null +++ b/src/gnome/new-user-interface.c @@ -0,0 +1,365 @@ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include + +#include "new-user-callbacks.h" +#include "new-user-interface.h" +#include "glade-support-gnc-dialogs.h" + +GtkWidget* +create_newUserDialog (void) +{ + GtkWidget *newUserDialog; + GtkWidget *accountChooseDruidPage; + 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 *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 *scrolledwindow1; + GtkWidget *newAccountTypesList; + GtkWidget *label2; + GtkWidget *label3; + GtkWidget *label4; + GtkWidget *hbox1; + GtkWidget *scrolledwindow2; + GtkWidget *accountTypesDescription; + GtkWidget *scrolledwindow3; + GtkWidget *viewport1; + GtkWidget *newAccountListTree; + 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 User Account setup")); + + accountChooseDruidPage = gnome_druid_new (); + gtk_widget_set_name (accountChooseDruidPage, "accountChooseDruidPage"); + gtk_widget_ref (accountChooseDruidPage); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "accountChooseDruidPage", accountChooseDruidPage, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (accountChooseDruidPage); + gtk_container_add (GTK_CONTAINER (newUserDialog), accountChooseDruidPage); + + 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 (accountChooseDruidPage), GNOME_DRUID_PAGE (newUserStartPage)); + gnome_druid_set_page (GNOME_DRUID (accountChooseDruidPage), 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 User Account Setup")); + gnome_druid_page_start_set_text (GNOME_DRUID_PAGE_START (newUserStartPage), _("This wizard will help you to set up a default set of accounts to use.")); + + 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 (accountChooseDruidPage), 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 Account Types")); + + 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); + + pickAccountsDescriptionLabel = gtk_label_new (_("Please check the account types you would like to have automatically setup in gnucash.")); + 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); + + 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 (druid_vbox1), scrolledwindow1, TRUE, TRUE, 0); + + newAccountTypesList = gtk_clist_new (3); + 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, 52); + gtk_clist_set_column_width (GTK_CLIST (newAccountTypesList), 1, 152); + gtk_clist_set_column_width (GTK_CLIST (newAccountTypesList), 2, 80); + gtk_clist_set_selection_mode (GTK_CLIST (newAccountTypesList), GTK_SELECTION_MULTIPLE); + gtk_clist_column_titles_show (GTK_CLIST (newAccountTypesList)); + + label2 = gtk_label_new (_("Choose")); + gtk_widget_set_name (label2, "label2"); + gtk_widget_ref (label2); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "label2", label2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label2); + gtk_clist_set_column_widget (GTK_CLIST (newAccountTypesList), 0, label2); + + label3 = gtk_label_new (_("Account Type Name")); + gtk_widget_set_name (label3, "label3"); + gtk_widget_ref (label3); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "label3", label3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label3); + gtk_clist_set_column_widget (GTK_CLIST (newAccountTypesList), 1, label3); + + label4 = gtk_label_new (_("Description")); + gtk_widget_set_name (label4, "label4"); + gtk_widget_ref (label4); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "label4", label4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label4); + gtk_clist_set_column_widget (GTK_CLIST (newAccountTypesList), 2, label4); + + hbox1 = gtk_hbox_new (FALSE, 0); + 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); + + scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_name (scrolledwindow2, "scrolledwindow2"); + gtk_widget_ref (scrolledwindow2); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "scrolledwindow2", scrolledwindow2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (scrolledwindow2); + gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow2, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); + + accountTypesDescription = gtk_text_new (NULL, NULL); + gtk_widget_set_name (accountTypesDescription, "accountTypesDescription"); + gtk_widget_ref (accountTypesDescription); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "accountTypesDescription", accountTypesDescription, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (accountTypesDescription); + gtk_container_add (GTK_CONTAINER (scrolledwindow2), accountTypesDescription); + gtk_widget_set_sensitive (accountTypesDescription, FALSE); + GTK_WIDGET_UNSET_FLAGS (accountTypesDescription, GTK_CAN_FOCUS); + + scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_name (scrolledwindow3, "scrolledwindow3"); + gtk_widget_ref (scrolledwindow3); + gtk_object_set_data_full (GTK_OBJECT (newUserDialog), "scrolledwindow3", scrolledwindow3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (scrolledwindow3); + gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow3, TRUE, TRUE, 0); + gtk_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); + gtk_widget_set_sensitive (newAccountListTree, FALSE); + + 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 (accountChooseDruidPage), 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), _("Please check the window for the new accounts that will be created.\nPress finish if this is OK.")); + + gtk_signal_connect (GTK_OBJECT (accountChooseDruidPage), "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 (chooseAccountTypesPage), "next", + GTK_SIGNAL_FUNC (on_chooseAccountTypesPage_next), + NULL); + gtk_signal_connect (GTK_OBJECT (newUserDruidFinishPage), "finish", + GTK_SIGNAL_FUNC (on_newUserDruidFinishPage_finish), + NULL); + + return newUserDialog; +} + +GtkWidget* +create_newAccountList (void) +{ + GtkWidget *newAccountList; + GtkWidget *scrolledwindow4; + GtkWidget *newAccountlistCTree; + GtkWidget *newAccountList_AccountName; + GtkWidget *newAccountList_AccountDescription; + + newAccountList = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (newAccountList, "newAccountList"); + gtk_object_set_data (GTK_OBJECT (newAccountList), "newAccountList", newAccountList); + gtk_widget_set_usize (newAccountList, 200, 400); + gtk_window_set_title (GTK_WINDOW (newAccountList), _("New Account List")); + + scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_name (scrolledwindow4, "scrolledwindow4"); + gtk_widget_ref (scrolledwindow4); + gtk_object_set_data_full (GTK_OBJECT (newAccountList), "scrolledwindow4", scrolledwindow4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (scrolledwindow4); + gtk_container_add (GTK_CONTAINER (newAccountList), scrolledwindow4); + + newAccountlistCTree = gtk_ctree_new (2, 0); + gtk_widget_set_name (newAccountlistCTree, "newAccountlistCTree"); + gtk_widget_ref (newAccountlistCTree); + gtk_object_set_data_full (GTK_OBJECT (newAccountList), "newAccountlistCTree", newAccountlistCTree, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (newAccountlistCTree); + gtk_container_add (GTK_CONTAINER (scrolledwindow4), newAccountlistCTree); + gtk_widget_set_sensitive (newAccountlistCTree, FALSE); + GTK_WIDGET_UNSET_FLAGS (newAccountlistCTree, GTK_CAN_FOCUS); + gtk_clist_set_column_width (GTK_CLIST (newAccountlistCTree), 0, 80); + gtk_clist_set_column_width (GTK_CLIST (newAccountlistCTree), 1, 80); + gtk_clist_column_titles_show (GTK_CLIST (newAccountlistCTree)); + + newAccountList_AccountName = gtk_label_new (_("Name")); + gtk_widget_set_name (newAccountList_AccountName, "newAccountList_AccountName"); + gtk_widget_ref (newAccountList_AccountName); + gtk_object_set_data_full (GTK_OBJECT (newAccountList), "newAccountList_AccountName", newAccountList_AccountName, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (newAccountList_AccountName); + gtk_clist_set_column_widget (GTK_CLIST (newAccountlistCTree), 0, newAccountList_AccountName); + + newAccountList_AccountDescription = gtk_label_new (_("Description")); + gtk_widget_set_name (newAccountList_AccountDescription, "newAccountList_AccountDescription"); + gtk_widget_ref (newAccountList_AccountDescription); + gtk_object_set_data_full (GTK_OBJECT (newAccountList), "newAccountList_AccountDescription", newAccountList_AccountDescription, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (newAccountList_AccountDescription); + gtk_clist_set_column_widget (GTK_CLIST (newAccountlistCTree), 1, newAccountList_AccountDescription); + + return newAccountList; +} + +GtkWidget* +create_addAccountCancelDialog (void) +{ + GtkWidget *addAccountCancelDialog; + GtkWidget *newAccountCancelDialog; + GtkWidget *vbox1; + GtkWidget *newAccountShouldRunAgain; + GtkWidget *newAccountRunAgain; + GtkWidget *dialog_action_area1; + GtkWidget *newAccountCancelDialog_OKButton; + + addAccountCancelDialog = gnome_dialog_new (NULL, 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, 0); + 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); + + newAccountShouldRunAgain = gtk_label_new (_("Canceling. Please uncheck if you would not like\nthis new user dialog to run again.")); + gtk_widget_set_name (newAccountShouldRunAgain, "newAccountShouldRunAgain"); + gtk_widget_ref (newAccountShouldRunAgain); + gtk_object_set_data_full (GTK_OBJECT (addAccountCancelDialog), "newAccountShouldRunAgain", newAccountShouldRunAgain, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (newAccountShouldRunAgain); + gtk_box_pack_start (GTK_BOX (vbox1), newAccountShouldRunAgain, FALSE, FALSE, 0); + + newAccountRunAgain = gtk_check_button_new_with_label (_("Run New User Dialog again?")); + gtk_widget_set_name (newAccountRunAgain, "newAccountRunAgain"); + gtk_widget_ref (newAccountRunAgain); + gtk_object_set_data_full (GTK_OBJECT (addAccountCancelDialog), "newAccountRunAgain", newAccountRunAgain, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (newAccountRunAgain); + gtk_box_pack_start (GTK_BOX (vbox1), newAccountRunAgain, FALSE, FALSE, 0); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (newAccountRunAgain), 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 (newAccountRunAgain), "toggled", + GTK_SIGNAL_FUNC (on_newAccountRunAgain_toggled), + NULL); + gtk_signal_connect (GTK_OBJECT (newAccountCancelDialog_OKButton), "clicked", + GTK_SIGNAL_FUNC (on_newAccountCancelDialog_OKButton_clicked), + NULL); + + return addAccountCancelDialog; +} + diff --git a/src/gnome/new-user-interface.h b/src/gnome/new-user-interface.h new file mode 100644 index 0000000000..5b750988a2 --- /dev/null +++ b/src/gnome/new-user-interface.h @@ -0,0 +1,7 @@ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +GtkWidget* create_newUserDialog (void); +GtkWidget* create_newAccountList (void); +GtkWidget* create_addAccountCancelDialog (void); diff --git a/src/gnome/new-user.glade b/src/gnome/new-user.glade new file mode 100644 index 0000000000..cf1408884f --- /dev/null +++ b/src/gnome/new-user.glade @@ -0,0 +1,422 @@ + + + + + New-user + new-user + + . + pixmaps + C + True + True + True + False + False + False + new-user-interface.c + new-user-interface.h + new-user-callbacks.c + new-user-callbacks.h + glade-support-gnc-dialogs.h + True + new-user-translatable.c + + + + GtkWindow + newUserDialog + 540 + 370 + New User Account setup + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GnomeDruid + accountChooseDruidPage + + cancel + on_accountChooseDruidPage_cancel + Wed, 10 Jan 2001 03:37:36 GMT + + + + GnomeDruidPageStart + newUserStartPage + + next + on_newUserStartPage_next + Tue, 09 Jan 2001 18:04:50 GMT + + New User Account Setup + This wizard will help you to set up a default set of accounts to use. + 255,255,255 + 0,0,0 + 25,25,112 + 255,255,255 + 255,255,255 + + + + GnomeDruidPageStandard + chooseAccountTypesPage + + next + on_chooseAccountTypesPage_next + Tue, 09 Jan 2001 18:05:14 GMT + + Choose Account Types + 255,255,255 + 25,25,112 + 255,255,255 + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox1 + False + 0 + + 0 + True + True + + + + GtkLabel + pickAccountsDescriptionLabel + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkScrolledWindow + scrolledwindow1 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCList + newAccountTypesList + True + 3 + 52,152,80 + GTK_SELECTION_MULTIPLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + label2 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label3 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label4 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkHBox + hbox1 + False + 0 + + 0 + True + True + + + + GtkScrolledWindow + scrolledwindow2 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkText + accountTypesDescription + False + False + + + + + + GtkScrolledWindow + scrolledwindow3 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkViewport + viewport1 + GTK_SHADOW_IN + + + GtkTree + newAccountListTree + False + GTK_SELECTION_SINGLE + GTK_TREE_VIEW_LINE + True + + + + + + + + + GnomeDruidPageFinish + newUserDruidFinishPage + + finish + on_newUserDruidFinishPage_finish + Tue, 09 Jan 2001 18:08:04 GMT + + Finish Account Setup + Please check the window for the new accounts that will be created. +Press finish if this is OK. + 25,25,112 + 255,255,255 + 255,255,255 + 0,0,0 + 255,255,255 + + + + + + GtkWindow + newAccountList + 200 + 400 + New Account List + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkScrolledWindow + scrolledwindow4 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkCTree + newAccountlistCTree + False + 2 + 114,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CTree:title + newAccountList_AccountName + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CTree:title + newAccountList_AccountDescription + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GnomeDialog + addAccountCancelDialog + GTK_WINDOW_DIALOG + GTK_WIN_POS_MOUSE + True + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + newAccountCancelDialog + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_DEFAULT_STYLE + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + newAccountCancelDialog_OKButton + True + True + + clicked + on_newAccountCancelDialog_OKButton_clicked + Wed, 10 Jan 2001 03:47:18 GMT + + GNOME_STOCK_BUTTON_OK + + + + + GtkVBox + vbox1 + False + 0 + + 0 + True + True + + + + GtkLabel + newAccountShouldRunAgain + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkCheckButton + newAccountRunAgain + True + + toggled + on_newAccountRunAgain_toggled + Wed, 10 Jan 2001 03:44:02 GMT + + + True + True + + 0 + False + False + + + + + + + diff --git a/src/gnome/top-level.c b/src/gnome/top-level.c index 942f093db8..311f53c869 100644 --- a/src/gnome/top-level.c +++ b/src/gnome/top-level.c @@ -61,6 +61,8 @@ #include "window-help.h" #include "window-main.h" #include "window-report.h" +#include "new-user-interface.h" +#include "new-user-funs.h" #include @@ -343,7 +345,7 @@ gnc_ui_destroy (void) /* ============================================================== */ int -gnc_ui_main(void) +gnc_ui_show_main_window(void) { /* Initialize gnome */ gnucash_ui_init(); @@ -351,8 +353,6 @@ gnc_ui_main(void) gtk_widget_show(app); - gnome_is_running = TRUE; - /* Get the main window on screen. */ while (gtk_events_pending()) gtk_main_iteration(); @@ -364,6 +364,13 @@ gnc_ui_main(void) SCM window = gw_wcp_assimilate_ptr(app, gh_lookup("")); gh_call2(run_danglers, hook, window); } + return 0; +} + +int +gnc_ui_start_event_loop(void) +{ + gnome_is_running = TRUE; /* Enter gnome event loop */ gtk_main(); @@ -374,6 +381,15 @@ gnc_ui_main(void) return 0; } + +int +gnc_ui_main(void) +{ + gnc_ui_show_main_window(); + + return gnc_ui_start_event_loop(); +} + /* ============================================================== */ int diff --git a/src/scm/main.scm b/src/scm/main.scm index 22d5b7d159..b5525201ec 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -146,9 +146,19 @@ ;; (gnc:load-account-file) (gnc:hook-add-dangler gnc:*ui-shutdown-hook* gnc:ui-finish) (gnc:ui-init) - (gnc:load-account-file) - (gnc:default-ui-start) - (gnc:ui-main) + (if (and + (not (string? (gnc:history-get-last))) + (equal? ((gnc:option-getter + (gnc:lookup-global-option "__new_user" "first_startup"))) + 1)) + (begin + (gnc:show-new-user-window) + (gnc:start-ui-event-loop)) + (begin + (gnc:load-account-file) + (gnc:default-ui-start) + (gnc:show-main-window) + (gnc:start-ui-event-loop))) (gnc:hook-remove-dangler gnc:*ui-shutdown-hook* gnc:ui-finish)) ;; else: we're in batch mode. Just do what the user said on the diff --git a/src/scm/prefs.scm b/src/scm/prefs.scm index 3f4ed2eab7..810c33ce76 100644 --- a/src/scm/prefs.scm +++ b/src/scm/prefs.scm @@ -598,3 +598,7 @@ the current value of the path." (gnc:register-configuration-option (gnc:make-internal-option "__exp_parser" "defined_variables" '())) + +(gnc:register-configuration-option + (gnc:make-internal-option + "__new_user" "first_startup" 1))