dabo Commit
Revision 6861
Date: 2011-09-27 15:29:26 -0700 (Tue, 27 Sep 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6861

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

Log:
Refactored the displayInfoMessage() method to move the UI-specific code into 
the UI layer.

Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py  2011-09-27 13:01:01 UTC (rev 6860)
+++ trunk/dabo/dApp.py  2011-09-27 22:29:26 UTC (rev 6861)
@@ -1327,12 +1327,8 @@
                prefKey = "display_info_messages.%s" % msgId
                if not self.getUserSetting(prefKey, True):
                        return
-               from dabo.ui.dialogs.infoMessage import DlgInfoMessage
-               dlg = DlgInfoMessage(Message=msg, 
DefaultShowInFuture=defaultShowInFuture)
-               dlg.show()
-               if not dlg.chkShowInFuture.Value:
-                       self.setUserSetting(prefKey, False)
-               dlg.release()
+               future = self.uiApp.displayInfoMessage(msg, 
defaultShowInFuture=defaultShowInFuture)
+               self.setUserSetting(prefKey, future)
  
 
        def clearActiveForm(self, frm):

Modified: trunk/dabo/ui/uiwx/uiApp.py
===================================================================
--- trunk/dabo/ui/uiwx/uiApp.py 2011-09-27 13:01:01 UTC (rev 6860)
+++ trunk/dabo/ui/uiwx/uiApp.py 2011-09-27 22:29:26 UTC (rev 6861)
@@ -365,6 +365,16 @@
                dlg.release()
 
 
+       def displayInfoMessage(self, msg, defaultShowInFuture=True):
+               """Display a dialog to the user that includes an option to not 
show the message again."""
+               from dabo.ui.dialogs.infoMessage import DlgInfoMessage
+               dlg = DlgInfoMessage(Message=msg, 
DefaultShowInFuture=defaultShowInFuture)
+               dlg.show()
+               ret = dlg.chkShowInFuture.Value
+               dlg.release()
+               return ret
+
+
        def _onKeyPress(self, evt):
                ## Zoom In / Out / Normal:
                alt = evt.AltDown()



_______________________________________________
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