Cleanup patch from Andreas Köhler.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13364 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-02-22 22:35:03 +00:00
parent 3d6a06e208
commit fa9f8dea28
3 changed files with 17 additions and 10 deletions

View File

@ -1,5 +1,9 @@
2006-02-22 David Hampton <hampton@employees.org> 2006-02-22 David Hampton <hampton@employees.org>
* 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.[ch]:
* src/register/ledger-core/split-register-control.c: * src/register/ledger-core/split-register-control.c:
* src/gnome/gnc-plugin-page-register.c: Provide a callback whereby * src/gnome/gnc-plugin-page-register.c: Provide a callback whereby

View File

@ -605,19 +605,19 @@ gnc_plugin_page_register_update_split_button (SplitRegister *reg, GncPluginPageR
} }
static void 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; GtkActionGroup *action_group;
GtkAction *action; GtkAction *action;
GValue gvalue = { 0 };
action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE (page)); 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, action = gtk_action_group_get_action (action_group,
"SplitTransactionAction"); "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 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); 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); 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) GncPluginPageRegister *plugin_page)
{ {
GncPluginPageRegisterPrivate *priv; GncPluginPageRegisterPrivate *priv;
SplitRegister *reg;
SplitRegisterStyle value; SplitRegisterStyle value;
ENTER("(action %p, radio action %p, plugin_page %p)", 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); priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
value = gtk_radio_action_get_current_value(current); value = gtk_radio_action_get_current_value(current);
gnc_split_reg_change_style(priv->gsr, value); 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(" "); LEAVE(" ");
} }

View File

@ -20,9 +20,9 @@
#ifndef HAVE_GTK26 #ifndef HAVE_GTK26
#define gtk_action_set_sensitive(action, xxx) \ #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) \ #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 #define GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID -2
#endif #endif