dabo Commit
Revision 5482
Date: 2009-10-23 04:20:33 -0700 (Fri, 23 Oct 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5482

Changed:
U   trunk/ide/ClassDesignerFormMixin.py
U   trunk/ide/ClassDesignerMenu.py

Log:
Added a 'Save As' menu option to the Class Designer. Suggested by Paul B. Trac 
issue #1296.


Diff:
Modified: trunk/ide/ClassDesignerFormMixin.py
===================================================================
--- trunk/ide/ClassDesignerFormMixin.py 2009-10-22 17:35:44 UTC (rev 5481)
+++ trunk/ide/ClassDesignerFormMixin.py 2009-10-23 11:20:33 UTC (rev 5482)
@@ -446,6 +446,18 @@
                return self._classFile
                
                
+       def onSaveAsDesign(self, evt):
+               self._classFile = dabo.ui.getSaveAs(wildcard="cdxml")
+               if not self._classFile:
+                       # User canceled
+                       return
+               self._classFile = self._classFile.rstrip(".")
+               if not self._classFile.endswith(".cdxml"):
+                       self._classFile += ".cdxml"
+               self._savedState = {}
+               self.onSaveDesign(evt)
+
+
        def onSaveDesign(self, evt, useTmp=False):
                currForm = self.Controller.CurrentForm
                newFile = False

Modified: trunk/ide/ClassDesignerMenu.py
===================================================================
--- trunk/ide/ClassDesignerMenu.py      2009-10-22 17:35:44 UTC (rev 5481)
+++ trunk/ide/ClassDesignerMenu.py      2009-10-23 11:20:33 UTC (rev 5482)
@@ -98,6 +98,11 @@
                                ItemID="file_saveasclass",
                                help=_("Save the ClassDesigner contents as a 
class"))
                itm.DynamicEnabled = app.shouldEnableSaveAsClass
+               fm.prepend(_("Save &As..."),
+                               HotKey="Ctrl+Shift+V",
+                               OnHit=app.onSaveAsDesign,
+                               ItemID="file_saveas",
+                               help=_("Save the ClassDesigner contents in a 
new file"))
                fm.prepend(_("&Save"),
                                HotKey="Ctrl+S",
                                OnHit=app.onSaveDesign,




_______________________________________________
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