Skip to content

Commit

Permalink
2001-06-16 Dave Peticolas <dave@krondo.com>
Browse files Browse the repository at this point in the history
	* 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
  • Loading branch information
jdavisp3 committed Jun 17, 2001
1 parent f46bdf4 commit e516792
Show file tree
Hide file tree
Showing 25 changed files with 1,994 additions and 3,041 deletions.
18 changes: 18 additions & 0 deletions ChangeLog
@@ -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

* po/POTFILES.in : remove references to deleted files.
Expand Down
2 changes: 1 addition & 1 deletion po/POTFILES.in
Expand Up @@ -31,6 +31,7 @@ src/gnome/glade/commodity_strings.c
src/gnome/glade/fincalc_strings.c
src/gnome/glade/find_strings.c
src/gnome/glade/help_strings.c
src/gnome/glade/newuser_strings.c
src/gnome/glade/price_strings.c
src/gnome/glade/print_strings.c
src/gnome/glade/progress_strings.c
Expand All @@ -47,7 +48,6 @@ src/gnome/gnc-dateedit.c
src/gnome/gnc-html.c
src/gnome/gnc-http.c
src/gnome/gnc-network.c
src/gnome/new-user-interface.c
src/gnome/print-session.c
src/gnome/reconcile-list.c
src/gnome/window-acct-tree.c
Expand Down
7 changes: 3 additions & 4 deletions src/FileDialog.c
Expand Up @@ -37,7 +37,6 @@
#include "gnc-event.h"
#include "gnc-ui.h"
#include "messages.h"
#include "gnome/new-user-funs.h"
#include "guile/global-options.h"

/* FIXME: this is wrong. This file should not need this include. */
Expand Down Expand Up @@ -266,17 +265,17 @@ gncFileNew (void)

if(gnc_lookup_boolean_option("General",
"No account list setup on new file",
1))
TRUE))
{
gh_call2(gh_eval_str("gnc:hook-run-danglers"),
gh_eval_str("gnc:*book-opened-hook*"),
gh_str02scm(gnc_book_get_url(current_book)));
}
else
{
gnc_ui_show_new_user_window(0);
gnc_ui_hierarchy_druid ();
}

gnc_engine_resume_events ();
gnc_gui_refresh_all ();
}
Expand Down
2 changes: 2 additions & 0 deletions src/gnc-ui.h
Expand Up @@ -103,6 +103,8 @@ gboolean gnc_get_username_password (gncUIWidget parent,
char **username,
char **password);

void gnc_ui_new_user_dialog (void);
void gnc_ui_hierarchy_druid (void);

/* Managing the GUI Windows *****************************************/

Expand Down
19 changes: 5 additions & 14 deletions src/gnome/Makefile.am
Expand Up @@ -14,6 +14,7 @@ libgncgnome_a_SOURCES = \
dialog-filebox.c \
dialog-fincalc.c \
dialog-find-transactions.c \
dialog-new-user.c \
dialog-options.c \
dialog-price-editor.c \
dialog-print-check.c \
Expand All @@ -25,12 +26,12 @@ libgncgnome_a_SOURCES = \
dialog-userpass.c \
dialog-utils.c \
druid-commodity.c \
druid-hierarchy.c \
druid-qif-import.c \
druid-stock-split.c \
druid-utils.c \
extensions.c \
file-history.c \
glade-support.c \
gnc-amount-edit.c \
gnc-commodity-edit.c \
gnc-currency-edit.c \
Expand All @@ -45,9 +46,6 @@ libgncgnome_a_SOURCES = \
gnc-splash.c \
gtkselect.c \
mainwindow-account-tree.c \
new-user-callbacks.c \
new-user-funs.c \
new-user-interface.c \
print-session.c \
query-user.c \
reconcile-list.c \
Expand Down Expand Up @@ -77,6 +75,7 @@ noinst_HEADERS = \
dialog-commodity.h \
dialog-fincalc.h \
dialog-find-transactions.h \
dialog-new-user.h \
dialog-options.h \
dialog-print-check.h \
dialog-progress.h \
Expand All @@ -85,10 +84,10 @@ noinst_HEADERS = \
dialog-transfer.h \
dialog-utils.h \
druid-commodity.h \
druid-hierarchy.h \
druid-qif-import.h \
druid-utils.h \
extensions.h \
glade-support.h \
gnc-amount-edit.h \
gnc-commodity-edit.h \
gnc-currency-edit.h \
Expand All @@ -104,9 +103,6 @@ noinst_HEADERS = \
gnc-splash.h \
gtkselect.h \
mainwindow-account-tree.h \
new-user-callbacks.h \
new-user-funs.h \
new-user-interface.h \
print-session.h \
query-user.h \
reconcile-list.h \
Expand All @@ -119,17 +115,12 @@ noinst_HEADERS = \
window-register.h \
window-report.h

GLADE_FILES = \
glade-support.c \
glade-support.h

EXTRA_DIST = \
.cvsignore \
gnc-dir.h.in \
gnucash.desktop \
gnucash.keys.in \
gnucash.mime \
new-user.glade
gnucash.mime

CFLAGS = @CFLAGS@ \
${G_WRAP_COMPILE_ARGS} \
Expand Down
130 changes: 130 additions & 0 deletions src/gnome/dialog-new-user.c
@@ -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)");
}
32 changes: 32 additions & 0 deletions src/gnome/dialog-new-user.h
@@ -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

0 comments on commit e516792

Please sign in to comment.