diff --git a/src/app-utils/gnc-prefs-utils.c b/src/app-utils/gnc-prefs-utils.c index b4362cc566..28f390c0ef 100644 --- a/src/app-utils/gnc-prefs-utils.c +++ b/src/app-utils/gnc-prefs-utils.c @@ -40,9 +40,9 @@ static QofLogModule log_module = G_LOG_DOMAIN; * Initialization * ***************************************************************/ static void -file_retain_changed_cb(GConfEntry *entry, gpointer user_data) +file_retain_changed_cb(gpointer gsettings, gchar *key, gpointer user_data) { - gint days = (int)gnc_gconf_get_float(GCONF_GENERAL, KEY_RETAIN_DAYS, NULL); + gint days = (int)gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_DAYS); gnc_prefs_set_file_retention_days (days); } @@ -82,13 +82,14 @@ void gnc_prefs_init (void) gnc_gsettings_load_backend(); /* Add hooks to update core preferences whenever the associated gconf key changes */ - gnc_gconf_general_register_cb(KEY_RETAIN_DAYS, file_retain_changed_cb, NULL); + gnc_prefs_register_cb(GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_DAYS, + (GCallback) file_retain_changed_cb, NULL); gnc_gconf_general_register_cb(KEY_RETAIN_TYPE, file_retain_type_changed_cb, NULL); gnc_prefs_register_cb(GNC_PREFS_GROUP_GENERAL, GNC_PREF_FILE_COMPRESSION, - (GCallback) file_compression_changed_cb, NULL); + (GCallback) file_compression_changed_cb, NULL); /* Call the hooks once manually to initialize the core preferences */ - file_retain_changed_cb (NULL, NULL); + file_retain_changed_cb (NULL, NULL, NULL); file_retain_type_changed_cb (NULL, NULL); file_compression_changed_cb (NULL, NULL, NULL); diff --git a/src/app-utils/gnc-ui-util.c b/src/app-utils/gnc-ui-util.c index e133cd4b78..914e014a99 100644 --- a/src/app-utils/gnc-ui-util.c +++ b/src/app-utils/gnc-ui-util.c @@ -2279,16 +2279,18 @@ xaccParseAmountExtended (const char * in_str, gboolean monetary, /* enable/disable the auto_decimal_enabled option */ static void -gnc_set_auto_decimal_enabled (GSettings *settings, gchar *key, gpointer user_data) +gnc_set_auto_decimal_enabled (gpointer settings, gchar *key, gpointer user_data) { - auto_decimal_enabled = g_settings_get_boolean (settings, key); + auto_decimal_enabled = + gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_AUTO_DECIMAL_POINT); } /* set the number of auto decimal places to use */ static void -gnc_set_auto_decimal_places (GSettings *settings, gchar *key, gpointer user_data) +gnc_set_auto_decimal_places (gpointer settings, gchar *key, gpointer user_data) { - auto_decimal_places = g_settings_get_int (settings, key); + auto_decimal_places = + gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_AUTO_DECIMAL_PLACES); } static void diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c index 42fc3196aa..7c4acb95a1 100644 --- a/src/business/business-gnome/dialog-invoice.c +++ b/src/business/business-gnome/dialog-invoice.c @@ -36,7 +36,6 @@ #include "dialog-utils.h" #include "gnc-component-manager.h" #include "gnc-ui.h" -#include "gnc-gconf-utils.h" #include "gnc-gui-query.h" #include "gnc-prefs.h" #include "gnc-ui-util.h" @@ -89,6 +88,7 @@ #define GNC_PREFS_GROUP_SEARCH "dialogs.business.invoice_search" #define GNC_PREF_NOTIFY_WHEN_DUE "notify_when_due" #define GNC_PREF_ACCUM_SPLITS "accumulate_splits" +#define GNC_PREF_DAYS_IN_ADVANCE "days_in_advance" #define LAST_POSTED_TO_ACCT "last-posted-to-acct" @@ -3217,7 +3217,7 @@ gnc_invoice_remind_bills_due (void) if (!gnc_current_session_exist()) return; book = qof_session_get_book(gnc_get_current_session()); - days = gnc_gconf_get_float(GCONF_SECTION_BILL, "days_in_advance", NULL); + days = gnc_prefs_get_float(GNC_PREFS_GROUP_BILL, GNC_PREF_DAYS_IN_ADVANCE); gnc_invoice_show_bills_due(book, days); } diff --git a/src/business/business-gnome/gtkbuilder/business-prefs.glade b/src/business/business-gnome/gtkbuilder/business-prefs.glade index 41c09b874c..9f0704cf94 100644 --- a/src/business/business-gnome/gtkbuilder/business-prefs.glade +++ b/src/business/business-gnome/gtkbuilder/business-prefs.glade @@ -65,7 +65,7 @@ - + True True True @@ -97,7 +97,7 @@ 0 _Days in advance: True - gconf/dialogs/business/bill/days_in_advance + pref/dialogs.business.bill/days_in_advance 2 diff --git a/src/gnome-utils/dialog-preferences.c b/src/gnome-utils/dialog-preferences.c index 52942bbc55..5bb5988122 100644 --- a/src/gnome-utils/dialog-preferences.c +++ b/src/gnome-utils/dialog-preferences.c @@ -752,79 +752,6 @@ gnc_prefs_connect_radio_button_gconf (GtkRadioButton *button) /****************************************************************************/ -/** The user updated a spin button. Update gconf. Spin button - * choices are stored as a float. - * - * @internal - * - * @param button A pointer to the spin button that was clicked. - * - * @param user_data Unused. - */ -static void -gnc_prefs_spin_button_user_cb_gconf (GtkSpinButton *spin, - gpointer user_data) -{ - const gchar *name; - gdouble value; - - g_return_if_fail(GTK_IS_SPIN_BUTTON(spin)); - name = gtk_buildable_get_name(GTK_BUILDABLE(spin)) + PREFIX_LEN; - value = gtk_spin_button_get_value(spin); - DEBUG("Spin button %s has value %f", name, value); - gnc_gconf_set_float(name, NULL, value, NULL); -} - - -/** A spin button choice was updated in gconf. Update the user - * visible dialog. - * - * @internal - * - * @param button A pointer to the spin button that changed. - * - * @param value The new value of the spin button. - */ -static void -gnc_prefs_spin_button_gconf_cb_gconf (GtkSpinButton *spin, - gdouble value) -{ - g_return_if_fail(GTK_IS_SPIN_BUTTON(spin)); - ENTER("button %p, value %f", spin, value); - g_signal_handlers_block_by_func(G_OBJECT(spin), - G_CALLBACK(gnc_prefs_spin_button_user_cb_gconf), NULL); - gtk_spin_button_set_value(spin, value); - g_signal_handlers_unblock_by_func(G_OBJECT(spin), - G_CALLBACK(gnc_prefs_spin_button_user_cb_gconf), NULL); - LEAVE(" "); -} - - -/** Connect a spin button widget to the user callback function. Set - * the starting state of the button from its value in gconf. - * - * @internal - * - * @param button A pointer to the spin button that should be - * connected. - */ -static void -gnc_prefs_connect_spin_button_gconf (GtkSpinButton *spin) -{ - const gchar *name; - gdouble value; - - g_return_if_fail(GTK_IS_SPIN_BUTTON(spin)); - name = gtk_buildable_get_name(GTK_BUILDABLE(spin)) + PREFIX_LEN; - value = gnc_gconf_get_float(name, NULL, NULL); - gtk_spin_button_set_value(spin, value); - DEBUG(" Spin button %s has initial value %f", name, value); - g_signal_connect(G_OBJECT(spin), "value-changed", - G_CALLBACK(gnc_prefs_spin_button_user_cb_gconf), NULL); -} - -/****************************************************************************/ - /** The user changed a combo box. Update gconf. Combo box * choices are stored as an int. * @@ -1307,6 +1234,35 @@ gnc_prefs_connect_check_button (GtkCheckButton *button) g_free (pref); } +/****************************************************************************/ + +/** Connect a GtkSpinButton widget to its stored value in the preferences database. + * + * @internal + * + * @param button A pointer to the spin button that should be + * connected. + */ +static void +gnc_prefs_connect_spin_button (GtkSpinButton *spin) +{ + gchar *group, *pref; + gdouble value; + + g_return_if_fail(GTK_IS_SPIN_BUTTON(spin)); + + gnc_prefs_split_widget_name (gtk_buildable_get_name(GTK_BUILDABLE(spin)), &group, &pref); + +// value = gnc_prefs_get_float (group, pref); +// gtk_spin_button_set_value(spin, value); +// DEBUG(" Spin button %s/%s has initial value %f", group, pref, value); + + gnc_prefs_bind (group, pref, G_OBJECT (spin), "value"); + + g_free (group); + g_free (pref); +} + /****************************************************************************/ @@ -1382,11 +1338,6 @@ gnc_prefs_connect_one_gconf (const gchar *name, DEBUG(" %s - radio button", name); gnc_prefs_connect_radio_button_gconf(GTK_RADIO_BUTTON(widget)); } - else if (GTK_IS_SPIN_BUTTON(widget)) - { - DEBUG(" %s - spin button", name); - gnc_prefs_connect_spin_button_gconf(GTK_SPIN_BUTTON(widget)); - } else if (GTK_IS_COMBO_BOX(widget)) { DEBUG(" %s - combo box", name); @@ -1460,6 +1411,11 @@ gnc_prefs_connect_one (const gchar *name, DEBUG(" %s - check button", name); gnc_prefs_connect_check_button(GTK_CHECK_BUTTON(widget)); } + else if (GTK_IS_SPIN_BUTTON(widget)) + { + DEBUG(" %s - spin button", name); + gnc_prefs_connect_spin_button(GTK_SPIN_BUTTON(widget)); + } else { DEBUG(" %s - unsupported %s", name, @@ -1713,12 +1669,6 @@ gnc_preferences_gconf_changed (GConfClient *client, DEBUG("widget %p - radio button", widget); gnc_prefs_radio_button_gconf_cb_gconf(GTK_RADIO_BUTTON(widget)); } - else if (GTK_IS_SPIN_BUTTON(widget)) - { - DEBUG("widget %p - spin button", widget); - gnc_prefs_spin_button_gconf_cb_gconf(GTK_SPIN_BUTTON(widget), - gconf_value_get_float(entry->value)); - } else if (GTK_IS_COMBO_BOX(widget)) { DEBUG("widget %p - combo_box", widget); diff --git a/src/gnome-utils/gnc-autosave.c b/src/gnome-utils/gnc-autosave.c index 0ed4a16bd0..0811803745 100644 --- a/src/gnome-utils/gnc-autosave.c +++ b/src/gnome-utils/gnc-autosave.c @@ -37,7 +37,7 @@ #include "gnc-gui-query.h" #define GNC_PREF_AUTOSAVE_SHOW_EXPLANATION "autosave_show_explanation" -#define KEY_AUTOSAVE_INTERVAL "autosave_interval_minutes" +#define GNC_PREF_AUTOSAVE_INTERVAL "autosave_interval_minutes" #define AUTOSAVE_SOURCE_ID "autosave_source_id" #ifdef G_LOG_DOMAIN @@ -80,7 +80,7 @@ static gboolean autosave_confirm(GtkWidget *toplevel) { GtkWidget *dialog; guint interval_mins = - gnc_gconf_get_float(GCONF_GENERAL, KEY_AUTOSAVE_INTERVAL, NULL); + gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_AUTOSAVE_INTERVAL); gboolean switch_off_autosave, show_expl_again, save_now; gint response; @@ -158,7 +158,7 @@ static gboolean autosave_confirm(GtkWidget *toplevel) /* Should we switch off autosave? */ if (switch_off_autosave) { - gnc_gconf_set_float(GCONF_GENERAL, KEY_AUTOSAVE_INTERVAL, 0, NULL); + gnc_prefs_set_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_AUTOSAVE_INTERVAL, 0); g_debug("autosave_timeout_cb: User chose to disable auto-save.\n"); } @@ -253,7 +253,7 @@ void gnc_autosave_remove_timer(QofBook *book) static void gnc_autosave_add_timer(QofBook *book) { guint interval_mins = - gnc_gconf_get_float(GCONF_GENERAL, KEY_AUTOSAVE_INTERVAL, NULL); + gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_AUTOSAVE_INTERVAL); /* Interval zero means auto-save is turned off. */ if ( interval_mins > 0 diff --git a/src/gnome-utils/gnc-gnome-utils.c b/src/gnome-utils/gnc-gnome-utils.c index 399001fdfe..86d3ebda90 100644 --- a/src/gnome-utils/gnc-gnome-utils.c +++ b/src/gnome-utils/gnc-gnome-utils.c @@ -168,8 +168,8 @@ gnc_configure_date_completion (void) { char *date_completion = gnc_gconf_get_string(GCONF_GENERAL, KEY_DATE_COMPLETION, NULL); - int backmonths = gnc_gconf_get_float(GCONF_GENERAL, - KEY_DATE_BACKMONTHS, NULL); + int backmonths = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, + GNC_PREF_DATE_BACKMONTHS); QofDateCompletion dc; if (backmonths < 0) @@ -196,7 +196,7 @@ gnc_configure_date_completion (void) dc = QOF_DATE_COMPLETION_THISYEAR; backmonths = 6; gnc_gconf_set_string (GCONF_GENERAL, KEY_DATE_COMPLETION, "thisyear", NULL); - gnc_gconf_set_float (GCONF_GENERAL, KEY_DATE_BACKMONTHS, 6.0, NULL); + gnc_prefs_set_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_DATE_BACKMONTHS, 6.0); } qof_date_completion_set(dc, backmonths); @@ -647,8 +647,10 @@ gnc_gui_init(void) KEY_DATE_FORMAT, (GncGconfGeneralCb)gnc_configure_date_format, NULL); gnc_gconf_general_register_cb( KEY_DATE_COMPLETION, (GncGconfGeneralCb)gnc_configure_date_completion, NULL); - gnc_gconf_general_register_cb( - KEY_DATE_BACKMONTHS, (GncGconfGeneralCb)gnc_configure_date_completion, NULL); + gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, + GNC_PREF_DATE_BACKMONTHS, + gnc_configure_date_completion, + NULL); gnc_gconf_general_register_any_cb( (GncGconfGeneralAnyCb)gnc_gui_refresh_all, NULL); diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index d99b26ccf1..e0b5cb118e 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -96,7 +96,7 @@ enum #define GNC_PREF_SHOW_CLOSE_BUTTON "tab_close_buttons" #define GNC_PREF_TAB_NEXT_RECENT "tab_next_recent" #define KEY_TAB_POSITION "tab_position" -#define KEY_TAB_WIDTH "tab_width" +#define GNC_PREF_TAB_WIDTH "tab_width" #define GNC_PREF_TAB_COLOR "show_account_color_tabs" #define GNC_MAIN_WINDOW_NAME "GncMainWindow" @@ -1883,8 +1883,9 @@ gnc_main_window_update_tab_close_one_page (GncPluginPage *page, * * @internal * - * @param entry A pointer to the GConfEntry which describes the new - * state of whether close buttons should be visible on notebook tabs. + * @param prefs Unused. + * + * @param pref Unused. * * @param user_data Unused. */ @@ -1947,13 +1948,14 @@ gnc_main_window_update_tab_color_one_page (GncPluginPage *page, * * @internal * - * @param entry A pointer to the GConfEntry which describes the new - * state of whether the account color should be visible on notebook tabs. + * @param prefs Unused. + * + * @param pref Name of the preference that was changed. * * @param user_data GncMainWindow. */ static void -gnc_main_window_update_tab_color (gpointer gsettings, gchar *key, gpointer user_data) +gnc_main_window_update_tab_color (gpointer gsettings, gchar *pref, gpointer user_data) { GncMainWindowPrivate *priv; GncMainWindow *window; @@ -1962,7 +1964,7 @@ gnc_main_window_update_tab_color (gpointer gsettings, gchar *key, gpointer user_ g_return_if_fail(GNC_IS_MAIN_WINDOW(user_data)); window = user_data; priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); - if (g_strcmp0 (GNC_PREF_TAB_COLOR, key) == 0) + if (g_strcmp0 (GNC_PREF_TAB_COLOR, pref) == 0) priv->show_color_tabs = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_COLOR); gnc_main_window_foreach_page (gnc_main_window_update_tab_color_one_page, window); LEAVE(" "); @@ -1972,7 +1974,7 @@ gnc_main_window_update_tab_color (gpointer gsettings, gchar *key, gpointer user_ /** Update the width of the label in the tab of a notebook page. This * function adjusts both the width and the ellipsize mode so that the tab * label looks correct. The special check for a zero value handles the - * case where a user hasn't set a tab width and the gconf default isn't + * case where a user hasn't set a tab width and the preference default isn't * detected. * * @internal @@ -2016,18 +2018,19 @@ gnc_main_window_update_tab_width_one_page (GncPluginPage *page, * * @internal * - * @param entry A pointer to the GConfEntry which describes the new - * size of the tab label width. + * @param prefs Unused. + * + * @param pref Unused. * * @param user_data Unused. */ static void -gnc_main_window_update_tab_width (GConfEntry *entry, gpointer user_data) +gnc_main_window_update_tab_width (gpointer prefs, gchar *pref, gpointer user_data) { gint new_value; ENTER(" "); - new_value = gconf_value_get_float(entry->value); + new_value = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH); gnc_main_window_foreach_page( gnc_main_window_update_tab_width_one_page, &new_value); @@ -2435,9 +2438,10 @@ gnc_main_window_class_init (GncMainWindowClass *klass) GNC_PREF_SHOW_CLOSE_BUTTON, gnc_main_window_update_tab_close, NULL); - gnc_gconf_general_register_cb (KEY_TAB_WIDTH, - gnc_main_window_update_tab_width, - NULL); + gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, + GNC_PREF_TAB_WIDTH, + gnc_main_window_update_tab_width, + NULL); gnc_hook_add_dangler(HOOK_BOOK_SAVED, (GFunc)gnc_main_window_update_all_titles, NULL); @@ -2468,7 +2472,7 @@ gnc_main_window_init (GncMainWindow *window, priv->event_handler_id = qof_event_register_handler(gnc_main_window_event_handler, window); - /* Get the show_color_tabs value from gconf */ + /* Get the show_color_tabs value preference */ priv->show_color_tabs = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_COLOR); gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, @@ -2829,7 +2833,7 @@ gnc_main_window_open_page (GncMainWindow *window, /* * The page tab. */ - width = gnc_gconf_get_float(GCONF_GENERAL, KEY_TAB_WIDTH, NULL); + width = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH); icon = GNC_PLUGIN_PAGE_GET_CLASS(page)->tab_icon; label = gtk_label_new (gnc_plugin_page_get_page_name(page)); if (width != 0) diff --git a/src/gnome-utils/gnc-tree-view-split-reg.c b/src/gnome-utils/gnc-tree-view-split-reg.c index 0fcec3ed5f..345ce78a0f 100644 --- a/src/gnome-utils/gnc-tree-view-split-reg.c +++ b/src/gnome-utils/gnc-tree-view-split-reg.c @@ -39,7 +39,6 @@ #include "gnc-tree-util-split-reg.h" #include "gnc-ui.h" #include "dialog-utils.h" -#include "gnc-gconf-utils.h" #include "gnc-prefs.h" #include "Transaction.h" #include "engine-helpers.h" @@ -295,6 +294,7 @@ struct GncTreeViewSplitRegPrivate #define GNC_PREF_SHOW_EXTRA_DATES_ON_SEL "show_extra_dates_on_selection" #define GNC_PREF_SHOW_CAL_BUTTONS "show_calendar_buttons" #define GNC_PREF_SEL_TO_BLANK_ON_EXPAND "selection_to_blank_on_expand" +#define GNC_PREF_KEY_LENGTH "key_length" /* This could be a preference setting, show currency / commodity symbols */ #define SHOW_SYMBOL FALSE @@ -478,7 +478,7 @@ gnc_tree_view_split_reg_init (GncTreeViewSplitReg *view) view->show_extra_dates = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_EXTRA_DATES); view->priv->show_extra_dates_on_selection = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_EXTRA_DATES_ON_SEL); view->priv->selection_to_blank_on_expand = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SEL_TO_BLANK_ON_EXPAND); - view->priv->key_length = gnc_gconf_get_float(GCONF_GENERAL_REGISTER, "key_length", NULL); + view->priv->key_length = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_KEY_LENGTH); view->priv->acct_short_names = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_LEAF_ACCT_NAMES); view->priv->negative_in_red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED); @@ -567,7 +567,7 @@ gnc_tree_view_split_reg_finalize (GObject *object) /* Update internal settings based on preferences */ void -gnc_tree_view_split_reg_refresh_from_gconf (GncTreeViewSplitReg *view) +gnc_tree_view_split_reg_refresh_from_prefs (GncTreeViewSplitReg *view) { GncTreeModelSplitReg *model; diff --git a/src/gnome-utils/gnc-tree-view-split-reg.h b/src/gnome-utils/gnc-tree-view-split-reg.h index a81ead7648..97ec903e7e 100644 --- a/src/gnome-utils/gnc-tree-view-split-reg.h +++ b/src/gnome-utils/gnc-tree-view-split-reg.h @@ -139,7 +139,7 @@ void gnc_tree_view_split_reg_set_uiupdate_cb (GncTreeViewSplitReg *view, GFunc c gboolean gnc_tree_view_split_reg_call_uiupdate_cb(GncTreeViewSplitReg *view); -void gnc_tree_view_split_reg_refresh_from_gconf (GncTreeViewSplitReg *view); +void gnc_tree_view_split_reg_refresh_from_prefs (GncTreeViewSplitReg *view); GtkWidget * gnc_tree_view_split_reg_get_parent (GncTreeViewSplitReg *view); diff --git a/src/gnome-utils/gtkbuilder/dialog-preferences.glade b/src/gnome-utils/gtkbuilder/dialog-preferences.glade index cd4b1c03f6..168fe216af 100644 --- a/src/gnome-utils/gtkbuilder/dialog-preferences.glade +++ b/src/gnome-utils/gtkbuilder/dialog-preferences.glade @@ -1392,7 +1392,7 @@ many months before the current month: - + True True True @@ -1610,7 +1610,7 @@ many months before the current month: False 6 - + True True True @@ -1728,7 +1728,7 @@ many months before the current month: 0 _Decimal places: True - gconf/general/auto_decimal_places + pref/general/auto_decimal_places 9 @@ -1739,7 +1739,7 @@ many months before the current month: - + True True True @@ -1855,7 +1855,7 @@ many months before the current month: 0 New search _limit: True - gconf/dialogs/search/new_search_limit + pref/dialogs.search/new_search_limit 21 @@ -1866,7 +1866,7 @@ many months before the current month: - + True True True @@ -1918,7 +1918,7 @@ many months before the current month: 0 Auto-save time _interval: True - gconf/general/autosave_interval_minutes + pref/general/autosave_interval_minutes 14 @@ -1934,7 +1934,7 @@ many months before the current month: False 6 - + True True True @@ -2893,7 +2893,7 @@ many months before the current month: 0 Number of _transactions: True - gconf/general/register/max_transactions + pref/general.register/max_transactions 9 @@ -2904,7 +2904,7 @@ many months before the current month: - + True True True @@ -3001,7 +3001,7 @@ many months before the current month: 0 Number of _characters for auto complete: True - gconf/general/register/key_length + pref/general.register/key_length 10 @@ -3012,7 +3012,7 @@ many months before the current month: - + True True True @@ -3836,7 +3836,7 @@ many months before the current month: True False - + True True True @@ -3921,7 +3921,7 @@ many months before the current month: 999999 - 1 + 0 1 10 diff --git a/src/gnome/dialog-print-check.c b/src/gnome/dialog-print-check.c index e995ee4ef8..a547d6c5de 100644 --- a/src/gnome/dialog-print-check.c +++ b/src/gnome/dialog-print-check.c @@ -72,22 +72,22 @@ G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks"; #define KEY_CHECK_POSITION "check_position" #define KEY_FIRST_PAGE_COUNT "first_page_count" #define KEY_DATE_FORMAT_USER "date_format_custom" -#define KEY_CUSTOM_PAYEE "custom_payee" -#define KEY_CUSTOM_DATE "custom_date" -#define KEY_CUSTOM_WORDS "custom_amount_words" -#define KEY_CUSTOM_NUMBER "custom_amount_number" -#define KEY_CUSTOM_ADDRESS "custom_address" -#define KEY_CUSTOM_NOTES "custom_memo" /* historically misnamed */ -#define KEY_CUSTOM_MEMO "custom_memo2" -#define KEY_CUSTOM_TRANSLATION "custom_translation" -#define KEY_CUSTOM_ROTATION "custom_rotation" +#define GNC_PREF_CUSTOM_PAYEE "custom_payee" +#define GNC_PREF_CUSTOM_DATE "custom_date" +#define GNC_PREF_CUSTOM_WORDS "custom_amount_words" +#define GNC_PREF_CUSTOM_NUMBER "custom_amount_number" +#define GNC_PREF_CUSTOM_ADDRESS "custom_address" +#define GNC_PREF_CUSTOM_NOTES "custom_notes" +#define GNC_PREF_CUSTOM_MEMO "custom_memo" +#define GNC_PREF_CUSTOM_TRANSLATION "custom_translation" +#define GNC_PREF_CUSTOM_ROTATION "custom_rotation" #define KEY_CUSTOM_UNITS "custom_units" #define GNC_PREF_PRINT_DATE_FMT "print_date_format" #define GNC_PREF_DEFAULT_FONT "default_font" #define GNC_PREF_BLOCKING_CHARS "blocking_chars" -#define KEY_SPLITS_AMOUNT "splits_amount" -#define KEY_SPLITS_MEMO "splits_memo" -#define KEY_SPLITS_ACCOUNT "splits_account" +#define GNC_PREF_SPLITS_AMOUNT "splits_amount" +#define GNC_PREF_SPLITS_MEMO "splits_memo" +#define GNC_PREF_SPLITS_ACCOUNT "splits_account" #define DEFAULT_FONT "sans 12" @@ -357,39 +357,30 @@ find_existing_format (GtkListStore *store, gchar *guid, GtkTreeIter *iter_out) /* This function is used by the custom format dialog to save position values - * to the GConf database. + * in the preferences database. */ static void -save_float_pair (const char *section, const char *key, double a, double b) +save_float_pair (const char *group, const char *pref, double a, double b) { - GSList *coord_list = NULL; - - coord_list = g_slist_append(coord_list, &a); - coord_list = g_slist_append(coord_list, &b); - gnc_gconf_set_list(section, key, GCONF_VALUE_FLOAT, coord_list, NULL); - g_slist_free(coord_list); + GVariant *coords = g_variant_new ("(dd)", a, b); + gnc_prefs_set_value (group, pref, coords); } /* This function is used by the custom format dialog to restore position - * values from the GConf database. + * values from the preferences database. */ static void -get_float_pair (const char *section, const char *key, double *a, double *b) +get_float_pair (const char *group, const char *pref, double *a, double *b) { - GSList *coord_list; + GVariant *coords = gnc_prefs_get_value (group, pref); - coord_list = gnc_gconf_get_list (section, key, GCONF_VALUE_FLOAT, NULL); - if (NULL == coord_list) - { - *a = 0; - *b = 0; - return; - } + *a = 0; + *b = 0; - *a = *(gdouble*)g_slist_nth_data(coord_list, 0); - *b = *(gdouble*)g_slist_nth_data(coord_list, 1); - g_slist_free(coord_list); + if (g_variant_is_of_type (coords, (const GVariantType *) "(dd)") ) + g_variant_get (coords, "(dd)", a, b); + g_variant_unref (coords); } @@ -594,42 +585,41 @@ gnc_ui_print_save_dialog(PrintCheckDialog *pcd) } /* Custom format page */ - save_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, gtk_spin_button_get_value(pcd->payee_x), gtk_spin_button_get_value(pcd->payee_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, gtk_spin_button_get_value(pcd->date_x), gtk_spin_button_get_value(pcd->date_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, gtk_spin_button_get_value(pcd->words_x), gtk_spin_button_get_value(pcd->words_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, gtk_spin_button_get_value(pcd->number_x), gtk_spin_button_get_value(pcd->number_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, gtk_spin_button_get_value(pcd->notes_x), gtk_spin_button_get_value(pcd->notes_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, gtk_spin_button_get_value(pcd->memo_x), gtk_spin_button_get_value(pcd->memo_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, gtk_spin_button_get_value(pcd->address_x), gtk_spin_button_get_value(pcd->address_y)); - save_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, gtk_spin_button_get_value(pcd->splits_amount_x), gtk_spin_button_get_value(pcd->splits_amount_y)); - save_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, gtk_spin_button_get_value(pcd->splits_memo_x), gtk_spin_button_get_value(pcd->splits_memo_y)); - save_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, gtk_spin_button_get_value(pcd->splits_account_x), gtk_spin_button_get_value(pcd->splits_account_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, gtk_spin_button_get_value(pcd->translation_x), gtk_spin_button_get_value(pcd->translation_y)); - gnc_gconf_set_float(GCONF_SECTION, KEY_CUSTOM_ROTATION, - gtk_spin_button_get_value(pcd->check_rotation), - NULL); + gnc_prefs_set_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION, + gtk_spin_button_get_value(pcd->check_rotation)); active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->units_combobox)); gnc_gconf_set_int(GCONF_SECTION, KEY_CUSTOM_UNITS, active, NULL); } @@ -690,41 +680,41 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) } /* Custom format page */ - get_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, &x, &y); gtk_spin_button_set_value(pcd->payee_x, x); gtk_spin_button_set_value(pcd->payee_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, &x, &y); gtk_spin_button_set_value(pcd->date_x, x); gtk_spin_button_set_value(pcd->date_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, &x, &y); gtk_spin_button_set_value(pcd->words_x, x); gtk_spin_button_set_value(pcd->words_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, &x, &y); gtk_spin_button_set_value(pcd->number_x, x); gtk_spin_button_set_value(pcd->number_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, &x, &y); gtk_spin_button_set_value(pcd->address_x, x); gtk_spin_button_set_value(pcd->address_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, &x, &y); gtk_spin_button_set_value(pcd->notes_x, x); gtk_spin_button_set_value(pcd->notes_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, &x, &y); gtk_spin_button_set_value(pcd->memo_x, x); gtk_spin_button_set_value(pcd->memo_y, y); - get_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, &x, &y); gtk_spin_button_set_value(pcd->splits_amount_x, x); gtk_spin_button_set_value(pcd->splits_amount_y, y); - get_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, &x, &y); gtk_spin_button_set_value(pcd->splits_memo_x, x); gtk_spin_button_set_value(pcd->splits_memo_y, y); - get_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, &x, &y); gtk_spin_button_set_value(pcd->splits_account_x, x); gtk_spin_button_set_value(pcd->splits_account_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, &x, &y); gtk_spin_button_set_value(pcd->translation_x, x); gtk_spin_button_set_value(pcd->translation_y, y); - x = gnc_gconf_get_float(GCONF_SECTION, KEY_CUSTOM_ROTATION, NULL); + x = gnc_prefs_get_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION); gtk_spin_button_set_value(pcd->check_rotation, x); active = gnc_gconf_get_int(GCONF_SECTION, KEY_CUSTOM_UNITS, NULL); gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->units_combobox), active); diff --git a/src/gnome/dialog-print-check2.c b/src/gnome/dialog-print-check2.c index a65d2bb358..a51d901997 100644 --- a/src/gnome/dialog-print-check2.c +++ b/src/gnome/dialog-print-check2.c @@ -72,22 +72,22 @@ G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks"; #define KEY_CHECK_POSITION "check_position" #define KEY_FIRST_PAGE_COUNT "first_page_count" #define KEY_DATE_FORMAT_USER "date_format_custom" -#define KEY_CUSTOM_PAYEE "custom_payee" -#define KEY_CUSTOM_DATE "custom_date" -#define KEY_CUSTOM_WORDS "custom_amount_words" -#define KEY_CUSTOM_NUMBER "custom_amount_number" -#define KEY_CUSTOM_ADDRESS "custom_address" -#define KEY_CUSTOM_NOTES "custom_memo" /* historically misnamed */ -#define KEY_CUSTOM_MEMO "custom_memo2" -#define KEY_CUSTOM_TRANSLATION "custom_translation" -#define KEY_CUSTOM_ROTATION "custom_rotation" +#define GNC_PREF_CUSTOM_PAYEE "custom_payee" +#define GNC_PREF_CUSTOM_DATE "custom_date" +#define GNC_PREF_CUSTOM_WORDS "custom_amount_words" +#define GNC_PREF_CUSTOM_NUMBER "custom_amount_number" +#define GNC_PREF_CUSTOM_ADDRESS "custom_address" +#define GNC_PREF_CUSTOM_NOTES "custom_notes" +#define GNC_PREF_CUSTOM_MEMO "custom_memo" +#define GNC_PREF_CUSTOM_TRANSLATION "custom_translation" +#define GNC_PREF_CUSTOM_ROTATION "custom_rotation" #define KEY_CUSTOM_UNITS "custom_units" #define GNC_PREF_PRINT_DATE_FMT "print_date_format" #define GNC_PREF_DEFAULT_FONT "default_font" #define GNC_PREF_BLOCKING_CHARS "blocking_chars" -#define KEY_SPLITS_AMOUNT "splits_amount" -#define KEY_SPLITS_MEMO "splits_memo" -#define KEY_SPLITS_ACCOUNT "splits_account" +#define GNC_PREF_SPLITS_AMOUNT "splits_amount" +#define GNC_PREF_SPLITS_MEMO "splits_memo" +#define GNC_PREF_SPLITS_ACCOUNT "splits_account" #define DEFAULT_FONT "sans 12" @@ -357,39 +357,31 @@ find_existing_format (GtkListStore *store, gchar *guid, GtkTreeIter *iter_out) /* This function is used by the custom format dialog to save position values - * to the GConf database. + * in the preferences database. */ static void -save_float_pair (const char *section, const char *key, double a, double b) +save_float_pair (const char *group, const char *pref, double a, double b) { - GSList *coord_list = NULL; - - coord_list = g_slist_append(coord_list, &a); - coord_list = g_slist_append(coord_list, &b); - gnc_gconf_set_list(section, key, GCONF_VALUE_FLOAT, coord_list, NULL); - g_slist_free(coord_list); + GVariant *coords = g_variant_new ("(dd)", a, b); + gnc_prefs_set_value (group, pref, coords); + g_variant_unref (coords); } /* This function is used by the custom format dialog to restore position - * values from the GConf database. + * values from the preferences database. */ static void -get_float_pair (const char *section, const char *key, double *a, double *b) +get_float_pair (const char *group, const char *pref, double *a, double *b) { - GSList *coord_list; + GVariant *coords = gnc_prefs_get_value (group, pref); - coord_list = gnc_gconf_get_list (section, key, GCONF_VALUE_FLOAT, NULL); - if (NULL == coord_list) - { - *a = 0; - *b = 0; - return; - } + *a = 0; + *b = 0; - *a = *(gdouble*)g_slist_nth_data(coord_list, 0); - *b = *(gdouble*)g_slist_nth_data(coord_list, 1); - g_slist_free(coord_list); + if (g_variant_is_of_type (coords, (const GVariantType *) "(dd)") ) + g_variant_get (coords, "(dd)", a, b); + g_variant_unref (coords); } @@ -594,42 +586,41 @@ gnc_ui_print_save_dialog(PrintCheckDialog *pcd) } /* Custom format page */ - save_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, gtk_spin_button_get_value(pcd->payee_x), gtk_spin_button_get_value(pcd->payee_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, gtk_spin_button_get_value(pcd->date_x), gtk_spin_button_get_value(pcd->date_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, gtk_spin_button_get_value(pcd->words_x), gtk_spin_button_get_value(pcd->words_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, gtk_spin_button_get_value(pcd->number_x), gtk_spin_button_get_value(pcd->number_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, gtk_spin_button_get_value(pcd->notes_x), gtk_spin_button_get_value(pcd->notes_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, gtk_spin_button_get_value(pcd->memo_x), gtk_spin_button_get_value(pcd->memo_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, gtk_spin_button_get_value(pcd->address_x), gtk_spin_button_get_value(pcd->address_y)); - save_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, gtk_spin_button_get_value(pcd->splits_amount_x), gtk_spin_button_get_value(pcd->splits_amount_y)); - save_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, gtk_spin_button_get_value(pcd->splits_memo_x), gtk_spin_button_get_value(pcd->splits_memo_y)); - save_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, gtk_spin_button_get_value(pcd->splits_account_x), gtk_spin_button_get_value(pcd->splits_account_y)); - save_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION, + save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, gtk_spin_button_get_value(pcd->translation_x), gtk_spin_button_get_value(pcd->translation_y)); - gnc_gconf_set_float(GCONF_SECTION, KEY_CUSTOM_ROTATION, - gtk_spin_button_get_value(pcd->check_rotation), - NULL); + gnc_prefs_set_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION, + gtk_spin_button_get_value(pcd->check_rotation)); active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->units_combobox)); gnc_gconf_set_int(GCONF_SECTION, KEY_CUSTOM_UNITS, active, NULL); } @@ -690,41 +681,41 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) } /* Custom format page */ - get_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, &x, &y); gtk_spin_button_set_value(pcd->payee_x, x); gtk_spin_button_set_value(pcd->payee_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, &x, &y); gtk_spin_button_set_value(pcd->date_x, x); gtk_spin_button_set_value(pcd->date_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, &x, &y); gtk_spin_button_set_value(pcd->words_x, x); gtk_spin_button_set_value(pcd->words_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, &x, &y); gtk_spin_button_set_value(pcd->number_x, x); gtk_spin_button_set_value(pcd->number_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, &x, &y); gtk_spin_button_set_value(pcd->address_x, x); gtk_spin_button_set_value(pcd->address_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, &x, &y); gtk_spin_button_set_value(pcd->notes_x, x); gtk_spin_button_set_value(pcd->notes_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, &x, &y); gtk_spin_button_set_value(pcd->memo_x, x); gtk_spin_button_set_value(pcd->memo_y, y); - get_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, &x, &y); gtk_spin_button_set_value(pcd->splits_amount_x, x); gtk_spin_button_set_value(pcd->splits_amount_y, y); - get_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, &x, &y); gtk_spin_button_set_value(pcd->splits_memo_x, x); gtk_spin_button_set_value(pcd->splits_memo_y, y); - get_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, &x, &y); gtk_spin_button_set_value(pcd->splits_account_x, x); gtk_spin_button_set_value(pcd->splits_account_y, y); - get_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION, &x, &y); + get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, &x, &y); gtk_spin_button_set_value(pcd->translation_x, x); gtk_spin_button_set_value(pcd->translation_y, y); - x = gnc_gconf_get_float(GCONF_SECTION, KEY_CUSTOM_ROTATION, NULL); + x = gnc_prefs_get_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION); gtk_spin_button_set_value(pcd->check_rotation, x); active = gnc_gconf_get_int(GCONF_SECTION, KEY_CUSTOM_UNITS, NULL); gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->units_combobox), active); diff --git a/src/gnome/dialog-sx-editor.c b/src/gnome/dialog-sx-editor.c index 703841b967..b3fb1e85a6 100644 --- a/src/gnome/dialog-sx-editor.c +++ b/src/gnome/dialog-sx-editor.c @@ -54,7 +54,6 @@ #include "gnc-embedded-window.h" #include "gnc-engine.h" #include "gnc-frequency.h" -#include "gnc-gconf-utils.h" #include "gnc-gui-query.h" #include "gnc-hooks.h" #include "gnc-ledger-display.h" @@ -1429,7 +1428,7 @@ schedXact_editor_populate( GncSxEditorDialog *sxed ) if ( sxed->newsxP ) { daysInAdvance = - gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL ); + gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_CREATE_DAYS); } else { @@ -1447,7 +1446,7 @@ schedXact_editor_populate( GncSxEditorDialog *sxed ) if ( sxed->newsxP ) { daysInAdvance = - gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_REMIND_DAYS, NULL ); + gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_REMIND_DAYS); } else { diff --git a/src/gnome/dialog-sx-editor.h b/src/gnome/dialog-sx-editor.h index 47c7581e1a..149ae53b30 100644 --- a/src/gnome/dialog-sx-editor.h +++ b/src/gnome/dialog-sx-editor.h @@ -28,9 +28,8 @@ #define DIALOG_SCHEDXACTION_CM_CLASS "dialog-scheduledtransactions" #define DIALOG_SCHEDXACTION_EDITOR_CM_CLASS "dialog-scheduledtransaction-editor" -#define SXED_GCONF_SECTION "dialogs/scheduled_trans/transaction_editor" -#define KEY_CREATE_DAYS "create_days" -#define KEY_REMIND_DAYS "remind_days" +#define GNC_PREF_CREATE_DAYS "create_days" +#define GNC_PREF_REMIND_DAYS "remind_days" #define GNC_PREFS_GROUP_SXED "dialogs.sxs.transaction_editor" #define GNC_PREF_CREATE_AUTO "create_auto" #define GNC_PREF_NOTIFY "notify" diff --git a/src/gnome/dialog-sx-editor2.c b/src/gnome/dialog-sx-editor2.c index b9705bfc86..c9de4dc9f7 100644 --- a/src/gnome/dialog-sx-editor2.c +++ b/src/gnome/dialog-sx-editor2.c @@ -54,7 +54,6 @@ #include "gnc-embedded-window.h" #include "gnc-engine.h" #include "gnc-frequency.h" -#include "gnc-gconf-utils.h" #include "gnc-gui-query.h" #include "gnc-hooks.h" #include "gnc-ledger-display.h" @@ -1421,7 +1420,7 @@ schedXact_editor_populate (GncSxEditorDialog2 *sxed) if ( sxed->newsxP ) { daysInAdvance = - gnc_gconf_get_float (SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL); + gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_CREATE_DAYS); } else { @@ -1439,7 +1438,7 @@ schedXact_editor_populate (GncSxEditorDialog2 *sxed) if (sxed->newsxP) { daysInAdvance = - gnc_gconf_get_float (SXED_GCONF_SECTION, KEY_REMIND_DAYS, NULL); + gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_REMIND_DAYS); } else { diff --git a/src/gnome/dialog-sx-editor2.h b/src/gnome/dialog-sx-editor2.h index 9aac936534..58d52f50ea 100644 --- a/src/gnome/dialog-sx-editor2.h +++ b/src/gnome/dialog-sx-editor2.h @@ -28,9 +28,8 @@ #define DIALOG_SCHEDXACTION2_CM_CLASS "dialog-scheduledtransactions" #define DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS "dialog-scheduledtransaction-editor" -#define SXED_GCONF_SECTION "dialogs/scheduled_trans/transaction_editor" -#define KEY_CREATE_DAYS "create_days" -#define KEY_REMIND_DAYS "remind_days" +#define GNC_PREF_CREATE_DAYS "create_days" +#define GNC_PREF_REMIND_DAYS "remind_days" #define GNC_PREFS_GROUP_SXED "dialogs.sxs.transaction_editor" #define GNC_PREF_CREATE_AUTO "create_auto" #define GNC_PREF_NOTIFY "notify" diff --git a/src/gnome/dialog-sx-from-trans.c b/src/gnome/dialog-sx-from-trans.c index 9f506eb60a..6065667087 100644 --- a/src/gnome/dialog-sx-from-trans.c +++ b/src/gnome/dialog-sx-from-trans.c @@ -36,7 +36,6 @@ #include "gnc-dense-cal.h" #include "gnc-engine.h" #include "engine-helpers.h" -#include "gnc-gconf-utils.h" #include "gnc-prefs.h" #include "gnc-ui-util.h" #include "gnc-ui.h" @@ -507,11 +506,11 @@ sxftd_compute_sx(SXFromTransInfo *sxfti) (autoCreateState & notifyState) ); daysInAdvance = - gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL ); + gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_CREATE_DAYS); xaccSchedXactionSetAdvanceCreation( sx, daysInAdvance ); daysInAdvance = - gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_REMIND_DAYS, NULL ); + gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_REMIND_DAYS); xaccSchedXactionSetAdvanceReminder( sx, daysInAdvance ); } diff --git a/src/gnome/gnc-plugin-page-register2.c b/src/gnome/gnc-plugin-page-register2.c index 4fba577eb2..bf6422a5b7 100644 --- a/src/gnome/gnc-plugin-page-register2.c +++ b/src/gnome/gnc-plugin-page-register2.c @@ -3900,7 +3900,7 @@ gnc_plugin_page_register2_refresh_cb (GHashTable *changes, gpointer user_data) / else { /* Force updates */ - gnc_tree_view_split_reg_refresh_from_gconf (view); + gnc_tree_view_split_reg_refresh_from_prefs (view); } gnc_plugin_page_register2_ui_update (NULL, page); } diff --git a/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in b/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in index 4a98bfe4e0..da2c2da80d 100644 --- a/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in +++ b/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in @@ -20,35 +20,70 @@ Custom date format If the 'date_format' is set to indicate a custom date format, this value is used as an argument to strftime to produce the date to be printed. It may be any valid strftime string; for more information about this format, read the manual page of strftime by "man 3 strftime". - - [] + + 0 + Units in which the custom coordinates are expressed + Units in which the custom coordinates are expressed (inches, mm, ...). + + + (0,0) Position of payee name This value contains the X,Y coordinates for the start of the payee line on the check. - - [] + + (0,0) Position of date line This value contains the X,Y coordinates for the start of the date line on the check. Coordinates are from the lower left corner of the specified check position. - - [] + + (0,0) Position of check amount in words This value contains the X,Y coordinates for the start of the written amount line on the check. Coordinates are from the lower left corner of the specified check position. - - [] + + (0,0) Position of check amount in numbers This value contains the X,Y coordinates for the start of the numerical amount line on the check. Coordinates are from the lower left corner of the specified check position. - - [] + + (0,0) + Position of payee address + This value contains the X,Y coordinates for the start of the payee address line on the check. Coordinates are from the lower left corner of the specified check position. + + + (0,0) + Position of notes line + This value contains the X,Y coordinates for the start of the notes line on the check. Coordinates are from the lower left corner of the specified check position. + + + (0,0) Position of memo line This value contains the X,Y coordinates for the start of the memo line on the check. Coordinates are from the lower left corner of the specified check position. - - [] - Position of check on page - This value contains the Y coordinate for the bottom edge of the check. This coordinate is from the bottom edge of the sheet of paper. + + (0,0) + Offset for complete check + This value contains the X,Y offset for the complete check. Coordinates are from the lower left corner of the specified check position. + + + 0.0 + Rotation angle + Number of degrees to rotate the check. + + + (0,0) + Position of split's amount in numbers + This value contains the X,Y coordinates for the start of the split's amount line on the check. Coordinates are from the lower left corner of the specified check position. + + + (0,0) + Position of split's memo line + This value contains the X,Y coordinates for the start of the split's memo line on the check. Coordinates are from the lower left corner of the specified check position. + + + (0,0) + Position of split's account line + This value contains the X,Y coordinates for the start of the split's account line on the check. Coordinates are from the lower left corner of the specified check position. false diff --git a/src/gnome/gtkbuilder/dialog-sx.glade b/src/gnome/gtkbuilder/dialog-sx.glade index 9cde42fc76..c79607fdb3 100644 --- a/src/gnome/gtkbuilder/dialog-sx.glade +++ b/src/gnome/gtkbuilder/dialog-sx.glade @@ -202,7 +202,7 @@ 0 Crea_te in advance: True - gconf/dialogs/scheduled_trans/transaction_editor/create_days + pref/dialogs.sxs.transaction_editor/create_days @@ -225,6 +225,7 @@ 0 R_emind in advance: True + pref/dialogs.sxs.transaction_editor/remind_days @@ -241,7 +242,7 @@ False 6 - + True True Begin notifications this many days before the transaction is created. @@ -287,7 +288,7 @@ False 6 - + True True Create the transaction this many days before its effective date. diff --git a/src/import-export/dialog-import.glade b/src/import-export/dialog-import.glade index b20d17c6ea..cbdc33e279 100644 --- a/src/import-export/dialog-import.glade +++ b/src/import-export/dialog-import.glade @@ -71,7 +71,7 @@ - + True True True @@ -99,7 +99,7 @@ - + True True True @@ -126,7 +126,7 @@ - + True True True @@ -153,7 +153,7 @@ - + True True True @@ -186,7 +186,7 @@ 0 Commercial ATM _fees threshold True - gconf/dialogs/import/generic_matcher/atm_fee_threshold + pref/dialogs.import.generic/atm_fee_threshold 7 @@ -203,7 +203,7 @@ 0 Auto-c_lear threshold True - gconf/dialogs/import/generic_matcher/auto_clear_threshold + pref/dialogs.import.generic/auto_clear_threshold 6 @@ -220,7 +220,7 @@ 0 Auto-_add threshold True - gconf/dialogs/import/generic_matcher/auto_add_threshold + pref/dialogs.import.generic/auto_add_threshold 5 @@ -237,7 +237,7 @@ 0 Match _display threshold True - gconf/dialogs/import/generic_matcher/match_threshold + pref/dialogs.import.generic/match_threshold 4 diff --git a/src/import-export/import-settings.c b/src/import-export/import-settings.c index 96d37b5772..ee6a4f6b8d 100644 --- a/src/import-export/import-settings.c +++ b/src/import-export/import-settings.c @@ -29,7 +29,6 @@ #include #include "import-settings.h" -#include "gnc-gconf-utils.h" #include "gnc-prefs.h" /********************************************************************\ @@ -90,14 +89,14 @@ gnc_import_Settings_new (void) settings->action_add_enabled = DEFAULT_ACTION_ADD_ENABLED; settings->action_clear_enabled = DEFAULT_ACTION_CLEAR_ENABLED; settings->clear_threshold = - (int)gnc_gconf_get_float(GCONF_IMPORT_SECTION, "auto_clear_threshold", NULL); + (int)gnc_prefs_get_float (GNC_PREFS_GROUP_IMPORT, GNC_PREF_AUTO_CLEAR_THRESHOLD); settings->add_threshold = - (int)gnc_gconf_get_float(GCONF_IMPORT_SECTION, "auto_add_threshold", NULL); + (int)gnc_prefs_get_float (GNC_PREFS_GROUP_IMPORT, GNC_PREF_AUTO_ADD_THRESHOLD); settings->display_threshold = - (int)gnc_gconf_get_float(GCONF_IMPORT_SECTION, "match_threshold", NULL); + (int)gnc_prefs_get_float (GNC_PREFS_GROUP_IMPORT, GNC_PREF_MATCH_THRESHOLD); settings->fuzzy_amount = - gnc_gconf_get_float(GCONF_IMPORT_SECTION, "atm_fee_threshold", NULL); + gnc_prefs_get_float (GNC_PREFS_GROUP_IMPORT, GNC_PREF_ATM_FEE_THRESHOLD); settings->match_date_hardlimit = 42; /* 6 weeks */ return settings; diff --git a/src/import-export/import-utilities.h b/src/import-export/import-utilities.h index b940e83ba4..f8518049bc 100644 --- a/src/import-export/import-utilities.h +++ b/src/import-export/import-utilities.h @@ -26,12 +26,15 @@ #define IMPORT_UTILITIES_H -/** The GConf section of the importer */ -#define GCONF_IMPORT_SECTION "dialogs/import/generic_matcher" -#define GNC_PREFS_GROUP_IMPORT "dialogs.import.generic" -#define GNC_PREF_ENABLE_SKIP "enable_skip" -#define GNC_PREF_ENABLE_UPDATE "enable_update" -#define GNC_PREF_USE_BAYES "use_bayes" +/** The preferences used by the importer */ +#define GNC_PREFS_GROUP_IMPORT "dialogs.import.generic" +#define GNC_PREF_ENABLE_SKIP "enable_skip" +#define GNC_PREF_ENABLE_UPDATE "enable_update" +#define GNC_PREF_USE_BAYES "use_bayes" +#define GNC_PREF_ATM_FEE_THRESHOLD "atm_fee_threshold" +#define GNC_PREF_AUTO_CLEAR_THRESHOLD "auto_clear_threshold" +#define GNC_PREF_AUTO_ADD_THRESHOLD "auto_add_threshold" +#define GNC_PREF_MATCH_THRESHOLD "match_threshold" #include "Account.h" diff --git a/src/register/ledger-core/gnc-ledger-display.c b/src/register/ledger-core/gnc-ledger-display.c index 34a655fbc4..66aa19101d 100644 --- a/src/register/ledger-core/gnc-ledger-display.c +++ b/src/register/ledger-core/gnc-ledger-display.c @@ -48,6 +48,7 @@ #define REGISTER_TEMPLATE_CM_CLASS "register-template" #define GNC_PREF_DOUBLE_LINE_MODE "double_line_mode" +#define GNC_PREF_MAX_TRANS "max_transactions" struct gnc_ledger_display @@ -776,7 +777,7 @@ gnc_ledger_display_internal (Account *lead_account, Query *q, ld->get_parent = NULL; ld->user_data = NULL; - limit = gnc_gconf_get_float(GCONF_GENERAL_REGISTER, "max_transactions", NULL); + limit = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_MAX_TRANS); /* set up the query filter */ if (q) diff --git a/src/register/ledger-core/gnc-ledger-display2.c b/src/register/ledger-core/gnc-ledger-display2.c index fe3965f521..feeb63ca13 100644 --- a/src/register/ledger-core/gnc-ledger-display2.c +++ b/src/register/ledger-core/gnc-ledger-display2.c @@ -52,6 +52,7 @@ #define REGISTER_TEMPLATE_CM_CLASS "register-template" #define GNC_PREF_DOUBLE_LINE_MODE "double_line_mode" +#define GNC_PREF_MAX_TRANS "max_transactions" struct gnc_ledger_display2 @@ -795,7 +796,7 @@ gnc_ledger_display2_internal (Account *lead_account, Query *q, ld->get_parent = NULL; ld->user_data = NULL; - limit = gnc_gconf_get_float(GCONF_GENERAL_REGISTER, "max_transactions", NULL); + limit = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_MAX_TRANS); /* set up the query filter */ if (q)