dabo Commit
Revision 5163
Date: 2009-03-31 18:47:42 -0700 (Tue, 31 Mar 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5163

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

Log:
Added the 'force' option to dEditor.saveFile(). Previously, if calling 'Save 
As' from the Editor, the save would be ignored if the original file was not 
changed.

Added additional pathing to image searching to handle the way py2app stores 
resources in bundled apps.


Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2009-03-31 22:39:02 UTC (rev 5162)
+++ trunk/dabo/ui/uiwx/__init__.py      2009-04-01 01:47:42 UTC (rev 5163)
@@ -1569,6 +1569,16 @@
                        # Create a list of the places to search for the image, 
with
                        # the most likely choices first.
                        paths = [val] + iconpaths + dabopaths + localpaths
+                       # See if it's running as a Mac application
+                       macAppIndicator = "/Contents/Resources"
+                       dpth = dabo.__path__[0]
+                       if macAppIndicator in dpth:
+                               # Running as a py2app application
+                               resPth = "%s%s" % 
(dpth.split(macAppIndicator)[0], macAppIndicator)
+                               macPaths = [os.path.join(resPth, pth, val)
+                                       for pth in ("icons", "resources")]
+                               paths += macPaths
+                               
                        # See if it's a standard icon
                        for pth in paths:
                                ret = dIcons.getIconBitmap(pth, noEmptyBmp=True)

Modified: trunk/dabo/ui/uiwx/dEditor.py
===================================================================
--- trunk/dabo/ui/uiwx/dEditor.py       2009-03-31 22:39:02 UTC (rev 5162)
+++ trunk/dabo/ui/uiwx/dEditor.py       2009-04-01 01:47:42 UTC (rev 5163)
@@ -1414,8 +1414,8 @@
                return fname
 
 
-       def saveFile(self, fname=None):
-               if not self.isChanged() and self._fileName:
+       def saveFile(self, fname=None, force=False):
+               if not force and (not self.isChanged() and self._fileName):
                        # Nothing changed
                        return
                if self._curdir:



_______________________________________________
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