Gnc-Prefs: migrate search dialog and saved window geometry preferences

Note: the saved window geometry options (position and size) are
converted into a type that is incompatible with gconf. This has two
consequences:
1. while testing the gconf backend is used by gsettings. The
incompatible option (last_geometry) won't be saved in gconf. You will
see an error because of this. It does work when switching to gsettings'
native backend

2. The old geometry data won't be converted at user migration time (ie
when the user starts gnucash-with-gsettings for the first time. I don't
think this is very dramatical. The next time a dialog is used, the last
saved position is saved again already automatically.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23229 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2013-10-07 14:09:14 +00:00
parent 8984c78f94
commit 84dda7abea
51 changed files with 472 additions and 308 deletions

View File

@ -31,7 +31,6 @@
#include "gnc-component-manager.h" #include "gnc-component-manager.h"
#include "gnc-ui.h" #include "gnc-ui.h"
#include "gnc-gui-query.h" #include "gnc-gui-query.h"
#include "gnc-gconf-utils.h"
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
#include "qof.h" #include "qof.h"

View File

@ -55,7 +55,7 @@
#define DIALOG_NEW_CUSTOMER_CM_CLASS "dialog-new-customer" #define DIALOG_NEW_CUSTOMER_CM_CLASS "dialog-new-customer"
#define DIALOG_EDIT_CUSTOMER_CM_CLASS "dialog-edit-customer" #define DIALOG_EDIT_CUSTOMER_CM_CLASS "dialog-edit-customer"
#define GCONF_SECTION_SEARCH "dialogs/business/customer_search" #define GNC_PREFS_GROUP_SEARCH "dialogs.business.customer_search"
void gnc_customer_taxtable_check_cb (GtkToggleButton *togglebutton, void gnc_customer_taxtable_check_cb (GtkToggleButton *togglebutton,
gpointer user_data); gpointer user_data);
@ -957,7 +957,7 @@ gnc_customer_search (GncCustomer *start, QofBook *book)
return gnc_search_dialog_create (type, _("Find Customer"), return gnc_search_dialog_create (type, _("Find Customer"),
params, columns, q, q2, buttons, NULL, params, columns, q, q2, buttons, NULL,
new_customer_cb, sw, free_userdata_cb, new_customer_cb, sw, free_userdata_cb,
GCONF_SECTION_SEARCH, NULL); GNC_PREFS_GROUP_SEARCH, NULL);
} }
GNCSearchWindow * GNCSearchWindow *

View File

@ -50,7 +50,7 @@
#define DIALOG_NEW_EMPLOYEE_CM_CLASS "dialog-new-employee" #define DIALOG_NEW_EMPLOYEE_CM_CLASS "dialog-new-employee"
#define DIALOG_EDIT_EMPLOYEE_CM_CLASS "dialog-edit-employee" #define DIALOG_EDIT_EMPLOYEE_CM_CLASS "dialog-edit-employee"
#define GCONF_SECTION_SEARCH "dialogs/business/employee_search" #define GNC_PREFS_GROUP_SEARCH "dialogs.business.employee_search"
void gnc_employee_window_ok_cb (GtkWidget *widget, gpointer data); void gnc_employee_window_ok_cb (GtkWidget *widget, gpointer data);
void gnc_employee_window_cancel_cb (GtkWidget *widget, gpointer data); void gnc_employee_window_cancel_cb (GtkWidget *widget, gpointer data);
@ -759,7 +759,7 @@ gnc_employee_search (GncEmployee *start, QofBook *book)
params, columns, q, q2, params, columns, q, q2,
buttons, NULL, new_employee_cb, buttons, NULL, new_employee_cb,
sw, free_employee_cb, sw, free_employee_cb,
GCONF_SECTION_SEARCH, NULL); GNC_PREFS_GROUP_SEARCH, NULL);
} }
GNCSearchWindow * GNCSearchWindow *

View File

@ -85,7 +85,7 @@
#define DIALOG_NEW_INVOICE_CM_CLASS "dialog-new-invoice" #define DIALOG_NEW_INVOICE_CM_CLASS "dialog-new-invoice"
#define DIALOG_VIEW_INVOICE_CM_CLASS "dialog-view-invoice" #define DIALOG_VIEW_INVOICE_CM_CLASS "dialog-view-invoice"
#define GCONF_SECTION_SEARCH "dialogs/business/invoice_search" #define GNC_PREFS_GROUP_SEARCH "dialogs.business.invoice_search"
#define LAST_POSTED_TO_ACCT "last-posted-to-acct" #define LAST_POSTED_TO_ACCT "last-posted-to-acct"
@ -3109,7 +3109,7 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
} }
return gnc_search_dialog_create (type, title, params, columns, q, q2, return gnc_search_dialog_create (type, title, params, columns, q, q2,
buttons, NULL, new_invoice_cb, buttons, NULL, new_invoice_cb,
sw, free_invoice_cb, GCONF_SECTION_SEARCH, sw, free_invoice_cb, GNC_PREFS_GROUP_SEARCH,
label); label);
} }

View File

@ -46,7 +46,7 @@
#define DIALOG_NEW_JOB_CM_CLASS "dialog-new-job" #define DIALOG_NEW_JOB_CM_CLASS "dialog-new-job"
#define DIALOG_EDIT_JOB_CM_CLASS "dialog-edit-job" #define DIALOG_EDIT_JOB_CM_CLASS "dialog-edit-job"
#define GCONF_SECTION_SEARCH "dialogs/business/job_search" #define GNC_PREFS_GROUP_SEARCH "dialogs.business.job_search"
void gnc_job_window_ok_cb (GtkWidget *widget, gpointer data); void gnc_job_window_ok_cb (GtkWidget *widget, gpointer data);
void gnc_job_window_cancel_cb (GtkWidget *widget, gpointer data); void gnc_job_window_cancel_cb (GtkWidget *widget, gpointer data);
@ -628,7 +628,7 @@ gnc_job_search (GncJob *start, GncOwner *owner, QofBook *book)
return gnc_search_dialog_create (type, _("Find Job"), return gnc_search_dialog_create (type, _("Find Job"),
params, columns, q, q2, buttons, NULL, params, columns, q, q2, buttons, NULL,
new_job_cb, sw, free_userdata_cb, new_job_cb, sw, free_userdata_cb,
GCONF_SECTION_SEARCH, NULL); GNC_PREFS_GROUP_SEARCH, NULL);
} }
/* Functions for widgets for job selection */ /* Functions for widgets for job selection */

View File

@ -52,7 +52,7 @@
#define DIALOG_EDIT_ORDER_CM_CLASS "dialog-edit-order" #define DIALOG_EDIT_ORDER_CM_CLASS "dialog-edit-order"
#define DIALOG_VIEW_ORDER_CM_CLASS "dialog-view-order" #define DIALOG_VIEW_ORDER_CM_CLASS "dialog-view-order"
#define GCONF_SECTION_SEARCH "dialogs/business/order_search" #define GNC_PREFS_GROUP_SEARCH "dialogs.business.order_search"
void gnc_order_window_ok_cb (GtkWidget *widget, gpointer data); void gnc_order_window_ok_cb (GtkWidget *widget, gpointer data);
void gnc_order_window_cancel_cb (GtkWidget *widget, gpointer data); void gnc_order_window_cancel_cb (GtkWidget *widget, gpointer data);
@ -946,7 +946,7 @@ gnc_order_search (GncOrder *start, GncOwner *owner, QofBook *book)
return gnc_search_dialog_create (type, _("Find Order"), return gnc_search_dialog_create (type, _("Find Order"),
params, columns, q, q2, params, columns, q, q2,
buttons, NULL, new_order_cb, buttons, NULL, new_order_cb,
sw, free_order_cb, GCONF_SECTION_SEARCH, sw, free_order_cb, GNC_PREFS_GROUP_SEARCH,
NULL); NULL);
} }

View File

@ -50,7 +50,7 @@
#define DIALOG_NEW_VENDOR_CM_CLASS "dialog-new-vendor" #define DIALOG_NEW_VENDOR_CM_CLASS "dialog-new-vendor"
#define DIALOG_EDIT_VENDOR_CM_CLASS "dialog-edit-vendor" #define DIALOG_EDIT_VENDOR_CM_CLASS "dialog-edit-vendor"
#define GCONF_SECTION_SEARCH "dialogs/business/vendor_search" #define GNC_PREFS_GROUP_SEARCH "dialogs.business.vendor_search"
void gnc_vendor_taxtable_check_cb (GtkToggleButton *togglebutton, gpointer user_data); void gnc_vendor_taxtable_check_cb (GtkToggleButton *togglebutton, gpointer user_data);
void gnc_vendor_window_ok_cb (GtkWidget *widget, gpointer data); void gnc_vendor_window_ok_cb (GtkWidget *widget, gpointer data);
@ -759,7 +759,7 @@ gnc_vendor_search (GncVendor *start, QofBook *book)
return gnc_search_dialog_create (type, _("Find Vendor"), return gnc_search_dialog_create (type, _("Find Vendor"),
params, columns, q, q2, buttons, NULL, params, columns, q, q2, buttons, NULL,
new_vendor_cb, sw, free_vendor_cb, new_vendor_cb, sw, free_vendor_cb,
GCONF_SECTION_SEARCH, NULL); GNC_PREFS_GROUP_SEARCH, NULL);
} }
GNCSearchWindow * GNCSearchWindow *

View File

