dabo Commit
Revision 5493
Date: 2009-10-26 12:53:33 -0700 (Mon, 26 Oct 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5493

Changed:
U   trunk/dabo/dApp.py
U   trunk/dabo/ui/uiwx/uiApp.py

Log:
Removed cruft from dApp.py, and moved the setting of the mainform's caption from
setup() to setMainForm(), as suggested by Jacek.


Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py  2009-10-26 12:04:05 UTC (rev 5492)
+++ trunk/dabo/dApp.py  2009-10-26 19:53:33 UTC (rev 5493)
@@ -377,14 +377,7 @@
 
                self._finished = False
                if (not self.SecurityManager or not 
self.SecurityManager.RequireAppLogin
-                       or getattr(self, "_loggedIn", False) or 
self.SecurityManager.login()):
-
-                       userName = self.getUserCaption()
-                       if userName:
-                               userName = " (%s)" % userName
-                       else:
-                               userName = ""
-
+                               or getattr(self, "_loggedIn", False) or 
self.SecurityManager.login()):
                        self._retrieveMRUs()
                        self.uiApp.start()
                if not self._finished:

Modified: trunk/dabo/ui/uiwx/uiApp.py
===================================================================
--- trunk/dabo/ui/uiwx/uiApp.py 2009-10-26 12:04:05 UTC (rev 5492)
+++ trunk/dabo/ui/uiwx/uiApp.py 2009-10-26 19:53:33 UTC (rev 5493)
@@ -409,24 +409,25 @@
                                        frm = self.dApp.MainForm = 
dabo.ui.createForm(mfc)
                                else:
                                        frm = self.dApp.MainForm = mfc()
-               if frm is not None:
-                       if len(frm.Caption) == 0:
-                               # The MainForm has no caption. Put in the 
application name, which by
-                               # default (as of this writing) is "Dabo 
Application"
-                               frm.Caption = self.dApp.getAppInfo("appName")
 
                        
-       def setMainForm(self, val):
+       def setMainForm(self, frm):
+               """Hook called when dApp.MainForm is set."""
                try:
                        self.dApp.MainForm.Destroy()
                except AttributeError:
                        pass
-               self.SetTopWindow(val)
+
+               self.SetTopWindow(frm)
+
+               if not frm.Caption:
+                       frm.Caption = self.dApp.getAppInfo("appName")
+
                # For performance, block all event bindings until after the 
form is shown.
-               eb = val._EventBindings[:]
-               val._EventBindings = []
-               val.Show(self.dApp.showMainFormOnStart)
-               val._EventBindings = eb
+               eb = frm._EventBindings[:]
+               frm._EventBindings = []
+               frm.Show(self.dApp.showMainFormOnStart)
+               frm._EventBindings = eb
 
 
        def start(self):




_______________________________________________
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