diff --git a/src/business/business-gnome/business-gnome-utils.h b/src/business/business-gnome/business-gnome-utils.h index e626450c1d..46dd37ad2f 100644 --- a/src/business/business-gnome/business-gnome-utils.h +++ b/src/business/business-gnome/business-gnome-utils.h @@ -30,11 +30,6 @@ #include "gncTaxTable.h" #include "gncInvoice.h" -#define GCONF_SECTION_ORDER "dialogs/business/order" -#define GCONF_SECTION_JOB "dialogs/business/job" -#define GCONF_SECTION_CUSTOMER "dialogs/business/customer" -#define GCONF_SECTION_VENDOR "dialogs/business/vendor" -#define GCONF_SECTION_EMPLOYEE "dialogs/business/employee" GtkWidget * gnc_owner_select_create (GtkWidget *label, GtkWidget *hbox, QofBook *book, GncOwner *owner); diff --git a/src/business/business-gnome/dialog-invoice.h b/src/business/business-gnome/dialog-invoice.h index a87b08a79d..114c817945 100644 --- a/src/business/business-gnome/dialog-invoice.h +++ b/src/business/business-gnome/dialog-invoice.h @@ -46,9 +46,6 @@ typedef enum } invoice_sort_type_t; -#define GCONF_SECTION_INVOICE "dialogs/business/invoice" -#define GCONF_SECTION_BILL "dialogs/business/bill" -#define GCONF_SECTION_VOUCHER "dialogs/business/voucher" #define GNC_PREFS_GROUP_INVOICE "dialogs.business.invoice" #define GNC_PREFS_GROUP_BILL "dialogs.business.bill" #define GNC_PREFS_GROUP_VOUCHER "dialogs.business.voucher" diff --git a/src/business/business-gnome/gnc-plugin-business.c b/src/business/business-gnome/gnc-plugin-business.c index 496a136e48..0bed8b3acc 100644 --- a/src/business/business-gnome/gnc-plugin-business.c +++ b/src/business/business-gnome/gnc-plugin-business.c @@ -48,8 +48,7 @@ #include "gnc-session.h" #include "gnome-utils/gnc-icons.h" /* for GNC_STOCK_INVOICE_NEW */ -#include "gnc-prefs.h" /* for GCONF_PATH */ -#include "gnc-gconf-utils.h" +#include "gnc-prefs.h" #include "gnome-utils/gnc-main-window.h" #include "gnc-plugin-page-register.h" @@ -134,6 +133,7 @@ static void update_inactive_actions(GncPluginPage *page); #define PLUGIN_UI_FILENAME "gnc-plugin-business-ui.xml" #define GNC_PREF_EXTRA_TOOLBUTTONS "enable_toolbuttons" +#define GNC_PREF_INV_PRINT_RPT "invoice_printreport" /** This variable maintains a pointer to the last window where a * Business command was executed. It is used to determine where new @@ -397,9 +397,6 @@ gnc_plugin_business_class_init (GncPluginBusinessClass *klass) plugin_class->n_actions = gnc_plugin_n_actions; plugin_class->ui_filename = PLUGIN_UI_FILENAME; - plugin_class->gconf_notifications = NULL; - plugin_class->gconf_section = NULL; - g_type_class_add_private(klass, sizeof(GncPluginBusinessPrivate)); } @@ -1078,8 +1075,7 @@ static const char* invoice_printreport_values[] = const char *gnc_plugin_business_get_invoice_printreport(void) { - int value = gnc_gconf_get_int(GCONF_SECTION_INVOICE, - "invoice_printreport", NULL); + int value = gnc_prefs_get_int (GNC_PREFS_GROUP_INVOICE, GNC_PREF_INV_PRINT_RPT); if (value >= 0 && value < 4) return invoice_printreport_values[value]; else diff --git a/src/business/business-gnome/gtkbuilder/business-prefs.glade b/src/business/business-gnome/gtkbuilder/business-prefs.glade index 9f0704cf94..ece87c66ae 100644 --- a/src/business/business-gnome/gtkbuilder/business-prefs.glade +++ b/src/business/business-gnome/gtkbuilder/business-prefs.glade @@ -262,7 +262,7 @@ - + True False True diff --git a/src/gnome-utils/dialog-preferences.c b/src/gnome-utils/dialog-preferences.c index 5bb5988122..cbb5359531 100644 --- a/src/gnome-utils/dialog-preferences.c +++ b/src/gnome-utils/dialog-preferences.c @@ -752,76 +752,6 @@ gnc_prefs_connect_radio_button_gconf (GtkRadioButton *button) /****************************************************************************/ -/** The user changed a combo box. Update gconf. Combo box - * choices are stored as an int. - * - * @internal - * - * @param box A pointer to the combo box that was changed. - * - * @param user_data Unused. - */ -static void -gnc_prefs_combo_box_user_cb_gconf (GtkComboBox *box, - gpointer user_data) -{ - const gchar *name; - gint active; - - g_return_if_fail(GTK_IS_COMBO_BOX(box)); - name = gtk_buildable_get_name(GTK_BUILDABLE(box)) + PREFIX_LEN; - active = gtk_combo_box_get_active(box); - DEBUG("Combo box %s set to item %d", name, active); - gnc_gconf_set_int(name, NULL, active, NULL); -} - - -/** A combo box choice was updated in gconf. Update the user - * visible dialog. - * - * @internal - * - * @param box A pointer to the combo box that changed. - * - * @param value The new value of the combo box. - */ -static void -gnc_prefs_combo_box_gconf_cb_gconf (GtkComboBox *box, - gint value) -{ - g_return_if_fail(GTK_IS_COMBO_BOX(box)); - ENTER("box %p, value %d", box, value); - g_signal_handlers_block_by_func(G_OBJECT(box), - G_CALLBACK(gnc_prefs_combo_box_user_cb_gconf), NULL); - gtk_combo_box_set_active(box, value); - g_signal_handlers_unblock_by_func(G_OBJECT(box), - G_CALLBACK(gnc_prefs_combo_box_user_cb_gconf), NULL); - LEAVE(" "); -} - - -/** Connect a combo box widget to the user callback function. Set - * the starting state of the box from its value in gconf. - * - * @internal - * - * @param box A pointer to the combo box that should be connected. - */ -static void -gnc_prefs_connect_combo_box_gconf (GtkComboBox *box) -{ - const gchar *name; - gint active; - - g_return_if_fail(GTK_IS_COMBO_BOX(box)); - name = gtk_buildable_get_name(GTK_BUILDABLE(box)) + PREFIX_LEN; - active = gnc_gconf_get_int(name, NULL, NULL); - gtk_combo_box_set_active(GTK_COMBO_BOX(box), active); - DEBUG(" Combo box %s set to item %d", name, active); - g_signal_connect(G_OBJECT(box), "changed", - G_CALLBACK(gnc_prefs_combo_box_user_cb_gconf), NULL); -} - /****************************************************************************/ /** The user changed a currency_edit. Update gconf. Currency_edit @@ -1263,6 +1193,34 @@ gnc_prefs_connect_spin_button (GtkSpinButton *spin) g_free (pref); } +/****************************************************************************/ + +/** Connect a GtkComboBox widget to its stored value in the preferences database. + * + * @internal + * + * @param box A pointer to the combo box that should be connected. + */ +static void +gnc_prefs_connect_combo_box (GtkComboBox *box) +{ + gchar *group, *pref; + gint active; + + g_return_if_fail(GTK_IS_COMBO_BOX(box)); + + gnc_prefs_split_widget_name (gtk_buildable_get_name(GTK_BUILDABLE(box)), &group, &pref); + +// active = gnc_prefs_get_int(group, pref); +// gtk_combo_box_set_active(GTK_COMBO_BOX(box), active); +// DEBUG(" Combo box %s/%s set to item %d", group, pref, active); + + gnc_prefs_bind (group, pref, G_OBJECT (box), "active"); + + g_free (group); + g_free (pref); +} + /****************************************************************************/ @@ -1338,11 +1296,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_COMBO_BOX(widget)) - { - DEBUG(" %s - combo box", name); - gnc_prefs_connect_combo_box_gconf(GTK_COMBO_BOX(widget)); - } else if (GTK_IS_ENTRY(widget)) { DEBUG(" %s - entry", name); @@ -1416,6 +1369,11 @@ gnc_prefs_connect_one (const gchar *name, DEBUG(" %s - spin button", name); gnc_prefs_connect_spin_button(GTK_SPIN_BUTTON(widget)); } + else if (GTK_IS_COMBO_BOX(widget)) + { + DEBUG(" %s - combo box", name); + gnc_prefs_connect_combo_box(GTK_COMBO_BOX(widget)); + } else { DEBUG(" %s - unsupported %s", name, @@ -1669,12 +1627,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_COMBO_BOX(widget)) - { - DEBUG("widget %p - combo_box", widget); - gnc_prefs_combo_box_gconf_cb_gconf(GTK_COMBO_BOX(widget), - gconf_value_get_int(entry->value)); - } else if (GTK_IS_ENTRY(widget)) { DEBUG("widget %p - entry", widget); diff --git a/src/gnome-utils/dialog-totd.c b/src/gnome-utils/dialog-totd.c index a1419e1737..c7e8a32bbb 100644 --- a/src/gnome-utils/dialog-totd.c +++ b/src/gnome-utils/dialog-totd.c @@ -31,14 +31,12 @@ #include "dialog-utils.h" #include "gnc-component-manager.h" #include "gnc-filepath-utils.h" -#include "gnc-gconf-utils.h" #include "gnc-prefs.h" #include "gnc-gnome-utils.h" #include "gnc-engine.h" -#define GCONF_SECTION "dialogs/tip_of_the_day" #define GNC_PREFS_GROUP "dialogs.totd" -#define KEY_CURRENT_TIP "current_tip" +#define GNC_PREF_CURRENT_TIP "current_tip" #define GNC_PREF_SHOW_TIPS "show_at_startup" #define DIALOG_TOTD_CM_CLASS "dialog-totd" @@ -68,7 +66,7 @@ typedef struct /*********************************************************************** * This function should be called to change the tip number. It * handles clamping the number to the range of tips available, saving - * the number in the GConf database, and updating the dialog window + * the number in the preferences database, and updating the dialog window * with the text of the newly selected tip. * * @param Tip of the day structure. This points to the dialog and @@ -93,7 +91,7 @@ gnc_new_tip_number (TotdDialog *totd_dialog, gint offset) current_tip_number = tip_count - 1; if (current_tip_number >= tip_count) current_tip_number = 0; - gnc_gconf_set_int(GCONF_SECTION, KEY_CURRENT_TIP, current_tip_number, NULL); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_CURRENT_TIP, current_tip_number); /* A tip consists of a translatable string, which might contain a %s * placeholder, optionally followed by a | and a (non-translated) @@ -322,7 +320,7 @@ gnc_totd_dialog (GtkWindow *parent, gboolean startup) { if (!gnc_totd_initialize()) return; - current_tip_number = gnc_gconf_get_int(GCONF_SECTION, KEY_CURRENT_TIP, NULL); + current_tip_number = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_CURRENT_TIP); } if (gnc_forall_gui_components(DIALOG_TOTD_CM_CLASS, show_handler, NULL)) diff --git a/src/gnome/dialog-lot-viewer.c b/src/gnome/dialog-lot-viewer.c index 24c94861ac..d517a2a534 100644 --- a/src/gnome/dialog-lot-viewer.c +++ b/src/gnome/dialog-lot-viewer.c @@ -45,8 +45,8 @@ #include "dialog-utils.h" #include "dialog-lot-viewer.h" #include "gnc-component-manager.h" +#include "gnc-prefs.h" #include "gnc-ui-util.h" -#include "gnc-gconf-utils.h" #include "misc-gnome-utils.h" #define LOT_VIEWER_CM_CLASS "dialog-lot-viewer" @@ -82,10 +82,9 @@ enum split_cols #define RESPONSE_SCRUB_ACCOUNT 4 #define RESPONSE_NEW_LOT 5 -#define GCONF_SECTION "dialogs/lot_viewer" #define GNC_PREFS_GROUP "dialogs.lot_viewer" -#define GCONF_KEY_HPOSITION "hpane_position" -#define GCONF_KEY_VPOSITION "vpane_position" +#define GNC_PREF_HPOS "hpane_position" +#define GNC_PREF_VPOS "vpane_position" struct _GNCLotViewer { @@ -96,8 +95,6 @@ struct _GNCLotViewer GtkButton * delete_button; GtkButton * scrub_lot_button; GtkButton * new_lot_button; - GtkPaned * lot_hpaned; - GtkPaned * lot_vpaned; GtkTreeView * lot_view; GtkListStore * lot_store; GtkTextView * lot_notes; @@ -722,32 +719,6 @@ lv_only_show_open_lots_changed_cb (GtkWidget *widget, GNCLotViewer * lv) lv_refresh(lv); } -/* ======================================================================== */ -/* Divider moved */ - -void -lv_paned_notify_cb (GObject *gobject, - GParamSpec *pspec, - gpointer user_data) -{ - const gchar *param_name; - gint value; - - param_name = g_param_spec_get_name(pspec); - if (strcmp(param_name, "position") != 0) - return; - g_object_get(gobject, "position", &value, NULL); - - if (GTK_IS_HPANED(gobject)) - { - gnc_gconf_set_int(GCONF_SECTION, GCONF_KEY_HPOSITION, value, NULL); - } - else - { - gnc_gconf_set_int(GCONF_SECTION, GCONF_KEY_VPOSITION, value, NULL); - } -} - /* ======================================================================== */ /* Any button was pressed */ @@ -968,6 +939,7 @@ lv_create (GNCLotViewer *lv) gchar *win_title; gint position; GtkBuilder *builder; + GtkWidget *widget; builder = gtk_builder_new(); gnc_builder_add_from_file (builder, "dialog-lot-viewer.glade", "Lot Viewer Window"); @@ -1000,15 +972,16 @@ lv_create (GNCLotViewer *lv) lv->remove_split_from_lot_button = GTK_BUTTON(gtk_builder_get_object (builder, "remove split from lot button")); lv_init_split_buttons(lv); - lv->lot_vpaned = GTK_PANED (gtk_builder_get_object (builder, "lot vpaned")); - position = gnc_gconf_get_int(GCONF_SECTION, GCONF_KEY_VPOSITION, NULL); - if (position) - gtk_paned_set_position (lv->lot_vpaned, position); - lv->lot_hpaned = GTK_PANED (gtk_builder_get_object (builder, "lot hpaned")); - position = gnc_gconf_get_int(GCONF_SECTION, GCONF_KEY_HPOSITION, NULL); - if (position) - gtk_paned_set_position (lv->lot_hpaned, position); + if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY)) + { + GObject *object; + object = gtk_builder_get_object (builder, "lot vpaned"); + gnc_prefs_bind (GNC_PREFS_GROUP, GNC_PREF_VPOS, object, "position"); + + object = gtk_builder_get_object (builder, "lot hpaned"); + gnc_prefs_bind (GNC_PREFS_GROUP, GNC_PREF_HPOS, object, "position"); + } lv->selected_lot = NULL; diff --git a/src/gnome/dialog-print-check.c b/src/gnome/dialog-print-check.c index a547d6c5de..6491ea6441 100644 --- a/src/gnome/dialog-print-check.c +++ b/src/gnome/dialog-print-check.c @@ -68,9 +68,8 @@ G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks"; #define GCONF_SECTION "dialogs/print_checks" #define GNC_PREFS_GROUP "dialogs.checkprinting" #define KEY_CHECK_FORMAT_GUID "check_format_guid" -#define KEY_CHECK_FORMAT "check_format" -#define KEY_CHECK_POSITION "check_position" -#define KEY_FIRST_PAGE_COUNT "first_page_count" +#define GNC_PREF_CHECK_POSITION "check_position" +#define GNC_PREF_FIRST_PAGE_COUNT "first_page_count" #define KEY_DATE_FORMAT_USER "date_format_custom" #define GNC_PREF_CUSTOM_PAYEE "custom_payee" #define GNC_PREF_CUSTOM_DATE "custom_date" @@ -81,7 +80,7 @@ G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks"; #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_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" @@ -569,11 +568,11 @@ gnc_ui_print_save_dialog(PrintCheckDialog *pcd) check ? check->guid : "custom", NULL); } active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox)); - gnc_gconf_set_int(GCONF_SECTION, KEY_CHECK_POSITION, active, NULL); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_CHECK_POSITION, active); active = gtk_spin_button_get_value_as_int(pcd->first_page_count); - gnc_gconf_set_int(GCONF_SECTION, KEY_FIRST_PAGE_COUNT, active, NULL); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_FIRST_PAGE_COUNT, active); active = gnc_date_format_get_format (GNC_DATE_FORMAT(pcd->date_format)); - gnc_gconf_set_int(GCONF_SECTION, KEY_DATE_FORMAT, active, NULL); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT, active); if (active == QOF_DATE_FORMAT_CUSTOM) { format = gnc_date_format_get_custom (GNC_DATE_FORMAT(pcd->date_format)); @@ -621,7 +620,7 @@ gnc_ui_print_save_dialog(PrintCheckDialog *pcd) 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); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_UNITS, active); } @@ -637,15 +636,10 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) /* Options page */ guid = gnc_gconf_get_string(GCONF_SECTION, KEY_CHECK_FORMAT_GUID, NULL); if (guid == NULL) - { - active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_FORMAT, NULL); - gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), active); - } + gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0); else if (strcmp(guid, "custom") == 0) - { gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), pcd->format_max - 1); - } else { model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox)); @@ -658,16 +652,16 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0); } } - active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_POSITION, NULL); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_CHECK_POSITION); /* If the check format used last time no longer exists, then the saved check position may be invalid. If so set it to the first position. */ if (active < 0 || active > pcd->position_max) active = 0; gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), active); - active = gnc_gconf_get_int(GCONF_SECTION, KEY_FIRST_PAGE_COUNT, NULL); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_FIRST_PAGE_COUNT); gtk_spin_button_set_value(pcd->first_page_count, (gdouble) active); - active = gnc_gconf_get_int(GCONF_SECTION, KEY_DATE_FORMAT, NULL); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT); gnc_date_format_set_format(GNC_DATE_FORMAT(pcd->date_format), active); if (active == QOF_DATE_FORMAT_CUSTOM) { @@ -716,7 +710,7 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) gtk_spin_button_set_value(pcd->translation_y, y); 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); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_UNITS); 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 a51d901997..d744956fcb 100644 --- a/src/gnome/dialog-print-check2.c +++ b/src/gnome/dialog-print-check2.c @@ -68,9 +68,8 @@ G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks"; #define GCONF_SECTION "dialogs/print_checks" #define GNC_PREFS_GROUP "dialogs.checkprinting" #define KEY_CHECK_FORMAT_GUID "check_format_guid" -#define KEY_CHECK_FORMAT "check_format" -#define KEY_CHECK_POSITION "check_position" -#define KEY_FIRST_PAGE_COUNT "first_page_count" +#define GNC_PREF_CHECK_POSITION "check_position" +#define GNC_PREF_FIRST_PAGE_COUNT "first_page_count" #define KEY_DATE_FORMAT_USER "date_format_custom" #define GNC_PREF_CUSTOM_PAYEE "custom_payee" #define GNC_PREF_CUSTOM_DATE "custom_date" @@ -81,7 +80,7 @@ G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks"; #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_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" @@ -570,11 +569,11 @@ gnc_ui_print_save_dialog(PrintCheckDialog *pcd) check ? check->guid : "custom", NULL); } active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox)); - gnc_gconf_set_int(GCONF_SECTION, KEY_CHECK_POSITION, active, NULL); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_CHECK_POSITION, active); active = gtk_spin_button_get_value_as_int(pcd->first_page_count); - gnc_gconf_set_int(GCONF_SECTION, KEY_FIRST_PAGE_COUNT, active, NULL); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_FIRST_PAGE_COUNT, active); active = gnc_date_format_get_format (GNC_DATE_FORMAT(pcd->date_format)); - gnc_gconf_set_int(GCONF_SECTION, KEY_DATE_FORMAT, active, NULL); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT, active); if (active == QOF_DATE_FORMAT_CUSTOM) { format = gnc_date_format_get_custom (GNC_DATE_FORMAT(pcd->date_format)); @@ -622,7 +621,7 @@ gnc_ui_print_save_dialog(PrintCheckDialog *pcd) 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); + gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_UNITS, active); } @@ -638,15 +637,10 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) /* Options page */ guid = gnc_gconf_get_string(GCONF_SECTION, KEY_CHECK_FORMAT_GUID, NULL); if (guid == NULL) - { - active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_FORMAT, NULL); - gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), active); - } + gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0); else if (strcmp(guid, "custom") == 0) - { gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), pcd->format_max - 1); - } else { model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox)); @@ -659,16 +653,16 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0); } } - active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_POSITION, NULL); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_CHECK_POSITION); /* If the check format used last time no longer exists, then the saved check position may be invalid. If so set it to the first position. */ if (active < 0 || active > pcd->position_max) active = 0; gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), active); - active = gnc_gconf_get_int(GCONF_SECTION, KEY_FIRST_PAGE_COUNT, NULL); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_FIRST_PAGE_COUNT); gtk_spin_button_set_value(pcd->first_page_count, (gdouble) active); - active = gnc_gconf_get_int(GCONF_SECTION, KEY_DATE_FORMAT, NULL); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT); gnc_date_format_set_format(GNC_DATE_FORMAT(pcd->date_format), active); if (active == QOF_DATE_FORMAT_CUSTOM) { @@ -717,7 +711,7 @@ gnc_ui_print_restore_dialog(PrintCheckDialog *pcd) gtk_spin_button_set_value(pcd->translation_y, y); 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); + active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_UNITS); gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->units_combobox), active); } diff --git a/src/gnome/dialog-tax-info.c b/src/gnome/dialog-tax-info.c index 0f9061567d..68c220d2f3 100644 --- a/src/gnome/dialog-tax-info.c +++ b/src/gnome/dialog-tax-info.c @@ -36,7 +36,6 @@ #include "Account.h" #include "gnc-ui-util.h" #include "dialog-utils.h" -#include "gnc-gconf-utils.h" #include "gnc-prefs.h" #include "gnc-tree-view-account.h" #include "gnc-component-manager.h" @@ -45,9 +44,8 @@ #include "gnc-ui.h" #define DIALOG_TAX_INFO_CM_CLASS "dialog-tax-info" -#define GCONF_SECTION "dialogs/tax_info" -#define PANED_POSITION "paned_position" -#define GNC_PREFS_GROUP "dialogs.tax_info" +#define GNC_PREFS_GROUP "dialogs.tax_info" +#define GNC_PREF_PANED_POS "paned_position" enum { @@ -97,7 +95,6 @@ typedef struct typedef struct { GtkWidget * dialog; - GtkWidget * paned; GtkWidget * entity_name_display; GtkWidget * entity_name_entry; @@ -1461,12 +1458,11 @@ gnc_tax_info_dialog_create (GtkWidget * parent, TaxInfoDialog *ti_dialog) gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(ti_dialog->dialog)); - ti_dialog->paned = GTK_WIDGET(gtk_builder_get_object (builder, "paned")); if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY)) { - gint position = gnc_gconf_get_int(GCONF_SECTION, PANED_POSITION, NULL); - gtk_paned_set_position(GTK_PANED(ti_dialog->paned), position); + GObject *object = gtk_builder_get_object (builder, "paned"); + gnc_prefs_bind (GNC_PREFS_GROUP, GNC_PREF_PANED_POS, object, "position"); } g_object_unref (builder); } @@ -1476,12 +1472,6 @@ close_handler (gpointer user_data) { TaxInfoDialog *ti_dialog = user_data; - if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY)) - { - gnc_gconf_set_int(GCONF_SECTION, PANED_POSITION, - gtk_paned_get_position(GTK_PANED(ti_dialog->paned)), NULL); - } - gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(ti_dialog->dialog)); gtk_widget_destroy (ti_dialog->dialog); } 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 da2c2da80d..2bcbe336eb 100644 --- a/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in +++ b/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in @@ -1,15 +1,20 @@ - - 0 - Index of predefined check format to use - This value specifies the predefined check format to use. The number is the 0-based index into the list of known check formats. + + '' + GUID of predefined check format to use + This value specifies the predefined check format to use. The number is the guid of a known check format. 0 Which check position to print On preprinted checks containing multiple checks per page, this setting specifies which check position to print. The possible values are 0, 1 and 2, corresponding to the top, middle and bottom checks on the page. + + 0 + Number of checks to print on the first page. + Number of checks to print on the first page. + 0 Date format to use diff --git a/src/gnome/gschemas/org.gnucash.dialogs.gschema.xml.in b/src/gnome/gschemas/org.gnucash.dialogs.gschema.xml.in index 22595e2e0d..e321f695f6 100644 --- a/src/gnome/gschemas/org.gnucash.dialogs.gschema.xml.in +++ b/src/gnome/gschemas/org.gnucash.dialogs.gschema.xml.in @@ -72,6 +72,11 @@ + + 0 + Position of the horizontal pane divider. + Position of the horizontal pane divider. + (-1,-1,-1,-1) Last window position and size @@ -169,6 +174,16 @@ + + 200 + Position of the horizontal pane divider. + Position of the horizontal pane divider. + + + 200 + Position of the vertical pane divider. + Position of the vertical pane divider. + (-1,-1,-1,-1) Last window position and size diff --git a/src/gnome/gtkbuilder/dialog-lot-viewer.glade b/src/gnome/gtkbuilder/dialog-lot-viewer.glade index fb74685436..739391e1ad 100644 --- a/src/gnome/gtkbuilder/dialog-lot-viewer.glade +++ b/src/gnome/gtkbuilder/dialog-lot-viewer.glade @@ -18,7 +18,6 @@ True True 200 - 300 @@ -27,7 +26,6 @@ True 3 200 - True diff --git a/src/import-export/csv-export/assistant-csv-export.c b/src/import-export/csv-export/assistant-csv-export.c index f1bcc02861..ff160e7547 100644 --- a/src/import-export/csv-export/assistant-csv-export.c +++ b/src/import-export/csv-export/assistant-csv-export.c @@ -34,7 +34,6 @@ #include "gnc-uri-utils.h" #include "gnc-component-manager.h" #include "gnc-date-edit.h" -#include "gnc-gconf-utils.h" #include "gnc-prefs.h" #include "gnc-tree-view-account.h" #include "dialog-utils.h" @@ -46,9 +45,8 @@ #include "csv-tree-export.h" #include "csv-transactions-export.h" -#define GCONF_SECTION "dialogs/export/csv" -#define GNC_PREFS_GROUP "dialogs.export.csv" -#define PANED_POSITION "paned_position" +#define GNC_PREFS_GROUP "dialogs.export.csv" +#define GNC_PREF_PANED_POS "paned_position" #define ASSISTANT_CSV_EXPORT_CM_CLASS "assistant-csv-export" /* This static indicates the debugging module that this .o belongs to. */ @@ -746,13 +744,6 @@ csv_export_assistant_summary_page_prepare (GtkAssistant *assistant, { CsvExportInfo *info = user_data; gchar *text, *mtext; - - /* Save the Window size, paned position and directory */ - if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY)) - { - gnc_gconf_set_int(GCONF_SECTION, PANED_POSITION, - gtk_paned_get_position(GTK_PANED(info->csva.paned)), NULL); - } gnc_set_default_directory(GNC_PREFS_GROUP, info->starting_dir); if (info->failed) @@ -1009,13 +1000,10 @@ csv_export_assistant_create (CsvExportInfo *info) G_CALLBACK (csv_export_assistant_destroy_cb), info); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window)); - - info->csva.paned = GTK_WIDGET(gtk_builder_get_object (builder, "paned")); - if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY)) { - gint position = gnc_gconf_get_int(GCONF_SECTION, PANED_POSITION, NULL); - gtk_paned_set_position(GTK_PANED(info->csva.paned), position); + GObject *object = gtk_builder_get_object (builder, "paned"); + gnc_prefs_bind (GNC_PREFS_GROUP, GNC_PREF_PANED_POS, object, "position"); } gtk_builder_connect_signals(builder, info); diff --git a/src/import-export/csv-export/assistant-csv-export.h b/src/import-export/csv-export/assistant-csv-export.h index 30d40732e3..99c9241843 100644 --- a/src/import-export/csv-export/assistant-csv-export.h +++ b/src/import-export/csv-export/assistant-csv-export.h @@ -52,7 +52,6 @@ typedef struct typedef struct { - GtkWidget *paned; GtkWidget *acct_info; GtkWidget *expense_radio; GtkWidget *asset_radio;