@ -1,16 +1,106 @@
<schemalist gettext-domain="GETTEXT_PACKAGE"> <schemalist gettext-domain="GETTEXT_PACKAGE">
<schema id="org.gnucash.dialogs.business" path="/apps/gnucash/dialogs/business/"> <schema id="org.gnucash.dialogs.business" path="/apps/gnucash/dialogs/business/">
<child name="customer_search" schema="org.gnucash.dialogs.business.customer_search"/> <child name="customer_search" schema="org.gnucash.dialogs.business.customer_search"/>
<child name="employee_search" schema="org.gnucash.dialogs.business.employee_search"/>
<child name="invoice_search" schema="org.gnucash.dialogs.business.invoice_search"/>
<child name="job_search" schema="org.gnucash.dialogs.business.job_search"/>
<child name="order_search" schema="org.gnucash.dialogs.business.order_search"/>
<child name="vendor_search" schema="org.gnucash.dialogs.business.vendor_search"/>
<child name="invoice" schema="org.gnucash.dialogs.business.invoice"/> <child name="invoice" schema="org.gnucash.dialogs.business.invoice"/>
<child name="bill" schema="org.gnucash.dialogs.business.bill"/> <child name="bill" schema="org.gnucash.dialogs.business.bill"/>
<child name="tax_tables" schema="org.gnucash.dialogs.business.tax_tables"/>
</schema> </schema>
<schema id="org.gnucash.dialogs.business.customer_search" path="/apps/gnucash/dialogs/business/customer_search/"> <schema id="org.gnucash.dialogs.business.customer_search" path="/apps/gnucash/dialogs/business/customer_search/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="search_for_active_only" type="b"> <key name="search_for_active_only" type="b">
<default>false</default> <default>false</default>
<summary>Search only in active items</summary> <summary>Search only in active items</summary>
<description>If active, only the 'active' items in the current class will be searched. Otherwise all items in the current class will be searched.</description> <description>If active, only the 'active' items in the current class will be searched. Otherwise all items in the current class will be searched.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.business.employee_search" path="/apps/gnucash/dialogs/business/employee_search/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="search_for_active_only" type="b">
<default>false</default>
<summary>Search only in active items</summary>
<description>If active, only the 'active' items in the current class will be searched. Otherwise all items in the current class will be searched.</description>
</key>
</schema>
<schema id="org.gnucash.dialogs.business.invoice_search" path="/apps/gnucash/dialogs/business/invoice_search/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="search_for_active_only" type="b">
<default>false</default>
<summary>Search only in active items</summary>
<description>If active, only the 'active' items in the current class will be searched. Otherwise all items in the current class will be searched.</description>
</key>
</schema>
<schema id="org.gnucash.dialogs.business.job_search" path="/apps/gnucash/dialogs/business/job_search/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="search_for_active_only" type="b">
<default>false</default>
<summary>Search only in active items</summary>
<description>If active, only the 'active' items in the current class will be searched. Otherwise all items in the current class will be searched.</description>
</key>
</schema>
<schema id="org.gnucash.dialogs.business.order_search" path="/apps/gnucash/dialogs/business/order_search/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="search_for_active_only" type="b">
<default>false</default>
<summary>Search only in active items</summary>
<description>If active, only the 'active' items in the current class will be searched. Otherwise all items in the current class will be searched.</description>
</key>
</schema>
<schema id="org.gnucash.dialogs.business.vendor_search" path="/apps/gnucash/dialogs/business/vendor_search/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="search_for_active_only" type="b">
<default>false</default>
<summary>Search only in active items</summary>
<description>If active, only the 'active' items in the current class will be searched. Otherwise all items in the current class will be searched.</description>
</key>
</schema>
<schema id="org.gnucash.dialogs.business.invoice" path="/apps/gnucash/dialogs/business/invoice/"> <schema id="org.gnucash.dialogs.business.invoice" path="/apps/gnucash/dialogs/business/invoice/">
<key name="tax_included" type="b"> <key name="tax_included" type="b">
<default>true</default> <default>true</default>
@ -55,4 +145,14 @@
<description>This field defines the number of days in advance that GnuCash will check for due bills. Its value is only used if the "Notify when due" setting is active.</description> <description>This field defines the number of days in advance that GnuCash will check for due bills. Its value is only used if the "Notify when due" setting is active.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.business.tax_tables" path="/apps/gnucash/dialogs/business/tax_tables/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
</schema>
</schemalist> </schemalist>

View File

@ -80,7 +80,6 @@ libgnc_core_utils_python_la_LIBADD = \
libgnc_core_utils_python_la_CPPFLAGS = \ libgnc_core_utils_python_la_CPPFLAGS = \
${GLIB_CFLAGS} \ ${GLIB_CFLAGS} \
${GCONF_CFLAGS} \
${GTK_MAC_CFLAGS} \ ${GTK_MAC_CFLAGS} \
${QOF_CFLAGS} \ ${QOF_CFLAGS} \
${PYTHON_CPPFLAGS} \ ${PYTHON_CPPFLAGS} \

View File

@ -34,7 +34,7 @@
#include "gnc-ui.h" #include "gnc-ui.h"
#include "gnc-gui-query.h" #include "gnc-gui-query.h"
#include "gnc-query-view.h" #include "gnc-query-view.h"
#include "gnc-gconf-utils.h" #include "gnc-prefs.h"
#include "gnc-session.h" #include "gnc-session.h"
#include "qof.h" #include "qof.h"
#include "engine-helpers.h" #include "engine-helpers.h"
@ -50,7 +50,9 @@
static QofLogModule log_module = G_LOG_DOMAIN; static QofLogModule log_module = G_LOG_DOMAIN;
#define DIALOG_SEARCH_CM_CLASS "dialog-search" #define DIALOG_SEARCH_CM_CLASS "dialog-search"
#define KEY_ACTIVE_ONLY "search_for_active_only" #define GNC_PREFS_GROUP_SEARCH_GENERAL "dialogs.search"
#define GNC_PREF_NEW_SEARCH_LIMIT "new_search_limit"
#define GNC_PREF_ACTIVE_ONLY "search_for_active_only"
typedef enum typedef enum
{ {
@ -123,7 +125,7 @@ struct _GNCSearchWindow
GList *crit_list; /* List of crit_data */ GList *crit_list; /* List of crit_data */
gint component_id; gint component_id;
const gchar *gconf_section; const gchar *prefs_group;
}; };
struct _crit_data struct _crit_data
@ -390,7 +392,7 @@ gnc_search_dialog_display_results (GNCSearchWindow *sw)
gnc_query_view_unselect_all (GNC_QUERY_VIEW(sw->result_view)); gnc_query_view_unselect_all (GNC_QUERY_VIEW(sw->result_view));
/* set 'new search' if fewer than max_count items is returned. */ /* set 'new search' if fewer than max_count items is returned. */
max_count = gnc_gconf_get_float("dialogs/search", "new_search_limit", NULL); max_count = gnc_prefs_get_float(GNC_PREFS_GROUP_SEARCH_GENERAL, GNC_PREF_NEW_SEARCH_LIMIT);
if (gnc_query_view_get_num_entries(GNC_QUERY_VIEW(sw->result_view)) < max_count) if (gnc_query_view_get_num_entries(GNC_QUERY_VIEW(sw->result_view)) < max_count)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), TRUE);
} }
@ -420,8 +422,8 @@ static void
search_active_only_cb (GtkToggleButton *button, GNCSearchWindow *sw) search_active_only_cb (GtkToggleButton *button, GNCSearchWindow *sw)
{ {
gnc_gconf_set_bool(sw->gconf_section, KEY_ACTIVE_ONLY, gnc_prefs_set_bool(sw->prefs_group, GNC_PREF_ACTIVE_ONLY,
gtk_toggle_button_get_active (button), NULL); gtk_toggle_button_get_active (button));
} }
@ -1132,7 +1134,7 @@ gnc_search_dialog_init_widgets (GNCSearchWindow *sw, const gchar *title)
g_signal_connect (sw->del_rb, "toggled", g_signal_connect (sw->del_rb, "toggled",
G_CALLBACK (search_type_cb), sw); G_CALLBACK (search_type_cb), sw);
active = gnc_gconf_get_bool(sw->gconf_section, KEY_ACTIVE_ONLY, NULL); active = gnc_prefs_get_bool(sw->prefs_group, GNC_PREF_ACTIVE_ONLY);
sw->active_only_check = GTK_WIDGET(gtk_builder_get_object (builder, "active_only_check")); sw->active_only_check = GTK_WIDGET(gtk_builder_get_object (builder, "active_only_check"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sw->active_only_check), active); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sw->active_only_check), active);
g_signal_connect (sw->active_only_check, "toggled", g_signal_connect (sw->active_only_check, "toggled",
@ -1209,8 +1211,8 @@ void
gnc_search_dialog_destroy (GNCSearchWindow *sw) gnc_search_dialog_destroy (GNCSearchWindow *sw)
{ {
if (!sw) return; if (!sw) return;
if (sw->gconf_section) if (sw->prefs_group)
gnc_save_window_size(sw->gconf_section, GTK_WINDOW(sw->dialog)); gnc_save_window_size(sw->prefs_group, GTK_WINDOW(sw->dialog));
gnc_close_gui_component (sw->component_id); gnc_close_gui_component (sw->component_id);
} }
@ -1231,7 +1233,7 @@ gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
GNCSearchResultCB result_callback, GNCSearchResultCB result_callback,
GNCSearchNewItemCB new_item_cb, GNCSearchNewItemCB new_item_cb,
gpointer user_data, GNCSearchFree free_cb, gpointer user_data, GNCSearchFree free_cb,
const gchar *gconf_section, const gchar *prefs_group,
const gchar *type_label) const gchar *type_label)
{ {
GNCSearchWindow *sw = g_new0 (GNCSearchWindow, 1); GNCSearchWindow *sw = g_new0 (GNCSearchWindow, 1);
@ -1255,7 +1257,7 @@ gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
sw->new_item_cb = new_item_cb; sw->new_item_cb = new_item_cb;
sw->user_data = user_data; sw->user_data = user_data;
sw->free_cb = free_cb; sw->free_cb = free_cb;
sw->gconf_section = gconf_section; sw->prefs_group = prefs_group;
sw->type_label = type_label; sw->type_label = type_label;
/* Grab the get_guid function */ /* Grab the get_guid function */
@ -1265,8 +1267,8 @@ gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
sw->q = show_start_query; sw->q = show_start_query;
gnc_search_dialog_init_widgets (sw, title); gnc_search_dialog_init_widgets (sw, title);
if (sw->gconf_section) if (sw->prefs_group)
gnc_restore_window_size(sw->gconf_section, GTK_WINDOW(sw->dialog)); gnc_restore_window_size(sw->prefs_group, GTK_WINDOW(sw->dialog));
gtk_widget_show(sw->dialog); gtk_widget_show(sw->dialog);
/* Maybe display the original query results? */ /* Maybe display the original query results? */

View File

@ -111,7 +111,7 @@ gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
GNCSearchResultCB result_callback, GNCSearchResultCB result_callback,
GNCSearchNewItemCB new_item_cb, GNCSearchNewItemCB new_item_cb,
gpointer user_data, GNCSearchFree free_user_data, gpointer user_data, GNCSearchFree free_user_data,
const gchar *gconf_section, const gchar *prefs_group,
const gchar *type_label); const gchar *type_label);
void gnc_search_dialog_destroy (GNCSearchWindow *sw); void gnc_search_dialog_destroy (GNCSearchWindow *sw);

View File

@ -53,7 +53,7 @@
#define DIALOG_NEW_ACCOUNT_CM_CLASS "dialog-new-account" #define DIALOG_NEW_ACCOUNT_CM_CLASS "dialog-new-account"
#define DIALOG_EDIT_ACCOUNT_CM_CLASS "dialog-edit-account" #define DIALOG_EDIT_ACCOUNT_CM_CLASS "dialog-edit-account"
#define GCONF_SECTION "dialogs/account" #define GNC_PREFS_GROUP "dialogs.account"
#define DEFAULT_COLOR "#ededececebeb" #define DEFAULT_COLOR "#ededececebeb"
enum account_cols enum account_cols
@ -1401,7 +1401,7 @@ gnc_account_window_create(AccountWindow *aw)
aw->type_view = GTK_WIDGET(gtk_builder_get_object (builder, "type_view")); aw->type_view = GTK_WIDGET(gtk_builder_get_object (builder, "type_view"));
gnc_account_type_view_create (aw); gnc_account_type_view_create (aw);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(aw->dialog)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(aw->dialog));
gtk_widget_grab_focus(GTK_WIDGET(aw->name_entry)); gtk_widget_grab_focus(GTK_WIDGET(aw->name_entry));
@ -1483,7 +1483,7 @@ close_handler (gpointer user_data)
AccountWindow *aw = user_data; AccountWindow *aw = user_data;
ENTER("aw %p, modal %d", aw, aw->modal); ENTER("aw %p, modal %d", aw, aw->modal);
gnc_save_window_size (GCONF_SECTION, GTK_WINDOW(aw->dialog)); gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(aw->dialog));
gtk_widget_destroy (GTK_WIDGET (aw->dialog)); gtk_widget_destroy (GTK_WIDGET (aw->dialog));
LEAVE(" "); LEAVE(" ");

