[Gnucash-changes] r13679 - gnucash/trunk - Add support for renumbering the account codes for all the children of

David Hampton hampton at cvs.gnucash.org
Tue Mar 21 18:36:06 EST 2006


Author: hampton
Date: 2006-03-21 18:36:05 -0500 (Tue, 21 Mar 2006)
New Revision: 13679
Trac: http://svn.gnucash.org/trac/changeset/13679

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/dialog-account.c
   gnucash/trunk/src/gnome-utils/dialog-account.h
   gnucash/trunk/src/gnome/glade/account.glade
   gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
   gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree-ui.xml
Log:
Add support for renumbering the account codes for all the children of
a given account.  Implements 334594.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-03-21 22:02:19 UTC (rev 13678)
+++ gnucash/trunk/ChangeLog	2006-03-21 23:36:05 UTC (rev 13679)
@@ -1,3 +1,12 @@
+2006-03-21  David Hampton  <hampton at employees.org>
+
+	* src/gnome-utils/dialog-account.[ch]:
+	* src/gnome/gnc-plugin-page-account-tree.c:
+	* src/gnome/glade/account.glade:
+	* src/gnome/ui/gnc-plugin-page-account-tree-ui.xml: Add support
+	for renumbering the account codes for all the children of a given
+	account.  Implements 334594.
+
 2006-03-21  Andreas Köhler  <andi5.py at gmx.net>
 
 	* src/gnome/gnc-plugin-page-register.c: Fill the filter by dialog

Modified: gnucash/trunk/src/gnome/glade/account.glade
===================================================================
--- gnucash/trunk/src/gnome/glade/account.glade	2006-03-21 22:02:19 UTC (rev 13678)
+++ gnucash/trunk/src/gnome/glade/account.glade	2006-03-21 23:36:05 UTC (rev 13679)
@@ -3155,4 +3155,331 @@
   </child>
 </widget>
 
+<widget class="GtkDialog" id="Renumber Accounts">
+  <property name="border_width">6</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Renumber sub-accounts</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">True</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="has_separator">True</property>
+  <signal name="response" handler="gnc_account_renumber_response_cb" last_modification_time="Sat, 18 Mar 2006 21:52:03 GMT"/>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox14">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">6</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area14">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton2">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton2">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment19">
+		  <property name="visible">True</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">0</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox1">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">2</property>
+
+		      <child>
+			<widget class="GtkImage" id="image1">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-execute</property>
+			  <property name="icon_size">4</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label8477439">
+			  <property name="visible">True</property>
+			  <property name="label">_Renumber</property>
+			  <property name="use_underline">True</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkTable" id="table12">
+	  <property name="visible">True</property>
+	  <property name="n_rows">5</property>
+	  <property name="n_columns">2</property>
+	  <property name="homogeneous">False</property>
+	  <property name="row_spacing">6</property>
+	  <property name="column_spacing">12</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label8477435">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Prefix:</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="header_label">
+	      <property name="visible">True</property>
+	      <property name="label">Renumber the immediate sub-accounts of xxx.</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">True</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">0</property>
+	      <property name="bottom_attach">1</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkEntry" id="prefix_entry">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="editable">True</property>
+	      <property name="visibility">True</property>
+	      <property name="max_length">0</property>
+	      <property name="text" translatable="yes"></property>
+	      <property name="has_frame">True</property>
+	      <property name="invisible_char">*</property>
+	      <property name="activates_default">False</property>
+	      <signal name="changed" handler="gnc_account_renumber_prefix_changed_cb" last_modification_time="Sat, 18 Mar 2006 21:52:12 GMT"/>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label8477436">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Examples:</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">3</property>
+	      <property name="bottom_attach">4</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="example1_label">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes"></property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">3</property>
+	      <property name="bottom_attach">4</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label8477438">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Interval:</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">3</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkSpinButton" id="interval_spin">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="climb_rate">1</property>
+	      <property name="digits">0</property>
+	      <property name="numeric">False</property>
+	      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+	      <property name="snap_to_ticks">False</property>
+	      <property name="wrap">False</property>
+	      <property name="adjustment">10 1 10000 5 100 100</property>
+	      <signal name="value_changed" handler="gnc_account_renumber_interval_changed_cb" last_modification_time="Sat, 18 Mar 2006 21:52:21 GMT"/>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">3</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="example2_label">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes"></property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">4</property>
+	      <property name="bottom_attach">5</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2006-03-21 22:02:19 UTC (rev 13678)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2006-03-21 23:36:05 UTC (rev 13679)
@@ -123,6 +123,7 @@
 static void gnc_plugin_page_account_tree_cmd_open_subaccounts (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_edit_account (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPageAccountTree *page);
+static void gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_view_filter_by (GtkAction *action, GncPluginPageAccountTree *plugin_page);
 static void gnc_plugin_page_account_tree_cmd_reconcile (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_transfer (GtkAction *action, GncPluginPageAccountTree *page);
@@ -161,6 +162,9 @@
 	{ "EditDeleteAccountAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete Account..."), NULL,
 	  N_("Delete selected account"),
 	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_delete_account) },
