From fa9f8dea28596e3ccc8f373c145ddadf5d108b1a Mon Sep 17 00:00:00 2001 From: David Hampton Date: Wed, 22 Feb 2006 22:35:03 +0000 Subject: [PATCH] =?UTF-8?q?Cleanup=20patch=20from=20Andreas=20K=C3=B6hler.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13364 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ src/gnome/gnc-plugin-page-register.c | 19 +++++++++++-------- src/gtk-compat.h | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f798d8fde..c0e7c5a2f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-02-22 David Hampton + * src/gtk-compat.h: + * src/gnome/gnc-plugin-page-register.c: Cleanup patch from Andreas + Köhler. + * src/register/ledger-core/split-register.[ch]: * src/register/ledger-core/split-register-control.c: * src/gnome/gnc-plugin-page-register.c: Provide a callback whereby diff --git a/src/gnome/gnc-plugin-page-register.c b/src/gnome/gnc-plugin-page-register.c index 9f6f66cd58..f0fd66afe9 100644 --- a/src/gnome/gnc-plugin-page-register.c +++ b/src/gnome/gnc-plugin-page-register.c @@ -605,19 +605,19 @@ gnc_plugin_page_register_update_split_button (SplitRegister *reg, GncPluginPageR } static void -gnc_plugin_page_register_update_toolbar (GncPluginPageRegister *page, SplitRegisterStyle style) +gnc_plugin_page_register_update_toolbar (SplitRegister *reg, GncPluginPageRegister *page) { GtkActionGroup *action_group; GtkAction *action; - GValue gvalue = { 0 }; action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE (page)); - - g_value_init (&gvalue, G_TYPE_BOOLEAN); - g_value_set_boolean (&gvalue, style == REG_STYLE_LEDGER); action = gtk_action_group_get_action (action_group, "SplitTransactionAction"); - g_object_set_property (G_OBJECT (action), "sensitive", &gvalue); + /* set sensitivity of split button */ + gtk_action_set_sensitive (action, reg->style == REG_STYLE_LEDGER); + + /* set activity of split button */ + gnc_plugin_page_register_update_split_button (reg, page); } static void @@ -660,7 +660,7 @@ gnc_plugin_page_register_update_menus (GncPluginPageRegister *page) gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), reg->use_double_line); g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register_cmd_style_double_line, page); - gnc_plugin_page_register_update_toolbar (page, reg->style); + gnc_plugin_page_register_update_toolbar (reg, page); } @@ -2136,6 +2136,7 @@ gnc_plugin_page_register_cmd_style_changed (GtkAction *action, GncPluginPageRegister *plugin_page) { GncPluginPageRegisterPrivate *priv; + SplitRegister *reg; SplitRegisterStyle value; ENTER("(action %p, radio action %p, plugin_page %p)", @@ -2148,7 +2149,9 @@ gnc_plugin_page_register_cmd_style_changed (GtkAction *action, priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page); value = gtk_radio_action_get_current_value(current); gnc_split_reg_change_style(priv->gsr, value); - gnc_plugin_page_register_update_toolbar (plugin_page, value); + + reg = gnc_ledger_display_get_split_register(priv->ledger); + gnc_plugin_page_register_update_toolbar (reg, plugin_page); LEAVE(" "); } diff --git a/src/gtk-compat.h b/src/gtk-compat.h index f9deaf9237..321d3c8430 100644 --- a/src/gtk-compat.h +++ b/src/gtk-compat.h @@ -20,9 +20,9 @@ #ifndef HAVE_GTK26 #define gtk_action_set_sensitive(action, xxx) \ - g_object_set(action, "sensitive", xxx, NULL) + g_object_set((action), "sensitive", (xxx), NULL) #define gtk_action_set_visible(action, xxx) \ - g_object_set(action, "visible", xxx, NULL) + g_object_set((action), "visible", (xxx), NULL) #define GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID -2 #endif