def _confirmation(self, message='', title='Save Changes?'): dialog = ConfirmationDialog(parent=self.window.control, message=message, cancel=True, default=CANCEL, title=title) return dialog.open()
def confirm_cancel(self, message, title=None, cancel=True, default=CANCEL, no_label="", yes_label=""): """ Convenience method to show a confirmation dialog. Returns None if Cancel was chosen in addition to the usual True/False. """ from pyface.confirmation_dialog import ConfirmationDialog if title is None: title = "Confirmation" dialog = ConfirmationDialog(parent=self.window.control, message=message, cancel=cancel, default=default, title=title, no_label=no_label, yes_label=yes_label) result = dialog.open() if result == YES: result = True elif result == NO: result = False else: result = None return result
def close( self, info, is_ok ): if self.model.dirty: dlg=ConfirmationDialog( message='Save changes to Hops file', cancel=True, default=CANCEL, title='Save Changes?') ret=dlg.open() if ret==CANCEL: return False elif ret==YES: self.model.save() return True
def confirm(self, message, title=None, cancel=False, default=NO, no_label="", yes_label=""): """ Convenience method to show a confirmation dialog. """ from pyface.confirmation_dialog import ConfirmationDialog if title is None: title = "Confirmation" dialog = ConfirmationDialog(parent=self.window.control, message=message, cancel=cancel, default=default, title=title, no_label=no_label, yes_label=yes_label) return dialog.open()
def close(self, info, is_ok): if self.model.dirty: dlg = ConfirmationDialog(message='Save changes to Hops file', cancel=True, default=CANCEL, title='Save Changes?') ret = dlg.open() if ret == CANCEL: return False elif ret == YES: self.model.save() return True
def confirm(self, message, title=None, cancel=False, default=NO, no_label="", yes_label=""): """ Convenience method to show a confirmation dialog. """ from pyface.confirmation_dialog import ConfirmationDialog if title is None: title = "Confirmation" dialog = ConfirmationDialog(parent=self.window.control, message=message, cancel=cancel, default=default, title=title, no_label=no_label, yes_label=yes_label) return dialog.open() == YES
def _confirmation(self, message=''): dialog = ConfirmationDialog(parent=self.window.control, message=message, cancel=True, default=CANCEL, title='Save Changes?') return dialog.open()