View File

@ -76,7 +76,7 @@
#include "dialog-preferences.h" #include "dialog-preferences.h"
#define DIALOG_PREFERENCES_CM_CLASS "dialog-newpreferences" #define DIALOG_PREFERENCES_CM_CLASS "dialog-newpreferences"
#define GCONF_SECTION "dialogs/preferences" #define GNC_PREFS_GROUP "dialogs.preferences"
#define PREFIX_LEN sizeof("gconf/") - 1 #define PREFIX_LEN sizeof("gconf/") - 1
#define WIDGET_HASH "widget_hash" #define WIDGET_HASH "widget_hash"
#define NOTEBOOK "notebook" #define NOTEBOOK "notebook"
@ -1410,7 +1410,7 @@ gnc_preferences_response_cb(GtkDialog *dialog, gint response, GtkDialog *unused)
break; break;
default: default:
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
gnc_unregister_gui_component_by_data(DIALOG_PREFERENCES_CM_CLASS, gnc_unregister_gui_component_by_data(DIALOG_PREFERENCES_CM_CLASS,
dialog); dialog);
gnc_gconf_general_remove_cb( gnc_gconf_general_remove_cb(
@ -1886,7 +1886,7 @@ gnc_preferences_dialog (void)
dialog = gnc_preferences_dialog_create(); dialog = gnc_preferences_dialog_create();
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
gtk_widget_show(dialog); gtk_widget_show(dialog);
gnc_gconf_add_notification(G_OBJECT(dialog), NULL, gnc_gconf_add_notification(G_OBJECT(dialog), NULL,

View File

@ -36,7 +36,7 @@
/* This static indicates the debugging module that this .o belongs to. */ /* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_PREFS; static QofLogModule log_module = GNC_MOD_PREFS;
#define GCONF_SECTION "dialogs/reset_warnings" #define GNC_PREFS_GROUP "dialogs.reset_warnings"
#define DIALOG_RESET_WARNINGS_CM_CLASS "reset-warnings" #define DIALOG_RESET_WARNINGS_CM_CLASS "reset-warnings"
#define GCONF_ENTRY_LIST "gconf_entries" #define GCONF_ENTRY_LIST "gconf_entries"
#define TIPS_STRING "tips" #define TIPS_STRING "tips"
@ -215,7 +215,7 @@ gnc_reset_warnings_response_cb (GtkDialog *dialog,
gnc_gconf_remove_notification(G_OBJECT(rw_dialog->dialog), GCONF_WARNINGS, gnc_gconf_remove_notification(G_OBJECT(rw_dialog->dialog), GCONF_WARNINGS,
DIALOG_RESET_WARNINGS_CM_CLASS); DIALOG_RESET_WARNINGS_CM_CLASS);
gnc_reset_warnings_apply_changes(rw_dialog); gnc_reset_warnings_apply_changes(rw_dialog);
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(rw_dialog->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(rw_dialog->dialog));
gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS, gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
rw_dialog); rw_dialog);
gtk_widget_destroy(GTK_WIDGET(rw_dialog->dialog)); gtk_widget_destroy(GTK_WIDGET(rw_dialog->dialog));
@ -552,7 +552,7 @@ gnc_reset_warnings_dialog (GtkWindow *parent)
gnc_reset_warnings_gconf_changed, gnc_reset_warnings_gconf_changed,
DIALOG_RESET_WARNINGS_CM_CLASS); DIALOG_RESET_WARNINGS_CM_CLASS);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(rw_dialog->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(rw_dialog->dialog));
gnc_register_gui_component (DIALOG_RESET_WARNINGS_CM_CLASS, gnc_register_gui_component (DIALOG_RESET_WARNINGS_CM_CLASS,
NULL, close_handler, rw_dialog); NULL, close_handler, rw_dialog);

View File

@ -42,7 +42,7 @@
#include "dialog-tax-table.h" #include "dialog-tax-table.h"
#define DIALOG_TAX_TABLE_CM_CLASS "tax-table-dialog" #define DIALOG_TAX_TABLE_CM_CLASS "tax-table-dialog"
#define GCONF_SECTION "dialogs/business/tax_tables" #define GNC_PREFS_GROUP "dialogs.business.tax_tables"
enum tax_table_cols enum tax_table_cols
{ {
@ -652,7 +652,7 @@ tax_table_window_close (GtkWidget *widget, gpointer data)
{ {
TaxTableWindow *ttw = data; TaxTableWindow *ttw = data;
gnc_save_window_size (GCONF_SECTION, GTK_WINDOW (ttw->dialog)); gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW (ttw->dialog));
gnc_ui_tax_table_window_destroy (ttw); gnc_ui_tax_table_window_destroy (ttw);
} }
@ -762,7 +762,7 @@ gnc_ui_tax_table_window_new (QofBook *book)
ttw); ttw);
tax_table_window_refresh (ttw); tax_table_window_refresh (ttw);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW (ttw->dialog)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW (ttw->dialog));
gtk_widget_show_all (ttw->dialog); gtk_widget_show_all (ttw->dialog);
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));

View File

@ -36,6 +36,7 @@
#include "gnc-engine.h" #include "gnc-engine.h"
#define GCONF_SECTION "dialogs/tip_of_the_day" #define GCONF_SECTION "dialogs/tip_of_the_day"
#define GNC_PREFS_GROUP "dialogs.totd"
#define KEY_CURRENT_TIP "current_tip" #define KEY_CURRENT_TIP "current_tip"
#define KEY_SHOW_TIPS "show_at_startup" #define KEY_SHOW_TIPS "show_at_startup"
#define DIALOG_TOTD_CM_CLASS "dialog-totd" #define DIALOG_TOTD_CM_CLASS "dialog-totd"
@ -145,7 +146,7 @@ void gnc_totd_dialog_response_cb (GtkDialog *dialog,
break; break;
case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_CLOSE:
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(totd_dialog->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(totd_dialog->dialog));
/* fall through */ /* fall through */
default: default:
@ -349,7 +350,7 @@ gnc_totd_dialog (GtkWindow *parent, gboolean startup)
gnc_new_tip_number(totd_dialog, 1); gnc_new_tip_number(totd_dialog, 1);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(totd_dialog->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(totd_dialog->dialog));
gtk_widget_show(GTK_WIDGET (totd_dialog->dialog)); gtk_widget_show(GTK_WIDGET (totd_dialog->dialog));
gnc_register_gui_component(DIALOG_TOTD_CM_CLASS, gnc_register_gui_component(DIALOG_TOTD_CM_CLASS,

View File

@ -52,7 +52,7 @@
#define DIALOG_TRANSFER_CM_CLASS "dialog-transfer" #define DIALOG_TRANSFER_CM_CLASS "dialog-transfer"
#define GCONF_SECTION "dialogs/transfer" #define GNC_PREFS_GROUP "dialogs.transfer"
#define PRECISION 1000000 #define PRECISION 1000000
@ -1942,7 +1942,7 @@ gnc_xfer_dialog_create(GtkWidget *parent, XferDialog *xferData)
} }
gtk_builder_connect_signals(builder, xferData); gtk_builder_connect_signals(builder, xferData);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW (xferData->dialog)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW (xferData->dialog));
LEAVE(" "); LEAVE(" ");
} }
@ -1955,7 +1955,7 @@ close_handler (gpointer user_data)
ENTER(" "); ENTER(" ");
dialog = GTK_WIDGET (xferData->dialog); dialog = GTK_WIDGET (xferData->dialog);
gnc_save_window_size (GCONF_SECTION, GTK_WINDOW (dialog)); gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW (dialog));
gtk_widget_hide (dialog); gtk_widget_hide (dialog);
gnc_xfer_dialog_close_cb(GTK_DIALOG(dialog), xferData); gnc_xfer_dialog_close_cb(GTK_DIALOG(dialog), xferData);
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);

View File

