dabo Commit
Revision 4492
Date: 2008-09-01 09:12:16 -0700 (Mon, 01 Sep 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4492

Changed:
U   trunk/ide/ClassDesigner.py

Log:
Modified the startup so that if you pass the name of file you want to create 
that does not yet exist, it asks you if you want to create it instead of just 
ignoring it.


Diff:
Modified: trunk/ide/ClassDesigner.py
===================================================================
--- trunk/ide/ClassDesigner.py  2008-09-01 01:17:47 UTC (rev 4491)
+++ trunk/ide/ClassDesigner.py  2008-09-01 16:12:16 UTC (rev 4492)
@@ -173,7 +173,10 @@
                                frm = self.openClass(clsFile)
                                clsOK = True
                        except IOError, e:
-                               dui.stop(str(e))
+                               msg = _("'%s' does not exist. Create it?") % 
clsFile
+                               if dui.areYouSure(message=msg, title=_("File 
Not Found"), cancelButton=False):
+                                       frm = self.onNewDesign(evt=None, 
pth=clsFile)
+                                       clsOK = True
 
                if not clsOK:
                        # Define the form class, and instantiate it.
@@ -1768,7 +1771,7 @@
                        dui.callAfterInterval(100, self.updateLayout)
 
 
-       def onNewDesign(self, evt):
+       def onNewDesign(self, evt, pth=None):
                pcs = self.pagedControls
                class NewClassPicker(dabo.ui.dOkCancelDialog):
                        def addControls(self):
@@ -1845,9 +1848,12 @@
                if not isFormClass:
                        obj = self.addNewControl(frm.initLayoutPanel, newClass)
                        frm.Caption = _("Dabo Class Designer: %s") % obj.Name
+               if pth:
+                       frm._classFile = pth
                frm.Visible = True
                dui.callAfter(frm.bringToFront)
                dui.callAfter(frm.saveState)
+               return frm
 
 
        def wrapSave(self, func, *args, **kwargs):




_______________________________________________
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