[Gnucash-changes] r14437 - gnucash/branches/register-rewrite/src/gnome - Generalize gnc_ui_print_check_dialog_create() to work with any GncPluginPage

Chris Shoemaker chris at cvs.gnucash.org
Sun Jun 25 19:47:25 EDT 2006


Author: chris
Date: 2006-06-25 19:47:25 -0400 (Sun, 25 Jun 2006)
New Revision: 14437
Trac: http://svn.gnucash.org/trac/changeset/14437

Modified:
   gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c
   gnucash/branches/register-rewrite/src/gnome/dialog-print-check.h
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c
Log:
   Generalize gnc_ui_print_check_dialog_create() to work with any GncPluginPage
   instead of only GncPluginPageRegister.


Modified: gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c	2006-06-25 23:42:31 UTC (rev 14436)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c	2006-06-25 23:47:25 UTC (rev 14437)
@@ -67,7 +67,7 @@
   GladeXML * xml;
   GtkWidget * dialog;
 
-  GncPluginPageRegister *plugin_page;
+  GncPluginPage *plugin_page;
   const char    *payee;
   gnc_numeric    amount;
   time_t         date;
@@ -223,7 +223,7 @@
 \********************************************************************/
 
 void
-gnc_ui_print_check_dialog_create(GncPluginPageRegister *plugin_page,
+gnc_ui_print_check_dialog_create(GncPluginPage *plugin_page,
 				 const char    *payee,
 				 gnc_numeric    amount,
 				 time_t         date,
@@ -273,7 +273,7 @@
     GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "check_rotation_entry"));
   pcd->units_combobox = glade_xml_get_widget (xml, "units_combobox");
 
-  window = GTK_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
+  window = GTK_WINDOW(plugin_page->window);
   gtk_window_set_transient_for(GTK_WINDOW(pcd->dialog), window);
 
   /* Create and attach the date-format chooser */

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-print-check.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-print-check.h	2006-06-25 23:42:31 UTC (rev 14436)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-print-check.h	2006-06-25 23:47:25 UTC (rev 14437)
@@ -27,10 +27,11 @@
 #include <libguile.h>
 
 #include "print-session.h"
+#include "gnc-plugin-page.h"
 
 typedef struct _print_check_dialog PrintCheckDialog;
 
-void gnc_ui_print_check_dialog_create(GncPluginPageRegister *plugin_page,
+void gnc_ui_print_check_dialog_create(GncPluginPage *plugin_page,
 				      const char    *payee,
 				      gnc_numeric    amount,
 				      time_t         date,

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c	2006-06-25 23:42:31 UTC (rev 14436)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c	2006-06-25 23:47:25 UTC (rev 14437)
@@ -269,6 +269,7 @@
 	  N_("Open a register report window for this transaction"),
 	  G_CALLBACK (gnc_plugin_page_register_cmd_transaction_report) },
 };
+
 static guint gnc_plugin_page_register_n_actions = G_N_ELEMENTS (gnc_plugin_page_register_actions);
 
 static GtkToggleActionEntry toggle_entries[] = {
@@ -554,17 +555,17 @@
 	action_group =
 	  gnc_plugin_page_create_action_group(parent,
 					      "GncPluginPageRegisterActions");
-	gtk_action_group_add_actions (action_group, gnc_plugin_page_register_actions,
-				      gnc_plugin_page_register_n_actions, plugin_page);
-	gtk_action_group_add_toggle_actions (action_group,
-					     toggle_entries, n_toggle_entries,
-					     plugin_page);
-	gtk_action_group_add_radio_actions (action_group,
-					    radio_entries_2, n_radio_entries_2,
-					    REG_STYLE_LEDGER,
-					    G_CALLBACK(gnc_plugin_page_register_cmd_style_changed),
-					    plugin_page);
-
+	
+	gtk_action_group_add_actions(
+	    action_group, gnc_plugin_page_register_actions,
+	    gnc_plugin_page_register_n_actions, plugin_page);
+	gtk_action_group_add_toggle_actions(
+	    action_group, toggle_entries, n_toggle_entries, plugin_page);
+	gtk_action_group_add_radio_actions(
+	    action_group, radio_entries_2, n_radio_entries_2, REG_STYLE_LEDGER,
+	    G_CALLBACK(gnc_plugin_page_register_cmd_style_changed),
+	    plugin_page);
+	
 	gnc_plugin_init_short_names (action_group, toolbar_labels);
 	gnc_plugin_set_important_actions (action_group, important_actions);
 
@@ -763,8 +764,8 @@
 		priv->component_manager_id, xaccAccountGetGUID(acct),
 		QOF_EVENT_DESTROY | QOF_EVENT_MODIFY);
 
-	gnc_split_reg_set_moved_cb
-	  (priv->gsr, (GFunc)gnc_plugin_page_register_ui_update, page);
+	gnc_split_reg_set_moved_cb(
+            priv->gsr, (GFunc)gnc_plugin_page_register_ui_update, page);
 
 	/* DRH - Probably lots of other stuff from regWindowLedger should end up here. */
 	LEAVE(" ");
@@ -1836,7 +1837,8 @@
     amount = gnc_numeric_abs (amount);
     date   = xaccTransGetDate(trans);
 
-    gnc_ui_print_check_dialog_create(plugin_page, payee, amount, date, memo);
+    gnc_ui_print_check_dialog_create(GNC_PLUGIN_PAGE(plugin_page), 
+                                     payee, amount, date, memo);
   }
   LEAVE(" ");
 }
@@ -2377,8 +2379,8 @@
   g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
   priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gnc_split_register_cancel_cursor_trans_changes
-    (gnc_ledger_display_get_split_register(priv->ledger));
+  gnc_split_register_cancel_cursor_trans_changes(
+      gnc_ledger_display_get_split_register(priv->ledger));
   LEAVE(" ");
 }
 
@@ -2429,8 +2431,8 @@
   g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
   priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gnc_split_register_duplicate_current
-    (gnc_ledger_display_get_split_register(priv->ledger));
+  gnc_split_register_duplicate_current(
+      gnc_ledger_display_get_split_register(priv->ledger));
   LEAVE(" ");
 }
 



More information about the gnucash-changes mailing list