dabo Commit
Revision 7150
Date: 2012-04-27 10:05:18 -0700 (Fri, 27 Apr 2012)
Author: Ed
Trac: http://trac.dabodev.com/changeset/7150

Changed:
U   trunk/dabo/ui/uiwx/__init__.py

Log:
Fixed a couple of edge cases in menu creation.

Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2012-04-27 15:53:30 UTC (rev 7149)
+++ trunk/dabo/ui/uiwx/__init__.py      2012-04-27 17:05:18 UTC (rev 7150)
@@ -1397,6 +1397,9 @@
                                cap = menu._extractKey(itmatts, "Caption")
                                hk = menu._extractKey(itmatts, "HotKey")
                                pic = menu._extractKey(itmatts, "Icon")
+                               if pic == "None":
+                                       # Can be the string 'None' if changed 
in the Menu Designer
+                                       pic = None
                                special = menu._extractKey(itmatts, "special", 
None)
                                binding = previewFunc
                                fnc = menu._extractKey(itmatts, "Action", "")
@@ -1419,10 +1422,15 @@
                mnd = src
        else:
                try:
-                       src = utils.resolvePathAndUpdate(src)
-               except IOError, e:
-                       stop(e, _("File Not Found"))
-                       return
+                       # See if the src is a JSON-ified dict
+                       src = dabo.lib.jsonDecode(src)
+               except ValueError:
+                       # Not JSON
+                       try:
+                               src = utils.resolvePathAndUpdate(src)
+                       except IOError, e:
+                               stop(e, _("File Not Found"))
+                               return
                mnd = dabo.lib.xmltodict.xmltodict(src)
        mb = dabo.ui.dMenuBar()
        for mn in mnd["children"]:



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to