def upload_changes(self, changes): run_with_progress(create_review, (changes, ), "Uploading Changes", "Please wait while uploading changes to server") self.RequestUserAttention() messageDialog(self, "Please finish the review on the web browser", "Review created", wx.OK)
def OnExplainBaseline(self, evt): combo = evt.GetEventObject().combo baseline = combo.GetStringSelection() if not baseline: return view = self._view.GetStringSelection() baseline = baseline.replace("(", "") baseline = baseline.replace(")", "") name, owner, date = baseline.split() activities = get_baseline_activities_progress(view, name) activitires_str = "\t" + "\n\t".join(activities) messageDialog( self, BASELINE_TEMPLATE % (name, owner, date, activitires_str), "Baseline Information for %s" % name, wx.OK)
def alert(message, title="", parent=None, scrolled=False, icon="exclamation"): "Show a simple pop-up modal dialog" if not scrolled: icons = {'exclamation': wx.ICON_EXCLAMATION, 'error': wx.ICON_ERROR, 'question': wx.ICON_QUESTION, 'info': wx.ICON_INFORMATION} style = wx.OK | icons[icon] result = dialogs.messageDialog(parent, message, title, style) else: result = dialogs.scrolledMessageDialog(parent, message, title)
def AskForUpdate(frame): """Asks if the user wants to download the updated version of the client program. If she says yes, a browser window opens. Regardless of her choice, the program closes.""" result = dialogs.messageDialog(frame, "A kliensből új verziót adtak ki. Szeretnéd most letölteni? Nemleges válasz esetén a program bezárul.", "Frissítés", wx.YES_NO) if result.accepted: webbrowser.open_new_tab(config.profileLink)
def AskForUpdate(frame): """Asks if the user wants to download the updated version of the client program. If she says yes, a browser window opens. Regardless of her choice, the program closes.""" result = dialogs.messageDialog( frame, "A kliensből új verziót adtak ki. Szeretnéd most letölteni? Nemleges válasz esetén a program bezárul.", "Frissítés", wx.YES_NO) if result.accepted: webbrowser.open_new_tab(config.profileLink)
def onDeleteEvent(self, event): """删除文件""" self.__enableToolbar(ID.ID_TOOLBAR_TRASH, False) message = u"您确定删除以下文件?\n" files = [] index = self.__dataList.GetFirstSelected() while index != -1: item = self.__dataList.GetItem(index) key = item.GetText() message += key + "\n" files.append(key) index = self.__dataList.GetNextSelected(index) results = dialogs.messageDialog(self, message, "Sure?") if results.accepted: AsynchronousThread((self.deleteSelectedFile, files)).start() else: self.__downloadButtonAndDeleteButtonStatus()
def confirm(message="", title="", default=False, ok=False, cancel=False, parent=None): "Ask for confirmation (yes/no or ok and cancel), returns True or False" style = wx.CENTRE if ok: style |= wx.OK else: style |= wx.YES | wx.NO if default: style |= wx.YES_DEFAULT else: style |= wx.NO_DEFAULT if cancel: style |= wx.CANCEL result = dialogs.messageDialog(parent, message, title, style) if cancel and result.returned == wx.ID_CANCEL: return None return result.accepted # True or False
def onDeleteEvent(self, event): """删除文件""" self.__enableToolbar(ID.ID_TOOLBAR_TRASH,False) message = u"您确定删除以下文件?\n" files = [] index = self.__dataList.GetFirstSelected() while index != -1: item = self.__dataList.GetItem(index) key = item.GetText() message += key + "\n" files.append(key) index = self.__dataList.GetNextSelected(index) results = dialogs.messageDialog(self,message,"Sure?") if results.accepted : AsynchronousThread((self.deleteSelectedFile,files)).start() else: self.__downloadButtonAndDeleteButtonStatus()
def ErrorDialog(message, caption): application = wx.PySimpleApp() messageDialog(None, message, caption, wx.OK | wx.ICON_ERROR)
def OkDialog(message, caption): application = wx.PySimpleApp() messageDialog(None, message, caption, wx.OK)
def YesNoCancelDialog(message, caption): application = wx.PySimpleApp() dlg = messageDialog(None, message, caption, wx.YES | wx.NO | wx.CANCEL | wx.ICON_INFORMATION) return dlg.returnedString
def error(message): messageDialog(None, "%s" % message, "UCMCC Error", wx.OK|wx.ICON_ERROR)