mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Cleanups in save/restore window position and sizes
- remove depreciated check on GtkObject flags (no longer required imo) - save position and size on window destruction consistently - add save and restore to some additional assistants (not all so far) git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22283 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -206,9 +206,6 @@ gnc_save_window_size(const char *section, GtkWindow *window)
|
||||
g_return_if_fail(section != NULL);
|
||||
g_return_if_fail(window != NULL);
|
||||
|
||||
if (GTK_OBJECT_FLAGS(window) & GTK_IN_DESTRUCTION)
|
||||
return;
|
||||
|
||||
if (!gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL))
|
||||
return;
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ void on_finish (GtkAssistant *gtkassistant, hierarchy_data *data);
|
||||
static void
|
||||
delete_hierarchy_dialog (hierarchy_data *data)
|
||||
{
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(data->dialog));
|
||||
gtk_widget_destroy (data->dialog);
|
||||
}
|
||||
|
||||
@@ -1117,6 +1118,8 @@ gnc_create_hierarchy_assistant (gboolean use_defaults, GncHierarchyAssistantFini
|
||||
|
||||
data->balance_hash = g_hash_table_new(NULL, NULL);
|
||||
|
||||
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(data->dialog));
|
||||
|
||||
g_signal_connect (G_OBJECT(dialog), "destroy",
|
||||
G_CALLBACK (gnc_hierarchy_destroy_cb), data);
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static QofLogModule log_module = GNC_MOD_ASSISTANT;
|
||||
|
||||
#define GCONF_SECTION "dialogs/ab_initial"
|
||||
#define ASSISTANT_AB_INITIAL_CM_CLASS "assistant-ab-initial"
|
||||
|
||||
typedef struct _ABInitialInfo ABInitialInfo;
|
||||
@@ -822,6 +823,7 @@ aai_close_handler(gpointer user_data)
|
||||
{
|
||||
ABInitialInfo *info = user_data;
|
||||
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
gtk_widget_destroy(info->window);
|
||||
}
|
||||
|
||||
@@ -893,6 +895,8 @@ gnc_ab_initial_assistant(void)
|
||||
selection = gtk_tree_view_get_selection(info->account_view);
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
|
||||
|
||||
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
|
||||
g_signal_connect(info->account_view, "row-activated",
|
||||
G_CALLBACK(account_list_clicked_cb), info);
|
||||
|
||||
|
||||
@@ -745,7 +745,6 @@ csv_export_assistant_summary_page_prepare (GtkAssistant *assistant,
|
||||
gnc_gconf_set_int(GCONF_SECTION, PANED_POSITION,
|
||||
gtk_paned_get_position(GTK_PANED(info->csva.paned)), NULL);
|
||||
gnc_set_default_directory(GCONF_SECTION, info->starting_dir);
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
|
||||
if (info->failed)
|
||||
text = _("There was a problem with the export, this could be due to lack of space, "
|
||||
@@ -838,6 +837,7 @@ csv_export_close_handler (gpointer user_data)
|
||||
g_free(info->file_name);
|
||||
g_free(info->starting_dir);
|
||||
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
gtk_widget_destroy (info->window);
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +372,6 @@ csv_import_assistant_finish_page_prepare (GtkAssistant *assistant,
|
||||
|
||||
/* Save the Window size and directory */
|
||||
gnc_set_default_directory(GCONF_SECTION, info->starting_dir);
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
|
||||
/* Enable the Assistant Buttons */
|
||||
gtk_assistant_set_page_complete (assistant, page, TRUE);
|
||||
@@ -483,6 +482,7 @@ csv_import_close_handler (gpointer user_data)
|
||||
g_free(info->file_name);
|
||||
g_string_free(info->regexp, TRUE);
|
||||
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
gtk_widget_destroy (info->window);
|
||||
}
|
||||
|
||||
|
||||
@@ -1503,7 +1503,6 @@ csv_import_trans_assistant_summary_page_prepare (GtkAssistant *assistant,
|
||||
|
||||
/* Save the Window size and directory */
|
||||
gnc_set_default_directory(GCONF_SECTION, info->starting_dir);
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
|
||||
/* Remove the added button */
|
||||
gtk_assistant_remove_action_widget (assistant, info->help_button);
|
||||
@@ -1612,6 +1611,7 @@ csv_import_trans_close_handler (gpointer user_data)
|
||||
if (!(info->gnc_csv_importer_gui == NULL))
|
||||
info->gnc_csv_importer_gui = NULL;
|
||||
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
|
||||
gtk_widget_destroy (info->window);
|
||||
}
|
||||
|
||||
|
||||
@@ -3617,6 +3617,8 @@ gnc_ui_qif_import_assistant_make(QIFImportWindow *qif_win)
|
||||
box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_picker_hbox"));
|
||||
gtk_box_pack_start(GTK_BOX(box), qif_win->currency_picker, TRUE, TRUE, 0);
|
||||
|
||||
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(qif_win->window));
|
||||
|
||||
g_signal_connect( qif_win->window, "destroy",
|
||||
G_CALLBACK(gnc_ui_qif_import_assistant_destroy), qif_win );
|
||||
|
||||
@@ -3638,6 +3640,8 @@ static void
|
||||
gnc_ui_qif_import_assistant_close_handler( gpointer user_data )
|
||||
{
|
||||
QIFImportWindow *qif_win = user_data;
|
||||
|
||||
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(qif_win->window));
|
||||
gtk_widget_destroy( qif_win->window );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user