--- a/UI/UserInterface.py Sun Mar 30 22:00:14 2014 +0200 +++ b/UI/UserInterface.py Thu Apr 03 23:05:31 2014 +0200 @@ -9,15 +9,15 @@ from __future__ import unicode_literals try: - str = unicode # __IGNORE_WARNING__ -except (NameError): + str = unicode +except NameError: pass import os import sys import logging -from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, \ +from PyQt4.QtCore import pyqtSlot, QTimer, QFile, QFileInfo, pyqtSignal, \ PYQT_VERSION_STR, QDate, QIODevice, qVersion, QProcess, QSize, QUrl, \ QObject, Qt from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \ @@ -38,6 +38,7 @@ from E5Gui.E5MainWindow import E5MainWindow from E5Gui.E5ZoomWidget import E5ZoomWidget from E5Gui.E5ProgressDialog import E5ProgressDialog +from E5Gui.E5ClickableLabel import E5ClickableLabel import Preferences import Utilities @@ -160,7 +161,6 @@ a restart (list of strings) """ super(UserInterface, self).__init__() - self.setAttribute(Qt.WA_DeleteOnClose) self.__restartArgs = restartArguments[:] @@ -213,13 +213,13 @@ from MultiProject.MultiProject import MultiProject self.multiProject = MultiProject(self.project, self) - splash.showMessage(self.trUtf8("Initializing Plugin Manager...")) + splash.showMessage(self.tr("Initializing Plugin Manager...")) # Initialize the Plugin Manager (Plugins are initialized later from PluginManager.PluginManager import PluginManager self.pluginManager = PluginManager(self, develPlugin=plugin) - splash.showMessage(self.trUtf8("Generating Main User Interface...")) + splash.showMessage(self.tr("Generating Main User Interface...")) # Create the main window now so that we can connect QActions to it. logging.debug("Creating Layout...") @@ -251,7 +251,7 @@ self.__notification = None # now setup the connections - splash.showMessage(self.trUtf8("Setting up connections...")) + splash.showMessage(self.tr("Setting up connections...")) self.browser.sourceFile[str].connect( self.viewmanager.openSourceFile) self.browser.sourceFile[str, int].connect( @@ -373,6 +373,8 @@ self.debugViewer.breakpointViewer.highlightBreakpoint) debugServer.clientProcessStdout.connect(self.appendToStdout) debugServer.clientProcessStderr.connect(self.appendToStderr) + debugServer.clientInterpreterChanged.connect( + self.browser.handleInterpreterChanged) self.stdout.appendStdout.connect(self.appendToStdout) self.stderr.appendStderr.connect(self.appendToStderr) @@ -439,7 +441,7 @@ self.toolbarManager.setMainWindow(self) # Initialize the tool groups and list of started tools - splash.showMessage(self.trUtf8("Initializing Tools...")) + splash.showMessage(self.tr("Initializing Tools...")) self.toolGroups, self.currentToolGroup = Preferences.readToolGroups() self.toolProcs = [] self.__initExternalToolsActions() @@ -450,7 +452,7 @@ HelpWindow(None, '.', None, 'help viewer', True, True) # register all relevant objects - splash.showMessage(self.trUtf8("Registering Objects...")) + splash.showMessage(self.tr("Registering Objects...")) e5App().registerObject("UserInterface", self) e5App().registerObject("DebugUI", self.debuggerUI) e5App().registerObject("DebugServer", debugServer) @@ -471,13 +473,13 @@ e5App().registerObject("Numbers", self.numbersViewer) # Initialize the actions, menus, toolbars and statusbar - splash.showMessage(self.trUtf8("Initializing Actions...")) + splash.showMessage(self.tr("Initializing Actions...")) self.__initActions() - splash.showMessage(self.trUtf8("Initializing Menus...")) + splash.showMessage(self.tr("Initializing Menus...")) self.__initMenus() - splash.showMessage(self.trUtf8("Initializing Toolbars...")) + splash.showMessage(self.tr("Initializing Toolbars...")) self.__initToolbars() - splash.showMessage(self.trUtf8("Initializing Statusbar...")) + splash.showMessage(self.tr("Initializing Statusbar...")) self.__initStatusbar() # connect the appFocusChanged signal after all actions are ready @@ -505,7 +507,7 @@ # now fire up the single application server if Preferences.getUI("SingleApplicationMode"): splash.showMessage( - self.trUtf8("Initializing Single Application Server...")) + self.tr("Initializing Single Application Server...")) self.SAServer = E5SingleApplicationServer() else: self.SAServer = None @@ -513,7 +515,7 @@ # now finalize the plugin manager setup self.pluginManager.finalizeSetup() # now activate plugins having autoload set to True - splash.showMessage(self.trUtf8("Activating Plugins...")) + splash.showMessage(self.tr("Activating Plugins...")) self.pluginManager.activatePlugins() # now read the keyboard shortcuts for all the actions @@ -521,24 +523,24 @@ Shortcuts.readShortcuts() # restore toolbar manager state - splash.showMessage(self.trUtf8("Restoring Toolbarmanager...")) + splash.showMessage(self.tr("Restoring Toolbarmanager...")) self.toolbarManager.restoreState( Preferences.getUI("ToolbarManagerState")) # now activate the initial view profile - splash.showMessage(self.trUtf8("Setting View Profile...")) + splash.showMessage(self.tr("Setting View Profile...")) self.__setEditProfile() # now read the saved tasks - splash.showMessage(self.trUtf8("Reading Tasks...")) + splash.showMessage(self.tr("Reading Tasks...")) self.__readTasks() # now read the saved templates - splash.showMessage(self.trUtf8("Reading Templates...")) + splash.showMessage(self.tr("Reading Templates...")) self.templateViewer.readTemplates() # now start the debug client - splash.showMessage(self.trUtf8("Starting Debugger...")) + splash.showMessage(self.tr("Starting Debugger...")) debugServer.startClient(False) # attributes for the network objects @@ -628,20 +630,20 @@ self.lToolboxDock = self.__createDockWindow("lToolboxDock") self.lToolbox = E5VerticalToolBox(self.lToolboxDock) self.__setupDockWindow(self.lToolboxDock, Qt.LeftDockWidgetArea, - self.lToolbox, self.trUtf8("Left Toolbox")) + self.lToolbox, self.tr("Left Toolbox")) # Create the horizontal toolbox self.hToolboxDock = self.__createDockWindow("hToolboxDock") self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea, self.hToolbox, - self.trUtf8("Horizontal Toolbox")) + self.tr("Horizontal Toolbox")) # Create the right toolbox self.rToolboxDock = self.__createDockWindow("rToolboxDock") self.rToolbox = E5VerticalToolBox(self.rToolboxDock) self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, - self.rToolbox, self.trUtf8("Right Toolbox")) + self.rToolbox, self.tr("Right Toolbox")) # Create the project browser from Project.ProjectBrowser import ProjectBrowser @@ -650,14 +652,14 @@ embeddedBrowser=(self.embeddedFileBrowser == 2)) self.lToolbox.addItem(self.projectBrowser, UI.PixmapCache.getIcon("projectViewer.png"), - self.trUtf8("Project-Viewer")) + self.tr("Project-Viewer")) # Create the multi project browser from MultiProject.MultiProjectBrowser import MultiProjectBrowser self.multiProjectBrowser = MultiProjectBrowser(self.multiProject) self.lToolbox.addItem(self.multiProjectBrowser, UI.PixmapCache.getIcon("multiProjectViewer.png"), - self.trUtf8("Multiproject-Viewer")) + self.tr("Multiproject-Viewer")) # Create the template viewer part of the user interface from Templates.TemplateViewer import TemplateViewer @@ -665,7 +667,7 @@ self.viewmanager) self.lToolbox.addItem(self.templateViewer, UI.PixmapCache.getIcon("templateViewer.png"), - self.trUtf8("Template-Viewer")) + self.tr("Template-Viewer")) # Create the debug viewer maybe without the embedded shell from Debugger.DebugViewer import DebugViewer @@ -675,35 +677,35 @@ embeddedBrowser=(self.embeddedFileBrowser == 1)) self.rToolbox.addItem(self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"), - self.trUtf8("Debug-Viewer")) + self.tr("Debug-Viewer")) # Create the chat part of the user interface from Cooperation.ChatWidget import ChatWidget self.cooperation = ChatWidget(self) self.rToolbox.addItem(self.cooperation, UI.PixmapCache.getIcon("cooperation.png"), - self.trUtf8("Cooperation")) + self.tr("Cooperation")) # Create the IRC part of the user interface from Network.IRC.IrcWidget import IrcWidget self.irc = IrcWidget(self) self.rToolbox.addItem(self.irc, UI.PixmapCache.getIcon("irc.png"), - self.trUtf8("IRC")) + self.tr("IRC")) # Create the task viewer part of the user interface from Tasks.TaskViewer import TaskViewer self.taskViewer = TaskViewer(None, self.project) self.hToolbox.addItem(self.taskViewer, UI.PixmapCache.getIcon("task.png"), - self.trUtf8("Task-Viewer")) + self.tr("Task-Viewer")) # Create the log viewer part of the user interface from .LogView import LogViewer self.logViewer = LogViewer() self.hToolbox.addItem(self.logViewer, UI.PixmapCache.getIcon("logViewer.png"), - self.trUtf8("Log-Viewer")) + self.tr("Log-Viewer")) if self.embeddedShell: self.shell = self.debugViewer.shell @@ -715,7 +717,7 @@ self.shell = self.shellAssembly.shell() self.hToolbox.insertItem(0, self.shellAssembly, UI.PixmapCache.getIcon("shell.png"), - self.trUtf8("Shell")) + self.tr("Shell")) if self.embeddedFileBrowser == 0: # separate window # Create the file browser @@ -723,7 +725,7 @@ self.browser = Browser() self.lToolbox.addItem(self.browser, UI.PixmapCache.getIcon("browser.png"), - self.trUtf8("File-Browser")) + self.tr("File-Browser")) elif self.embeddedFileBrowser == 1: # embedded in debug browser self.browser = self.debugViewer.browser else: # embedded in project browser @@ -734,14 +736,14 @@ self.symbolsViewer = SymbolsWidget() self.lToolbox.addItem(self.symbolsViewer, UI.PixmapCache.getIcon("symbols.png"), - self.trUtf8("Symbols")) + self.tr("Symbols")) # Create the numbers viewer from .NumbersWidget import NumbersWidget self.numbersViewer = NumbersWidget() self.hToolbox.addItem(self.numbersViewer, UI.PixmapCache.getIcon("numbers.png"), - self.trUtf8("Numbers")) + self.tr("Numbers")) self.hToolbox.setCurrentIndex(0) @@ -772,7 +774,7 @@ self.leftSidebar.addTab( self.projectBrowser, UI.PixmapCache.getIcon("projectViewer.png"), - self.trUtf8("Project-Viewer")) + self.tr("Project-Viewer")) # Create the multi project browser logging.debug("Creating Multiproject Browser...") @@ -781,7 +783,7 @@ self.leftSidebar.addTab( self.multiProjectBrowser, UI.PixmapCache.getIcon("multiProjectViewer.png"), - self.trUtf8("Multiproject-Viewer")) + self.tr("Multiproject-Viewer")) # Create the template viewer part of the user interface logging.debug("Creating Template Viewer...") @@ -791,7 +793,7 @@ self.leftSidebar.addTab( self.templateViewer, UI.PixmapCache.getIcon("templateViewer.png"), - self.trUtf8("Template-Viewer")) + self.tr("Template-Viewer")) # Create the debug viewer maybe without the embedded shell logging.debug("Creating Debug Viewer...") @@ -802,7 +804,7 @@ embeddedBrowser=(self.embeddedFileBrowser == 1)) self.rightSidebar.addTab( self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"), - self.trUtf8("Debug-Viewer")) + self.tr("Debug-Viewer")) # Create the chat part of the user interface logging.debug("Creating Chat Widget...") @@ -810,14 +812,14 @@ self.cooperation = ChatWidget(self) self.rightSidebar.addTab( self.cooperation, UI.PixmapCache.getIcon("cooperation.png"), - self.trUtf8("Cooperation")) + self.tr("Cooperation")) # Create the IRC part of the user interface logging.debug("Creating IRC Widget...") from Network.IRC.IrcWidget import IrcWidget self.irc = IrcWidget(self) self.rightSidebar.addTab( - self.irc, UI.PixmapCache.getIcon("irc.png"), self.trUtf8("IRC")) + self.irc, UI.PixmapCache.getIcon("irc.png"), self.tr("IRC")) # Create the task viewer part of the user interface logging.debug("Creating Task Viewer...") @@ -825,7 +827,7 @@ self.taskViewer = TaskViewer(None, self.project) self.bottomSidebar.addTab(self.taskViewer, UI.PixmapCache.getIcon("task.png"), - self.trUtf8("Task-Viewer")) + self.tr("Task-Viewer")) # Create the log viewer part of the user interface logging.debug("Creating Log Viewer...") @@ -833,7 +835,7 @@ self.logViewer = LogViewer() self.bottomSidebar.addTab(self.logViewer, UI.PixmapCache.getIcon("logViewer.png"), - self.trUtf8("Log-Viewer")) + self.tr("Log-Viewer")) if self.embeddedShell: self.shell = self.debugViewer.shell @@ -846,7 +848,7 @@ self.shell = self.shellAssembly.shell() self.bottomSidebar.insertTab(0, self.shellAssembly, UI.PixmapCache.getIcon("shell.png"), - self.trUtf8("Shell")) + self.tr("Shell")) if self.embeddedFileBrowser == 0: # separate window # Create the file browser @@ -855,7 +857,7 @@ self.browser = Browser() self.leftSidebar.addTab(self.browser, UI.PixmapCache.getIcon("browser.png"), - self.trUtf8("File-Browser")) + self.tr("File-Browser")) elif self.embeddedFileBrowser == 1: # embedded in debug browser self.browser = self.debugViewer.browser else: # embedded in project browser @@ -867,7 +869,7 @@ self.symbolsViewer = SymbolsWidget() self.leftSidebar.addTab(self.symbolsViewer, UI.PixmapCache.getIcon("symbols.png"), - self.trUtf8("Symbols")) + self.tr("Symbols")) # Create the numbers viewer logging.debug("Creating Numbers Viewer...") @@ -875,7 +877,7 @@ self.numbersViewer = NumbersWidget() self.bottomSidebar.addTab(self.numbersViewer, UI.PixmapCache.getIcon("numbers.png"), - self.trUtf8("Numbers")) + self.tr("Numbers")) self.bottomSidebar.setCurrentIndex(0) @@ -1157,16 +1159,16 @@ if self.passiveMode: if not self.capProject and not self.capEditor: self.setWindowTitle( - self.trUtf8("{0} - Passive Mode").format(Program)) + self.tr("{0} - Passive Mode").format(Program)) elif self.capProject and not self.capEditor: - self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode") + self.setWindowTitle(self.tr("{0} - {1} - Passive Mode") .format(self.capProject, Program)) elif not self.capProject and self.capEditor: - self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode") + self.setWindowTitle(self.tr("{0} - {1} - Passive Mode") .format(self.capEditor, Program)) else: self.setWindowTitle( - self.trUtf8("{0} - {1} - {2} - Passive Mode") + self.tr("{0} - {1} - {2} - Passive Mode") .format(self.capProject, self.capEditor, Program)) else: if not self.capProject and not self.capEditor: @@ -1189,35 +1191,35 @@ self.wizardsActions = [] self.exitAct = E5Action( - self.trUtf8('Quit'), + self.tr('Quit'), UI.PixmapCache.getIcon("exit.png"), - self.trUtf8('&Quit'), - QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), + self.tr('&Quit'), + QKeySequence(self.tr("Ctrl+Q", "File|Quit")), 0, self, 'quit') - self.exitAct.setStatusTip(self.trUtf8('Quit the IDE')) - self.exitAct.setWhatsThis(self.trUtf8( + self.exitAct.setStatusTip(self.tr('Quit the IDE')) + self.exitAct.setWhatsThis(self.tr( """<b>Quit the IDE</b>""" """<p>This quits the IDE. Any unsaved changes may be saved""" """ first. Any Python program being debugged will be stopped""" """ and the preferences will be written to disc.</p>""" )) - self.exitAct.triggered[()].connect(self.__quit) + self.exitAct.triggered.connect(self.__quit) self.exitAct.setMenuRole(QAction.QuitRole) self.actions.append(self.exitAct) self.newWindowAct = E5Action( - self.trUtf8('New Window'), + self.tr('New Window'), UI.PixmapCache.getIcon("newWindow.png"), - self.trUtf8('New &Window'), - QKeySequence(self.trUtf8("Ctrl+Shift+N", "File|New Window")), + self.tr('New &Window'), + QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), 0, self, 'new_window') - self.newWindowAct.setStatusTip(self.trUtf8( + self.newWindowAct.setStatusTip(self.tr( 'Open a new eric5 instance')) - self.newWindowAct.setWhatsThis(self.trUtf8( + self.newWindowAct.setWhatsThis(self.tr( """<b>New Window</b>""" """<p>This opens a new instance of the eric5 IDE.</p>""" )) - self.newWindowAct.triggered[()].connect(self.__newWindow) + self.newWindowAct.triggered.connect(self.__newWindow) self.actions.append(self.newWindowAct) self.newWindowAct.setEnabled( not Preferences.getUI("SingleApplicationMode")) @@ -1225,338 +1227,338 @@ self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) self.setEditProfileAct = E5Action( - self.trUtf8('Edit Profile'), + self.tr('Edit Profile'), UI.PixmapCache.getIcon("viewProfileEdit.png"), - self.trUtf8('Edit Profile'), + self.tr('Edit Profile'), 0, 0, self.viewProfileActGrp, 'edit_profile', True) - self.setEditProfileAct.setStatusTip(self.trUtf8( + self.setEditProfileAct.setStatusTip(self.tr( 'Activate the edit view profile')) - self.setEditProfileAct.setWhatsThis(self.trUtf8( + self.setEditProfileAct.setWhatsThis(self.tr( """<b>Edit Profile</b>""" """<p>Activate the "Edit View Profile". Windows being shown,""" """ if this profile is active, may be configured with the""" """ "View Profile Configuration" dialog.</p>""" )) - self.setEditProfileAct.triggered[()].connect(self.__setEditProfile) + self.setEditProfileAct.triggered.connect(self.__setEditProfile) self.actions.append(self.setEditProfileAct) self.setDebugProfileAct = E5Action( - self.trUtf8('Debug Profile'), + self.tr('Debug Profile'), UI.PixmapCache.getIcon("viewProfileDebug.png"), - self.trUtf8('Debug Profile'), + self.tr('Debug Profile'), 0, 0, self.viewProfileActGrp, 'debug_profile', True) self.setDebugProfileAct.setStatusTip( - self.trUtf8('Activate the debug view profile')) - self.setDebugProfileAct.setWhatsThis(self.trUtf8( + self.tr('Activate the debug view profile')) + self.setDebugProfileAct.setWhatsThis(self.tr( """<b>Debug Profile</b>""" """<p>Activate the "Debug View Profile". Windows being shown,""" """ if this profile is active, may be configured with the""" """ "View Profile Configuration" dialog.</p>""" )) - self.setDebugProfileAct.triggered[()].connect(self.setDebugProfile) + self.setDebugProfileAct.triggered.connect(self.setDebugProfile) self.actions.append(self.setDebugProfileAct) self.pbActivateAct = E5Action( - self.trUtf8('Project-Viewer'), - self.trUtf8('&Project-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+P")), + self.tr('Project-Viewer'), + self.tr('&Project-Viewer'), + QKeySequence(self.tr("Alt+Shift+P")), 0, self, 'project_viewer_activate') - self.pbActivateAct.setStatusTip(self.trUtf8( + self.pbActivateAct.setStatusTip(self.tr( "Switch the input focus to the Project-Viewer window.")) - self.pbActivateAct.setWhatsThis(self.trUtf8( + self.pbActivateAct.setWhatsThis(self.tr( """<b>Activate Project-Viewer</b>""" """<p>This switches the input focus to the Project-Viewer""" """ window.</p>""" )) - self.pbActivateAct.triggered[()].connect(self.__activateProjectBrowser) + self.pbActivateAct.triggered.connect(self.__activateProjectBrowser) self.actions.append(self.pbActivateAct) self.addAction(self.pbActivateAct) self.mpbActivateAct = E5Action( - self.trUtf8('Multiproject-Viewer'), - self.trUtf8('&Multiproject-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+M")), + self.tr('Multiproject-Viewer'), + self.tr('&Multiproject-Viewer'), + QKeySequence(self.tr("Alt+Shift+M")), 0, self, 'multi_project_viewer_activate') - self.mpbActivateAct.setStatusTip(self.trUtf8( + self.mpbActivateAct.setStatusTip(self.tr( "Switch the input focus to the Multiproject-Viewer window.")) - self.mpbActivateAct.setWhatsThis(self.trUtf8( + self.mpbActivateAct.setWhatsThis(self.tr( """<b>Activate Multiproject-Viewer</b>""" """<p>This switches the input focus to the Multiproject-Viewer""" """ window.</p>""" )) - self.mpbActivateAct.triggered[()].connect( + self.mpbActivateAct.triggered.connect( self.__activateMultiProjectBrowser) self.actions.append(self.mpbActivateAct) self.addAction(self.mpbActivateAct) self.debugViewerActivateAct = E5Action( - self.trUtf8('Debug-Viewer'), - self.trUtf8('&Debug-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+D")), + self.tr('Debug-Viewer'), + self.tr('&Debug-Viewer'), + QKeySequence(self.tr("Alt+Shift+D")), 0, self, 'debug_viewer_activate') - self.debugViewerActivateAct.setStatusTip(self.trUtf8( + self.debugViewerActivateAct.setStatusTip(self.tr( "Switch the input focus to the Debug-Viewer window.")) - self.debugViewerActivateAct.setWhatsThis(self.trUtf8( + self.debugViewerActivateAct.setWhatsThis(self.tr( """<b>Activate Debug-Viewer</b>""" """<p>This switches the input focus to the Debug-Viewer""" """ window.</p>""" )) - self.debugViewerActivateAct.triggered[()].connect( + self.debugViewerActivateAct.triggered.connect( self.__activateDebugViewer) self.actions.append(self.debugViewerActivateAct) self.addAction(self.debugViewerActivateAct) self.shellActivateAct = E5Action( - self.trUtf8('Shell'), - self.trUtf8('&Shell'), - QKeySequence(self.trUtf8("Alt+Shift+S")), + self.tr('Shell'), + self.tr('&Shell'), + QKeySequence(self.tr("Alt+Shift+S")), 0, self, 'interprter_shell_activate') - self.shellActivateAct.setStatusTip(self.trUtf8( + self.shellActivateAct.setStatusTip(self.tr( "Switch the input focus to the Shell window.")) - self.shellActivateAct.setWhatsThis(self.trUtf8( + self.shellActivateAct.setWhatsThis(self.tr( """<b>Activate Shell</b>""" """<p>This switches the input focus to the Shell window.</p>""" )) - self.shellActivateAct.triggered[()].connect(self.__activateShell) + self.shellActivateAct.triggered.connect(self.__activateShell) self.actions.append(self.shellActivateAct) self.addAction(self.shellActivateAct) self.browserActivateAct = E5Action( - self.trUtf8('File-Browser'), - self.trUtf8('&File-Browser'), - QKeySequence(self.trUtf8("Alt+Shift+F")), + self.tr('File-Browser'), + self.tr('&File-Browser'), + QKeySequence(self.tr("Alt+Shift+F")), 0, self, 'file_browser_activate') - self.browserActivateAct.setStatusTip(self.trUtf8( + self.browserActivateAct.setStatusTip(self.tr( "Switch the input focus to the File-Browser window.")) - self.browserActivateAct.setWhatsThis(self.trUtf8( + self.browserActivateAct.setWhatsThis(self.tr( """<b>Activate File-Browser</b>""" """<p>This switches the input focus to the File-Browser""" """ window.</p>""" )) - self.browserActivateAct.triggered[()].connect(self.__activateBrowser) + self.browserActivateAct.triggered.connect(self.__activateBrowser) self.actions.append(self.browserActivateAct) self.addAction(self.browserActivateAct) self.logViewerActivateAct = E5Action( - self.trUtf8('Log-Viewer'), - self.trUtf8('Lo&g-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+G")), + self.tr('Log-Viewer'), + self.tr('Lo&g-Viewer'), + QKeySequence(self.tr("Alt+Shift+G")), 0, self, 'log_viewer_activate') - self.logViewerActivateAct.setStatusTip(self.trUtf8( + self.logViewerActivateAct.setStatusTip(self.tr( "Switch the input focus to the Log-Viewer window.")) - self.logViewerActivateAct.setWhatsThis(self.trUtf8( + self.logViewerActivateAct.setWhatsThis(self.tr( """<b>Activate Log-Viewer</b>""" """<p>This switches the input focus to the Log-Viewer""" """ window.</p>""" )) - self.logViewerActivateAct.triggered[()].connect( + self.logViewerActivateAct.triggered.connect( self.__activateLogViewer) self.actions.append(self.logViewerActivateAct) self.addAction(self.logViewerActivateAct) self.taskViewerActivateAct = E5Action( - self.trUtf8('Task-Viewer'), - self.trUtf8('&Task-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+T")), + self.tr('Task-Viewer'), + self.tr('&Task-Viewer'), + QKeySequence(self.tr("Alt+Shift+T")), 0, self, 'task_viewer_activate') - self.taskViewerActivateAct.setStatusTip(self.trUtf8( + self.taskViewerActivateAct.setStatusTip(self.tr( "Switch the input focus to the Task-Viewer window.")) - self.taskViewerActivateAct.setWhatsThis(self.trUtf8( + self.taskViewerActivateAct.setWhatsThis(self.tr( """<b>Activate Task-Viewer</b>""" """<p>This switches the input focus to the Task-Viewer""" """ window.</p>""" )) - self.taskViewerActivateAct.triggered[()].connect( + self.taskViewerActivateAct.triggered.connect( self.__activateTaskViewer) self.actions.append(self.taskViewerActivateAct) self.addAction(self.taskViewerActivateAct) self.templateViewerActivateAct = E5Action( - self.trUtf8('Template-Viewer'), - self.trUtf8('Templ&ate-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+A")), + self.tr('Template-Viewer'), + self.tr('Templ&ate-Viewer'), + QKeySequence(self.tr("Alt+Shift+A")), 0, self, 'template_viewer_activate') - self.templateViewerActivateAct.setStatusTip(self.trUtf8( + self.templateViewerActivateAct.setStatusTip(self.tr( "Switch the input focus to the Template-Viewer window.")) - self.templateViewerActivateAct.setWhatsThis(self.trUtf8( + self.templateViewerActivateAct.setWhatsThis(self.tr( """<b>Activate Template-Viewer</b>""" """<p>This switches the input focus to the Template-Viewer""" """ window.</p>""" )) - self.templateViewerActivateAct.triggered[()].connect( + self.templateViewerActivateAct.triggered.connect( self.__activateTemplateViewer) self.actions.append(self.templateViewerActivateAct) self.addAction(self.templateViewerActivateAct) self.ltAct = E5Action( - self.trUtf8('Left Toolbox'), - self.trUtf8('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) - self.ltAct.setStatusTip(self.trUtf8('Toggle the Left Toolbox window')) - self.ltAct.setWhatsThis(self.trUtf8( + self.tr('Left Toolbox'), + self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) + self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window')) + self.ltAct.setWhatsThis(self.tr( """<b>Toggle the Left Toolbox window</b>""" """<p>If the Left Toolbox window is hidden then display it.""" """ If it is displayed then close it.</p>""" )) - self.ltAct.triggered[()].connect(self.__toggleLeftToolbox) + self.ltAct.triggered.connect(self.__toggleLeftToolbox) self.actions.append(self.ltAct) self.rtAct = E5Action( - self.trUtf8('Right Toolbox'), - self.trUtf8('&Right Toolbox'), + self.tr('Right Toolbox'), + self.tr('&Right Toolbox'), 0, 0, self, 'vertical_toolbox', True) - self.rtAct.setStatusTip(self.trUtf8('Toggle the Right Toolbox window')) - self.rtAct.setWhatsThis(self.trUtf8( + self.rtAct.setStatusTip(self.tr('Toggle the Right Toolbox window')) + self.rtAct.setWhatsThis(self.tr( """<b>Toggle the Right Toolbox window</b>""" """<p>If the Right Toolbox window is hidden then display it.""" """ If it is displayed then close it.</p>""" )) - self.rtAct.triggered[()].connect(self.__toggleRightToolbox) + self.rtAct.triggered.connect(self.__toggleRightToolbox) self.actions.append(self.rtAct) self.htAct = E5Action( - self.trUtf8('Horizontal Toolbox'), - self.trUtf8('&Horizontal Toolbox'), 0, 0, self, + self.tr('Horizontal Toolbox'), + self.tr('&Horizontal Toolbox'), 0, 0, self, 'horizontal_toolbox', True) - self.htAct.setStatusTip(self.trUtf8( + self.htAct.setStatusTip(self.tr( 'Toggle the Horizontal Toolbox window')) - self.htAct.setWhatsThis(self.trUtf8( + self.htAct.setWhatsThis(self.tr( """<b>Toggle the Horizontal Toolbox window</b>""" """<p>If the Horizontal Toolbox window is hidden then display""" """ it. If it is displayed then close it.</p>""" )) - self.htAct.triggered[()].connect(self.__toggleHorizontalToolbox) + self.htAct.triggered.connect(self.__toggleHorizontalToolbox) self.actions.append(self.htAct) self.lsbAct = E5Action( - self.trUtf8('Left Sidebar'), - self.trUtf8('&Left Sidebar'), + self.tr('Left Sidebar'), + self.tr('&Left Sidebar'), 0, 0, self, 'left_sidebar', True) - self.lsbAct.setStatusTip(self.trUtf8('Toggle the left sidebar window')) - self.lsbAct.setWhatsThis(self.trUtf8( + self.lsbAct.setStatusTip(self.tr('Toggle the left sidebar window')) + self.lsbAct.setWhatsThis(self.tr( """<b>Toggle the left sidebar window</b>""" """<p>If the left sidebar window is hidden then display it.""" """ If it is displayed then close it.</p>""" )) - self.lsbAct.triggered[()].connect(self.__toggleLeftSidebar) + self.lsbAct.triggered.connect(self.__toggleLeftSidebar) self.actions.append(self.lsbAct) self.rsbAct = E5Action( - self.trUtf8('Right Sidebar'), - self.trUtf8('&Right Sidebar'), + self.tr('Right Sidebar'), + self.tr('&Right Sidebar'), 0, 0, self, 'right_sidebar', True) - self.rsbAct.setStatusTip(self.trUtf8( + self.rsbAct.setStatusTip(self.tr( 'Toggle the right sidebar window')) - self.rsbAct.setWhatsThis(self.trUtf8( + self.rsbAct.setWhatsThis(self.tr( """<b>Toggle the right sidebar window</b>""" """<p>If the right sidebar window is hidden then display it.""" """ If it is displayed then close it.</p>""" )) - self.rsbAct.triggered[()].connect(self.__toggleRightSidebar) + self.rsbAct.triggered.connect(self.__toggleRightSidebar) self.actions.append(self.rsbAct) self.bsbAct = E5Action( - self.trUtf8('Bottom Sidebar'), - self.trUtf8('&Bottom Sidebar'), 0, 0, self, + self.tr('Bottom Sidebar'), + self.tr('&Bottom Sidebar'), 0, 0, self, 'bottom_sidebar', True) - self.bsbAct.setStatusTip(self.trUtf8( + self.bsbAct.setStatusTip(self.tr( 'Toggle the bottom sidebar window')) - self.bsbAct.setWhatsThis(self.trUtf8( + self.bsbAct.setWhatsThis(self.tr( """<b>Toggle the bottom sidebar window</b>""" """<p>If the bottom sidebar window is hidden then display it.""" """ If it is displayed then close it.</p>""" )) - self.bsbAct.triggered[()].connect(self.__toggleBottomSidebar) + self.bsbAct.triggered.connect(self.__toggleBottomSidebar) self.actions.append(self.bsbAct) self.cooperationViewerActivateAct = E5Action( - self.trUtf8('Cooperation-Viewer'), - self.trUtf8('Co&operation-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+O")), + self.tr('Cooperation-Viewer'), + self.tr('Co&operation-Viewer'), + QKeySequence(self.tr("Alt+Shift+O")), 0, self, 'cooperation_viewer_activate') - self.cooperationViewerActivateAct.setStatusTip(self.trUtf8( + self.cooperationViewerActivateAct.setStatusTip(self.tr( "Switch the input focus to the Cooperation-Viewer window.")) - self.cooperationViewerActivateAct.setWhatsThis(self.trUtf8( + self.cooperationViewerActivateAct.setWhatsThis(self.tr( """<b>Activate Cooperation-Viewer</b>""" """<p>This switches the input focus to the Cooperation-Viewer""" """ window.</p>""" )) - self.cooperationViewerActivateAct.triggered[()].connect( + self.cooperationViewerActivateAct.triggered.connect( self.activateCooperationViewer) self.actions.append(self.cooperationViewerActivateAct) self.addAction(self.cooperationViewerActivateAct) self.ircActivateAct = E5Action( - self.trUtf8('IRC'), - self.trUtf8('&IRC'), - QKeySequence(self.trUtf8("Meta+Shift+I")), + self.tr('IRC'), + self.tr('&IRC'), + QKeySequence(self.tr("Meta+Shift+I")), 0, self, 'irc_widget_activate') - self.ircActivateAct.setStatusTip(self.trUtf8( + self.ircActivateAct.setStatusTip(self.tr( "Switch the input focus to the IRC window.")) - self.ircActivateAct.setWhatsThis(self.trUtf8( + self.ircActivateAct.setWhatsThis(self.tr( """<b>Activate IRC</b>""" """<p>This switches the input focus to the IRC window.</p>""" )) - self.ircActivateAct.triggered[()].connect( + self.ircActivateAct.triggered.connect( self.__activateIRC) self.actions.append(self.ircActivateAct) self.addAction(self.ircActivateAct) self.symbolsViewerActivateAct = E5Action( - self.trUtf8('Symbols-Viewer'), - self.trUtf8('S&ymbols-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+Y")), + self.tr('Symbols-Viewer'), + self.tr('S&ymbols-Viewer'), + QKeySequence(self.tr("Alt+Shift+Y")), 0, self, 'symbols_viewer_activate') - self.symbolsViewerActivateAct.setStatusTip(self.trUtf8( + self.symbolsViewerActivateAct.setStatusTip(self.tr( "Switch the input focus to the Symbols-Viewer window.")) - self.symbolsViewerActivateAct.setWhatsThis(self.trUtf8( + self.symbolsViewerActivateAct.setWhatsThis(self.tr( """<b>Activate Symbols-Viewer</b>""" """<p>This switches the input focus to the Symbols-Viewer""" """ window.</p>""" )) - self.symbolsViewerActivateAct.triggered[()].connect( + self.symbolsViewerActivateAct.triggered.connect( self.__activateSymbolsViewer) self.actions.append(self.symbolsViewerActivateAct) self.addAction(self.symbolsViewerActivateAct) self.numbersViewerActivateAct = E5Action( - self.trUtf8('Numbers-Viewer'), - self.trUtf8('Num&bers-Viewer'), - QKeySequence(self.trUtf8("Alt+Shift+B")), + self.tr('Numbers-Viewer'), + self.tr('Num&bers-Viewer'), + QKeySequence(self.tr("Alt+Shift+B")), 0, self, 'numbers_viewer_activate') - self.numbersViewerActivateAct.setStatusTip(self.trUtf8( + self.numbersViewerActivateAct.setStatusTip(self.tr( "Switch the input focus to the Numbers-Viewer window.")) - self.numbersViewerActivateAct.setWhatsThis(self.trUtf8( + self.numbersViewerActivateAct.setWhatsThis(self.tr( """<b>Activate Numbers-Viewer</b>""" """<p>This switches the input focus to the Numbers-Viewer""" """ window.</p>""" )) - self.numbersViewerActivateAct.triggered[()].connect( + self.numbersViewerActivateAct.triggered.connect( self.__activateNumbersViewer) self.actions.append(self.numbersViewerActivateAct) self.addAction(self.numbersViewerActivateAct) self.whatsThisAct = E5Action( - self.trUtf8('What\'s This?'), + self.tr('What\'s This?'), UI.PixmapCache.getIcon("whatsThis.png"), - self.trUtf8('&What\'s This?'), - QKeySequence(self.trUtf8("Shift+F1")), + self.tr('&What\'s This?'), + QKeySequence(self.tr("Shift+F1")), 0, self, 'whatsThis') - self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) - self.whatsThisAct.setWhatsThis(self.trUtf8( + self.whatsThisAct.setStatusTip(self.tr('Context sensitive help')) + self.whatsThisAct.setWhatsThis(self.tr( """<b>Display context sensitive help</b>""" """<p>In What's This? mode, the mouse cursor shows an arrow with""" """ a question mark, and you can click on the interface elements""" @@ -1564,18 +1566,18 @@ """ them. In dialogs, this feature can be accessed using the""" """ context help button in the titlebar.</p>""" )) - self.whatsThisAct.triggered[()].connect(self.__whatsThis) + self.whatsThisAct.triggered.connect(self.__whatsThis) self.actions.append(self.whatsThisAct) self.helpviewerAct = E5Action( - self.trUtf8('Helpviewer'), + self.tr('Helpviewer'), UI.PixmapCache.getIcon("help.png"), - self.trUtf8('&Helpviewer...'), - QKeySequence(self.trUtf8("F1")), + self.tr('&Helpviewer...'), + QKeySequence(self.tr("F1")), 0, self, 'helpviewer') - self.helpviewerAct.setStatusTip(self.trUtf8( + self.helpviewerAct.setStatusTip(self.tr( 'Open the helpviewer window')) - self.helpviewerAct.setWhatsThis(self.trUtf8( + self.helpviewerAct.setWhatsThis(self.tr( """<b>Helpviewer</b>""" """<p>Display the eric5 web browser. This window will show""" """ HTML help files and help from Qt help collections. It has""" @@ -1584,7 +1586,7 @@ """ browse the internet as well</p><p>If called with a word""" """ selected, this word is search in the Qt help collection.</p>""" )) - self.helpviewerAct.triggered[()].connect(self.__helpViewer) + self.helpviewerAct.triggered.connect(self.__helpViewer) self.actions.append(self.helpviewerAct) self.__initQtDocActions() @@ -1593,154 +1595,154 @@ self.__initPySideDocAction() self.versionAct = E5Action( - self.trUtf8('Show Versions'), - self.trUtf8('Show &Versions'), + self.tr('Show Versions'), + self.tr('Show &Versions'), 0, 0, self, 'show_versions') - self.versionAct.setStatusTip(self.trUtf8( + self.versionAct.setStatusTip(self.tr( 'Display version information')) - self.versionAct.setWhatsThis(self.trUtf8( + self.versionAct.setWhatsThis(self.tr( """<b>Show Versions</b>""" """<p>Display version information.</p>""" )) - self.versionAct.triggered[()].connect(self.__showVersions) + self.versionAct.triggered.connect(self.__showVersions) self.actions.append(self.versionAct) self.checkUpdateAct = E5Action( - self.trUtf8('Check for Updates'), - self.trUtf8('Check for &Updates...'), 0, 0, self, 'check_updates') - self.checkUpdateAct.setStatusTip(self.trUtf8('Check for Updates')) - self.checkUpdateAct.setWhatsThis(self.trUtf8( + self.tr('Check for Updates'), + self.tr('Check for &Updates...'), 0, 0, self, 'check_updates') + self.checkUpdateAct.setStatusTip(self.tr('Check for Updates')) + self.checkUpdateAct.setWhatsThis(self.tr( """<b>Check for Updates...</b>""" """<p>Checks the internet for updates of eric5.</p>""" )) - self.checkUpdateAct.triggered[()].connect(self.performVersionCheck) + self.checkUpdateAct.triggered.connect(self.performVersionCheck) self.actions.append(self.checkUpdateAct) self.showVersionsAct = E5Action( - self.trUtf8('Show downloadable versions'), - self.trUtf8('Show &downloadable versions...'), + self.tr('Show downloadable versions'), + self.tr('Show &downloadable versions...'), 0, 0, self, 'show_downloadable_versions') self.showVersionsAct.setStatusTip( - self.trUtf8('Show the versions available for download')) - self.showVersionsAct.setWhatsThis(self.trUtf8( + self.tr('Show the versions available for download')) + self.showVersionsAct.setWhatsThis(self.tr( """<b>Show downloadable versions...</b>""" """<p>Shows the eric5 versions available for download """ """from the internet.</p>""" )) - self.showVersionsAct.triggered[()].connect( + self.showVersionsAct.triggered.connect( self.showAvailableVersionsInfo) self.actions.append(self.showVersionsAct) self.showErrorLogAct = E5Action( - self.trUtf8('Show Error Log'), - self.trUtf8('Show Error &Log...'), + self.tr('Show Error Log'), + self.tr('Show Error &Log...'), 0, 0, self, 'show_error_log') - self.showErrorLogAct.setStatusTip(self.trUtf8('Show Error Log')) - self.showErrorLogAct.setWhatsThis(self.trUtf8( + self.showErrorLogAct.setStatusTip(self.tr('Show Error Log')) + self.showErrorLogAct.setWhatsThis(self.tr( """<b>Show Error Log...</b>""" """<p>Opens a dialog showing the most recent error log.</p>""" )) - self.showErrorLogAct.triggered[()].connect(self.__showErrorLog) + self.showErrorLogAct.triggered.connect(self.__showErrorLog) self.actions.append(self.showErrorLogAct) self.reportBugAct = E5Action( - self.trUtf8('Report Bug'), - self.trUtf8('Report &Bug...'), + self.tr('Report Bug'), + self.tr('Report &Bug...'), 0, 0, self, 'report_bug') - self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) - self.reportBugAct.setWhatsThis(self.trUtf8( + self.reportBugAct.setStatusTip(self.tr('Report a bug')) + self.reportBugAct.setWhatsThis(self.tr( """<b>Report Bug...</b>""" """<p>Opens a dialog to report a bug.</p>""" )) - self.reportBugAct.triggered[()].connect(self.__reportBug) + self.reportBugAct.triggered.connect(self.__reportBug) self.actions.append(self.reportBugAct) self.requestFeatureAct = E5Action( - self.trUtf8('Request Feature'), - self.trUtf8('Request &Feature...'), + self.tr('Request Feature'), + self.tr('Request &Feature...'), 0, 0, self, 'request_feature') - self.requestFeatureAct.setStatusTip(self.trUtf8( + self.requestFeatureAct.setStatusTip(self.tr( 'Send a feature request')) - self.requestFeatureAct.setWhatsThis(self.trUtf8( + self.requestFeatureAct.setWhatsThis(self.tr( """<b>Request Feature...</b>""" """<p>Opens a dialog to send a feature request.</p>""" )) - self.requestFeatureAct.triggered[()].connect(self.__requestFeature) + self.requestFeatureAct.triggered.connect(self.__requestFeature) self.actions.append(self.requestFeatureAct) self.utActGrp = createActionGroup(self) self.utDialogAct = E5Action( - self.trUtf8('Unittest'), + self.tr('Unittest'), UI.PixmapCache.getIcon("unittest.png"), - self.trUtf8('&Unittest...'), + self.tr('&Unittest...'), 0, 0, self.utActGrp, 'unittest') - self.utDialogAct.setStatusTip(self.trUtf8('Start unittest dialog')) - self.utDialogAct.setWhatsThis(self.trUtf8( + self.utDialogAct.setStatusTip(self.tr('Start unittest dialog')) + self.utDialogAct.setWhatsThis(self.tr( """<b>Unittest</b>""" """<p>Perform unit tests. The dialog gives you the""" """ ability to select and run a unittest suite.</p>""" )) - self.utDialogAct.triggered[()].connect(self.__unittest) + self.utDialogAct.triggered.connect(self.__unittest) self.actions.append(self.utDialogAct) self.utRestartAct = E5Action( - self.trUtf8('Unittest Restart'), + self.tr('Unittest Restart'), UI.PixmapCache.getIcon("unittestRestart.png"), - self.trUtf8('&Restart Unittest...'), + self.tr('&Restart Unittest...'), 0, 0, self.utActGrp, 'unittest_restart') - self.utRestartAct.setStatusTip(self.trUtf8('Restart last unittest')) - self.utRestartAct.setWhatsThis(self.trUtf8( + self.utRestartAct.setStatusTip(self.tr('Restart last unittest')) + self.utRestartAct.setWhatsThis(self.tr( """<b>Restart Unittest</b>""" """<p>Restart the unittest performed last.</p>""" )) - self.utRestartAct.triggered[()].connect(self.__unittestRestart) + self.utRestartAct.triggered.connect(self.__unittestRestart) self.utRestartAct.setEnabled(False) self.actions.append(self.utRestartAct) self.utRerunFailedAct = E5Action( - self.trUtf8('Unittest Rerun Failed'), + self.tr('Unittest Rerun Failed'), UI.PixmapCache.getIcon("unittestRerunFailed.png"), - self.trUtf8('Rerun Failed Tests...'), + self.tr('Rerun Failed Tests...'), 0, 0, self.utActGrp, 'unittest_rerun_failed') - self.utRerunFailedAct.setStatusTip(self.trUtf8( + self.utRerunFailedAct.setStatusTip(self.tr( 'Rerun failed tests of the last run')) - self.utRerunFailedAct.setWhatsThis(self.trUtf8( + self.utRerunFailedAct.setWhatsThis(self.tr( """<b>Rerun Failed Tests</b>""" """<p>Rerun all tests that failed during the last unittest""" """ run.</p>""" )) - self.utRerunFailedAct.triggered[()].connect(self.__unittestRerunFailed) + self.utRerunFailedAct.triggered.connect(self.__unittestRerunFailed) self.utRerunFailedAct.setEnabled(False) self.actions.append(self.utRerunFailedAct) self.utScriptAct = E5Action( - self.trUtf8('Unittest Script'), + self.tr('Unittest Script'), UI.PixmapCache.getIcon("unittestScript.png"), - self.trUtf8('Unittest &Script...'), + self.tr('Unittest &Script...'), 0, 0, self.utActGrp, 'unittest_script') - self.utScriptAct.setStatusTip(self.trUtf8( + self.utScriptAct.setStatusTip(self.tr( 'Run unittest with current script')) - self.utScriptAct.setWhatsThis(self.trUtf8( + self.utScriptAct.setWhatsThis(self.tr( """<b>Unittest Script</b>""" """<p>Run unittest with current script.</p>""" )) - self.utScriptAct.triggered[()].connect(self.__unittestScript) + self.utScriptAct.triggered.connect(self.__unittestScript) self.utScriptAct.setEnabled(False) self.actions.append(self.utScriptAct) self.utProjectAct = E5Action( - self.trUtf8('Unittest Project'), + self.tr('Unittest Project'), UI.PixmapCache.getIcon("unittestProject.png"), - self.trUtf8('Unittest &Project...'), + self.tr('Unittest &Project...'), 0, 0, self.utActGrp, 'unittest_project') - self.utProjectAct.setStatusTip(self.trUtf8( + self.utProjectAct.setStatusTip(self.tr( 'Run unittest with current project')) - self.utProjectAct.setWhatsThis(self.trUtf8( + self.utProjectAct.setWhatsThis(self.tr( """<b>Unittest Project</b>""" """<p>Run unittest with current project.</p>""" )) - self.utProjectAct.triggered[()].connect(self.__unittestProject) + self.utProjectAct.triggered.connect(self.__unittestProject) self.utProjectAct.setEnabled(False) self.actions.append(self.utProjectAct) @@ -1757,16 +1759,16 @@ Utilities.generateQtToolName("designer")) if os.path.exists(designerExe): self.designer4Act = E5Action( - self.trUtf8('Qt-Designer'), + self.tr('Qt-Designer'), UI.PixmapCache.getIcon("designer4.png"), - self.trUtf8('Qt-&Designer...'), + self.tr('Qt-&Designer...'), 0, 0, self, 'qt_designer4') - self.designer4Act.setStatusTip(self.trUtf8('Start Qt-Designer')) - self.designer4Act.setWhatsThis(self.trUtf8( + self.designer4Act.setStatusTip(self.tr('Start Qt-Designer')) + self.designer4Act.setWhatsThis(self.tr( """<b>Qt-Designer</b>""" """<p>Start Qt-Designer.</p>""" )) - self.designer4Act.triggered[()].connect(self.__designer4) + self.designer4Act.triggered.connect(self.__designer4) self.actions.append(self.designer4Act) else: self.designer4Act = None @@ -1783,414 +1785,414 @@ Utilities.generateQtToolName("linguist")) if os.path.exists(linguistExe): self.linguist4Act = E5Action( - self.trUtf8('Qt-Linguist'), + self.tr('Qt-Linguist'), UI.PixmapCache.getIcon("linguist4.png"), - self.trUtf8('Qt-&Linguist...'), + self.tr('Qt-&Linguist...'), 0, 0, self, 'qt_linguist4') - self.linguist4Act.setStatusTip(self.trUtf8('Start Qt-Linguist')) - self.linguist4Act.setWhatsThis(self.trUtf8( + self.linguist4Act.setStatusTip(self.tr('Start Qt-Linguist')) + self.linguist4Act.setWhatsThis(self.tr( """<b>Qt-Linguist</b>""" """<p>Start Qt-Linguist.</p>""" )) - self.linguist4Act.triggered[()].connect(self.__linguist4) + self.linguist4Act.triggered.connect(self.__linguist4) self.actions.append(self.linguist4Act) else: self.linguist4Act = None self.uipreviewerAct = E5Action( - self.trUtf8('UI Previewer'), + self.tr('UI Previewer'), UI.PixmapCache.getIcon("uiPreviewer.png"), - self.trUtf8('&UI Previewer...'), + self.tr('&UI Previewer...'), 0, 0, self, 'ui_previewer') - self.uipreviewerAct.setStatusTip(self.trUtf8('Start the UI Previewer')) - self.uipreviewerAct.setWhatsThis(self.trUtf8( + self.uipreviewerAct.setStatusTip(self.tr('Start the UI Previewer')) + self.uipreviewerAct.setWhatsThis(self.tr( """<b>UI Previewer</b>""" """<p>Start the UI Previewer.</p>""" )) - self.uipreviewerAct.triggered[()].connect(self.__UIPreviewer) + self.uipreviewerAct.triggered.connect(self.__UIPreviewer) self.actions.append(self.uipreviewerAct) self.trpreviewerAct = E5Action( - self.trUtf8('Translations Previewer'), + self.tr('Translations Previewer'), UI.PixmapCache.getIcon("trPreviewer.png"), - self.trUtf8('&Translations Previewer...'), + self.tr('&Translations Previewer...'), 0, 0, self, 'tr_previewer') - self.trpreviewerAct.setStatusTip(self.trUtf8( + self.trpreviewerAct.setStatusTip(self.tr( 'Start the Translations Previewer')) - self.trpreviewerAct.setWhatsThis(self.trUtf8( + self.trpreviewerAct.setWhatsThis(self.tr( """<b>Translations Previewer</b>""" """<p>Start the Translations Previewer.</p>""" )) - self.trpreviewerAct.triggered[()].connect(self.__TRPreviewer) + self.trpreviewerAct.triggered.connect(self.__TRPreviewer) self.actions.append(self.trpreviewerAct) self.diffAct = E5Action( - self.trUtf8('Compare Files'), + self.tr('Compare Files'), UI.PixmapCache.getIcon("diffFiles.png"), - self.trUtf8('&Compare Files...'), + self.tr('&Compare Files...'), 0, 0, self, 'diff_files') - self.diffAct.setStatusTip(self.trUtf8('Compare two files')) - self.diffAct.setWhatsThis(self.trUtf8( + self.diffAct.setStatusTip(self.tr('Compare two files')) + self.diffAct.setWhatsThis(self.tr( """<b>Compare Files</b>""" """<p>Open a dialog to compare two files.</p>""" )) - self.diffAct.triggered[()].connect(self.__compareFiles) + self.diffAct.triggered.connect(self.__compareFiles) self.actions.append(self.diffAct) self.compareAct = E5Action( - self.trUtf8('Compare Files side by side'), + self.tr('Compare Files side by side'), UI.PixmapCache.getIcon("compareFiles.png"), - self.trUtf8('Compare &Files side by side...'), + self.tr('Compare &Files side by side...'), 0, 0, self, 'compare_files') - self.compareAct.setStatusTip(self.trUtf8('Compare two files')) - self.compareAct.setWhatsThis(self.trUtf8( + self.compareAct.setStatusTip(self.tr('Compare two files')) + self.compareAct.setWhatsThis(self.tr( """<b>Compare Files side by side</b>""" """<p>Open a dialog to compare two files and show the result""" """ side by side.</p>""" )) - self.compareAct.triggered[()].connect(self.__compareFilesSbs) + self.compareAct.triggered.connect(self.__compareFilesSbs) self.actions.append(self.compareAct) self.sqlBrowserAct = E5Action( - self.trUtf8('SQL Browser'), + self.tr('SQL Browser'), UI.PixmapCache.getIcon("sqlBrowser.png"), - self.trUtf8('SQL &Browser...'), + self.tr('SQL &Browser...'), 0, 0, self, 'sql_browser') - self.sqlBrowserAct.setStatusTip(self.trUtf8('Browse a SQL database')) - self.sqlBrowserAct.setWhatsThis(self.trUtf8( + self.sqlBrowserAct.setStatusTip(self.tr('Browse a SQL database')) + self.sqlBrowserAct.setWhatsThis(self.tr( """<b>SQL Browser</b>""" """<p>Browse a SQL database.</p>""" )) - self.sqlBrowserAct.triggered[()].connect(self.__sqlBrowser) + self.sqlBrowserAct.triggered.connect(self.__sqlBrowser) self.actions.append(self.sqlBrowserAct) self.miniEditorAct = E5Action( - self.trUtf8('Mini Editor'), + self.tr('Mini Editor'), UI.PixmapCache.getIcon("editor.png"), - self.trUtf8('Mini &Editor...'), + self.tr('Mini &Editor...'), 0, 0, self, 'mini_editor') - self.miniEditorAct.setStatusTip(self.trUtf8('Mini Editor')) - self.miniEditorAct.setWhatsThis(self.trUtf8( + self.miniEditorAct.setStatusTip(self.tr('Mini Editor')) + self.miniEditorAct.setWhatsThis(self.tr( """<b>Mini Editor</b>""" """<p>Open a dialog with a simplified editor.</p>""" )) - self.miniEditorAct.triggered[()].connect(self.__openMiniEditor) + self.miniEditorAct.triggered.connect(self.__openMiniEditor) self.actions.append(self.miniEditorAct) self.webBrowserAct = E5Action( - self.trUtf8('eric5 Web Browser'), + self.tr('eric5 Web Browser'), UI.PixmapCache.getIcon("ericWeb.png"), - self.trUtf8('eric5 &Web Browser...'), + self.tr('eric5 &Web Browser...'), 0, 0, self, 'web_browser') - self.webBrowserAct.setStatusTip(self.trUtf8( + self.webBrowserAct.setStatusTip(self.tr( 'Start the eric5 Web Browser')) - self.webBrowserAct.setWhatsThis(self.trUtf8( + self.webBrowserAct.setWhatsThis(self.tr( """<b>eric5 Web Browser</b>""" """<p>Browse the Internet with the eric5 Web Browser.</p>""" )) - self.webBrowserAct.triggered[()].connect(self.__startWebBrowser) + self.webBrowserAct.triggered.connect(self.__startWebBrowser) self.actions.append(self.webBrowserAct) self.iconEditorAct = E5Action( - self.trUtf8('Icon Editor'), + self.tr('Icon Editor'), UI.PixmapCache.getIcon("iconEditor.png"), - self.trUtf8('&Icon Editor...'), + self.tr('&Icon Editor...'), 0, 0, self, 'icon_editor') - self.iconEditorAct.setStatusTip(self.trUtf8( + self.iconEditorAct.setStatusTip(self.tr( 'Start the eric5 Icon Editor')) - self.iconEditorAct.setWhatsThis(self.trUtf8( + self.iconEditorAct.setWhatsThis(self.tr( """<b>Icon Editor</b>""" """<p>Starts the eric5 Icon Editor for editing simple icons.</p>""" )) - self.iconEditorAct.triggered[()].connect(self.__editPixmap) + self.iconEditorAct.triggered.connect(self.__editPixmap) self.actions.append(self.iconEditorAct) self.snapshotAct = E5Action( - self.trUtf8('Snapshot'), + self.tr('Snapshot'), UI.PixmapCache.getIcon("ericSnap.png"), - self.trUtf8('&Snapshot...'), + self.tr('&Snapshot...'), 0, 0, self, 'snapshot') - self.snapshotAct.setStatusTip(self.trUtf8( + self.snapshotAct.setStatusTip(self.tr( 'Take snapshots of a screen region')) - self.snapshotAct.setWhatsThis(self.trUtf8( + self.snapshotAct.setWhatsThis(self.tr( """<b>Snapshot</b>""" """<p>This opens a dialog to take snapshots of a screen""" """ region.</p>""" )) - self.snapshotAct.triggered[()].connect(self.__snapshot) + self.snapshotAct.triggered.connect(self.__snapshot) self.actions.append(self.snapshotAct) self.prefAct = E5Action( - self.trUtf8('Preferences'), + self.tr('Preferences'), UI.PixmapCache.getIcon("configure.png"), - self.trUtf8('&Preferences...'), + self.tr('&Preferences...'), 0, 0, self, 'preferences') - self.prefAct.setStatusTip(self.trUtf8( + self.prefAct.setStatusTip(self.tr( 'Set the prefered configuration')) - self.prefAct.setWhatsThis(self.trUtf8( + self.prefAct.setWhatsThis(self.tr( """<b>Preferences</b>""" """<p>Set the configuration items of the application""" """ with your prefered values.</p>""" )) - self.prefAct.triggered[()].connect(self.showPreferences) + self.prefAct.triggered.connect(self.showPreferences) self.prefAct.setMenuRole(QAction.PreferencesRole) self.actions.append(self.prefAct) self.prefExportAct = E5Action( - self.trUtf8('Export Preferences'), + self.tr('Export Preferences'), UI.PixmapCache.getIcon("configureExport.png"), - self.trUtf8('E&xport Preferences...'), + self.tr('E&xport Preferences...'), 0, 0, self, 'export_preferences') - self.prefExportAct.setStatusTip(self.trUtf8( + self.prefExportAct.setStatusTip(self.tr( 'Export the current configuration')) - self.prefExportAct.setWhatsThis(self.trUtf8( + self.prefExportAct.setWhatsThis(self.tr( """<b>Export Preferences</b>""" """<p>Export the current configuration to a file.</p>""" )) - self.prefExportAct.triggered[()].connect(self.__exportPreferences) + self.prefExportAct.triggered.connect(self.__exportPreferences) self.actions.append(self.prefExportAct) self.prefImportAct = E5Action( - self.trUtf8('Import Preferences'), + self.tr('Import Preferences'), UI.PixmapCache.getIcon("configureImport.png"), - self.trUtf8('I&mport Preferences...'), + self.tr('I&mport Preferences...'), 0, 0, self, 'import_preferences') - self.prefImportAct.setStatusTip(self.trUtf8( + self.prefImportAct.setStatusTip(self.tr( 'Import a previously exported configuration')) - self.prefImportAct.setWhatsThis(self.trUtf8( + self.prefImportAct.setWhatsThis(self.tr( """<b>Import Preferences</b>""" """<p>Import a previously exported configuration.</p>""" )) - self.prefImportAct.triggered[()].connect(self.__importPreferences) + self.prefImportAct.triggered.connect(self.__importPreferences) self.actions.append(self.prefImportAct) self.reloadAPIsAct = E5Action( - self.trUtf8('Reload APIs'), - self.trUtf8('Reload &APIs'), + self.tr('Reload APIs'), + self.tr('Reload &APIs'), 0, 0, self, 'reload_apis') - self.reloadAPIsAct.setStatusTip(self.trUtf8( + self.reloadAPIsAct.setStatusTip(self.tr( 'Reload the API information')) - self.reloadAPIsAct.setWhatsThis(self.trUtf8( + self.reloadAPIsAct.setWhatsThis(self.tr( """<b>Reload APIs</b>""" """<p>Reload the API information.</p>""" )) - self.reloadAPIsAct.triggered[()].connect(self.__reloadAPIs) + self.reloadAPIsAct.triggered.connect(self.__reloadAPIs) self.actions.append(self.reloadAPIsAct) self.showExternalToolsAct = E5Action( - self.trUtf8('Show external tools'), + self.tr('Show external tools'), UI.PixmapCache.getIcon("showPrograms.png"), - self.trUtf8('Show external &tools'), + self.tr('Show external &tools'), 0, 0, self, 'show_external_tools') - self.showExternalToolsAct.setStatusTip(self.trUtf8( + self.showExternalToolsAct.setStatusTip(self.tr( 'Show external tools')) - self.showExternalToolsAct.setWhatsThis(self.trUtf8( + self.showExternalToolsAct.setWhatsThis(self.tr( """<b>Show external tools</b>""" """<p>Opens a dialog to show the path and versions of all""" """ extenal tools used by eric5.</p>""" )) - self.showExternalToolsAct.triggered[()].connect( + self.showExternalToolsAct.triggered.connect( self.__showExternalTools) self.actions.append(self.showExternalToolsAct) self.configViewProfilesAct = E5Action( - self.trUtf8('View Profiles'), + self.tr('View Profiles'), UI.PixmapCache.getIcon("configureViewProfiles.png"), - self.trUtf8('&View Profiles...'), + self.tr('&View Profiles...'), 0, 0, self, 'view_profiles') - self.configViewProfilesAct.setStatusTip(self.trUtf8( + self.configViewProfilesAct.setStatusTip(self.tr( 'Configure view profiles')) - self.configViewProfilesAct.setWhatsThis(self.trUtf8( + self.configViewProfilesAct.setWhatsThis(self.tr( """<b>View Profiles</b>""" """<p>Configure the view profiles. With this dialog you may""" """ set the visibility of the various windows for the""" """ predetermined view profiles.</p>""" )) - self.configViewProfilesAct.triggered[()].connect( + self.configViewProfilesAct.triggered.connect( self.__configViewProfiles) self.actions.append(self.configViewProfilesAct) self.configToolBarsAct = E5Action( - self.trUtf8('Toolbars'), + self.tr('Toolbars'), UI.PixmapCache.getIcon("toolbarsConfigure.png"), - self.trUtf8('Tool&bars...'), + self.tr('Tool&bars...'), 0, 0, self, 'configure_toolbars') - self.configToolBarsAct.setStatusTip(self.trUtf8('Configure toolbars')) - self.configToolBarsAct.setWhatsThis(self.trUtf8( + self.configToolBarsAct.setStatusTip(self.tr('Configure toolbars')) + self.configToolBarsAct.setWhatsThis(self.tr( """<b>Toolbars</b>""" """<p>Configure the toolbars. With this dialog you may""" """ change the actions shown on the various toolbars and""" """ define your own toolbars.</p>""" )) - self.configToolBarsAct.triggered[()].connect(self.__configToolBars) + self.configToolBarsAct.triggered.connect(self.__configToolBars) self.actions.append(self.configToolBarsAct) self.shortcutsAct = E5Action( - self.trUtf8('Keyboard Shortcuts'), + self.tr('Keyboard Shortcuts'), UI.PixmapCache.getIcon("configureShortcuts.png"), - self.trUtf8('Keyboard &Shortcuts...'), + self.tr('Keyboard &Shortcuts...'), 0, 0, self, 'keyboard_shortcuts') - self.shortcutsAct.setStatusTip(self.trUtf8( + self.shortcutsAct.setStatusTip(self.tr( 'Set the keyboard shortcuts')) - self.shortcutsAct.setWhatsThis(self.trUtf8( + self.shortcutsAct.setWhatsThis(self.tr( """<b>Keyboard Shortcuts</b>""" """<p>Set the keyboard shortcuts of the application""" """ with your prefered values.</p>""" )) - self.shortcutsAct.triggered[()].connect(self.__configShortcuts) + self.shortcutsAct.triggered.connect(self.__configShortcuts) self.actions.append(self.shortcutsAct) self.exportShortcutsAct = E5Action( - self.trUtf8('Export Keyboard Shortcuts'), + self.tr('Export Keyboard Shortcuts'), UI.PixmapCache.getIcon("exportShortcuts.png"), - self.trUtf8('&Export Keyboard Shortcuts...'), + self.tr('&Export Keyboard Shortcuts...'), 0, 0, self, 'export_keyboard_shortcuts') - self.exportShortcutsAct.setStatusTip(self.trUtf8( + self.exportShortcutsAct.setStatusTip(self.tr( 'Export the keyboard shortcuts')) - self.exportShortcutsAct.setWhatsThis(self.trUtf8( + self.exportShortcutsAct.setWhatsThis(self.tr( """<b>Export Keyboard Shortcuts</b>""" """<p>Export the keyboard shortcuts of the application.</p>""" )) - self.exportShortcutsAct.triggered[()].connect(self.__exportShortcuts) + self.exportShortcutsAct.triggered.connect(self.__exportShortcuts) self.actions.append(self.exportShortcutsAct) self.importShortcutsAct = E5Action( - self.trUtf8('Import Keyboard Shortcuts'), + self.tr('Import Keyboard Shortcuts'), UI.PixmapCache.getIcon("importShortcuts.png"), - self.trUtf8('&Import Keyboard Shortcuts...'), + self.tr('&Import Keyboard Shortcuts...'), 0, 0, self, 'import_keyboard_shortcuts') - self.importShortcutsAct.setStatusTip(self.trUtf8( + self.importShortcutsAct.setStatusTip(self.tr( 'Import the keyboard shortcuts')) - self.importShortcutsAct.setWhatsThis(self.trUtf8( + self.importShortcutsAct.setWhatsThis(self.tr( """<b>Import Keyboard Shortcuts</b>""" """<p>Import the keyboard shortcuts of the application.</p>""" )) - self.importShortcutsAct.triggered[()].connect(self.__importShortcuts) + self.importShortcutsAct.triggered.connect(self.__importShortcuts) self.actions.append(self.importShortcutsAct) if SSL_AVAILABLE: self.certificatesAct = E5Action( - self.trUtf8('Manage SSL Certificates'), + self.tr('Manage SSL Certificates'), UI.PixmapCache.getIcon("certificates.png"), - self.trUtf8('Manage SSL Certificates...'), + self.tr('Manage SSL Certificates...'), 0, 0, self, 'manage_ssl_certificates') - self.certificatesAct.setStatusTip(self.trUtf8( + self.certificatesAct.setStatusTip(self.tr( 'Manage the saved SSL certificates')) - self.certificatesAct.setWhatsThis(self.trUtf8( + self.certificatesAct.setWhatsThis(self.tr( """<b>Manage SSL Certificates...</b>""" """<p>Opens a dialog to manage the saved SSL certificates.""" """</p>""" )) - self.certificatesAct.triggered[()].connect( + self.certificatesAct.triggered.connect( self.__showCertificatesDialog) self.actions.append(self.certificatesAct) self.editMessageFilterAct = E5Action( - self.trUtf8('Edit Message Filters'), + self.tr('Edit Message Filters'), UI.PixmapCache.getIcon("warning.png"), - self.trUtf8('Edit Message Filters...'), + self.tr('Edit Message Filters...'), 0, 0, self, 'manage_message_filters') - self.editMessageFilterAct.setStatusTip(self.trUtf8( + self.editMessageFilterAct.setStatusTip(self.tr( 'Edit the message filters used to suppress unwanted messages')) - self.editMessageFilterAct.setWhatsThis(self.trUtf8( + self.editMessageFilterAct.setWhatsThis(self.tr( """<b>Edit Message Filters</b>""" """<p>Opens a dialog to edit the message filters used to""" """ suppress unwanted messages been shown in an error""" """ window.</p>""" )) - self.editMessageFilterAct.triggered[()].connect( + self.editMessageFilterAct.triggered.connect( E5ErrorMessage.editMessageFilters) self.actions.append(self.editMessageFilterAct) self.viewmanagerActivateAct = E5Action( - self.trUtf8('Activate current editor'), - self.trUtf8('Activate current editor'), - QKeySequence(self.trUtf8("Alt+Shift+E")), + self.tr('Activate current editor'), + self.tr('Activate current editor'), + QKeySequence(self.tr("Alt+Shift+E")), 0, self, 'viewmanager_activate', 1) - self.viewmanagerActivateAct.triggered[()].connect( + self.viewmanagerActivateAct.triggered.connect( self.__activateViewmanager) self.actions.append(self.viewmanagerActivateAct) self.addAction(self.viewmanagerActivateAct) self.nextTabAct = E5Action( - self.trUtf8('Show next'), - self.trUtf8('Show next'), - QKeySequence(self.trUtf8('Ctrl+Alt+Tab')), 0, + self.tr('Show next'), + self.tr('Show next'), + QKeySequence(self.tr('Ctrl+Alt+Tab')), 0, self, 'view_next_tab') - self.nextTabAct.triggered[()].connect(self.__showNext) + self.nextTabAct.triggered.connect(self.__showNext) self.actions.append(self.nextTabAct) self.addAction(self.nextTabAct) self.prevTabAct = E5Action( - self.trUtf8('Show previous'), - self.trUtf8('Show previous'), - QKeySequence(self.trUtf8('Shift+Ctrl+Alt+Tab')), 0, + self.tr('Show previous'), + self.tr('Show previous'), + QKeySequence(self.tr('Shift+Ctrl+Alt+Tab')), 0, self, 'view_previous_tab') - self.prevTabAct.triggered[()].connect(self.__showPrevious) + self.prevTabAct.triggered.connect(self.__showPrevious) self.actions.append(self.prevTabAct) self.addAction(self.prevTabAct) self.switchTabAct = E5Action( - self.trUtf8('Switch between tabs'), - self.trUtf8('Switch between tabs'), - QKeySequence(self.trUtf8('Ctrl+1')), 0, + self.tr('Switch between tabs'), + self.tr('Switch between tabs'), + QKeySequence(self.tr('Ctrl+1')), 0, self, 'switch_tabs') - self.switchTabAct.triggered[()].connect(self.__switchTab) + self.switchTabAct.triggered.connect(self.__switchTab) self.actions.append(self.switchTabAct) self.addAction(self.switchTabAct) self.pluginInfoAct = E5Action( - self.trUtf8('Plugin Infos'), + self.tr('Plugin Infos'), UI.PixmapCache.getIcon("plugin.png"), - self.trUtf8('&Plugin Infos...'), 0, 0, self, 'plugin_infos') - self.pluginInfoAct.setStatusTip(self.trUtf8('Show Plugin Infos')) - self.pluginInfoAct.setWhatsThis(self.trUtf8( + self.tr('&Plugin Infos...'), 0, 0, self, 'plugin_infos') + self.pluginInfoAct.setStatusTip(self.tr('Show Plugin Infos')) + self.pluginInfoAct.setWhatsThis(self.tr( """<b>Plugin Infos...</b>""" """<p>This opens a dialog, that show some information about""" """ loaded plugins.</p>""" )) - self.pluginInfoAct.triggered[()].connect(self.__showPluginInfo) + self.pluginInfoAct.triggered.connect(self.__showPluginInfo) self.actions.append(self.pluginInfoAct) self.pluginInstallAct = E5Action( - self.trUtf8('Install Plugins'), + self.tr('Install Plugins'), UI.PixmapCache.getIcon("pluginInstall.png"), - self.trUtf8('&Install Plugins...'), + self.tr('&Install Plugins...'), 0, 0, self, 'plugin_install') - self.pluginInstallAct.setStatusTip(self.trUtf8('Install Plugins')) - self.pluginInstallAct.setWhatsThis(self.trUtf8( + self.pluginInstallAct.setStatusTip(self.tr('Install Plugins')) + self.pluginInstallAct.setWhatsThis(self.tr( """<b>Install Plugins...</b>""" """<p>This opens a dialog to install or update plugins.</p>""" )) - self.pluginInstallAct.triggered[()].connect(self.__installPlugins) + self.pluginInstallAct.triggered.connect(self.__installPlugins) self.actions.append(self.pluginInstallAct) self.pluginDeinstallAct = E5Action( - self.trUtf8('Uninstall Plugin'), + self.tr('Uninstall Plugin'), UI.PixmapCache.getIcon("pluginUninstall.png"), - self.trUtf8('&Uninstall Plugin...'), + self.tr('&Uninstall Plugin...'), 0, 0, self, 'plugin_deinstall') - self.pluginDeinstallAct.setStatusTip(self.trUtf8('Uninstall Plugin')) - self.pluginDeinstallAct.setWhatsThis(self.trUtf8( + self.pluginDeinstallAct.setStatusTip(self.tr('Uninstall Plugin')) + self.pluginDeinstallAct.setWhatsThis(self.tr( """<b>Uninstall Plugin...</b>""" """<p>This opens a dialog to uninstall a plugin.</p>""" )) - self.pluginDeinstallAct.triggered[()].connect(self.__deinstallPlugin) + self.pluginDeinstallAct.triggered.connect(self.__deinstallPlugin) self.actions.append(self.pluginDeinstallAct) self.pluginRepoAct = E5Action( - self.trUtf8('Plugin Repository'), + self.tr('Plugin Repository'), UI.PixmapCache.getIcon("pluginRepository.png"), - self.trUtf8('Plugin &Repository...'), + self.tr('Plugin &Repository...'), 0, 0, self, 'plugin_repository') - self.pluginRepoAct.setStatusTip(self.trUtf8( + self.pluginRepoAct.setStatusTip(self.tr( 'Show Plugins available for download')) - self.pluginRepoAct.setWhatsThis(self.trUtf8( + self.pluginRepoAct.setWhatsThis(self.tr( """<b>Plugin Repository...</b>""" """<p>This opens a dialog, that shows a list of plugins """ """available on the Internet.</p>""" )) - self.pluginRepoAct.triggered[()].connect(self.showPluginsAvailable) + self.pluginRepoAct.triggered.connect(self.showPluginsAvailable) self.actions.append(self.pluginRepoAct) # initialize viewmanager actions @@ -2210,63 +2212,63 @@ Private slot to initialize the action to show the Qt documentation. """ self.qt4DocAct = E5Action( - self.trUtf8('Qt4 Documentation'), - self.trUtf8('Qt&4 Documentation'), + self.tr('Qt4 Documentation'), + self.tr('Qt&4 Documentation'), 0, 0, self, 'qt4_documentation') - self.qt4DocAct.setStatusTip(self.trUtf8('Open Qt4 Documentation')) - self.qt4DocAct.setWhatsThis(self.trUtf8( + self.qt4DocAct.setStatusTip(self.tr('Open Qt4 Documentation')) + self.qt4DocAct.setWhatsThis(self.tr( """<b>Qt4 Documentation</b>""" """<p>Display the Qt4 Documentation. Dependent upon your""" """ settings, this will either show the help in Eric's internal""" """ help viewer, or execute a web browser or Qt Assistant. </p>""" )) - self.qt4DocAct.triggered[()].connect(self.__showQt4Doc) + self.qt4DocAct.triggered.connect(self.__showQt4Doc) self.actions.append(self.qt4DocAct) self.qt5DocAct = E5Action( - self.trUtf8('Qt5 Documentation'), - self.trUtf8('Qt&5 Documentation'), + self.tr('Qt5 Documentation'), + self.tr('Qt&5 Documentation'), 0, 0, self, 'qt5_documentation') - self.qt5DocAct.setStatusTip(self.trUtf8('Open Qt5 Documentation')) - self.qt5DocAct.setWhatsThis(self.trUtf8( + self.qt5DocAct.setStatusTip(self.tr('Open Qt5 Documentation')) + self.qt5DocAct.setWhatsThis(self.tr( """<b>Qt5 Documentation</b>""" """<p>Display the Qt5 Documentation. Dependent upon your""" """ settings, this will either show the help in Eric's internal""" """ help viewer, or execute a web browser or Qt Assistant. </p>""" )) - self.qt5DocAct.triggered[()].connect(self.__showQt5Doc) + self.qt5DocAct.triggered.connect(self.__showQt5Doc) self.actions.append(self.qt5DocAct) self.pyqt4DocAct = E5Action( - self.trUtf8('PyQt4 Documentation'), - self.trUtf8('PyQt&4 Documentation'), + self.tr('PyQt4 Documentation'), + self.tr('PyQt&4 Documentation'), 0, 0, self, 'pyqt4_documentation') - self.pyqt4DocAct.setStatusTip(self.trUtf8('Open PyQt4 Documentation')) - self.pyqt4DocAct.setWhatsThis(self.trUtf8( + self.pyqt4DocAct.setStatusTip(self.tr('Open PyQt4 Documentation')) + self.pyqt4DocAct.setWhatsThis(self.tr( """<b>PyQt4 Documentation</b>""" """<p>Display the PyQt4 Documentation. Dependent upon your""" """ settings, this will either show the help in Eric's internal""" """ help viewer, or execute a web browser or Qt Assistant. </p>""" )) - self.pyqt4DocAct.triggered[()].connect(self.__showPyQt4Doc) + self.pyqt4DocAct.triggered.connect(self.__showPyQt4Doc) self.actions.append(self.pyqt4DocAct) try: import PyQt5 # __IGNORE_WARNING__ self.pyqt5DocAct = E5Action( - self.trUtf8('PyQt5 Documentation'), - self.trUtf8('PyQt&5 Documentation'), + self.tr('PyQt5 Documentation'), + self.tr('PyQt&5 Documentation'), 0, 0, self, 'pyqt5_documentation') - self.pyqt5DocAct.setStatusTip(self.trUtf8( + self.pyqt5DocAct.setStatusTip(self.tr( 'Open PyQt5 Documentation')) - self.pyqt5DocAct.setWhatsThis(self.trUtf8( + self.pyqt5DocAct.setWhatsThis(self.tr( """<b>PyQt5 Documentation</b>""" """<p>Display the PyQt5 Documentation. Dependent upon your""" """ settings, this will either show the help in Eric's""" """ internal help viewer, or execute a web browser or""" """ Qt Assistant. </p>""" )) - self.pyqt5DocAct.triggered[()].connect(self.__showPyQt5Doc) + self.pyqt5DocAct.triggered.connect(self.__showPyQt5Doc) self.actions.append(self.pyqt5DocAct) except ImportError: self.pyqt5DocAct = None @@ -2277,12 +2279,12 @@ documentation. """ self.pythonDocAct = E5Action( - self.trUtf8('Python 3 Documentation'), - self.trUtf8('Python &3 Documentation'), + self.tr('Python 3 Documentation'), + self.tr('Python &3 Documentation'), 0, 0, self, 'python3_documentation') - self.pythonDocAct.setStatusTip(self.trUtf8( + self.pythonDocAct.setStatusTip(self.tr( 'Open Python 3 Documentation')) - self.pythonDocAct.setWhatsThis(self.trUtf8( + self.pythonDocAct.setWhatsThis(self.tr( """<b>Python 3 Documentation</b>""" """<p>Display the Python 3 documentation. If no documentation""" """ directory is configured, the location of the Python 3""" @@ -2291,16 +2293,16 @@ """ <i>/usr/share/doc/packages/python/html</i> on Unix. Set""" """ PYTHON3DOCDIR in your environment to override this.</p>""" )) - self.pythonDocAct.triggered[()].connect(self.__showPythonDoc) + self.pythonDocAct.triggered.connect(self.__showPythonDoc) self.actions.append(self.pythonDocAct) self.python2DocAct = E5Action( - self.trUtf8('Python 2 Documentation'), - self.trUtf8('Python &2 Documentation'), + self.tr('Python 2 Documentation'), + self.tr('Python &2 Documentation'), 0, 0, self, 'python2_documentation') - self.python2DocAct.setStatusTip(self.trUtf8( + self.python2DocAct.setStatusTip(self.tr( 'Open Python 2 Documentation')) - self.python2DocAct.setWhatsThis(self.trUtf8( + self.python2DocAct.setWhatsThis(self.tr( """<b>Python 2 Documentation</b>""" """<p>Display the Python 2 documentation. If no documentation""" """ directory is configured, the location of the Python 2""" @@ -2311,7 +2313,7 @@ """ on Unix. Set PYTHON2DOCDIR in your environment to override""" """ this. </p>""" )) - self.python2DocAct.triggered[()].connect(self.__showPython2Doc) + self.python2DocAct.triggered.connect(self.__showPython2Doc) self.actions.append(self.python2DocAct) def __initEricDocAction(self): @@ -2319,18 +2321,18 @@ Private slot to initialize the action to show the eric5 documentation. """ self.ericDocAct = E5Action( - self.trUtf8("Eric API Documentation"), - self.trUtf8('&Eric API Documentation'), + self.tr("Eric API Documentation"), + self.tr('&Eric API Documentation'), 0, 0, self, 'eric_documentation') - self.ericDocAct.setStatusTip(self.trUtf8( + self.ericDocAct.setStatusTip(self.tr( "Open Eric API Documentation")) - self.ericDocAct.setWhatsThis(self.trUtf8( + self.ericDocAct.setWhatsThis(self.tr( """<b>Eric API Documentation</b>""" """<p>Display the Eric API documentation. The location for the""" """ documentation is the Documentation/Source subdirectory of""" """ the eric5 installation directory.</p>""" )) - self.ericDocAct.triggered[()].connect(self.__showEricDoc) + self.ericDocAct.triggered.connect(self.__showEricDoc) self.actions.append(self.ericDocAct) def __initPySideDocAction(self): @@ -2340,19 +2342,19 @@ pyside2, pyside3 = Utilities.checkPyside() if pyside2 or pyside3: self.pysideDocAct = E5Action( - self.trUtf8('PySide Documentation'), - self.trUtf8('Py&Side Documentation'), + self.tr('PySide Documentation'), + self.tr('Py&Side Documentation'), 0, 0, self, 'pyside_documentation') - self.pysideDocAct.setStatusTip(self.trUtf8( + self.pysideDocAct.setStatusTip(self.tr( 'Open PySide Documentation')) - self.pysideDocAct.setWhatsThis(self.trUtf8( + self.pysideDocAct.setWhatsThis(self.tr( """<b>PySide Documentation</b>""" """<p>Display the PySide Documentation. Dependent upon your""" """ settings, this will either show the help in Eric's""" """ internal help viewer, or execute a web browser or""" """ Qt Assistant. </p>""" )) - self.pysideDocAct.triggered[()].connect(self.__showPySideDoc) + self.pysideDocAct.triggered.connect(self.__showPySideDoc) self.actions.append(self.pysideDocAct) else: self.pysideDocAct = None @@ -2384,7 +2386,7 @@ mb.addMenu(self.__menus["start"]) mb.addMenu(self.__menus["debug"]) - self.__menus["unittest"] = QMenu(self.trUtf8('&Unittest'), self) + self.__menus["unittest"] = QMenu(self.tr('&Unittest'), self) self.__menus["unittest"].setTearOffEnabled(True) mb.addMenu(self.__menus["unittest"]) self.__menus["unittest"].addAction(self.utDialogAct) @@ -2401,12 +2403,12 @@ self.__menus["project"] = self.project.initMenu() mb.addMenu(self.__menus["project"]) - self.__menus["extras"] = QMenu(self.trUtf8('E&xtras'), self) + self.__menus["extras"] = QMenu(self.tr('E&xtras'), self) self.__menus["extras"].setTearOffEnabled(True) self.__menus["extras"].aboutToShow.connect(self.__showExtrasMenu) mb.addMenu(self.__menus["extras"]) self.viewmanager.addToExtrasMenu(self.__menus["extras"]) - self.__menus["wizards"] = QMenu(self.trUtf8('Wi&zards'), self) + self.__menus["wizards"] = QMenu(self.tr('Wi&zards'), self) self.__menus["wizards"].setTearOffEnabled(True) self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu) self.wizardsMenuAct = self.__menus["extras"].addMenu( @@ -2414,16 +2416,16 @@ self.wizardsMenuAct.setEnabled(False) self.__menus["macros"] = self.viewmanager.initMacroMenu() self.__menus["extras"].addMenu(self.__menus["macros"]) - self.__menus["tools"] = QMenu(self.trUtf8('&Tools'), self) + self.__menus["tools"] = QMenu(self.tr('&Tools'), self) self.__menus["tools"].aboutToShow.connect(self.__showToolsMenu) self.__menus["tools"].triggered.connect(self.__toolExecute) - self.toolGroupsMenu = QMenu(self.trUtf8("Select Tool Group"), self) + self.toolGroupsMenu = QMenu(self.tr("Select Tool Group"), self) self.toolGroupsMenu.aboutToShow.connect(self.__showToolGroupsMenu) self.toolGroupsMenu.triggered.connect(self.__toolGroupSelected) self.toolGroupsMenuTriggered = False self.__menus["extras"].addMenu(self.__menus["tools"]) - self.__menus["settings"] = QMenu(self.trUtf8('Se&ttings'), self) + self.__menus["settings"] = QMenu(self.tr('Se&ttings'), self) mb.addMenu(self.__menus["settings"]) self.__menus["settings"].setTearOffEnabled(True) self.__menus["settings"].addAction(self.prefAct) @@ -2446,12 +2448,12 @@ self.__menus["settings"].addSeparator() self.__menus["settings"].addAction(self.editMessageFilterAct) - self.__menus["window"] = QMenu(self.trUtf8('&Window'), self) + self.__menus["window"] = QMenu(self.tr('&Window'), self) mb.addMenu(self.__menus["window"]) self.__menus["window"].setTearOffEnabled(True) self.__menus["window"].aboutToShow.connect(self.__showWindowMenu) - self.__menus["subwindow"] = QMenu(self.trUtf8("&Windows"), + self.__menus["subwindow"] = QMenu(self.tr("&Windows"), self.__menus["window"]) self.__menus["subwindow"].setTearOffEnabled(True) # left side @@ -2471,7 +2473,7 @@ self.__menus["subwindow"].addAction(self.ircActivateAct) self.__menus["toolbars"] = \ - QMenu(self.trUtf8("&Toolbars"), self.__menus["window"]) + QMenu(self.tr("&Toolbars"), self.__menus["window"]) self.__menus["toolbars"].setTearOffEnabled(True) self.__menus["toolbars"].aboutToShow.connect(self.__showToolbarsMenu) self.__menus["toolbars"].triggered.connect(self.__TBMenuTriggered) @@ -2482,7 +2484,7 @@ mb.addMenu(self.__menus["bookmarks"]) self.__menus["bookmarks"].setTearOffEnabled(True) - self.__menus["plugins"] = QMenu(self.trUtf8('P&lugins'), self) + self.__menus["plugins"] = QMenu(self.tr('P&lugins'), self) mb.addMenu(self.__menus["plugins"]) self.__menus["plugins"].setTearOffEnabled(True) self.__menus["plugins"].addAction(self.pluginInfoAct) @@ -2492,11 +2494,11 @@ self.__menus["plugins"].addAction(self.pluginRepoAct) self.__menus["plugins"].addSeparator() self.__menus["plugins"].addAction( - self.trUtf8("Configure..."), self.__pluginsConfigure) + self.tr("Configure..."), self.__pluginsConfigure) mb.addSeparator() - self.__menus["help"] = QMenu(self.trUtf8('&Help'), self) + self.__menus["help"] = QMenu(self.tr('&Help'), self) mb.addMenu(self.__menus["help"]) self.__menus["help"].setTearOffEnabled(True) self.__menus["help"].addAction(self.helpviewerAct) @@ -2544,14 +2546,14 @@ starttb, debugtb = self.debuggerUI.initToolbars(self.toolbarManager) multiprojecttb = self.multiProject.initToolbar(self.toolbarManager) projecttb = self.project.initToolbar(self.toolbarManager) - toolstb = QToolBar(self.trUtf8("Tools"), self) - unittesttb = QToolBar(self.trUtf8("Unittest"), self) + toolstb = QToolBar(self.tr("Tools"), self) + unittesttb = QToolBar(self.tr("Unittest"), self) bookmarktb = self.viewmanager.initBookmarkToolbar(self.toolbarManager) spellingtb = self.viewmanager.initSpellingToolbar(self.toolbarManager) - settingstb = QToolBar(self.trUtf8("Settings"), self) - helptb = QToolBar(self.trUtf8("Help"), self) - profilestb = QToolBar(self.trUtf8("Profiles"), self) - pluginstb = QToolBar(self.trUtf8("Plugins"), self) + settingstb = QToolBar(self.tr("Settings"), self) + helptb = QToolBar(self.tr("Help"), self) + profilestb = QToolBar(self.tr("Profiles"), self) + pluginstb = QToolBar(self.tr("Plugins"), self) toolstb.setIconSize(Config.ToolBarIconSize) unittesttb.setIconSize(Config.ToolBarIconSize) @@ -2567,12 +2569,12 @@ profilestb.setObjectName("ProfilesToolbar") pluginstb.setObjectName("PluginsToolbar") - toolstb.setToolTip(self.trUtf8("Tools")) - unittesttb.setToolTip(self.trUtf8("Unittest")) - settingstb.setToolTip(self.trUtf8("Settings")) - helptb.setToolTip(self.trUtf8("Help")) - profilestb.setToolTip(self.trUtf8("Profiles")) - pluginstb.setToolTip(self.trUtf8("Plugins")) + toolstb.setToolTip(self.tr("Tools")) + unittesttb.setToolTip(self.tr("Unittest")) + settingstb.setToolTip(self.tr("Settings")) + helptb.setToolTip(self.tr("Help")) + profilestb.setToolTip(self.tr("Profiles")) + pluginstb.setToolTip(self.tr("Plugins")) filetb.addSeparator() filetb.addAction(self.exitAct) @@ -2717,44 +2719,44 @@ self.__statusBar = self.statusBar() self.__statusBar.setSizeGripEnabled(True) - self.sbLanguage = QLabel(self.__statusBar) + self.sbLanguage = E5ClickableLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbLanguage) - self.sbLanguage.setWhatsThis(self.trUtf8( + self.sbLanguage.setWhatsThis(self.tr( """<p>This part of the status bar displays the""" """ current editors language.</p>""" )) - self.sbEncoding = QLabel(self.__statusBar) + self.sbEncoding = E5ClickableLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbEncoding) - self.sbEncoding.setWhatsThis(self.trUtf8( + self.sbEncoding.setWhatsThis(self.tr( """<p>This part of the status bar displays the""" """ current editors encoding.</p>""" )) - self.sbEol = QLabel(self.__statusBar) + self.sbEol = E5ClickableLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbEol) - self.sbEol.setWhatsThis(self.trUtf8( + self.sbEol.setWhatsThis(self.tr( """<p>This part of the status bar displays the""" """ current editors eol setting.</p>""" )) self.sbWritable = QLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbWritable) - self.sbWritable.setWhatsThis(self.trUtf8( + self.sbWritable.setWhatsThis(self.tr( """<p>This part of the status bar displays an indication of the""" """ current editors files writability.</p>""" )) self.sbLine = QLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbLine) - self.sbLine.setWhatsThis(self.trUtf8( + self.sbLine.setWhatsThis(self.tr( """<p>This part of the status bar displays the line number of""" """ the current editor.</p>""" )) self.sbPos = QLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbPos) - self.sbPos.setWhatsThis(self.trUtf8( + self.sbPos.setWhatsThis(self.tr( """<p>This part of the status bar displays the cursor position""" """ of the current editor.</p>""" )) @@ -2765,7 +2767,7 @@ UI.PixmapCache.getPixmap("zoomReset.png"), self.__statusBar) self.__statusBar.addPermanentWidget(self.sbZoom) - self.sbZoom.setWhatsThis(self.trUtf8( + self.sbZoom.setWhatsThis(self.tr( """<p>This part of the status bar allows zooming the current""" """ editor, shell or terminal.</p>""" )) @@ -2784,14 +2786,14 @@ """ self.toolGroupActions = {} for toolGroup in self.toolGroups: - category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) + category = self.tr("External Tools/{0}").format(toolGroup[0]) for tool in toolGroup[1]: if tool['menutext'] != '--': act = QAction(UI.PixmapCache.getIcon(tool['icon']), tool['menutext'], self) act.setObjectName("{0}@@{1}".format(toolGroup[0], tool['menutext'])) - act.triggered[()].connect(self.__toolActionTriggered) + act.triggered.connect(self.__toolActionTriggered) self.toolGroupActions[act.objectName()] = act self.toolbarManager.addAction(act, category) @@ -2819,12 +2821,12 @@ for key in groupActionKeys: if key not in ckeys: self.toolbarManager.removeAction(self.toolGroupActions[key]) - self.toolGroupActions[key].triggered[()].disconnect( + self.toolGroupActions[key].triggered.disconnect( self.__toolActionTriggered) del self.toolGroupActions[key] # step 4: add all newly configured tools - category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) + category = self.tr("External Tools/{0}").format(toolGroup[0]) for tool in toolGroup[1]: if tool['menutext'] != '--': key = "{0}@@{1}".format(toolGroup[0], tool['menutext']) @@ -2832,7 +2834,7 @@ act = QAction(UI.PixmapCache.getIcon(tool['icon']), tool['menutext'], self) act.setObjectName(key) - act.triggered[()].connect(self.__toolActionTriggered) + act.triggered.connect(self.__toolActionTriggered) self.toolGroupActions[key] = act self.toolbarManager.addAction(act, category) @@ -2921,7 +2923,7 @@ except ImportError: sip_version_str = "sip version not available" - versionText = self.trUtf8( + versionText = self.tr( """<h3>Version Numbers</h3>""" """<table>""") versionText += """<tr><td><b>Python</b></td><td>{0}</td></tr>"""\ @@ -2942,7 +2944,7 @@ pass versionText += """<tr><td><b>{0}</b></td><td>{1}</td></tr>"""\ .format(Program, Version) - versionText += self.trUtf8("""</table>""") + versionText += self.tr("""</table>""") E5MessageBox.about(self, Program, versionText) @@ -2974,8 +2976,8 @@ Preferences.getUser("MailServer") == "": E5MessageBox.critical( self, - self.trUtf8("Report Bug"), - self.trUtf8( + self.tr("Report Bug"), + self.tr( """Email address or mail server address is empty.""" """ Please configure your Email settings in the""" """ Preferences Dialog.""")) @@ -3247,8 +3249,8 @@ """ res = E5MessageBox.yesNo( self, - self.trUtf8("Restart application"), - self.trUtf8( + self.tr("Restart application"), + self.tr( """The application needs to be restarted. Do it now?"""), yesDefault=True) @@ -3280,11 +3282,11 @@ self.__menus["tools"].addMenu(self.toolGroupsMenu) act = self.__menus["tools"].addAction( - self.trUtf8("Configure Tool Groups ..."), + self.tr("Configure Tool Groups ..."), self.__toolGroupsConfiguration) act.setData(-1) act = self.__menus["tools"].addAction( - self.trUtf8("Configure current Tool Group ..."), + self.tr("Configure current Tool Group ..."), self.__toolsConfiguration) act.setData(-2) self.__menus["tools"].addSeparator() @@ -3333,7 +3335,7 @@ self.toolGroupsMenu.clear() # add the default entry - act = self.toolGroupsMenu.addAction(self.trUtf8("&Builtin Tools")) + act = self.toolGroupsMenu.addAction(self.tr("&Builtin Tools")) act.setData(-1) if self.currentToolGroup == -1: font = act.font() @@ -3341,7 +3343,7 @@ act.setFont(font) # add the plugins entry - act = self.toolGroupsMenu.addAction(self.trUtf8("&Plugin Tools")) + act = self.toolGroupsMenu.addAction(self.tr("&Plugin Tools")) act.setData(-2) if self.currentToolGroup == -2: font = act.font() @@ -3431,9 +3433,9 @@ act.setChecked(not tb.isHidden()) self.__menus["toolbars"].addSeparator() self.__toolbarsShowAllAct = \ - self.__menus["toolbars"].addAction(self.trUtf8("&Show all")) + self.__menus["toolbars"].addAction(self.tr("&Show all")) self.__toolbarsHideAllAct = \ - self.__menus["toolbars"].addAction(self.trUtf8("&Hide all")) + self.__menus["toolbars"].addAction(self.tr("&Hide all")) def __TBMenuTriggered(self, act): """ @@ -3600,6 +3602,7 @@ self.__currentBottomWidget = None self.__activateViewmanager() + @pyqtSlot() def __setEditProfile(self, save=True): """ Private slot to activate the edit view profile. @@ -3610,6 +3613,7 @@ self.__activateViewProfile("edit", save) self.setEditProfileAct.setChecked(True) + @pyqtSlot() def setDebugProfile(self, save=True): """ Public slot to activate the debug view profile. @@ -3976,7 +3980,9 @@ self.__createUnitTestDialog() self.unittestDialog.show() self.unittestDialog.raise_() - + + @pyqtSlot() + @pyqtSlot(str) def __unittestScript(self, prog=None): """ Private slot for displaying the unittest dialog and run the current @@ -4015,8 +4021,8 @@ else: E5MessageBox.critical( self, - self.trUtf8("Unittest Project"), - self.trUtf8( + self.tr("Unittest Project"), + self.tr( "There is no main script defined for the" " current project. Aborting")) return @@ -4078,8 +4084,8 @@ if version == 3: E5MessageBox.information( self, - self.trUtf8("Qt 3 support"), - self.trUtf8("""Qt v.3 is not supported by eric5.""")) + self.tr("Qt 3 support"), + self.tr("""Qt v.3 is not supported by eric5.""")) return args = [] @@ -4090,8 +4096,8 @@ else: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4099,8 +4105,8 @@ except EnvironmentError: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4121,8 +4127,8 @@ if not proc.startDetached(designer, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start Qt-Designer.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(designer)) @@ -4143,8 +4149,8 @@ if version < 4: E5MessageBox.information( self, - self.trUtf8("Qt 3 support"), - self.trUtf8("""Qt v.3 is not supported by eric5.""")) + self.tr("Qt 3 support"), + self.tr("""Qt v.3 is not supported by eric5.""")) return args = [] @@ -4157,8 +4163,8 @@ else: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4166,8 +4172,8 @@ except EnvironmentError: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4188,12 +4194,14 @@ if not proc.startDetached(linguist, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start Qt-Linguist.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(linguist)) - + + @pyqtSlot() + @pyqtSlot(str) def __linguist4(self, fn=None): """ Private slot to start the Qt-Linguist 4 executable. @@ -4212,8 +4220,8 @@ if version < 4: E5MessageBox.information( self, - self.trUtf8("Qt 3 support"), - self.trUtf8("""Qt v.3 is not supported by eric5.""")) + self.tr("Qt 3 support"), + self.tr("""Qt v.3 is not supported by eric5.""")) return args = [] @@ -4237,8 +4245,8 @@ if not proc.startDetached(assistant, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start Qt-Assistant.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(assistant)) @@ -4265,8 +4273,8 @@ if not customViewer: E5MessageBox.information( self, - self.trUtf8("Help"), - self.trUtf8( + self.tr("Help"), + self.tr( """Currently no custom viewer is selected.""" """ Please use the preferences dialog to specify one.""")) return @@ -4279,8 +4287,8 @@ if not proc.startDetached(customViewer, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start custom viewer.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(customViewer)) @@ -4299,12 +4307,14 @@ if not proc.startDetached("hh", args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start the help viewer.<br>' 'Ensure that it is available as <b>hh</b>.</p>' )) + @pyqtSlot() + @pyqtSlot(str) def __UIPreviewer(self, fn=None): """ Private slot to start the UI Previewer executable. @@ -4325,8 +4335,8 @@ else: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4334,8 +4344,8 @@ except EnvironmentError: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4345,12 +4355,15 @@ not proc.startDetached(sys.executable, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start UI Previewer.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(viewer)) + @pyqtSlot() + @pyqtSlot(str) + @pyqtSlot(str, bool) def __TRPreviewer(self, fileNames=None, ignore=False): """ Private slot to start the Translation Previewer executable. @@ -4376,8 +4389,8 @@ if not ignore: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4386,8 +4399,8 @@ if not ignore: E5MessageBox.critical( self, - self.trUtf8('Problem'), - self.trUtf8( + self.tr('Problem'), + self.tr( '<p>The file <b>{0}</b> does not exist or' ' is zero length.</p>') .format(fn)) @@ -4397,8 +4410,8 @@ not proc.startDetached(sys.executable, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start Translation Previewer.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(viewer)) @@ -4418,12 +4431,14 @@ not proc.startDetached(sys.executable, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start SQL Browser.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(browser)) + @pyqtSlot() + @pyqtSlot(str) def __editPixmap(self, fn=""): """ Private slot to show a pixmap in a dialog. @@ -4434,6 +4449,8 @@ dlg = IconEditorWindow(fn, self, fromEric=True, project=self.project) dlg.show() + @pyqtSlot() + @pyqtSlot(str) def __showPixmap(self, fn): """ Private slot to show a pixmap in a dialog. @@ -4445,6 +4462,8 @@ if dlg.getStatus(): dlg.show() + @pyqtSlot() + @pyqtSlot(str) def __showSvg(self, fn): """ Private slot to show a SVG file in a dialog. @@ -4470,8 +4489,8 @@ not proc.startDetached(sys.executable, args): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start Snapshot tool.<br>' 'Ensure that it is available as <b>{0}</b>.</p>' ).format(snap)) @@ -4491,8 +4510,8 @@ E5MessageBox.information( self, - self.trUtf8("External Tools"), - self.trUtf8( + self.tr("External Tools"), + self.tr( """No tool entry found for external tool '{0}' """ """in tool group '{1}'.""") .format(toolMenuText, toolGroupName)) @@ -4500,8 +4519,8 @@ E5MessageBox.information( self, - self.trUtf8("External Tools"), - self.trUtf8("""No toolgroup entry '{0}' found.""") + self.tr("External Tools"), + self.tr("""No toolgroup entry '{0}' found.""") .format(toolGroupName) ) @@ -4537,7 +4556,7 @@ args = [] argv = Utilities.parseOptionString(tool['arguments']) args.extend(argv) - t = self.trUtf8("Starting process '{0} {1}'.\n")\ + t = self.tr("Starting process '{0} {1}'.\n")\ .format(program, tool['arguments']) self.appendToStdout(t) @@ -4555,8 +4574,8 @@ if not proc.waitForStarted(): E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( '<p>Could not start the tool entry <b>{0}</b>.<br>' 'Ensure that it is available as <b>{1}</b>.</p>') .format(tool['menutext'], tool['executable'])) @@ -4629,7 +4648,7 @@ # now delete the exited procs from the list of running processes for proc in exitedProcs: self.toolProcs.remove(proc) - t = self.trUtf8("Process '{0}' has exited.\n").format(proc[0]) + t = self.tr("Process '{0}' has exited.\n").format(proc[0]) self.appendToStdout(t) def __showPythonDoc(self): @@ -4665,9 +4684,9 @@ if not os.path.exists(home): E5MessageBox.warning( self, - self.trUtf8("Documentation Missing"), - self.trUtf8("""<p>The documentation starting point""" - """ "<b>{0}</b>" could not be found.</p>""") + self.tr("Documentation Missing"), + self.tr("""<p>The documentation starting point""" + """ "<b>{0}</b>" could not be found.</p>""") .format(home)) return @@ -4722,9 +4741,9 @@ if not os.path.exists(home): E5MessageBox.warning( self, - self.trUtf8("Documentation Missing"), - self.trUtf8("""<p>The documentation starting point""" - """ "<b>{0}</b>" could not be found.</p>""") + self.tr("Documentation Missing"), + self.tr("""<p>The documentation starting point""" + """ "<b>{0}</b>" could not be found.</p>""") .format(home)) return @@ -4791,9 +4810,9 @@ if not os.path.exists(home): E5MessageBox.warning( self, - self.trUtf8("Documentation Missing"), - self.trUtf8("""<p>The documentation starting point""" - """ "<b>{0}</b>" could not be found.</p>""") + self.tr("Documentation Missing"), + self.tr("""<p>The documentation starting point""" + """ "<b>{0}</b>" could not be found.</p>""") .format(home)) return @@ -4823,9 +4842,9 @@ if not pyqt4DocDir: E5MessageBox.warning( self, - self.trUtf8("Documentation"), - self.trUtf8("""<p>The PyQt4 documentation starting point""" - """ has not been configured.</p>""")) + self.tr("Documentation"), + self.tr("""<p>The PyQt4 documentation starting point""" + """ has not been configured.</p>""")) return if not pyqt4DocDir.startswith("http://") and \ @@ -4849,9 +4868,9 @@ if not home or not os.path.exists(home): E5MessageBox.warning( self, - self.trUtf8("Documentation Missing"), - self.trUtf8("""<p>The documentation starting point""" - """ "<b>{0}</b>" could not be found.</p>""") + self.tr("Documentation Missing"), + self.tr("""<p>The documentation starting point""" + """ "<b>{0}</b>" could not be found.</p>""") .format(home)) return @@ -4883,9 +4902,9 @@ if not pyqt5DocDir: E5MessageBox.warning( self, - self.trUtf8("Documentation"), - self.trUtf8("""<p>The PyQt5 documentation starting point""" - """ has not been configured.</p>""")) + self.tr("Documentation"), + self.tr("""<p>The PyQt5 documentation starting point""" + """ has not been configured.</p>""")) return if not pyqt5DocDir.startswith("http://") and \ @@ -4911,9 +4930,9 @@ if not home or not os.path.exists(home): E5MessageBox.warning( self, - self.trUtf8("Documentation Missing"), - self.trUtf8("""<p>The documentation starting point""" - """ "<b>{0}</b>" could not be found.</p>""") + self.tr("Documentation Missing"), + self.tr("""<p>The documentation starting point""" + """ "<b>{0}</b>" could not be found.</p>""") .format(home)) return @@ -4947,9 +4966,9 @@ if not os.path.exists(home): E5MessageBox.warning( self, - self.trUtf8("Documentation Missing"), - self.trUtf8("""<p>The documentation starting point""" - """ "<b>{0}</b>" could not be found.</p>""") + self.tr("Documentation Missing"), + self.tr("""<p>The documentation starting point""" + """ "<b>{0}</b>" could not be found.</p>""") .format(home)) return @@ -4979,9 +4998,9 @@ if not pysideDocDir: E5MessageBox.warning( self, - self.trUtf8("Documentation"), - self.trUtf8("""<p>The PySide documentation starting point""" - """ has not been configured.</p>""")) + self.tr("Documentation"), + self.tr("""<p>The PySide documentation starting point""" + """ has not been configured.</p>""")) return if not pysideDocDir.startswith("http://") and \ @@ -4995,9 +5014,9 @@ if not os.path.exists(home): E5MessageBox.warning( self, - self.trUtf8("Documentation Missing"), - self.trUtf8("""<p>The documentation starting point""" - """ "<b>{0}</b>" could not be found.</p>""") + self.tr("Documentation Missing"), + self.tr("""<p>The documentation starting point""" + """ "<b>{0}</b>" could not be found.</p>""") .format(home)) return @@ -5088,8 +5107,8 @@ if not started: E5MessageBox.critical( self, - self.trUtf8('Open Browser'), - self.trUtf8('Could not start a web browser')) + self.tr('Open Browser'), + self.tr('Could not start a web browser')) def getHelpViewer(self, preview=False): """ @@ -5104,6 +5123,8 @@ self.helpWindow.raise_() return self.helpWindow + @pyqtSlot() + @pyqtSlot(str) def showPreferences(self, pageName=None): """ Public slot to set the preferences. @@ -5262,9 +5283,9 @@ """ fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( None, - self.trUtf8("Export Keyboard Shortcuts"), + self.tr("Export Keyboard Shortcuts"), "", - self.trUtf8("Keyboard shortcut file (*.e4k)"), + self.tr("Keyboard shortcut file (*.e4k)"), "", E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) @@ -5286,9 +5307,9 @@ """ fn = E5FileDialog.getOpenFileName( None, - self.trUtf8("Import Keyboard Shortcuts"), + self.tr("Import Keyboard Shortcuts"), "", - self.trUtf8("Keyboard shortcut file (*.e4k)")) + self.tr("Keyboard shortcut file (*.e4k)")) if fn: from Preferences import Shortcuts @@ -5377,7 +5398,7 @@ self.utEditorOpen = cap & HasUnittest return - if self.viewmanager.getOpenEditor(fn).getPyVersion(): + if self.viewmanager.getOpenEditor(fn).isPyFile(): self.utScriptAct.setEnabled(True) self.utEditorOpen = True @@ -5403,7 +5424,7 @@ self.utEditorOpen = cap & HasUnittest return - if editor.getPyVersion(): + if editor.isPyFile(): self.utScriptAct.setEnabled(True) self.utEditorOpen = True return @@ -5420,8 +5441,8 @@ if not ok: E5MessageBox.critical( self, - self.trUtf8("Save tasks"), - self.trUtf8( + self.tr("Save tasks"), + self.tr( "<p>The tasks file <b>{0}</b> could not be written.</p>") .format(fn)) return @@ -5446,8 +5467,8 @@ else: E5MessageBox.critical( self, - self.trUtf8("Read tasks"), - self.trUtf8( + self.tr("Read tasks"), + self.tr( "<p>The tasks file <b>{0}</b> could not be read.</p>") .format(fn)) @@ -5464,8 +5485,8 @@ else: E5MessageBox.critical( self, - self.trUtf8("Save session"), - self.trUtf8( + self.tr("Save session"), + self.tr( "<p>The session file <b>{0}</b> could not be written.</p>") .format(fn)) @@ -5477,8 +5498,8 @@ if not os.path.exists(fn): E5MessageBox.critical( self, - self.trUtf8("Read session"), - self.trUtf8( + self.tr("Read session"), + self.tr( "<p>The session file <b>{0}</b> could not be read.</p>") .format(fn)) return @@ -5492,8 +5513,8 @@ else: E5MessageBox.critical( self, - self.trUtf8("Read session"), - self.trUtf8( + self.tr("Read session"), + self.tr( "<p>The session file <b>{0}</b> could not be read.</p>") .format(fn)) @@ -5590,6 +5611,7 @@ self.__pluginInfoDialog = PluginInfoDialog(self.pluginManager, self) self.__pluginInfoDialog.show() + @pyqtSlot() def __installPlugins(self, pluginFileNames=[]): """ Private slot to show a dialog to install a new plugin. @@ -5681,8 +5703,8 @@ else: E5MessageBox.information( self, - self.trUtf8("Drop Error"), - self.trUtf8("""<p><b>{0}</b> is not a file.</p>""") + self.tr("Drop Error"), + self.tr("""<p><b>{0}</b> is not a file.</p>""") .format(fname)) self.inDragDrop = False @@ -5783,6 +5805,7 @@ """ self.performVersionCheck(manual=True, showVersions=True) + @pyqtSlot() def performVersionCheck(self, manual=True, alternative=0, showVersions=False): """ @@ -5807,11 +5830,11 @@ if period == 2 and lastCheck.day() == now.day(): # daily return - elif (period == 3 and - lastCheck.weekNumber() == now.weekNumber()): + elif period == 3 and lastCheck.daysTo(now) < 7: # weekly return - elif period == 4 and lastCheck.month() == now.month(): + elif period == 4 and (lastCheck.daysTo(now) < + lastCheck.daysInMonth()): # monthly return @@ -5824,20 +5847,20 @@ if manual: if self.__versionCheckProgress is None: self.__versionCheckProgress = E5ProgressDialog( - "", self.trUtf8("&Cancel"), + "", self.tr("&Cancel"), 0, len(self.__httpAlternatives), - self.trUtf8("%v/%m"), self) + self.tr("%v/%m"), self) self.__versionCheckProgress.setMinimumDuration(0) self.__versionCheckProgress.canceled.connect( self.__versionsDownloadCanceled) self.__versionCheckProgress.setLabelText( - self.trUtf8("Trying host {0}").format(url.host())) + self.tr("Trying host {0}").format(url.host())) self.__versionCheckProgress.setValue(alternative) request = QNetworkRequest(url) request.setAttribute(QNetworkRequest.CacheLoadControlAttribute, QNetworkRequest.AlwaysNetwork) reply = self.__networkManager.get(request) - reply.finished[()].connect(self.__versionsDownloadDone) + reply.finished.connect(self.__versionsDownloadDone) self.__replies.append(reply) def __versionsDownloadDone(self): @@ -5876,17 +5899,17 @@ if self.manualUpdatesCheck: E5MessageBox.warning( self, - self.trUtf8("Error getting versions information"), - self.trUtf8("""The versions information could not be""" - """ downloaded.""" - """ Please go online and try again.""")) + self.tr("Error getting versions information"), + self.tr("""The versions information could not be""" + """ downloaded.""" + """ Please go online and try again.""")) elif failedDuration > 7: E5MessageBox.warning( self, - self.trUtf8("Error getting versions information"), - self.trUtf8("""The versions information could not be""" - """ downloaded for the last 7 days.""" - """ Please go online and try again.""")) + self.tr("Error getting versions information"), + self.tr("""The versions information could not be""" + """ downloaded for the last 7 days.""" + """ Please go online and try again.""")) return else: self.performVersionCheck(self.manualUpdatesCheck, @@ -5938,8 +5961,8 @@ if versions[2][0] == "5" and versions[2] > Version: res = E5MessageBox.yesNo( self, - self.trUtf8("Update available"), - self.trUtf8( + self.tr("Update available"), + self.tr( """The update to <b>{0}</b> of eric5 is""" """ available at <b>{1}</b>. Would you like to""" """ get it?""") @@ -5949,8 +5972,8 @@ elif versions[0] > Version: res = E5MessageBox.yesNo( self, - self.trUtf8("Update available"), - self.trUtf8( + self.tr("Update available"), + self.tr( """The update to <b>{0}</b> of eric5 is""" """ available at <b>{1}</b>. Would you like to""" """ get it?""") @@ -5961,8 +5984,8 @@ if self.manualUpdatesCheck: E5MessageBox.information( self, - self.trUtf8("Eric5 is up to date"), - self.trUtf8( + self.tr("Eric5 is up to date"), + self.tr( """You are using the latest version of""" """ eric5""")) else: @@ -5970,8 +5993,8 @@ if versions[0] > Version: res = E5MessageBox.yesNo( self, - self.trUtf8("Update available"), - self.trUtf8( + self.tr("Update available"), + self.tr( """The update to <b>{0}</b> of eric5 is""" """ available at <b>{1}</b>. Would you like""" """ to get it?""") @@ -5982,15 +6005,15 @@ if self.manualUpdatesCheck: E5MessageBox.information( self, - self.trUtf8("Eric5 is up to date"), - self.trUtf8( + self.tr("Eric5 is up to date"), + self.tr( """You are using the latest version of""" """ eric5""")) except IndexError: E5MessageBox.warning( self, - self.trUtf8("Error during updates check"), - self.trUtf8("""Could not perform updates check.""")) + self.tr("Error during updates check"), + self.tr("""Could not perform updates check.""")) if url: QDesktopServices.openUrl(QUrl(url)) @@ -6010,7 +6033,7 @@ @param versions contents of the downloaded versions file (list of strings) """ - versionText = self.trUtf8( + versionText = self.tr( """<h3>Available versions</h3>""" """<table>""") line = 0 @@ -6024,7 +6047,7 @@ 'sourceforge' in versions[line + 1] and "SourceForge" or versions[line + 1]) line += 2 - versionText += self.trUtf8("""</table>""") + versionText += self.tr("""</table>""") E5MessageBox.about(self, Program, versionText) @@ -6053,9 +6076,9 @@ E5MessageBox.information( self, - self.trUtf8("First time usage"), - self.trUtf8("""eric5 has not been configured yet. """ - """The configuration dialog will be started.""")) + self.tr("First time usage"), + self.tr("""eric5 has not been configured yet. """ + """The configuration dialog will be started.""")) self.showPreferences() def checkProjectsWorkspace(self): @@ -6072,7 +6095,7 @@ default = Utilities.getHomeDir() workspace = E5FileDialog.getExistingDirectory( None, - self.trUtf8("Select Workspace Directory"), + self.tr("Select Workspace Directory"), default, E5FileDialog.Options(E5FileDialog.Option(0))) Preferences.setMultiProject("Workspace", workspace)