@ -40,6 +40,7 @@
#include "gnc-euro.h" #include "gnc-euro.h"
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
#include "gnc-gconf-utils.h" #include "gnc-gconf-utils.h"
#include "gnc-prefs.h"
#include "guile-util.h" #include "guile-util.h"
#include "gnc-main-window.h" #include "gnc-main-window.h"
#include <gnc-gdate-utils.h> #include <gnc-gdate-utils.h>
@ -47,8 +48,7 @@
/* This static indicates the debugging module that this .o belongs to. */ /* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI; static QofLogModule log_module = GNC_MOD_GUI;
#define WINDOW_POSITION "window_position" #define GNC_PREF_LAST_GEOMETRY "last-geometry"
#define WINDOW_GEOMETRY "window_geometry"
/********************************************************************\ /********************************************************************\
* gnc_get_toolbar_style * * gnc_get_toolbar_style *
@ -141,61 +141,60 @@ gnc_set_label_color(GtkWidget *label, gnc_numeric value)
/********************************************************************\ /********************************************************************\
* gnc_restore_window_size * * gnc_restore_window_size *
* returns the window size to use for the given option prefix, * * restores the position and size of the given window, if these *
* if window sizes are being saved, otherwise returns 0 for both. * * these parameters have been saved earlier. Does nothing if no *
* saved values are found. *
* * * *
* Args: prefix - the option name prefix * * Args: group - the preferences group to look in for saved coords *
* width - pointer to width * * window - the window for which the coords are to be *
* height - pointer to height * * restored *
* Returns: nothing * * Returns: nothing *
\*******************************************************************/ \*******************************************************************/
void void
gnc_restore_window_size(const char *section, GtkWindow *window) gnc_restore_window_size(const char *group, GtkWindow *window)
{ {
GSList *coord_list; gint wpos[2], wsize[2];
gint coords[2]; GVariant *geometry;
ENTER(""); ENTER("");
g_return_if_fail(section != NULL); g_return_if_fail(group != NULL);
g_return_if_fail(window != NULL); g_return_if_fail(window != NULL);
if (!gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL)) if (!gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL))
return; return;
coord_list = gnc_gconf_get_list(section, WINDOW_POSITION, geometry = gnc_prefs_get_value (group, GNC_PREF_LAST_GEOMETRY);
GCONF_VALUE_INT, NULL); if (g_variant_is_of_type (geometry, (const GVariantType *) "(iiii)") )
if (coord_list)
{ {
gint screen_width = gdk_screen_width(); gint screen_width = gdk_screen_width();
gint screen_height = gdk_screen_height(); gint screen_height = gdk_screen_height();
coords[0] = GPOINTER_TO_INT(g_slist_nth_data(coord_list, 0)); g_variant_get (geometry, "(iiii)",
coords[1] = GPOINTER_TO_INT(g_slist_nth_data(coord_list, 1)); &wpos[0], &wpos[1],
DEBUG("from gconf - coords[0]: %d, coords[1]: %d", coords[0], coords[1]); &wsize[0], &wsize[1]);
DEBUG("geometry from preferences - wpos[0]: %d, wpos[1]: %d, wsize[0]: %d, wsize[1]: %d",
wpos[0], wpos[1], wsize[0], wsize[1]);
/* (-1, -1) means no geometry was saved (default preferences value) */
if ((wpos[0] != -1) && (wpos[1] != -1))
{
/* Keep the window on screen if possible */ /* Keep the window on screen if possible */
if (screen_width != 0) if (screen_width != 0)
coords[0] = coords[0] % screen_width; wpos[0] = wpos[0] % screen_width;
if (screen_height != 0) if (screen_height != 0)
coords[1] = coords[1] % screen_height; wpos[1] = wpos[1] % screen_height;
DEBUG("after screen adaption - coords[0]: %d, coords[1]: %d", coords[0], coords[1]); DEBUG("geometry after screen adaption - wpos[0]: %d, wpos[1]: %d, wsize[0]: %d, wsize[1]: %d",
wpos[0], wpos[1], wsize[0], wsize[1]);
gtk_window_move(window, coords[0], coords[1]); gtk_window_move(window, wpos[0], wpos[1]);
g_slist_free(coord_list);
} }
coord_list = gnc_gconf_get_list(section, WINDOW_GEOMETRY, /* Don't attempt to restore invalid sizes */
GCONF_VALUE_INT, NULL); if ((wsize[0] > 0) && (wsize[1] > 0))
if (coord_list) gtk_window_resize(window, wsize[0], wsize[1]);
{
coords[0] = GPOINTER_TO_INT(g_slist_nth_data(coord_list, 0));
coords[1] = GPOINTER_TO_INT(g_slist_nth_data(coord_list, 1));
DEBUG("coords[0]: %d, coords[1]: %d", coords[0], coords[1]);
if ((coords[0] != 0) && (coords[1] != 0))
gtk_window_resize(window, coords[0], coords[1]);
g_slist_free(coord_list);
} }
g_variant_unref (geometry);
LEAVE(""); LEAVE("");
} }
@ -203,40 +202,32 @@ gnc_restore_window_size(const char *section, GtkWindow *window)
/********************************************************************\ /********************************************************************\
* gnc_save_window_size * * gnc_save_window_size *
* save the window size into options whose names are determined * * save the window position and size into options whose names are *
* by the string prefix. * * prefixed by the group name. *
* * * *
* Args: prefix - determines the options used to save the values * * Args: group - preferences group to save the options in *
* width - width of the window to save * * window - the window for which current position and size *
* height - height of the window to save * * are to be saved *
* Returns: nothing * * Returns: nothing *
\********************************************************************/ \********************************************************************/
void void
gnc_save_window_size(const char *section, GtkWindow *window) gnc_save_window_size(const char *group, GtkWindow *window)
{ {
GSList *coord_list = NULL; gint wpos[2], wsize[2];
gint coords[2]; GVariant *geometry;
g_return_if_fail(section != NULL); g_return_if_fail(group != NULL);
g_return_if_fail(window != NULL); g_return_if_fail(window != NULL);
if (!gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL)) if (!gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL))
return; return;
gtk_window_get_size(GTK_WINDOW(window), &coords[0], &coords[1]); gtk_window_get_position(GTK_WINDOW(window), &wpos[0], &wpos[1]);
coord_list = g_slist_append(coord_list, GUINT_TO_POINTER(coords[0])); gtk_window_get_size(GTK_WINDOW(window), &wsize[0], &wsize[1]);
coord_list = g_slist_append(coord_list, GUINT_TO_POINTER(coords[1])); geometry = g_variant_new ("(iiii)", wpos[0], wpos[1],
gnc_gconf_set_list(section, WINDOW_GEOMETRY, GCONF_VALUE_INT, wsize[0], wsize[1]);
coord_list, NULL); gnc_prefs_set_value (group, GNC_PREF_LAST_GEOMETRY, geometry);
g_slist_free(coord_list); g_variant_unref (geometry);
coord_list = NULL;
gtk_window_get_position(GTK_WINDOW(window), &coords[0], &coords[1]);
coord_list = g_slist_append(coord_list, GUINT_TO_POINTER(coords[0]));
coord_list = g_slist_append(coord_list, GUINT_TO_POINTER(coords[1]));
gnc_gconf_set_list(section, WINDOW_POSITION, GCONF_VALUE_INT,
coord_list, NULL);
g_slist_free(coord_list);
} }

View File

@ -56,7 +56,8 @@
#include "gnc-engine.h" #include "gnc-engine.h"
static QofLogModule log_module = GNC_MOD_IMPORT; static QofLogModule log_module = GNC_MOD_IMPORT;
#define GCONF_SECTION "dialogs/new_hierarchy" #define GNC_PREFS_GROUP "dialogs.new_hierarchy"
#define GNC_PREF_SHOW_ON_NEW_FILE "show_on_new_file"
typedef enum typedef enum
{ {
@ -118,7 +119,7 @@ void on_finish (GtkAssistant *gtkassistant, hierarchy_data *data);
static void static void
delete_hierarchy_dialog (hierarchy_data *data) delete_hierarchy_dialog (hierarchy_data *data)
{ {
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(data->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(data->dialog));
gtk_widget_destroy (data->dialog); gtk_widget_destroy (data->dialog);
} }
@ -1132,7 +1133,7 @@ gnc_create_hierarchy_assistant (gboolean use_defaults, GncHierarchyAssistantFini
data->balance_hash = g_hash_table_new(NULL, NULL); data->balance_hash = g_hash_table_new(NULL, NULL);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(data->dialog)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(data->dialog));
g_signal_connect (G_OBJECT(dialog), "destroy", g_signal_connect (G_OBJECT(dialog), "destroy",
G_CALLBACK (gnc_hierarchy_destroy_cb), data); G_CALLBACK (gnc_hierarchy_destroy_cb), data);

View File

@ -42,6 +42,7 @@
#define DIALOG_COMMODITIES_CM_CLASS "dialog-commodities" #define DIALOG_COMMODITIES_CM_CLASS "dialog-commodities"
#define GCONF_SECTION "dialogs/edit_commodities" #define GCONF_SECTION "dialogs/edit_commodities"
#define GNC_PREFS_GROUP "dialogs.edit_commodities"
/* This static indicates the debugging module that this .o belongs to. */ /* This static indicates the debugging module that this .o belongs to. */
/* static short module = MOD_GUI; */ /* static short module = MOD_GUI; */
@ -356,7 +357,7 @@ gnc_commodities_dialog_create (GtkWidget * parent, CommoditiesDialog *cd)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), cd->show_currencies); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), cd->show_currencies);
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(cd->dialog)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(cd->dialog));
} }
static void static void
@ -364,7 +365,7 @@ close_handler (gpointer user_data)
{ {
CommoditiesDialog *cd = user_data; CommoditiesDialog *cd = user_data;
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(cd->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(cd->dialog));
gnc_gconf_set_bool(GCONF_SECTION, "include_iso", cd->show_currencies, NULL); gnc_gconf_set_bool(GCONF_SECTION, "include_iso", cd->show_currencies, NULL);

View File

@ -42,7 +42,7 @@
#define DIALOG_FINCALC_CM_CLASS "dialog-fincalc" #define DIALOG_FINCALC_CM_CLASS "dialog-fincalc"
#define GCONF_SECTION "dialogs/fincalc" #define GNC_PREFS_GROUP "dialogs.fincalc"
typedef enum typedef enum
{ {
@ -463,7 +463,7 @@ void fincalc_response_cb (GtkDialog *dialog,
/* Fall through */ /* Fall through */
case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_CLOSE:
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
break; break;
default: default:
@ -669,7 +669,7 @@ gnc_ui_fincalc_dialog_create(void)
gtk_builder_connect_signals(builder, fcd); gtk_builder_connect_signals(builder, fcd);
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(fcd->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(fcd->dialog));
gtk_widget_show(fcd->dialog); gtk_widget_show(fcd->dialog);
} }

View File

@ -36,7 +36,7 @@
#include "gnc-plugin-page-register.h" #include "gnc-plugin-page-register.h"
#include "search-param.h" #include "search-param.h"
#define GCONF_SECTION "dialogs/find" #define GNC_PREFS_GROUP_SEARCH "dialogs.find"
struct _ftd_data struct _ftd_data
{ {
@ -203,7 +203,7 @@ gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"), ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
params, NULL, start_q, show_q, params, NULL, start_q, show_q,
NULL, do_find_cb, NULL, NULL, do_find_cb, NULL,
ftd, free_ftd_cb, GCONF_SECTION, NULL); ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL);
if (!ftd->sw) if (!ftd->sw)
{ {

View File

@ -36,7 +36,7 @@
#include "gnc-plugin-page-register2.h" #include "gnc-plugin-page-register2.h"
#include "search-param.h" #include "search-param.h"
#define GCONF_SECTION "dialogs/find" #define GNC_PREFS_GROUP_SEARCH "dialogs.find"
struct _ftd_data struct _ftd_data
{ {
@ -204,7 +204,7 @@ gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * orig_ledg)
ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"), ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
params, NULL, start_q, show_q, params, NULL, start_q, show_q,
NULL, do_find_cb, NULL, NULL, do_find_cb, NULL,
ftd, free_ftd_cb, GCONF_SECTION, NULL); ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL);
if (!ftd->sw) if (!ftd->sw)
{ {

View File

@ -83,6 +83,7 @@ enum split_cols
#define RESPONSE_NEW_LOT 5 #define RESPONSE_NEW_LOT 5
#define GCONF_SECTION "dialogs/lot_viewer" #define GCONF_SECTION "dialogs/lot_viewer"
#define GNC_PREFS_GROUP "dialogs.lot_viewer"
#define GCONF_KEY_HPOSITION "hpane_position" #define GCONF_KEY_HPOSITION "hpane_position"
#define GCONF_KEY_VPOSITION "vpane_position" #define GCONF_KEY_VPOSITION "vpane_position"
@ -613,7 +614,7 @@ lv_close_handler (gpointer user_data)
lv_save_current_lot (lv); lv_save_current_lot (lv);
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(lv->window)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(lv->window));
gtk_widget_destroy (lv->window); gtk_widget_destroy (lv->window);
} }
@ -1017,7 +1018,7 @@ lv_create (GNCLotViewer *lv)
lv_update_split_buttons(lv); lv_update_split_buttons(lv);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(lv->window)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(lv->window));
} }
/* ======================================================================== */ /* ======================================================================== */

View File

