[Gnucash-changes] r13364 - gnucash/trunk - Cleanup patch from Andreas Köhler.

David Hampton hampton at cvs.gnucash.org
Wed Feb 22 17:35:04 EST 2006


Author: hampton
Date: 2006-02-22 17:35:03 -0500 (Wed, 22 Feb 2006)
New Revision: 13364
Trac: http://svn.gnucash.org/trac/changeset/13364

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome/gnc-plugin-page-register.c
   gnucash/trunk/src/gtk-compat.h
Log:
Cleanup patch from Andreas Köhler.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-02-22 21:52:46 UTC (rev 13363)
+++ gnucash/trunk/ChangeLog	2006-02-22 22:35:03 UTC (rev 13364)
@@ -1,5 +1,9 @@
 2006-02-22  David Hampton  <hampton at 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-control.c:
 	* src/gnome/gnc-plugin-page-register.c: Provide a callback whereby

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2006-02-22 21:52:46 UTC (rev 13363)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2006-02-22 22:35:03 UTC (rev 13364)
@@ -605,19 +605,19 @@
 }
 
 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 @@
 	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 @@
 					    GncPluginPageRegister *plugin_page)
 {
   GncPluginPageRegisterPrivate *priv;
+  SplitRegister *reg;
   SplitRegisterStyle value;
 
   ENTER("(action %p, radio action %p, plugin_page %p)",
@@ -2148,7 +2149,9 @@
   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(" ");
 }
 

Modified: gnucash/trunk/src/gtk-compat.h
===================================================================
--- gnucash/trunk/src/gtk-compat.h	2006-02-22 21:52:46 UTC (rev 13363)
+++ gnucash/trunk/src/gtk-compat.h	2006-02-22 22:35:03 UTC (rev 13364)
@@ -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



More information about the gnucash-changes mailing list