+	{ "EditRenumberSubaccountsAction", NULL, N_("_Renumber Subaccounts..."), NULL,
+	  N_("Renumber the children of the selected account"),
+	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_renumber_accounts) },
 
 	/* View menu */
 	{ "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
@@ -623,20 +627,24 @@
 						   GncPluginPageAccountTree *page)
 {
 	GtkActionGroup *action_group;
+	GtkAction *action;
 	GtkTreeView *view;
 	Account *account = NULL;
 	gboolean sensitive;
+	gboolean subaccounts;
 
 	g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
 
 	if (!selection) {
 		sensitive = FALSE;
+		subaccounts = FALSE;
 	} else {
 		g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
 		view = gtk_tree_selection_get_tree_view (selection);
 		account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(view));
 		sensitive = (account != NULL);
 
+		subaccounts = (xaccAccountGetChildren(account) != NULL);
 		/* Check here for placeholder accounts, etc. */
 	}
 
@@ -644,6 +652,13 @@
 	gnc_plugin_update_actions (action_group, actions_requiring_account,
 				   "sensitive", sensitive);
 	g_signal_emit (page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
+
+	action = gtk_action_group_get_action (action_group, "EditRenumberSubaccountsAction");
+	g_object_set (G_OBJECT(action), "sensitive",
+		      sensitive && subaccounts, NULL);
+
+	gnc_plugin_update_actions (action_group, actions_requiring_account,
+				   "sensitive", sensitive);
 }
 	
 
@@ -1084,6 +1099,21 @@
   g_free(acct_name);
 }
 
+static void
+gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action,
+						    GncPluginPageAccountTree *page)
+{
+  Account *account;
+  GtkWidget *window;
+
+  window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
+  account = gnc_plugin_page_account_tree_get_current_account(page);
+  if (!window || !account)
+    return;
+
+  gnc_account_renumber_create_dialog(window, account);
+}
+
 /*********************/
 
 static void

Modified: gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree-ui.xml
===================================================================
--- gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree-ui.xml	2006-03-21 22:02:19 UTC (rev 13678)
+++ gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree-ui.xml	2006-03-21 23:36:05 UTC (rev 13679)
@@ -18,6 +18,7 @@
       <placeholder name="EditSelectedPlaceholder">
         <menuitem name="EditEditAccount" action="EditEditAccountAction"/>
 	<menuitem name="EditDeleteAccount" action="EditDeleteAccountAction"/>
+	<menuitem name="EditRenumberSubaccounts" action="EditRenumberSubaccountsAction"/>
       </placeholder>
     </menu>
     <menu name="Actions" action="ActionsAction">

Modified: gnucash/trunk/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.c	2006-03-21 22:02:19 UTC (rev 13678)
+++ gnucash/trunk/src/gnome-utils/dialog-account.c	2006-03-21 23:36:05 UTC (rev 13679)
@@ -2,7 +2,7 @@
  * dialog-account.c -- window for creating and editing accounts for *
  *                     GnuCash                                      *
  * Copyright (C) 2000 Dave Peticolas <dave at krondo.com>              *
- * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>    *
+ * Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org> *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -105,7 +105,18 @@
   gint component_id;
 } AccountWindow;
 
+typedef struct _RenumberDialog
+{
+  GtkWidget *dialog;
+  GtkWidget *prefix;
+  GtkWidget *interval;
+  GtkWidget *example1;
+  GtkWidget *example2;
 
+  Account *parent;
+  gint num_children;
+} RenumberDialog;
+
 /** Static Globals *******************************************************/
 static QofLogModule log_module = GNC_MOD_GUI;
 
@@ -117,6 +128,9 @@
 static void gnc_account_window_set_name (AccountWindow *aw);
 static void make_account_changes(GHashTable *change_type);
 
+void gnc_account_renumber_prefix_changed_cb (GtkEditable *editable, RenumberDialog *data);
+void gnc_account_renumber_interval_changed_cb (GtkSpinButton *spinbutton, RenumberDialog *data);
+void gnc_account_renumber_response_cb (GtkDialog *dialog, gint response, RenumberDialog *data);
 
 /** Implementation *******************************************************/
 
@@ -1779,3 +1793,116 @@
 
   return;
 }