@ -52,6 +52,7 @@
#define DIALOG_PRICE_DB_CM_CLASS "dialog-price-edit-db" #define DIALOG_PRICE_DB_CM_CLASS "dialog-price-edit-db"
#define GCONF_SECTION "dialogs/edit_prices" #define GCONF_SECTION "dialogs/edit_prices"
#define GNC_PREFS_GROUP "dialogs.edit_prices"
/* This static indicates the debugging module that this .o belongs to. */ /* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI; static QofLogModule log_module = GNC_MOD_GUI;
@ -482,7 +483,7 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pdb_dialog->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pdb_dialog->dialog));
LEAVE(" "); LEAVE(" ");
} }
@ -493,7 +494,7 @@ close_handler (gpointer user_data)
PricesDialog *pdb_dialog = user_data; PricesDialog *pdb_dialog = user_data;
ENTER(" "); ENTER(" ");
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(pdb_dialog->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pdb_dialog->dialog));
gtk_widget_destroy (GTK_WIDGET (pdb_dialog->dialog)); gtk_widget_destroy (GTK_WIDGET (pdb_dialog->dialog));
LEAVE(" "); LEAVE(" ");

View File

@ -49,7 +49,7 @@
#define DIALOG_PRICE_EDIT_CM_CLASS "dialog-price-edit" #define DIALOG_PRICE_EDIT_CM_CLASS "dialog-price-edit"
#define GCONF_SECTION "dialogs/price_editor" #define GNC_PREFS_GROUP "dialogs.price_editor"
#define DIALOG_PRICE_EDIT_SOURCE "user:price-editor" #define DIALOG_PRICE_EDIT_SOURCE "user:price-editor"
@ -304,7 +304,7 @@ pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
} }
else else
{ {
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(pedit_dialog->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pedit_dialog->dialog));
gtk_widget_destroy (GTK_WIDGET (pedit_dialog->dialog)); gtk_widget_destroy (GTK_WIDGET (pedit_dialog->dialog));
pedit_dialog_destroy_cb (NULL, pedit_dialog); pedit_dialog_destroy_cb (NULL, pedit_dialog);
} }
@ -542,7 +542,7 @@ gnc_price_edit_dialog (GtkWidget * parent,
pedit_dialog = g_new0 (PriceEditDialog, 1); pedit_dialog = g_new0 (PriceEditDialog, 1);
gnc_price_pedit_dialog_create (parent, pedit_dialog, session); gnc_price_pedit_dialog_create (parent, pedit_dialog, session);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pedit_dialog->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pedit_dialog->dialog));
pedit_dialog->type = type; pedit_dialog->type = type;
switch (type) switch (type)

View File

@ -65,6 +65,7 @@
G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks"; G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks";
#define GCONF_SECTION "dialogs/print_checks" #define GCONF_SECTION "dialogs/print_checks"
#define GNC_PREFS_GROUP "dialogs.print_checks"
#define KEY_CHECK_FORMAT_GUID "check_format_guid" #define KEY_CHECK_FORMAT_GUID "check_format_guid"
#define KEY_CHECK_FORMAT "check_format" #define KEY_CHECK_FORMAT "check_format"
#define KEY_CHECK_POSITION "check_position" #define KEY_CHECK_POSITION "check_position"
@ -1764,7 +1765,7 @@ gnc_ui_print_check_dialog_create(GncPluginPageRegister *plugin_page,
gtk_widget_destroy(GTK_WIDGET(gtk_builder_get_object (builder, "lower_left"))); gtk_widget_destroy(GTK_WIDGET(gtk_builder_get_object (builder, "lower_left")));
gnc_ui_print_restore_dialog(pcd); gnc_ui_print_restore_dialog(pcd);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pcd->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pcd->dialog));
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));
gtk_widget_show_all(pcd->dialog); gtk_widget_show_all(pcd->dialog);
@ -2674,11 +2675,11 @@ gnc_ui_print_check_response_cb(GtkDialog *dialog,
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
gnc_ui_print_check_dialog_ok_cb(pcd); gnc_ui_print_check_dialog_ok_cb(pcd);
gnc_ui_print_save_dialog(pcd); gnc_ui_print_save_dialog(pcd);
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
break; break;
case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_CANCEL:
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
break; break;
} }

View File

@ -1237,7 +1237,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create (SchedXaction *sx,
/* Allow resize */ /* Allow resize */
gtk_window_set_resizable (GTK_WINDOW(sxed->dialog), TRUE); gtk_window_set_resizable (GTK_WINDOW(sxed->dialog), TRUE);
gnc_restore_window_size(SXED_GCONF_SECTION, GTK_WINDOW(sxed->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP_SXED, GTK_WINDOW(sxed->dialog));
/* create the frequency-selection widget and example [dense-]calendar. */ /* create the frequency-selection widget and example [dense-]calendar. */
schedXact_editor_create_freq_sel( sxed ); schedXact_editor_create_freq_sel( sxed );
@ -1271,7 +1271,7 @@ static
void void
gnc_sxed_record_size( GncSxEditorDialog *sxed ) gnc_sxed_record_size( GncSxEditorDialog *sxed )
{ {
gnc_save_window_size( SXED_GCONF_SECTION, GTK_WINDOW(sxed->dialog) ); gnc_save_window_size( GNC_PREFS_GROUP_SXED, GTK_WINDOW(sxed->dialog) );
} }

View File

@ -33,6 +33,7 @@
#define KEY_NOTIFY "notify" #define KEY_NOTIFY "notify"
#define KEY_CREATE_DAYS "create_days" #define KEY_CREATE_DAYS "create_days"
#define KEY_REMIND_DAYS "remind_days" #define KEY_REMIND_DAYS "remind_days"
#define GNC_PREFS_GROUP_SXED "dialogs.sxs.transaction_editor"
typedef struct _GncSxEditorDialog GncSxEditorDialog; typedef struct _GncSxEditorDialog GncSxEditorDialog;

View File

@ -61,6 +61,7 @@ G_GNUC_UNUSED static QofLogModule log_module = GNC_MOD_GUI_SX;
#define DIALOG_SX_SINCE_LAST_RUN_CM_CLASS "dialog-sx-since-last-run" #define DIALOG_SX_SINCE_LAST_RUN_CM_CLASS "dialog-sx-since-last-run"
#define GCONF_SECTION "dialogs/scheduled_trans/since_last_run" #define GCONF_SECTION "dialogs/scheduled_trans/since_last_run"
#define GNC_PREFS_GROUP "dialogs.sxs.since_last_run"
struct _GncSxSinceLastRunDialog struct _GncSxSinceLastRunDialog
{ {
@ -987,7 +988,7 @@ gnc_ui_sx_since_last_run_dialog(GncSxInstanceModel *sx_instances, GList *auto_cr
g_signal_connect(G_OBJECT(dialog->dialog), "response", G_CALLBACK(dialog_response_cb), dialog); g_signal_connect(G_OBJECT(dialog->dialog), "response", G_CALLBACK(dialog_response_cb), dialog);
g_signal_connect(G_OBJECT(dialog->dialog), "destroy", G_CALLBACK(dialog_destroy_cb), dialog); g_signal_connect(G_OBJECT(dialog->dialog), "destroy", G_CALLBACK(dialog_destroy_cb), dialog);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog->dialog));
dialog->component_id = gnc_register_gui_component dialog->component_id = gnc_register_gui_component
(DIALOG_SX_SINCE_LAST_RUN_CM_CLASS, NULL, close_handler, dialog); (DIALOG_SX_SINCE_LAST_RUN_CM_CLASS, NULL, close_handler, dialog);
@ -1038,7 +1039,7 @@ close_handler(gpointer user_data)
{ {
GncSxSinceLastRunDialog *app_dialog = user_data; GncSxSinceLastRunDialog *app_dialog = user_data;
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(app_dialog->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(app_dialog->dialog));
gtk_widget_destroy(app_dialog->dialog); gtk_widget_destroy(app_dialog->dialog);
} }

View File

@ -46,6 +46,7 @@
#define DIALOG_TAX_INFO_CM_CLASS "dialog-tax-info" #define DIALOG_TAX_INFO_CM_CLASS "dialog-tax-info"
#define GCONF_SECTION "dialogs/tax_info" #define GCONF_SECTION "dialogs/tax_info"
#define PANED_POSITION "paned_position" #define PANED_POSITION "paned_position"
#define GNC_PREFS_GROUP "dialogs.tax_info"
enum enum
{ {
@ -1457,7 +1458,7 @@ gnc_tax_info_dialog_create (GtkWidget * parent, TaxInfoDialog *ti_dialog)
clear_gui (ti_dialog); clear_gui (ti_dialog);
gnc_tax_info_set_changed (ti_dialog, FALSE); gnc_tax_info_set_changed (ti_dialog, FALSE);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(ti_dialog->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(ti_dialog->dialog));
ti_dialog->paned = GTK_WIDGET(gtk_builder_get_object (builder, "paned")); ti_dialog->paned = GTK_WIDGET(gtk_builder_get_object (builder, "paned"));
@ -1480,7 +1481,7 @@ close_handler (gpointer user_data)
gtk_paned_get_position(GTK_PANED(ti_dialog->paned)), NULL); gtk_paned_get_position(GTK_PANED(ti_dialog->paned)), NULL);
} }
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(ti_dialog->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(ti_dialog->dialog));
gtk_widget_destroy (ti_dialog->dialog); gtk_widget_destroy (ti_dialog->dialog);
} }

View File

