dabo Commit
Revision 5462
Date: 2009-10-14 17:14:37 -0700 (Wed, 14 Oct 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5462

Changed:
U   trunk/dabo/dApp.py

Log:
Implemented dApp.LoginDialogClass, per Jacek's request in ticket #1290.

I only tested that starting a regular app doesn't cause an error. Jacek,
please test and modify if needed.



Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py  2009-10-15 00:04:08 UTC (rev 5461)
+++ trunk/dabo/dApp.py  2009-10-15 00:14:37 UTC (rev 5462)
@@ -440,12 +440,11 @@
 
                Return a tuple of (user, pass).
                """
-               import dabo.ui.dialogs.login as login
-               ld = login.Login(self.MainForm)
-               ld.setMessage(message)
-               # Allow the developer to customize the default login
-               self.loginDialogHook(ld)
-               ld.show()
+               loginDialog = self.LoginDialogClass(self.MainForm)
+               loginDialog.setMessage(message)
+               # Allow the developer to customize the login dialog:
+               self.loginDialogHook(loginDialog)
+               loginDialog.show()
                user, password = ld.user, ld.password
                return user, password
 
@@ -1417,6 +1416,15 @@
                self._icon = val
 
 
+       def _getLoginDialogClass(self):
+               import dabo.ui.dialogs.login as login
+               defaultDialogClass = login.Login
+               ret = getattr(self, "_loginDialogClass", defaultDialogClass)
+               
+       def _setLoginDialogClass(self, val):
+               self._loginDialogClass = val
+
+
        def _getMainForm(self):
                try:
                        frm = self._mainForm
@@ -1641,6 +1649,9 @@
                        system will not have to scale the icon, resulting in a 
much better
                        appearance."""))
 
+       LoginDialogClass = property(_getLoginDialogClass, _setLoginDialogClass, 
None,
+                       _("""The class to use for logging in."""))
+
        MainForm = property(_getMainForm, _setMainForm, None,
                        _("""The object reference to the main form of the 
application, or None.
 




_______________________________________________
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