From 66baad0f8ed4d373229b67c85dece0043847a446 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Wed, 22 Feb 2006 01:38:42 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20from=20Andreas=20K=C3=B6hler=20to=20deact?= =?UTF-8?q?ivate=20the=20toolbar=20split=20button=20in=20an=20auto-split?= =?UTF-8?q?=20register.=20=20Fixes=20330621.?= 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@13354 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ src/gnome/gnc-plugin-page-register.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index adea375c72..1468ab469c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-02-21 David Hampton + * src/gnome/gnc-plugin-page-register.c: Fix from Andreas Köhler to + deactivate the toolbar split button in an auto-split register. + Fixes 330621. + * src/gnome-utils/gnc-tree-model-account.c: Two fixes from Andreas Köhler. One fixes 331183, the problem where editing a top-level account doesn't set the current parent. diff --git a/src/gnome/gnc-plugin-page-register.c b/src/gnome/gnc-plugin-page-register.c index f828949f6f..e9e69ff1b2 100644 --- a/src/gnome/gnc-plugin-page-register.c +++ b/src/gnome/gnc-plugin-page-register.c @@ -577,6 +577,22 @@ gnc_plugin_page_register_get_account (GncPluginPageRegister *page) } +static void +gnc_plugin_page_register_update_toolbar (GncPluginPageRegister *page, SplitRegisterStyle style) +{ + 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); +} + static void gnc_plugin_page_register_update_menus (GncPluginPageRegister *page) { @@ -616,6 +632,8 @@ gnc_plugin_page_register_update_menus (GncPluginPageRegister *page) g_signal_handlers_block_by_func(action, gnc_plugin_page_register_cmd_style_double_line, 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); } @@ -2103,6 +2121,7 @@ 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); LEAVE(" "); }