@ -9,169 +9,122 @@
<child name="reset_warnings" schema="org.gnucash.dialogs.reset_warnings"/> <child name="reset_warnings" schema="org.gnucash.dialogs.reset_warnings"/>
<child name="tax_info" schema="org.gnucash.dialogs.tax_info"/> <child name="tax_info" schema="org.gnucash.dialogs.tax_info"/>
<child name="tip_of_the_day" schema="org.gnucash.dialogs.tip_of_the_day"/> <child name="tip_of_the_day" schema="org.gnucash.dialogs.tip_of_the_day"/>
<child name="window_reconcile" schema="org.gnucash.dialogs.window_reconcile"/> <child name="fincalc" schema="org.gnucash.dialogs.fincalc"/>
<child name="find" schema="org.gnucash.dialogs.find"/> <child name="find" schema="org.gnucash.dialogs.find"/>
<child name="export_accounts" schema="org.gnucash.dialogs.export_accounts"/> <child name="export_accounts" schema="org.gnucash.dialogs.export_accounts"/>
<child name="log_replay" schema="org.gnucash.dialogs.log_replay"/> <child name="log_replay" schema="org.gnucash.dialogs.log_replay"/>
<child name="open_save" schema="org.gnucash.dialogs.open_save"/> <child name="open_save" schema="org.gnucash.dialogs.open_save"/>
<child name="report" schema="org.gnucash.dialogs.report"/> <child name="report" schema="org.gnucash.dialogs.report"/>
<child name="lot_viewer" schema="org.gnucash.dialogs.lot_viewer"/>
<child name="new_user" schema="org.gnucash.dialogs.new_user"/> <child name="new_user" schema="org.gnucash.dialogs.new_user"/>
<child name="new_hierarchy" schema="org.gnucash.dialogs.new_hierarchy"/> <child name="new_hierarchy" schema="org.gnucash.dialogs.new_hierarchy"/>
<child name="search" schema="org.gnucash.dialogs.search"/> <child name="search" schema="org.gnucash.dialogs.search"/>
<child name="transfer" schema="org.gnucash.dialogs.transfer"/>
</schema> </schema>
<!-- keys to store window geometry (postition and size).
This still has to be added for several dialogs, but perhaps in other schema files:
- business/bill
- business/customer_search
- business/employee_search
- business/invoice
- business/invoice_search
- business/job_search
- business/order_search
- business/vendor_search
- business/voucher
- export/csv
- import/csv
- import/generic_matcher/match_picker
- import/generic_matcher/transaction_list
- import/hbci/connection_dialog
- scheduled_trans/since_last_run
- scheduled_trans/transaction_editor
- scheduled_trans/transaction_list -->
<schema id="org.gnucash.dialogs.account" path="/apps/gnucash/dialogs/account/"> <schema id="org.gnucash.dialogs.account" path="/apps/gnucash/dialogs/account/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.edit_prices" path="/apps/gnucash/dialogs/edit_prices/"> <schema id="org.gnucash.dialogs.edit_prices" path="/apps/gnucash/dialogs/edit_prices/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.preferences" path="/apps/gnucash/dialogs/preferences/"> <schema id="org.gnucash.dialogs.preferences" path="/apps/gnucash/dialogs/preferences/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.price_editor" path="/apps/gnucash/dialogs/price_editor/"> <schema id="org.gnucash.dialogs.price_editor" path="/apps/gnucash/dialogs/price_editor/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.print_checks" path="/apps/gnucash/dialogs/print_checks/"> <schema id="org.gnucash.dialogs.print_checks" path="/apps/gnucash/dialogs/print_checks/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.reset_warnings" path="/apps/gnucash/dialogs/reset_warnings/"> <schema id="org.gnucash.dialogs.reset_warnings" path="/apps/gnucash/dialogs/reset_warnings/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.tax_info" path="/apps/gnucash/dialogs/tax_info/"> <schema id="org.gnucash.dialogs.tax_info" path="/apps/gnucash/dialogs/tax_info/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.tip_of_the_day" path="/apps/gnucash/dialogs/tip_of_the_day/"> <schema id="org.gnucash.dialogs.tip_of_the_day" path="/apps/gnucash/dialogs/tip_of_the_day/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.window_reconcile" path="/apps/gnucash/dialogs/window_reconcile/"> <schema id="org.gnucash.dialogs.fincalc" path="/apps/gnucash/dialogs/fincalc/">
<key name="window_position" type="ai"> <key name="last-geometry" type="(iiii)">
<default>[]</default> <default>(-1,-1,-1,-1)</default>
<summary>Window position</summary> <summary>Last window position and size</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <description>This setting describes the size and position of the window when it was last closed.
</key> The numbers are the X and Y coordinates of the top left corner of the window
<key name="window_geometry" type="ai"> followed by the width and height of the window.</description>
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.find" path="/apps/gnucash/dialogs/find/"> <schema id="org.gnucash.dialogs.find" path="/apps/gnucash/dialogs/find/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="search_for_active_only" type="b"> <key name="search_for_active_only" type="b">
<default>false</default> <default>false</default>
<summary>Search only in active items</summary> <summary>Search only in active items</summary>
<description>This setting indicates whether to search in all items in the current class, or only in 'active' items in the current class.</description> <description>This setting indicates whether to search in all items in the current class, or only in 'active' items in the current class.</description>
</key> </key>
<key name="window_position" type="ai">
<default>[]</default>
<summary>Window position</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description>
</key>
<key name="window_geometry" type="ai">
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key>
</schema> </schema>
<schema id="org.gnucash.dialogs.export_accounts" path="/apps/gnucash/dialogs/export_accounts/"> <schema id="org.gnucash.dialogs.export_accounts" path="/apps/gnucash/dialogs/export_accounts/">
@ -207,6 +160,13 @@
</schema> </schema>
<schema id="org.gnucash.dialogs.edit_commodities" path="/apps/gnucash/dialogs/edit_commodities/"> <schema id="org.gnucash.dialogs.edit_commodities" path="/apps/gnucash/dialogs/edit_commodities/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="sort_column" type="as"> <key name="sort_column" type="as">
<default>[]</default> <default>[]</default>
<summary>Columns used for sorting</summary> <summary>Columns used for sorting</summary>
@ -217,17 +177,18 @@
<summary>Sort column ascending or descending</summary> <summary>Sort column ascending or descending</summary>
<description>This setting indicates how the key column is sorted. Possible values for this setting are 'ascending' and 'descending'.</description> <description>This setting indicates how the key column is sorted. Possible values for this setting are 'ascending' and 'descending'.</description>
</key> </key>
<key name="window_position" type="ai"> </schema>
<default>[]</default>
<summary>Window position</summary> <schema id="org.gnucash.dialogs.lot_viewer" path="/apps/gnucash/dialogs/lot_viewer/">
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description> <key name="last-geometry" type="(iiii)">
</key> <default>(-1,-1,-1,-1)</default>
<key name="window_geometry" type="ai"> <summary>Last window position and size</summary>
<default>[]</default> <description>This setting describes the size and position of the window when it was last closed.
<summary>Window size</summary> The numbers are the X and Y coordinates of the top left corner of the window
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description> followed by the width and height of the window.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.new_user" path="/apps/gnucash/dialogs/new_user/"> <schema id="org.gnucash.dialogs.new_user" path="/apps/gnucash/dialogs/new_user/">
<key name="first_startup" type="b"> <key name="first_startup" type="b">
<default>true</default> <default>true</default>
@ -235,23 +196,22 @@
<description>If active, the new user window will be shown. Otherwise it will not be shown.</description> <description>If active, the new user window will be shown. Otherwise it will not be shown.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.new_hierarchy" path="/apps/gnucash/dialogs/new_hierarchy/"> <schema id="org.gnucash.dialogs.new_hierarchy" path="/apps/gnucash/dialogs/new_hierarchy/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="show_on_new_file" type="b"> <key name="show_on_new_file" type="b">
<default>true</default> <default>true</default>
<summary>New hierarchy window on "New File"</summary> <summary>New hierarchy window on "New File"</summary>
<description>If active, the "New Hierarchy" window will be shown whenever the "New File" menu item is chosen. Otherwise it will not be shown.</description> <description>If active, the "New Hierarchy" window will be shown whenever the "New File" menu item is chosen. Otherwise it will not be shown.</description>
</key> </key>
<key name="window_position" type="ai">
<default>[]</default>
<summary>Window position</summary>
<description>This setting describes the last position of the window. The numbers are the X and Y coordinates of the top left corner of the window.</description>
</key>
<key name="window_geometry" type="ai">
<default>[]</default>
<summary>Window size</summary>
<description>This setting describes the size of the window when it was last closed. The numbers are the width and height of the window.</description>
</key>
</schema> </schema>
<schema id="org.gnucash.dialogs.search" path="/apps/gnucash/dialogs/search/"> <schema id="org.gnucash.dialogs.search" path="/apps/gnucash/dialogs/search/">
<key name="new_search_limit" type="d"> <key name="new_search_limit" type="d">
<default>1.0</default> <default>1.0</default>
@ -259,4 +219,14 @@
<description>Default to 'new search' if fewer than this number of items is returned</description> <description>Default to 'new search' if fewer than this number of items is returned</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.transfer" path="/apps/gnucash/dialogs/transfer/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
</schema>
</schemalist> </schemalist>

View File

@ -20,5 +20,12 @@
<summary>Always reconcile to today</summary> <summary>Always reconcile to today</summary>
<description>If active, always open the reconcile dialog using today's date for the statement date, regardless of previous reconciliations.</description> <description>If active, always open the reconcile dialog using today's date for the statement date, regardless of previous reconciliations.</description>
</key> </key>
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
</schema> </schema>
</schemalist> </schemalist>

View File

@ -3,13 +3,22 @@
<child name="since_last_run" schema="org.gnucash.dialogs.sxs.since_last_run"/> <child name="since_last_run" schema="org.gnucash.dialogs.sxs.since_last_run"/>
<child name="transaction_editor" schema="org.gnucash.dialogs.sxs.transaction_editor"/> <child name="transaction_editor" schema="org.gnucash.dialogs.sxs.transaction_editor"/>
</schema> </schema>
<schema id="org.gnucash.dialogs.sxs.since_last_run" path="/apps/gnucash/dialogs/scheduled_trans/since_last_run/"> <schema id="org.gnucash.dialogs.sxs.since_last_run" path="/apps/gnucash/dialogs/scheduled_trans/since_last_run/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="show_at_file_open" type="b"> <key name="show_at_file_open" type="b">
<default>true</default> <default>true</default>
<summary>Show "since last run" dialog when a file is opened.</summary> <summary>Show "since last run" dialog when a file is opened.</summary>
<description>This setting controls whether the scheduled transactions "since last run" dialog is shown automatically when a data file is opened. This includes the initial opening of the data file when GnuCash starts. If this setting is active, show the dialog, otherwise it is not shown.</description> <description>This setting controls whether the scheduled transactions "since last run" dialog is shown automatically when a data file is opened. This includes the initial opening of the data file when GnuCash starts. If this setting is active, show the dialog, otherwise it is not shown.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.sxs.transaction_editor" path="/apps/gnucash/dialogs/scheduled_trans/transaction_editor/"> <schema id="org.gnucash.dialogs.sxs.transaction_editor" path="/apps/gnucash/dialogs/scheduled_trans/transaction_editor/">
<key name="create_auto" type="b"> <key name="create_auto" type="b">
<default>false</default> <default>false</default>
@ -21,6 +30,13 @@
<summary>How many days in advance to notify the user.</summary> <summary>How many days in advance to notify the user.</summary>
<description>How many days in advance to notify the user.</description> <description>How many days in advance to notify the user.</description>
</key> </key>
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="notify" type="b"> <key name="notify" type="b">
<default>true</default> <default>true</default>
<summary>Set the "notify" flag by default</summary> <summary>Set the "notify" flag by default</summary>

View File

@ -1,14 +1,21 @@
<schemalist gettext-domain="GETTEXT_PACKAGE"> <schemalist gettext-domain="GETTEXT_PACKAGE">
<schema id="org.gnucash.dialogs.totd" path="/apps/gnucash/dialogs/tip_of_the_day/"> <schema id="org.gnucash.dialogs.totd" path="/apps/gnucash/dialogs/tip_of_the_day/">
<key name="show_at_startup" type="b">
<default>true</default>
<summary>Show "Tip Of The Day" at GnuCash start</summary>
<description>Enables the "Tip Of The Day" when GnuCash starts up. If active, the dialog will be shown. Otherwise it will not be shown.</description>
</key>
<key name="current_tip" type="i"> <key name="current_tip" type="i">
<default>0</default> <default>0</default>
<summary>The next tip to show.</summary> <summary>The next tip to show.</summary>
<description>The next tip to show.</description> <description>The next tip to show.</description>
</key> </key>
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="show_at_startup" type="b">
<default>true</default>
<summary>Show "Tip Of The Day" at GnuCash start</summary>
<description>Enables the "Tip Of The Day" when GnuCash starts up. If active, the dialog will be shown. Otherwise it will not be shown.</description>
</key>
</schema> </schema>
</schemalist> </schemalist>

