Python wx.ICON_EXCLAMATION Examples
The following are 18
code examples of wx.ICON_EXCLAMATION().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: TreeItem.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def AskDelete(self): allItems = self.GetAllItems() if eg.config.confirmDelete: count = len(allItems) - 1 if count > 0: mesg = eg.text.General.deleteManyQuestion % str(count) else: mesg = eg.text.General.deleteQuestion answer = eg.MessageBox( mesg, eg.APP_NAME, wx.NO_DEFAULT | wx.YES_NO | wx.ICON_EXCLAMATION ) if answer == wx.ID_NO: return False dependants = self.GetDependantsOutside(allItems) if len(dependants) > 0: answer = eg.MessageBox( eg.text.General.deleteLinkedItems, eg.APP_NAME, wx.NO_DEFAULT | wx.YES_NO | wx.ICON_EXCLAMATION ) return answer == wx.ID_YES return True
Example #2
Source File: WinUsb.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def CheckAddOnFiles(self): neededFiles = self.GetNeededFiles() if len(neededFiles) == 0: return True if not eg.CallWait(self.ShowDownloadMessage): return False stopEvent = threading.Event() wx.CallAfter(eg.TransferDialog, None, neededFiles, stopEvent) stopEvent.wait() neededFiles = self.GetNeededFiles() if neededFiles: eg.CallWait( wx.MessageBox, Text.downloadFailedMsg, caption=Text.dialogCaption % self.plugin.name, style=wx.OK | wx.ICON_EXCLAMATION | wx.STAY_ON_TOP, parent=eg.document.frame ) return False return True
Example #3
Source File: AddPluginDialog.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def CheckMultiload(self): if not self.checkMultiLoad: return True info = self.resultData if not info: return True if info.canMultiLoad: return True if any((plugin.info.path == info.path) for plugin in eg.pluginList): eg.MessageBox( Text.noMultiload, Text.noMultiloadTitle, style=wx.ICON_EXCLAMATION ) return False else: return True
Example #4
Source File: mainframe.py From youtube-dl-gui with The Unlicense | 6 votes |
def _on_add(self, event): urls = self._get_urls() if not urls: self._create_popup(self.PROVIDE_URL_MSG, self.WARNING_LABEL, wx.OK | wx.ICON_EXCLAMATION) else: self._url_list.Clear() options = self._options_parser.parse(self.opt_manager.options) for url in urls: download_item = DownloadItem(url, options) download_item.path = self.opt_manager.options["save_path"] if not self._download_list.has_item(download_item.object_id): self._status_list.bind_item(download_item) self._download_list.insert(download_item)
Example #5
Source File: PluginItem.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def AskDelete(self): actionItemCls = self.document.ActionItem def SearchFunc(obj): if obj.__class__ == actionItemCls: if obj.executable and obj.executable.plugin == self.executable: return True return None if self.root.Traverse(SearchFunc) is not None: eg.MessageBox( eg.text.General.deletePlugin, eg.APP_NAME, wx.NO_DEFAULT | wx.OK | wx.ICON_EXCLAMATION ) return False if not TreeItem.AskDelete(self): return False return True
Example #6
Source File: xrced.py From admin4 with Apache License 2.0 | 6 votes |
def AskSave(self): if not (self.modified or panel.IsModified()): return True flags = wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL | wx.CENTRE dlg = wx.MessageDialog( self, 'File is modified. Save before exit?', 'Save before too late?', flags ) say = dlg.ShowModal() dlg.Destroy() wx.Yield() if say == wx.ID_YES: self.OnSaveOrSaveAs(wx.CommandEvent(wx.ID_SAVE)) # If save was successful, modified flag is unset if not self.modified: return True elif say == wx.ID_NO: self.SetModified(False) panel.SetModified(False) return True return False
Example #7
Source File: Update.py From admin4 with Apache License 2.0 | 5 votes |
def run(self): update=OnlineUpdate() if update.IsValid(): adm.updateInfo=update if update.UpdateAvailable(): wx.CallAfter(self.frame.OnUpdate) elif update.exception: wx.CallAfter(wx.MessageBox, xlt("Connection error while trying to retrieve update information from the update server.\nCheck network connectivity and proxy settings!"), xlt("Communication error"), wx.ICON_EXCLAMATION)
Example #8
Source File: LDViewer.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def AddLadderBlock(self): message = wx.MessageDialog(self, _("This option isn't available yet!"), _("Warning"), wx.OK | wx.ICON_EXCLAMATION) message.ShowModal() message.Destroy() # ------------------------------------------------------------------------------- # Delete element functions # -------------------------------------------------------------------------------
Example #9
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def DisplayError(self, errorText): eg.MessageBox( errorText, style=wx.ICON_EXCLAMATION | wx.OK, parent=self )
Example #10
Source File: about.py From wxGlade with MIT License | 5 votes |
def OnLinkClicked(self, event): href = event.GetLinkInfo().GetHref() if href == 'show_license': if config.license_file: from wx.lib.dialogs import ScrolledMessageDialog try: license_file = codecs.open(config.license_file, encoding='UTF-8') dlg = ScrolledMessageDialog( self, license_file.read(), "wxGlade - License" ) license_file.close() dlg.ShowModal() dlg.Destroy() except EnvironmentError as inst: bugdialog.ShowEnvironmentError( _('''Can't read the file "LICENSE.txt".\n\nYou can get a license copy at\n''' '''http://www.opensource.org/licenses/mit-license.php'''), inst) else: wx.MessageBox(_('File "LICENSE.txt" not found!\nYou can get a license copy at\n' 'http://www.opensource.org/licenses/mit-license.php'), _('Error'), wx.OK | wx.CENTRE | wx.ICON_EXCLAMATION) elif href == 'show_credits': if config.credits_file: from wx.lib.dialogs import ScrolledMessageDialog try: credits_file = codecs.open( config.credits_file, encoding='UTF-8' ) dlg = ScrolledMessageDialog( self, credits_file.read(), _("wxGlade - Credits") ) credits_file.close() dlg.ShowModal() dlg.Destroy() except EnvironmentError as inst: bugdialog.ShowEnvironmentError(_('''Can't read the file "CREDITS.txt"'''), inst) else: wx.MessageBox(_('File "CREDITS.txt" not found!'), _('Error'), wx.OK | wx.CENTRE | wx.ICON_EXCLAMATION) else: import webbrowser webbrowser.open(href, new=True)
Example #11
Source File: GoSyncModel.py From gosync with GNU General Public License v2.0 | 5 votes |
def AskChooseCredentialsFile(self): dial = wx.MessageDialog(None, 'No Credentials file was found!\n\nDo you want to load one?\n', 'Error', wx.YES_NO | wx.ICON_EXCLAMATION) res = dial.ShowModal() if res == wx.ID_YES: return True else: return false
Example #12
Source File: mainframe.py From youtube-dl-gui with The Unlicense | 5 votes |
def _update_youtubedl(self): """Update youtube-dl binary to the latest version. """ if self.download_manager is not None and self.download_manager.is_alive(): self._create_popup(self.DOWNLOAD_ACTIVE, self.WARNING_LABEL, wx.OK | wx.ICON_EXCLAMATION) elif self.update_thread is not None and self.update_thread.is_alive(): self._create_popup(self.UPDATE_ACTIVE, self.INFO_LABEL, wx.OK | wx.ICON_INFORMATION) else: self.update_thread = UpdateThread(self.opt_manager.options['youtubedl_path'])
Example #13
Source File: mainframe.py From youtube-dl-gui with The Unlicense | 5 votes |
def _on_viewlog(self, event): if self.log_manager is None: self._create_popup(_("Logging is disabled"), self.WARNING_LABEL, wx.OK | wx.ICON_EXCLAMATION) else: log_window = LogGUI(self) log_window.load(self.log_manager.log_file) log_window.Show()
Example #14
Source File: mainframe.py From youtube-dl-gui with The Unlicense | 5 votes |
def _on_start(self, event): if self.download_manager is None: if self.update_thread is not None and self.update_thread.is_alive(): self._create_popup(_("Update in progress. Please wait for the update to complete"), self.WARNING_LABEL, wx.OK | wx.ICON_EXCLAMATION) else: self._start_download() else: self.download_manager.stop_downloads()
Example #15
Source File: GoSyncModel.py From gosync with GNU General Public License v2.0 | 5 votes |
def CreateDirectoryByPath(self, dirpath): self.SendlToLog(3,"create directory: %s\n" % dirpath) drivepath = dirpath.split(self.mirror_directory+'/')[1] basepath = os.path.dirname(drivepath) dirname = self.PathLeaf(dirpath) try: f = self.LocateFolderOnDrive(drivepath) return except FolderNotFound: if basepath == '': self.CreateDirectoryInParent(dirname) else: try: parent_folder = self.LocateFolderOnDrive(basepath) self.CreateDirectoryInParent(dirname, parent_folder['id']) except: errorMsg = "Failed to locate directory path %s on drive.\n" % basepath self.SendlToLog(1,errorMsg) dial = wx.MessageDialog(None, errorMsg, 'Directory Not Found', wx.ID_OK | wx.ICON_EXCLAMATION) dial.ShowModal() return except FileListQueryFailed: errorMsg = "Server Query Failed!\n" self.SendlToLog(1,errorMsg) dial = wx.MessageDialog(None, errorMsg, 'Directory Not Found', wx.ID_OK | wx.ICON_EXCLAMATION) dial.ShowModal() return
Example #16
Source File: mainframe.py From youtube-dl-gui with The Unlicense | 4 votes |
def _on_delete(self, event): index = self._status_list.get_next_selected() if index == -1: dlg = ButtonsChoiceDialog(self, [_("Remove all"), _("Remove completed")], _("No items selected. Please pick an action"), _("Delete")) ret_code = dlg.ShowModal() dlg.Destroy() #REFACTOR Maybe add this functionality directly to DownloadList? if ret_code == 1: for ditem in self._download_list.get_items(): if ditem.stage != "Active": self._status_list.remove_row(self._download_list.index(ditem.object_id)) self._download_list.remove(ditem.object_id) if ret_code == 2: for ditem in self._download_list.get_items(): if ditem.stage == "Completed": self._status_list.remove_row(self._download_list.index(ditem.object_id)) self._download_list.remove(ditem.object_id) else: if self.opt_manager.options["confirm_deletion"]: dlg = wx.MessageDialog(self, _("Are you sure you want to remove selected items?"), _("Delete"), wx.YES_NO | wx.ICON_QUESTION) result = dlg.ShowModal() == wx.ID_YES dlg.Destroy() else: result = True if result: while index >= 0: object_id = self._status_list.GetItemData(index) selected_download_item = self._download_list.get_item(object_id) if selected_download_item.stage == "Active": self._create_popup(_("Item is active, cannot remove"), self.WARNING_LABEL, wx.OK | wx.ICON_EXCLAMATION) else: #if selected_download_item.stage == "Completed": #dlg = wx.MessageDialog(self, "Do you want to remove the files associated with this item?", "Remove files", wx.YES_NO | wx.ICON_QUESTION) #result = dlg.ShowModal() == wx.ID_YES #dlg.Destroy() #if result: #for cur_file in selected_download_item.get_files(): #remove_file(cur_file) self._status_list.remove_row(index) self._download_list.remove(object_id) index -= 1 index = self._status_list.get_next_selected(index) self._update_pause_button(None)
Example #17
Source File: PouDialog.py From OpenPLC_Editor with GNU General Public License v3.0 | 4 votes |
def OnOK(self, event): error = [] pou_name = self.PouName.GetValue() if pou_name == "": error.append(_("POU Name")) if self.PouType.GetSelection() == -1: error.append(_("POU Type")) if self.Language.GetSelection() == -1: error.append(_("Language")) message = None question = False if len(error) > 0: text = "" for i, item in enumerate(error): if i == 0: text += item elif i == len(error) - 1: text += _(" and %s") % item else: text += _(", %s") % item message = _("Form isn't complete. %s must be filled!") % text elif not TestIdentifier(pou_name): message = _("\"%s\" is not a valid identifier!") % pou_name elif pou_name.upper() in IEC_KEYWORDS: message = _("\"%s\" is a keyword. It can't be used!") % pou_name elif pou_name.upper() in self.PouNames: message = _("\"%s\" pou already exists!") % pou_name elif pou_name.upper() in self.PouElementNames: message = _("A POU has an element named \"%s\". This could cause a conflict. Do you wish to continue?") % pou_name question = True if message is not None: if question: dialog = wx.MessageDialog(self, message, _("Warning"), wx.YES_NO | wx.ICON_EXCLAMATION) result = dialog.ShowModal() dialog.Destroy() if result == wx.ID_YES: self.EndModal(wx.ID_OK) else: dialog = wx.MessageDialog(self, message, _("Error"), wx.OK | wx.ICON_ERROR) dialog.ShowModal() dialog.Destroy() else: self.EndModal(wx.ID_OK)
Example #18
Source File: GoSyncModel.py From gosync with GNU General Public License v2.0 | 4 votes |
def DoAuthenticate(self): try: # If modifying these scopes, delete the file token.pickle. SCOPES = ['https://www.googleapis.com/auth/drive'] creds = None # The file token.pickle stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists(self.client_pickle): with open(self.client_pickle, 'rb') as token: self.SendlToLog(2, "Authenticate - Loading pickle file") try: creds = pickle.load(token) self.SendlToLog(2, "Authenticate - Loading pickle file: SUCCESS") except: self.SendlToLog(2, "Authenticate - Failed to load pickle file") creds = None # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: self.SendlToLog(2, "Authenticate - expired. Refreshing") creds.refresh(Request()) else: self.SendlToLog(2, "Authenticate - New authentication") self.SendlToLog(2, "Authenticate - File %s" % (self.credential_file)) flow = InstalledAppFlow.from_client_secrets_file(self.credential_file, SCOPES) self.SendlToLog(2, "Authenticate - running local server") creds = flow.run_local_server(port=0) self.SendlToLog(2, "Authenticate - Saving pickle file") # Save the credentials for the next run with open(self.client_pickle, 'wb') as token: pickle.dump(creds, token) self.SendlToLog(2, "Authenticate - Building service") try: service = build('drive', 'v3', credentials=creds) self.SendlToLog(2, "Authenticate - service built successfully!") except: self.SendlToLog(2, "Authenticate - service built failed. Going for re-authentication") try: flow = InstalledAppFlow.from_client_secrets_file(self.credential_file, SCOPES) creds = flow.run_local_server(port=0) service = build('drive', 'v3', credentials=creds) except: raise AuthenticationFailed() self.drive = service self.is_logged_in = True return service except: dial = wx.MessageDialog(None, "Authentication Rejected!\n", 'Information', wx.ID_OK | wx.ICON_EXCLAMATION) dial.ShowModal() self.is_logged_in = False pass