r23688 - gnucash/trunk/src/gnome-utils - Bug 555182 - Security Type template hidden

John Ralls jralls at code.gnucash.org
Sun Jan 12 21:12:10 EST 2014


Author: jralls
Date: 2014-01-12 21:12:10 -0500 (Sun, 12 Jan 2014)
New Revision: 23688
Trac: http://svn.gnucash.org/trac/changeset/23688

Modified:
   gnucash/trunk/src/gnome-utils/dialog-commodity.c
Log:
Bug 555182 - Security Type template hidden

Part 1: Prevent users from creating commodities of type "template"

Modified: gnucash/trunk/src/gnome-utils/dialog-commodity.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-commodity.c	2014-01-12 20:50:51 UTC (rev 23687)
+++ gnucash/trunk/src/gnome-utils/dialog-commodity.c	2014-01-13 02:12:10 UTC (rev 23688)
@@ -1329,6 +1329,17 @@
         return FALSE;
     }
 
+    /* Don't allow user to create commodities in namespace
+     * "template". That's reserved for scheduled transaction use.
+     */
+    if (g_utf8_collate(namespace, "template") == 0)
+    {
+	gnc_warning_dialog (w->dialog,
+			    _("%s is a reserved commodity type."
+			      " Please use something else."), "template");
+	return FALSE;
+    }
+
     if (fullname && fullname[0] &&
             namespace && namespace[0] &&
             mnemonic && mnemonic[0])



More information about the gnucash-changes mailing list