From: Kevin A. <ka...@us...> - 2004-08-12 19:19:35
|
Update of /cvsroot/pythoncard/PythonCard/samples/fpop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16511/fpop Modified Files: dlg_config.py fpop.py message.py preview.py Log Message: dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: preview.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/fpop/preview.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** preview.py 8 Aug 2004 18:31:53 -0000 1.21 --- preview.py 12 Aug 2004 19:18:52 -0000 1.22 *************** *** 145,150 **** dir = self.application.applicationDirectory result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result['accepted']: ! path = result['paths'][0] else: # error message here? --- 145,150 ---- dir = self.application.applicationDirectory result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result.accepted: ! path = result.paths[0] else: # error message here? Index: message.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/fpop/message.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** message.py 5 May 2004 16:53:25 -0000 1.16 --- message.py 12 Aug 2004 19:18:52 -0000 1.17 *************** *** 206,213 **** message = "You haven't sent this message. Close anyway?" result = dialog.messageDialog(self, message, 'Unsent Message', \ ! dialog.ICON_INFORMATION, dialog.BUTTON_YES_NO | \ ! dialog.BUTTON_NO_DEFAULT | dialog.BUTTON_CANCEL) ! if result['accepted']: ! returned = result['returned'] if returned == 'Yes': del self.parent.messageWindows[self.GetId()] --- 206,212 ---- message = "You haven't sent this message. Close anyway?" result = dialog.messageDialog(self, message, 'Unsent Message', \ ! wx.ICON_INFORMATION | wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL) ! if result.accepted: ! returned = result.returnedString if returned == 'Yes': del self.parent.messageWindows[self.GetId()] Index: dlg_config.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/fpop/dlg_config.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dlg_config.py 17 May 2004 16:43:53 -0000 1.10 --- dlg_config.py 12 Aug 2004 19:18:52 -0000 1.11 *************** *** 45,62 **** def configureDialog(parent): dlg = ConfigureDialog(parent) ! dlg.showModal() ! result = {'accepted':dlg.accepted()} ! result['fromName'] = dlg.components.fromName.text ! result['fromAttribution'] = dlg.components.fromAttribution.text ! result['fromAddress'] = dlg.components.fromAddress.text ! result['replyAddress'] = dlg.components.replyAddress.text ! result['SMTPserver'] = dlg.components.SMTPserver.text ! result['POPserver'] = dlg.components.POPserver.text ! result['POPuser'] = dlg.components.POPuser.text ! result['POPpwd'] = dlg.components.POPpwd.text ! result['CheckAtStart'] = dlg.components.CheckAtStart.checked ! result['AutoCheck'] = dlg.components.AutoCheck.checked ! result['AutoCheckInterval'] = dlg.components.AutoCheckInterval.value ! result['PreviewLines'] = dlg.components.PreviewLines.value dlg.destroy() return result --- 45,61 ---- def configureDialog(parent): dlg = ConfigureDialog(parent) ! result = dlg.showModal() ! result.fromName = dlg.components.fromName.text ! result.fromAttribution = dlg.components.fromAttribution.text ! result.fromAddress = dlg.components.fromAddress.text ! result.replyAddress = dlg.components.replyAddress.text ! result.SMTPserver = dlg.components.SMTPserver.text ! result.POPserver = dlg.components.POPserver.text ! result.POPuser = dlg.components.POPuser.text ! result.POPpwd = dlg.components.POPpwd.text ! result.CheckAtStart = dlg.components.CheckAtStart.checked ! result.AutoCheck = dlg.components.AutoCheck.checked ! result.AutoCheckInterval = dlg.components.AutoCheckInterval.value ! result.PreviewLines = dlg.components.PreviewLines.value dlg.destroy() return result Index: fpop.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/fpop/fpop.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** fpop.py 17 May 2004 16:43:53 -0000 1.44 --- fpop.py 12 Aug 2004 19:18:52 -0000 1.45 *************** *** 336,342 **** if self.POPpwd == '': result = dialog.textEntryDialog(self, 'Password', 'Enter your password:', ! '', dialog.TEXT_PASSWORD) ! if result['accepted'] and result['text'] != '': ! self.POPpwd = result['text'] else: return --- 336,342 ---- if self.POPpwd == '': result = dialog.textEntryDialog(self, 'Password', 'Enter your password:', ! '', wx.TEXT_PASSWORD) ! if result.accepted and result.text != '': ! self.POPpwd = result.text else: return *************** *** 469,485 **** def on_btnConfigure_mouseClick(self, event): result = dlg_config.configureDialog(self) ! if result['accepted'] : ! self.fromName = result['fromName'] ! self.fromAttribution = result['fromAttribution'] ! self.fromAddress = result['fromAddress'] ! self.replyAddress = result['replyAddress'] ! self.SMTPserver = result['SMTPserver'] ! self.POPserver = result['POPserver'] ! self.POPuser = result['POPuser'] ! self.POPpwd = result['POPpwd'] ! self.CheckAtStart = result['CheckAtStart'] ! self.AutoCheck = result['AutoCheck'] ! self.AutoCheckInterval = result['AutoCheckInterval'] ! self.PreviewLines = result['PreviewLines'] if self.POPserver == '' or self.POPuser == '': --- 469,485 ---- def on_btnConfigure_mouseClick(self, event): result = dlg_config.configureDialog(self) ! if result.accepted: ! self.fromName = result.fromName ! self.fromAttribution = result.fromAttribution ! self.fromAddress = result.fromAddress ! self.replyAddress = result.replyAddress ! self.SMTPserver = result.SMTPserver ! self.POPserver = result.POPserver ! self.POPuser = result.POPuser ! self.POPpwd = result.POPpwd ! self.CheckAtStart = result.CheckAtStart ! self.AutoCheck = result.AutoCheck ! self.AutoCheckInterval = result.AutoCheckInterval ! self.PreviewLines = result.PreviewLines if self.POPserver == '' or self.POPuser == '': |