View File

@ -69,6 +69,7 @@ typedef struct
} GNCReconcileViewClass; } GNCReconcileViewClass;
#define GCONF_RECONCILE_SECTION "dialogs/reconcile" #define GCONF_RECONCILE_SECTION "dialogs/reconcile"
#define GNC_PREFS_GROUP_RECONCILE "dialogs.reconcile"
/*********************************************************** /***********************************************************
* public functions * * public functions *

View File

@ -52,13 +52,13 @@
#include "gnc-gnome-utils.h" #include "gnc-gnome-utils.h"
#include "gnc-main-window.h" #include "gnc-main-window.h"
#include "gnc-plugin-page-register.h" #include "gnc-plugin-page-register.h"
#include "gnc-prefs.h"
#include "gnc-ui.h" #include "gnc-ui.h"
#include "gnc-ui-balances.h" #include "gnc-ui-balances.h"
#include "guile-util.h" #include "guile-util.h"
#include "reconcile-view.h" #include "reconcile-view.h"
#include "window-reconcile.h" #include "window-reconcile.h"
#define GCONF_SECTION "dialogs/window-reconcile"
#define WINDOW_RECONCILE_CM_CLASS "window-reconcile" #define WINDOW_RECONCILE_CM_CLASS "window-reconcile"
@ -1613,7 +1613,7 @@ close_handler (gpointer user_data)
{ {
RecnWindow *recnData = user_data; RecnWindow *recnData = user_data;
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(recnData->window)); gnc_save_window_size(GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW(recnData->window));
gtk_widget_destroy (recnData->window); gtk_widget_destroy (recnData->window);
} }
@ -1801,7 +1801,7 @@ recnWindowWithBalance (GtkWidget *parent, Account *account,
/* Force a reasonable starting size */ /* Force a reasonable starting size */
gtk_window_set_default_size(GTK_WINDOW(recnData->window), 800, 600); gtk_window_set_default_size(GTK_WINDOW(recnData->window), 800, 600);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(recnData->window)); gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW(recnData->window));
gtk_container_add(GTK_CONTAINER(frame), main_area); gtk_container_add(GTK_CONTAINER(frame), main_area);
gtk_container_set_border_width(GTK_CONTAINER(main_area), 10); gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);

View File

@ -52,13 +52,13 @@
#include "gnc-gnome-utils.h" #include "gnc-gnome-utils.h"
#include "gnc-main-window.h" #include "gnc-main-window.h"
#include "gnc-plugin-page-register2.h" #include "gnc-plugin-page-register2.h"
#include "gnc-prefs.h"
#include "gnc-ui.h" #include "gnc-ui.h"
#include "gnc-ui-balances.h" #include "gnc-ui-balances.h"
#include "guile-util.h" #include "guile-util.h"
#include "reconcile-view.h" #include "reconcile-view.h"
#include "window-reconcile2.h" #include "window-reconcile2.h"
#define GCONF_SECTION "dialogs/window-reconcile"
#define WINDOW_RECONCILE_CM_CLASS "window-reconcile" #define WINDOW_RECONCILE_CM_CLASS "window-reconcile"
@ -1613,7 +1613,7 @@ close_handler (gpointer user_data)
{ {
RecnWindow2 *recnData = user_data; RecnWindow2 *recnData = user_data;
gnc_save_window_size (GCONF_SECTION, GTK_WINDOW (recnData->window)); gnc_save_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW (recnData->window));
gtk_widget_destroy (recnData->window); gtk_widget_destroy (recnData->window);
} }
@ -1801,7 +1801,7 @@ recnWindow2WithBalance (GtkWidget *parent, Account *account,
/* Force a reasonable starting size */ /* Force a reasonable starting size */
gtk_window_set_default_size (GTK_WINDOW (recnData->window), 800, 600); gtk_window_set_default_size (GTK_WINDOW (recnData->window), 800, 600);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW (recnData->window)); gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW (recnData->window));
gtk_container_add(GTK_CONTAINER(frame), main_area); gtk_container_add(GTK_CONTAINER(frame), main_area);
gtk_container_set_border_width(GTK_CONTAINER(main_area), 10); gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);

View File

@ -62,7 +62,7 @@
/* This static indicates the debugging module that this .o belongs to. */ /* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_ASSISTANT; static QofLogModule log_module = GNC_MOD_ASSISTANT;
#define GCONF_SECTION "dialogs/ab_initial" #define GNC_PREFS_GROUP "dialogs.ab_initial"
#define ASSISTANT_AB_INITIAL_CM_CLASS "assistant-ab-initial" #define ASSISTANT_AB_INITIAL_CM_CLASS "assistant-ab-initial"
typedef struct _ABInitialInfo ABInitialInfo; typedef struct _ABInitialInfo ABInitialInfo;
@ -823,7 +823,7 @@ aai_close_handler(gpointer user_data)
{ {
ABInitialInfo *info = user_data; ABInitialInfo *info = user_data;
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->window));
gtk_widget_destroy(info->window); gtk_widget_destroy(info->window);
} }
@ -895,7 +895,7 @@ gnc_ab_initial_assistant(void)
selection = gtk_tree_view_get_selection(info->account_view); selection = gtk_tree_view_get_selection(info->account_view);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(info->window)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
g_signal_connect(info->account_view, "row-activated", g_signal_connect(info->account_view, "row-activated",
G_CALLBACK(account_list_clicked_cb), info); G_CALLBACK(account_list_clicked_cb), info);

View File

@ -56,7 +56,7 @@
#endif #endif
#define GWEN_GUI_CM_CLASS "dialog-hbcilog" #define GWEN_GUI_CM_CLASS "dialog-hbcilog"
#define GCONF_SECTION_CONNECTION GCONF_SECTION_AQBANKING "/connection_dialog" #define GNC_PREFS_GROUP_CONNECTION GNC_PREFS_GROUP_AQBANKING ".connection_dialog"
#define KEY_CLOSE_ON_FINISH "close_on_finish" #define KEY_CLOSE_ON_FINISH "close_on_finish"
#define KEY_REMEMBER_PIN "remember_pin" #define KEY_REMEMBER_PIN "remember_pin"
@ -614,7 +614,7 @@ reset_dialog(GncGWENGui *gui)
if (gui->parent) if (gui->parent)
gtk_window_set_transient_for(GTK_WINDOW(gui->dialog), gtk_window_set_transient_for(GTK_WINDOW(gui->dialog),
GTK_WINDOW(gui->parent)); GTK_WINDOW(gui->parent));
gnc_restore_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW(gui->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP_CONNECTION, GTK_WINDOW(gui->dialog));
gui->keep_alive = TRUE; gui->keep_alive = TRUE;
gui->state = INIT; gui->state = INIT;
@ -725,7 +725,7 @@ hide_dialog(GncGWENGui *gui)
NULL); NULL);
/* Remember size and position of the dialog */ /* Remember size and position of the dialog */
gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW(gui->dialog)); gnc_save_window_size(GNC_PREFS_GROUP_CONNECTION, GTK_WINDOW(gui->dialog));
/* Do not serve as GUI anymore */ /* Do not serve as GUI anymore */
gui->state = HIDDEN; gui->state = HIDDEN;

View File

@ -1,4 +1,14 @@
<schemalist gettext-domain="GETTEXT_PACKAGE"> <schemalist gettext-domain="GETTEXT_PACKAGE">
<schema id="org.gnucash.dialogs.ab_initial" path="/apps/gnucash/dialogs/ab_initial/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
</schema>
<schema id="org.gnucash.dialogs.import.hbci" path="/apps/gnucash/dialogs/import/hbci/"> <schema id="org.gnucash.dialogs.import.hbci" path="/apps/gnucash/dialogs/import/hbci/">
<key name="close_on_finish" type="b"> <key name="close_on_finish" type="b">
<default>true</default> <default>true</default>
@ -40,5 +50,16 @@
<summary>Last pathname used</summary> <summary>Last pathname used</summary>
<description>This field contains the last pathname used by this window. It will be used as the initial filename/pathname the next time this window is opened.</description> <description>This field contains the last pathname used by this window. It will be used as the initial filename/pathname the next time this window is opened.</description>
</key> </key>
<child name="connection_dialog" schema="org.gnucash.dialogs.import.hbci.connection_dialog"/>
</schema>
<schema id="org.gnucash.dialogs.import.hbci.connection_dialog" path="/apps/gnucash/dialogs/import/hbci/connection_dialog/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
</schema> </schema>
</schemalist> </schemalist>

View File

@ -842,7 +842,7 @@ csv_export_close_handler (gpointer user_data)
g_free(info->file_name); g_free(info->file_name);
g_free(info->starting_dir); g_free(info->starting_dir);
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->window));
gtk_widget_destroy (info->window); gtk_widget_destroy (info->window);
} }
@ -1004,7 +1004,7 @@ csv_export_assistant_create (CsvExportInfo *info)
g_signal_connect (G_OBJECT(window), "destroy", g_signal_connect (G_OBJECT(window), "destroy",
G_CALLBACK (csv_export_assistant_destroy_cb), info); G_CALLBACK (csv_export_assistant_destroy_cb), info);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(info->window)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
info->csva.paned = GTK_WIDGET(gtk_builder_get_object (builder, "paned")); info->csva.paned = GTK_WIDGET(gtk_builder_get_object (builder, "paned"));

View File

@ -1,14 +1,21 @@
<schemalist gettext-domain="GETTEXT_PACKAGE"> <schemalist gettext-domain="GETTEXT_PACKAGE">
<schema id="org.gnucash.dialogs.export.csv" path="/apps/gnucash/dialogs/export/csv/"> <schema id="org.gnucash.dialogs.export.csv" path="/apps/gnucash/dialogs/export/csv/">
<key name="paned_position" type="i"> <key name="last-geometry" type="(iiii)">
<default>0</default> <default>(-1,-1,-1,-1)</default>
<summary>Window geometry</summary> <summary>Last window position and size</summary>
<description>The position of paned window when it was last closed.</description> <description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key> </key>
<key name="last_path" type="s"> <key name="last_path" type="s">
<default>''</default> <default>''</default>
<summary>Last pathname used</summary> <summary>Last pathname used</summary>
<description>This field contains the last pathname used by this window. It will be used as the initial filename/pathname the next time this window is opened.</description> <description>This field contains the last pathname used by this window. It will be used as the initial filename/pathname the next time this window is opened.</description>
</key> </key>
<key name="paned_position" type="i">
<default>0</default>
<summary>Window geometry</summary>
<description>The position of paned window when it was last closed.</description>
</key>
</schema> </schema>
</schemalist> </schemalist>

