r22239 - gnucash/branches/2.4/src - Bug #611853 - Entering a 2-digit year in the opening balance tab results

Geert Janssens gjanssens at code.gnucash.org
Mon Jun 25 16:01:37 EDT 2012


Author: gjanssens
Date: 2012-06-25 16:01:36 -0400 (Mon, 25 Jun 2012)
New Revision: 22239
Trac: http://svn.gnucash.org/trac/changeset/22239

Modified:
   gnucash/branches/2.4/src/gnome-utils/dialog-account.c
   gnucash/branches/2.4/src/gnome/glade/account.glade
Log:
Bug #611853 - Entering a 2-digit year in the opening balance tab results
in "Parsing Error"
This bug was already fixed on trunk as part of the patch that converted
the new account dialog from glade to gtkbuilder.
This commit extracts only the parts required to fix bug #611853

Modified: gnucash/branches/2.4/src/gnome/glade/account.glade
===================================================================
--- gnucash/branches/2.4/src/gnome/glade/account.glade	2012-06-24 04:05:23 UTC (rev 22238)
+++ gnucash/branches/2.4/src/gnome/glade/account.glade	2012-06-25 20:01:36 UTC (rev 22239)
@@ -620,13 +620,7 @@
                       <widget class="GtkHBox" id="opening_balance_date_box">
                         <property name="visible">True</property>
                         <child>
-                          <widget class="GnomeDateEdit" id="opening_balance_date_edit">
-                            <property name="visible">True</property>
-                            <property name="dateedit_flags">GNOME_DATE_EDIT_SHOW_TIME | GNOME_DATE_EDIT_24_HR</property>
-                          </widget>
-                          <packing>
-                            <property name="position">0</property>
-                          </packing>
+                          <placeholder/>
                         </child>
                       </widget>
                       <packing>

Modified: gnucash/branches/2.4/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/branches/2.4/src/gnome-utils/dialog-account.c	2012-06-24 04:05:23 UTC (rev 22238)
+++ gnucash/branches/2.4/src/gnome-utils/dialog-account.c	2012-06-25 20:01:36 UTC (rev 22239)
@@ -37,6 +37,7 @@
 #include "dialog-commodity.h"
 #include "dialog-utils.h"
 #include "gnc-amount-edit.h"
+#include "gnc-date-edit.h"
 #include "gnc-general-select.h"
 #include "gnc-commodity.h"
 #include "gnc-commodity-edit.h"
@@ -448,8 +449,8 @@
     if (gnc_reverse_balance (account))
         balance = gnc_numeric_neg (balance);
 
-    date = gnome_date_edit_get_time (
-               GNOME_DATE_EDIT (aw->opening_balance_date_edit));
+    date = gnc_date_edit_get_date (
+               GNC_DATE_EDIT (aw->opening_balance_date_edit));
 
     use_equity = gtk_toggle_button_get_active
                  (GTK_TOGGLE_BUTTON (aw->opening_equity_radio));
@@ -1296,6 +1297,7 @@
 gnc_account_window_create(AccountWindow *aw)
 {
     GtkWidget *amount;
+    GtkWidget *date_edit;
     GObject *awo;
     GtkWidget *box;
     GtkWidget *label;
@@ -1378,7 +1380,10 @@
     gtk_label_set_mnemonic_widget (GTK_LABEL(label), amount);
 
     box = glade_xml_get_widget (xml, "opening_balance_date_box");
-    aw->opening_balance_date_edit = glade_xml_get_widget (xml, "opening_balance_date_edit");
+    date_edit = gnc_date_edit_new (time (NULL), 1, 1);
+    aw->opening_balance_date_edit = date_edit;
+    gtk_box_pack_start(GTK_BOX(box), date_edit, TRUE, TRUE, 0);
+    gtk_widget_show (date_edit);
 
     aw->opening_balance_page =
         gtk_notebook_get_nth_page (GTK_NOTEBOOK (aw->notebook), 1);



More information about the gnucash-changes mailing list