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
This commit is contained in:
Dave Peticolas 2001-01-11 22:32:22 +00:00
parent 4ea0c1ff47
commit a74241ef87
28 changed files with 1234 additions and 31 deletions

4
debian/changelog vendored
View File

@ -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 <dres@debian.org> Mon, 18 Dec 2000 19:33:43 -0500

10
debian/rules vendored
View File

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

View File

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

View File

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

View File

@ -0,0 +1,24 @@
<!ENTITY % types SYSTEM "types.dtd">
%types;
<!ELEMENT gnc:account (act:name, act:id, act:type, act:currency,
act:security?, act:slots?, act:parent?)>
<!ATTLIST gnc:account version CDATA #REQUIRED>
<!ELEMENT act:name (#PCDATA)>
<!ELEMENT act:id (#PCDATA)>
<!ATTLIST act:id type %id-types; %default-id-type;>
<!ELEMENT act:type (#PCDATA)>
<!ELEMENT act:currency %currency-type;>
<!ELEMENT act:security %currency-type;>
<!ELEMENT act:slots %slot-type;>
<!ELEMENT act:parent (#PCDATA)>
<!ATTLIST act:parent type %id-types; #REQUIRED>

View File

@ -0,0 +1,9 @@
<!ELEMENT gnc:commodity (cmdty:space, cmdty:id, cmdty:name,
cmdty:xcode?, cmdty:fraction)>
<!ATTLIST gnc:commodity version CDATA #REQUIRED>
<!ELEMENT cmdty:space (#PCDATA)>
<!ELEMENT cmdty:id (#PCDATA)>
<!ELEMENT cmdty:name (#PCDATA)>
<!ELEMENT cmdty:xcode (#PCDATA)>
<!ELEMENT cmdty:fraction (#PCDATA)>

View File

@ -0,0 +1 @@
<!ELEMENT gnc:defaults (#PCDATA)>

View File

@ -1,5 +1,3 @@
<?xml version="1.0"?>
<!DOCTYPE gnc [
<!ELEMENT gnc (version, defaults*, preferences*,
ledger-data*, prices*, recurring-transactions*)>
@ -76,4 +74,4 @@
<!ELEMENT restore (%combined-restores;)>
<!ELEMENT new (%combined-news;)>
]>

View File

@ -0,0 +1,22 @@
<!ELEMENT gnc (gnc:defaults*, gnc:preferences*, gnc:prices*,
gnc:commodity*, gnc:account*, gnc:transaction*)>
<!ENTITY % defaults-v1 SYSTEM "defaults-v1.dtd">
<!ENTITY % prefs-v1 SYSTEM "preferences-v1.dtd">
<!ENTITY % prices-v1 SYSTEM "prices-v1.dtd">
<!ENTITY % commodity-v2 SYSTEM "commodity-v2.dtd">
<!ENTITY % account-v2 SYSTEM "account-v2.dtd">
<!ENTITY % transactions-v2 SYSTEM "transactions-v2.dtd">
%defaults-v1;
%prefs-v1;
%prices-v1;
%commodity-v2;
%account-v2;
%transactions-v2;

View File

@ -0,0 +1 @@
<!ELEMENT gnc:prefs (#PCDATA)>

View File

@ -0,0 +1 @@
<!ELEMENT gnc:price (#PCDATA)>

View File

@ -0,0 +1,42 @@
<!ENTITY % types SYSTEM "types.dtd">
%types;
<!ELEMENT gnc:transaction (trn:guid, trn:num?, trn:date-posted,
trn:date-entered, trn:description?,
trn:slots?, trn:split+)>
<!ATTLIST gnc:transaction version CDATA #REQUIRED>
<!ELEMENT trn:guid (#PCDATA)>
<!ATTLIST trn:guid type %id-type; %default-id-type;>
<!ELEMENT trn:num (#PCDATA)>
<!ELEMENT trn:date-posted %date-type;>
<!ELEMENT trn:date-enterede %date-type;>
<!ELEMENT trn:description (#PCDATA)>
<!ELEMENT trn:slots %slot-type;>
<!ELEMENT trn:split (split:guid, split:memo?, split:reconciled-state,
split:reconcile-date?, split:value,
split:quantity, split:account)>
<!ELEMENT split:guid (#PCDATA)>
<!ATTLIST split:guid type %id-type; %default-id-type;>
<!ELEMENT split:memo (#PCDATA)>
<!ELEMENT split:reconciled-state (#PCDATA)>
<!ELEMENT split:reconcile-date %date-type;>
<!ELEMENT split:value (#PCDATA)>
<!ELEMENT split:quantity (#PCDATA)>
<!ELEMENT split:account (#PCDATA)>
<!ATTLIST split:account type %id-type; %default-id-type;>

22
src/doc/xml/types.dtd Normal file
View File

@ -0,0 +1,22 @@
<!ENTITY % id-type "(guid, new)">
<!ENTITY % default-id-type "guid">
<!ENTITY % currency-type "(cur:space, cur:id)">
<!ENTITY % slot-types "(string | integer | double | etc)">
<!ELEMENT slot (key, value)>
<!ELEMENT slot:key (#PCDATA)>
<!ELEMENT slot:value (#PCDATA)>
<!ATTLIST slot:value type %slot-types; "string">
<!ENTITY % slot-type "(slot+)">
<!ELEMENT date (#PCDATA)>
<!ELEMENT ns (#PCDATA)>
<!ENTITY % date-type "(date, ns?)">

View File

@ -25,6 +25,8 @@
#include <string.h>
#include <time.h>
#include <glib.h>
#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;
}

View File

@ -28,6 +28,8 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
#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 *

View File

@ -27,13 +27,16 @@
#define _GNU_SOURCE
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "config.h"
#include <glib.h>
#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 *

View File

@ -12,6 +12,8 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
#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 */

View File

@ -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} \

View File

@ -0,0 +1,108 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <glib.h>
#include <gnome.h>
#include "new-user-callbacks.h"
#include "new-user-interface.h"
#include "glade-support-gnc-dialogs.h"
#include "new-user-funs.h"
#include <guile/gh.h>
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)");
}

View File

@ -0,0 +1,40 @@
#include <gnome.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_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);

77
src/gnome/new-user-funs.c Normal file
View File

@ -0,0 +1,77 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gnome.h>
#include <stdio.h>
#include "new-user-callbacks.h"
#include "new-user-interface.h"
#include "new-user-funs.h"
#include <guile/gh.h>
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);
}

14
src/gnome/new-user-funs.h Normal file
View File

@ -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 */

View File

@ -0,0 +1,365 @@
/*
* 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-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;
}

View File

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

422
src/gnome/new-user.glade Normal file
View File

@ -0,0 +1,422 @@
<?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_support_files>False</output_support_files>
<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_header_file>glade-support-gnc-dialogs.h</support_header_file>
<output_translatable_strings>True</output_translatable_strings>
<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 User Account setup</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GnomeDruid</class>
<name>accountChooseDruidPage</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 User Account Setup</title>
<text>This wizard will help you to set up a default set of accounts to use.</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>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>
<title>Choose Account Types</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>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>pickAccountsDescriptionLabel</name>
<label>Please check the account types you would like to have automatically setup in gnucash.</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>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>
<columns>3</columns>
<column_widths>52,152,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>label2</name>
<label>Choose</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>label3</name>
<label>Account Type 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>CList:title</child_name>
<name>label4</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>hbox1</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<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>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkText</class>
<name>accountTypesDescription</name>
<sensitive>False</sensitive>
<editable>False</editable>
<text></text>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow3</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkViewport</class>
<name>viewport1</name>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkTree</class>
<name>newAccountListTree</name>
<sensitive>False</sensitive>
<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>
<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>Please check the window for the new accounts that will be created.
Press finish if this is OK.</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>GtkWindow</class>
<name>newAccountList</name>
<width>200</width>
<height>400</height>
<title>New Account List</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow4</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>
<widget>
<class>GtkCTree</class>
<name>newAccountlistCTree</name>
<sensitive>False</sensitive>
<columns>2</columns>
<column_widths>114,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>newAccountList_AccountName</name>
<label>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>newAccountList_AccountDescription</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>
<widget>
<class>GnomeDialog</class>
<name>addAccountCancelDialog</name>
<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>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>newAccountShouldRunAgain</name>
<label>Canceling. Please uncheck if you would not like
this new user dialog to run again.</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>GtkCheckButton</class>
<name>newAccountRunAgain</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_newAccountRunAgain_toggled</handler>
<last_modification_time>Wed, 10 Jan 2001 03:44:02 GMT</last_modification_time>
</signal>
<label>Run New User Dialog 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

@ -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 <g-wrap-runtime-guile.h>
@ -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("<gw:wt-gncUIWidget>"));
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

View File

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

View File

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