View File

@ -41,7 +41,6 @@
#include "assistant-csv-account-import.h" #include "assistant-csv-account-import.h"
#include "csv-account-import.h" #include "csv-account-import.h"
#define GCONF_SECTION "dialogs/import/csv"
#define GNC_PREFS_GROUP "dialogs.import.csv" #define GNC_PREFS_GROUP "dialogs.import.csv"
#define ASSISTANT_CSV_IMPORT_CM_CLASS "assistant-csv-account-import" #define ASSISTANT_CSV_IMPORT_CM_CLASS "assistant-csv-account-import"
@ -540,7 +539,7 @@ csv_import_close_handler (gpointer user_data)
g_free(info->file_name); g_free(info->file_name);
g_string_free(info->regexp, TRUE); g_string_free(info->regexp, TRUE);
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->window));
gtk_widget_destroy (info->window); gtk_widget_destroy (info->window);
} }
@ -644,7 +643,7 @@ csv_import_assistant_create (CsvImportInfo *info)
g_signal_connect (G_OBJECT(window), "destroy", g_signal_connect (G_OBJECT(window), "destroy",
G_CALLBACK (csv_import_assistant_destroy_cb), info); G_CALLBACK (csv_import_assistant_destroy_cb), info);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(info->window)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
gtk_builder_connect_signals(builder, info); gtk_builder_connect_signals(builder, info);
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));

View File

@ -49,7 +49,6 @@
#include <goffice/gtk/go-charmap-sel.h> #include <goffice/gtk/go-charmap-sel.h>
#define MIN_COL_WIDTH 70 #define MIN_COL_WIDTH 70
#define GCONF_SECTION "dialogs/import/csv"
#define GNC_PREFS_GROUP "dialogs.import.csv" #define GNC_PREFS_GROUP "dialogs.import.csv"
#define ASSISTANT_CSV_IMPORT_TRANS_CM_CLASS "assistant-csv-trans-import" #define ASSISTANT_CSV_IMPORT_TRANS_CM_CLASS "assistant-csv-trans-import"
@ -1620,7 +1619,7 @@ csv_import_trans_close_handler (gpointer user_data)
if (!(info->gnc_csv_importer_gui == NULL)) if (!(info->gnc_csv_importer_gui == NULL))
info->gnc_csv_importer_gui = NULL; info->gnc_csv_importer_gui = NULL;
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->window));
gtk_widget_destroy (info->window); gtk_widget_destroy (info->window);
} }
@ -1816,7 +1815,7 @@ csv_import_trans_assistant_create (CsvImportTrans *info)
g_signal_connect (G_OBJECT(window), "destroy", g_signal_connect (G_OBJECT(window), "destroy",
G_CALLBACK (csv_import_trans_assistant_destroy_cb), info); G_CALLBACK (csv_import_trans_assistant_destroy_cb), info);
gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(info->window)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
gtk_builder_connect_signals(builder, info); gtk_builder_connect_signals(builder, info);
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));

View File

@ -1,5 +1,12 @@
<schemalist gettext-domain="GETTEXT_PACKAGE"> <schemalist gettext-domain="GETTEXT_PACKAGE">
<schema id="org.gnucash.dialogs.import.csv" path="/apps/gnucash/dialogs/import/csv/"> <schema id="org.gnucash.dialogs.import.csv" path="/apps/gnucash/dialogs/import/csv/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="last_path" type="s"> <key name="last_path" type="s">
<default>''</default> <default>''</default>
<summary>Last pathname used</summary> <summary>Last pathname used</summary>

View File

@ -41,7 +41,10 @@
<description>Enables the automatic creation of new commodities if any unknown commodity is encountered during import. Otherwise the user will be asked what to do with each unknown commodity.</description> <description>Enables the automatic creation of new commodities if any unknown commodity is encountered during import. Otherwise the user will be asked what to do with each unknown commodity.</description>
</key> </key>
<child name="account_matcher" schema="org.gnucash.dialogs.import.generic.account_matcher"/> <child name="account_matcher" schema="org.gnucash.dialogs.import.generic.account_matcher"/>
<child name="matcher_picker" schema="org.gnucash.dialogs.import.generic.matcher_picker"/>
<child name="transaction_list" schema="org.gnucash.dialogs.import.generic.transaction_list"/>
</schema> </schema>
<schema id="org.gnucash.dialogs.import.generic.account_matcher" path="/apps/gnucash/dialogs/import/generic_matcher/account_matcher/"> <schema id="org.gnucash.dialogs.import.generic.account_matcher" path="/apps/gnucash/dialogs/import/generic_matcher/account_matcher/">
<key name="account-code_visible" type="b"> <key name="account-code_visible" type="b">
<default>false</default> <default>false</default>
@ -54,4 +57,24 @@
<description>This setting stores the width of the given column in pixels.</description> <description>This setting stores the width of the given column in pixels.</description>
</key> </key>
</schema> </schema>
<schema id="org.gnucash.dialogs.import.generic.matcher_picker" path="/apps/gnucash/dialogs/import/generic_matcher/matcher_picker/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
</schema>
<schema id="org.gnucash.dialogs.import.generic.transaction_list" path="/apps/gnucash/dialogs/import/generic_matcher/transaction_list/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
</schema>
</schemalist> </schemalist>

View File

@ -50,7 +50,7 @@
#include "import-account-matcher.h" #include "import-account-matcher.h"
#include "app-utils/gnc-component-manager.h" #include "app-utils/gnc-component-manager.h"
#define GCONF_SECTION "dialogs/import/generic_matcher/transaction_list" #define GNC_PREFS_GROUP "dialogs.import.generic.transaction_list"
struct _main_matcher_info struct _main_matcher_info
{ {
@ -137,7 +137,7 @@ void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
if (!(info->dialog == NULL)) if (!(info->dialog == NULL))
{ {
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->dialog));
gnc_import_Settings_delete (info->user_settings); gnc_import_Settings_delete (info->user_settings);
gtk_widget_destroy (GTK_WIDGET (info->dialog)); gtk_widget_destroy (GTK_WIDGET (info->dialog));
} }
@ -574,7 +574,7 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
if (heading) if (heading)
gtk_label_set_text (GTK_LABEL (heading_label), heading); gtk_label_set_text (GTK_LABEL (heading_label), heading);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog)); gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->dialog));
gtk_widget_show_all (GTK_WIDGET (info->dialog)); gtk_widget_show_all (GTK_WIDGET (info->dialog));
info->transaction_processed_cb = NULL; info->transaction_processed_cb = NULL;

View File

@ -41,7 +41,7 @@
* Constants * * Constants *
\********************************************************************/ \********************************************************************/
#define GCONF_SECTION "dialogs/import/generic_matcher/match_picker" #define GNC_PREFS_GROUP "dialogs.import.generic.match_picker"
enum downloaded_cols enum downloaded_cols
{ {
@ -426,7 +426,7 @@ init_match_picker_gui(GNCImportMatchPicker * matcher)
", add_threshold:",matcher->add_threshold, ", add_threshold:",matcher->add_threshold,
", display_threshold:",matcher->display_threshold); */ ", display_threshold:",matcher->display_threshold); */
gnc_restore_window_size(GCONF_SECTION, gnc_restore_window_size(GNC_PREFS_GROUP,
GTK_WINDOW (matcher->transaction_matcher)); GTK_WINDOW (matcher->transaction_matcher));
gtk_widget_show(matcher->transaction_matcher); gtk_widget_show(matcher->transaction_matcher);
@ -462,7 +462,7 @@ gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info)
/*DEBUG("Right before run and close");*/ /*DEBUG("Right before run and close");*/
gtk_window_set_modal(GTK_WINDOW(matcher->transaction_matcher), TRUE); gtk_window_set_modal(GTK_WINDOW(matcher->transaction_matcher), TRUE);
response = gtk_dialog_run (GTK_DIALOG (matcher->transaction_matcher)); response = gtk_dialog_run (GTK_DIALOG (matcher->transaction_matcher));
gnc_save_window_size(GCONF_SECTION, gnc_save_window_size(GNC_PREFS_GROUP,
GTK_WINDOW (matcher->transaction_matcher)); GTK_WINDOW (matcher->transaction_matcher));
gtk_widget_destroy (matcher->transaction_matcher); gtk_widget_destroy (matcher->transaction_matcher);
/*DEBUG("Right after run and close");*/ /*DEBUG("Right after run and close");*/

View File

@ -3612,7 +3612,7 @@ gnc_ui_qif_import_assistant_make(QIFImportWindow *qif_win)
box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_picker_hbox")); 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); 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)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(qif_win->window));
g_signal_connect( qif_win->window, "destroy", g_signal_connect( qif_win->window, "destroy",
G_CALLBACK(gnc_ui_qif_import_assistant_destroy), qif_win ); G_CALLBACK(gnc_ui_qif_import_assistant_destroy), qif_win );
@ -3636,7 +3636,7 @@ gnc_ui_qif_import_assistant_close_handler( gpointer user_data )
{ {
QIFImportWindow *qif_win = user_data; QIFImportWindow *qif_win = user_data;
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(qif_win->window)); gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(qif_win->window));
gtk_widget_destroy( qif_win->window ); gtk_widget_destroy( qif_win->window );
} }

View File

@ -1,19 +1,26 @@
<schemalist gettext-domain="GETTEXT_PACKAGE"> <schemalist gettext-domain="GETTEXT_PACKAGE">
<schema id="org.gnucash.dialogs.import.qif" path="/apps/gnucash/dialogs/import/qif/"> <schema id="org.gnucash.dialogs.import.qif" path="/apps/gnucash/dialogs/import/qif/">
<key name="show_doc" type="b">
<default>true</default>
<summary>Show documentation</summary>
<description>Show some documentation-only pages in QIF Import assistant.</description>
</key>
<key name="default_status" type="s"> <key name="default_status" type="s">
<default>'not_cleared'</default> <default>'not_cleared'</default>
<summary>Default QIF transaction status</summary> <summary>Default QIF transaction status</summary>
<description>Default status for QIF transaction when not specified in QIF file.</description> <description>Default status for QIF transaction when not specified in QIF file.</description>
</key> </key>
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
<summary>Last window position and size</summary>
<description>This setting describes the size and position of the window when it was last closed.
The numbers are the X and Y coordinates of the top left corner of the window
followed by the width and height of the window.</description>
</key>
<key name="last_path" type="s"> <key name="last_path" type="s">
<default>''</default> <default>''</default>
<summary>Last pathname used</summary> <summary>Last pathname used</summary>
<description>This field contains the last pathname used by this window. It will be used as the initial filename/pathname the next time this window is opened.</description> <description>This field contains the last pathname used by this window. It will be used as the initial filename/pathname the next time this window is opened.</description>
</key> </key>
<key name="show_doc" type="b">
<default>true</default>
<summary>Show documentation</summary>
<description>Show some documentation-only pages in QIF Import assistant.</description>
</key>
</schema> </schema>
</schemalist> </schemalist>