+
+/**************************************************/
+
+static void
+gnc_account_renumber_update_examples (RenumberDialog *data)
+{
+  gchar *str;
+  gchar *prefix;
+  gint interval, num_digits;
+
+  prefix = gtk_editable_get_chars(GTK_EDITABLE(data->prefix), 0, -1);
+  interval = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(data->interval));
+  num_digits = log10(data->num_children * interval) + 1;
+
+  str = g_strdup_printf("%s-%0*d", prefix, num_digits, interval);
+  gtk_label_set_text(GTK_LABEL(data->example1), str);
+  g_free(str);
+
+  str = g_strdup_printf("%s-%0*d", prefix, num_digits,
+			interval * data->num_children);
+  gtk_label_set_text(GTK_LABEL(data->example2), str);
+  g_free(str);
+
+  g_free(prefix);
+}
+
+void
+gnc_account_renumber_prefix_changed_cb (GtkEditable *editable,
+				  RenumberDialog *data)
+{
+  gnc_account_renumber_update_examples(data);
+}
+
+void
+gnc_account_renumber_interval_changed_cb (GtkSpinButton *spinbutton,
+				    RenumberDialog *data)
+{
+  gnc_account_renumber_update_examples(data);
+}
+
+void
+gnc_account_renumber_response_cb (GtkDialog *dialog,
+			       gint response,
+			       RenumberDialog *data)
+{
+  AccountGroup *group;
+  GList *children, *tmp;
+  gchar *str;
+  gchar *prefix;
+  gint interval, num_digits, i;
+
+  if (response == GTK_RESPONSE_OK) {
+    gtk_widget_hide(data->dialog);
+    group = xaccAccountGetChildren(data->parent);
+    children = xaccGroupGetAccountListSorted(group);
+    prefix = gtk_editable_get_chars(GTK_EDITABLE(data->prefix), 0, -1);
+    interval =
+      gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(data->interval));
+    num_digits = log10(data->num_children * interval) + 1;
+
+    gnc_set_busy_cursor (NULL, TRUE);
+    for (tmp = children, i = 1; tmp; tmp = g_list_next(tmp), i += 1) {
+      str = g_strdup_printf("%s-%0*d", prefix, num_digits, interval * i);
+      xaccAccountSetCode(tmp->data, str);
+      g_free(str);
+    }
+    gnc_unset_busy_cursor (NULL);
+  }
+
+  gtk_widget_destroy(data->dialog);
+  g_free(data);
+}
+
+void
+gnc_account_renumber_create_dialog (GtkWidget *window, Account *account)
+{
+  RenumberDialog *data;
+  GladeXML *xml;
+  AccountGroup *children;
+  GtkWidget *widget;
+  gchar *string;
+
+  data = g_new(RenumberDialog, 1);
+  data->parent = account;
+  children = xaccAccountGetChildren(account);
+  data->num_children = xaccGroupGetNumAccounts(children);
+
+  xml = gnc_glade_xml_new ("account.glade", "Renumber Accounts");
+  data->dialog = glade_xml_get_widget (xml, "Renumber Accounts");
+  gtk_window_set_transient_for(GTK_WINDOW(data->dialog), GTK_WINDOW(window));
+  g_object_set_data_full(G_OBJECT(data->dialog), "xml", xml, g_object_unref);
+
+  widget = glade_xml_get_widget (xml, "header_label");
+  string = g_strdup_printf(_( "Renumber the immediate sub-accounts of %s?  "
+			      "This will replace the account code field of "
+			      "each child account with a newly generated code."),
+			   xaccAccountGetFullName(account));
+  gtk_label_set_text(GTK_LABEL(widget), string);
+  g_free(string);
+
+  data->prefix = glade_xml_get_widget (xml, "prefix_entry");
+  data->interval = glade_xml_get_widget (xml, "interval_spin");
+  data->example1 = glade_xml_get_widget (xml, "example1_label");
+  data->example2 = glade_xml_get_widget (xml, "example2_label");
+
+  gtk_entry_set_text(GTK_ENTRY(data->prefix), xaccAccountGetCode(account));
+  gnc_account_renumber_update_examples(data);
+
+  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func,
+				    data);
+  
+  gtk_widget_show_all(data->dialog);
+}

Modified: gnucash/trunk/src/gnome-utils/dialog-account.h
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.h	2006-03-21 22:02:19 UTC (rev 13678)
+++ gnucash/trunk/src/gnome-utils/dialog-account.h	2006-03-21 23:36:05 UTC (rev 13679)
@@ -146,6 +146,9 @@
  */
 void gnc_ui_register_account_destroy_callback (void (*cb)(Account *));
 /** @} */
+
+void gnc_account_renumber_create_dialog (GtkWidget *window, Account *account);
+
 /** @} */
 /** @} */
 



More information about the gnucash-changes mailing list