r15546 - gnucash/trunk/src - Ability to clear out variable bindings in the SLR dialog; better logging.

Josh Sled jsled at cvs.gnucash.org
Fri Feb 9 21:30:44 EST 2007


Author: jsled
Date: 2007-02-09 21:30:43 -0500 (Fri, 09 Feb 2007)
New Revision: 15546
Trac: http://svn.gnucash.org/trac/changeset/15546

Modified:
   gnucash/trunk/src/doc/sx.rst
   gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
Log:
Ability to clear out variable bindings in the SLR dialog; better logging.


Modified: gnucash/trunk/src/doc/sx.rst
===================================================================
--- gnucash/trunk/src/doc/sx.rst	2007-02-10 01:29:29 UTC (rev 15545)
+++ gnucash/trunk/src/doc/sx.rst	2007-02-10 02:30:43 UTC (rev 15546)
@@ -65,25 +65,25 @@
 - bugs
   - [ ] with SLR open (with instances), add variables to SX; only newly-created instances will have appropriate variable tables.
 
+  - [ ] sx-from-trans: "unknown get.type [3]" [dh20070120]_
+
+  - [ ] auto-create (+notify) txns not in review list. [ve20070209]_
+
 ! - [x] crash with two sx lists open and SX mutation
     - I'm pretty sure this is due to SX lists not getting cleaned up on page close, somehow.
 
-  - [ ] sx-from-trans: "unknown get.type [3]" [dh20070120]_
+  - [x] no way to clear a variable entry [ve20070209]_
 
-  - [ ] no way to clear a variable entry [ve20070209]_
-
-  - [ ] auto-create (+notify) txns not in review list. [ve20070209]_
-
 .. _[dh20070120]: http://lists.gnucash.org/pipermail/gnucash-devel/2007-January/019667.html
 .. _[ve20070209]: http://lists.gnucash.org/pipermail/gnucash-devel/2007-February/019834.html
 
 - sx list page
 ! - [ ] use gnc-tree-view?
-! - [x] save/restore state
 ! - [ ] save/restore size
   - [/] make into split panel
     - [ ] fix slider position
   - [ ] {0, 1, 2, 4, 8, 12} month selection for dense calendar
+! - [x] save/restore state
 
 - sx editor
   - [ ] clean up source formatting

Modified: gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2007-02-10 01:29:29 UTC (rev 15545)
+++ gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2007-02-10 02:30:43 UTC (rev 15546)
@@ -903,8 +903,19 @@
      if (!xaccParseAmount(value, TRUE, &parsed_num, &endStr)
          || gnc_numeric_check(parsed_num) != GNC_ERROR_OK)
      {
-          g_critical("@@fixme: better parse error handling");
-          // @fixme: set location (back) to "(need value)"
+          gchar *value_copy = g_strdup(value);
+          g_debug("value=[%s] endStr[%s]", value, endStr);
+          if (strlen(g_strstrip(value_copy)) == 0)
+          {
+               gnc_numeric invalid_num = gnc_numeric_error(GNC_ERROR_ARG);
+               // @fixme? Change to gnc_sx_slr_model_clear_variable(...)?
+               gnc_sx_slr_model_change_variable(dialog->editing_model, inst, var, &invalid_num);
+          }
+          else
+          {
+               g_warning("error parsing value [%s]", value);
+          }
+          g_free(value_copy);
           return;
      }
      gnc_sx_slr_model_change_variable(dialog->editing_model, inst, var, &parsed_num);



More information about the gnucash-changes mailing list