diff --git a/ChangeLog b/ChangeLog index df0d3e1a44..b91f3df911 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-03-04 Dave Peticolas + + * src/gnome/window-help.c: save & restore window size + + * src/gnome/window-report.c: save & restore window size + + * src/scm/prefs.scm: add vars for report & help win sizes + 2001-03-03 Dave Peticolas * src/engine/sql/README: add info about running without root diff --git a/src/gnome/window-help.c b/src/gnome/window-help.c index f7eaec122d..aa0f697427 100644 --- a/src/gnome/window-help.c +++ b/src/gnome/window-help.c @@ -64,6 +64,7 @@ #endif #include "File.h" +#include "dialog-utils.h" #include "glade-cb-gnc-dialogs.h" #include "glade-gnc-dialogs.h" #include "gnc-component-manager.h" @@ -95,6 +96,10 @@ struct _gnc_help_window { /* This static indicates the debugging module that this .o belongs to. */ static short module = MOD_GUI; +static gint last_width = 0; +static gint last_height = 0; + + /******************************************************************** * gnc_help_window_check_urltype * is it OK to show a certain URLType in this window? @@ -486,6 +491,11 @@ close_handler (gpointer user_data) { gnc_help_window *help = user_data; + gdk_window_get_geometry (GTK_WIDGET(help->toplevel)->window, NULL, NULL, + &last_width, &last_height, NULL); + + gnc_save_window_size ("help_win", last_width, last_height); + gnc_help_window_destroy (help); } @@ -624,6 +634,14 @@ gnc_help_window_new (void) { } g_free(indexfile); + if (last_width == 0) + gnc_get_window_size("help_win", &last_width, &last_height); + + gtk_window_set_default_size(GTK_WINDOW(help->toplevel), + last_width, last_height); + + gnc_window_adjust_for_screen (GTK_WINDOW(help->toplevel)); + gtk_widget_show_all(help->toplevel); return help; diff --git a/src/gnome/window-report.c b/src/gnome/window-report.c index 0952ca03cd..6b61a10364 100644 --- a/src/gnome/window-report.c +++ b/src/gnome/window-report.c @@ -31,6 +31,7 @@ #include #include "dialog-options.h" +#include "dialog-utils.h" #include "glade-gnc-dialogs.h" #include "gnc-component-manager.h" #include "gnc-engine-util.h" @@ -64,6 +65,9 @@ struct _gnc_report_window { /* This static indicates the debugging module that this .o belongs to. */ static short module = MOD_HTML; +static gint last_width = 0; +static gint last_height = 0; + /******************************************************************** * gnc_report_window_check_urltype @@ -387,6 +391,14 @@ close_handler (gpointer user_data) { gnc_report_window *win = user_data; + if (win->top_level) + { + gdk_window_get_geometry (GTK_WIDGET(win->container)->window, NULL, NULL, + &last_width, &last_height, NULL); + + gnc_save_window_size ("report_win", last_width, last_height); + } + gnc_report_window_destroy (win); } @@ -534,6 +546,17 @@ gnc_report_window_new(GtkWidget * container) { report->option_dialog = NULL; report->odb = NULL; + if (report->top_level) + { + if (last_width == 0) + gnc_get_window_size("report_win", &last_width, &last_height); + + gtk_window_set_default_size(GTK_WINDOW(report->container), + last_width, last_height); + + gnc_window_adjust_for_screen (GTK_WINDOW(report->container)); + } + gtk_widget_show_all(report->container); return report; diff --git a/src/scm/prefs.scm b/src/scm/prefs.scm index e86fedc0e3..6068f50278 100644 --- a/src/scm/prefs.scm +++ b/src/scm/prefs.scm @@ -583,6 +583,14 @@ the current value of the path." (gnc:make-internal-option "__gui" "account_win_height" 0)) +(gnc:register-configuration-option + (gnc:make-internal-option + "__gui" "help_win_width" 0)) + +(gnc:register-configuration-option + (gnc:make-internal-option + "__gui" "help_win_height" 0)) + (gnc:register-configuration-option (gnc:make-internal-option "__gui" "main_win_width" 0)) @@ -603,6 +611,14 @@ the current value of the path." (gnc:make-internal-option "__gui" "reg_column_widths" '())) +(gnc:register-configuration-option + (gnc:make-internal-option + "__gui" "report_win_width" 0)) + +(gnc:register-configuration-option + (gnc:make-internal-option + "__gui" "report_win_height" 0)) + (gnc:register-configuration-option (gnc:make-internal-option "__exp_parser" "defined_variables" '()))