UI/UserInterface.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3456
96232974dcdb
parent 3446
5a670e55adbb
child 3515
1b8381afe38f
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
7 Module implementing the main user interface. 7 Module implementing the main user interface.
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 try: 11 try:
12 str = unicode # __IGNORE_WARNING__ 12 str = unicode
13 except (NameError): 13 except NameError:
14 pass 14 pass
15 15
16 import os 16 import os
17 import sys 17 import sys
18 import logging 18 import logging
19 19
20 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, \ 20 from PyQt4.QtCore import pyqtSlot, QTimer, QFile, QFileInfo, pyqtSignal, \
21 PYQT_VERSION_STR, QDate, QIODevice, qVersion, QProcess, QSize, QUrl, \ 21 PYQT_VERSION_STR, QDate, QIODevice, qVersion, QProcess, QSize, QUrl, \
22 QObject, Qt 22 QObject, Qt
23 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \ 23 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \
24 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, \ 24 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, \
25 QVBoxLayout, QDockWidget, QAction, QLabel 25 QVBoxLayout, QDockWidget, QAction, QLabel
36 from E5Gui import E5MessageBox, E5FileDialog, E5ErrorMessage 36 from E5Gui import E5MessageBox, E5FileDialog, E5ErrorMessage
37 from E5Gui.E5Application import e5App 37 from E5Gui.E5Application import e5App
38 from E5Gui.E5MainWindow import E5MainWindow 38 from E5Gui.E5MainWindow import E5MainWindow
39 from E5Gui.E5ZoomWidget import E5ZoomWidget 39 from E5Gui.E5ZoomWidget import E5ZoomWidget
40 from E5Gui.E5ProgressDialog import E5ProgressDialog 40 from E5Gui.E5ProgressDialog import E5ProgressDialog
41 from E5Gui.E5ClickableLabel import E5ClickableLabel
41 42
42 import Preferences 43 import Preferences
43 import Utilities 44 import Utilities
44 45
45 import UI.PixmapCache 46 import UI.PixmapCache
158 should not be executed (boolean) 159 should not be executed (boolean)
159 @param restartArguments list of command line parameters to be used for 160 @param restartArguments list of command line parameters to be used for
160 a restart (list of strings) 161 a restart (list of strings)
161 """ 162 """
162 super(UserInterface, self).__init__() 163 super(UserInterface, self).__init__()
163 self.setAttribute(Qt.WA_DeleteOnClose)
164 164
165 self.__restartArgs = restartArguments[:] 165 self.__restartArgs = restartArguments[:]
166 166
167 self.setStyle(Preferences.getUI("Style"), 167 self.setStyle(Preferences.getUI("Style"),
168 Preferences.getUI("StyleSheet")) 168 Preferences.getUI("StyleSheet"))
211 self.project = Project(self) 211 self.project = Project(self)
212 212
213 from MultiProject.MultiProject import MultiProject 213 from MultiProject.MultiProject import MultiProject
214 self.multiProject = MultiProject(self.project, self) 214 self.multiProject = MultiProject(self.project, self)
215 215
216 splash.showMessage(self.trUtf8("Initializing Plugin Manager...")) 216 splash.showMessage(self.tr("Initializing Plugin Manager..."))
217 217
218 # Initialize the Plugin Manager (Plugins are initialized later 218 # Initialize the Plugin Manager (Plugins are initialized later
219 from PluginManager.PluginManager import PluginManager 219 from PluginManager.PluginManager import PluginManager
220 self.pluginManager = PluginManager(self, develPlugin=plugin) 220 self.pluginManager = PluginManager(self, develPlugin=plugin)
221 221
222 splash.showMessage(self.trUtf8("Generating Main User Interface...")) 222 splash.showMessage(self.tr("Generating Main User Interface..."))
223 223
224 # Create the main window now so that we can connect QActions to it. 224 # Create the main window now so that we can connect QActions to it.
225 logging.debug("Creating Layout...") 225 logging.debug("Creating Layout...")
226 self.__createLayout(debugServer) 226 self.__createLayout(debugServer)
227 self.__currentRightWidget = None 227 self.__currentRightWidget = None
249 self.findFilesDialog = None 249 self.findFilesDialog = None
250 self.replaceFilesDialog = None 250 self.replaceFilesDialog = None
251 self.__notification = None 251 self.__notification = None
252 252
253 # now setup the connections 253 # now setup the connections
254 splash.showMessage(self.trUtf8("Setting up connections...")) 254 splash.showMessage(self.tr("Setting up connections..."))
255 self.browser.sourceFile[str].connect( 255 self.browser.sourceFile[str].connect(
256 self.viewmanager.openSourceFile) 256 self.viewmanager.openSourceFile)
257 self.browser.sourceFile[str, int].connect( 257 self.browser.sourceFile[str, int].connect(
258 self.viewmanager.openSourceFile) 258 self.viewmanager.openSourceFile)
259 self.browser.sourceFile[str, int, str].connect( 259 self.browser.sourceFile[str, int, str].connect(
371 self.debugViewer.exceptionLogger.addException) 371 self.debugViewer.exceptionLogger.addException)
372 debugServer.clientLine.connect( 372 debugServer.clientLine.connect(
373 self.debugViewer.breakpointViewer.highlightBreakpoint) 373 self.debugViewer.breakpointViewer.highlightBreakpoint)
374 debugServer.clientProcessStdout.connect(self.appendToStdout) 374 debugServer.clientProcessStdout.connect(self.appendToStdout)
375 debugServer.clientProcessStderr.connect(self.appendToStderr) 375 debugServer.clientProcessStderr.connect(self.appendToStderr)
376 debugServer.clientInterpreterChanged.connect(
377 self.browser.handleInterpreterChanged)
376 378
377 self.stdout.appendStdout.connect(self.appendToStdout) 379 self.stdout.appendStdout.connect(self.appendToStdout)
378 self.stderr.appendStderr.connect(self.appendToStderr) 380 self.stderr.appendStderr.connect(self.appendToStderr)
379 381
380 self.preferencesChanged.connect(self.viewmanager.preferencesChanged) 382 self.preferencesChanged.connect(self.viewmanager.preferencesChanged)
437 # create the toolbar manager object 439 # create the toolbar manager object
438 self.toolbarManager = E5ToolBarManager(self, self) 440 self.toolbarManager = E5ToolBarManager(self, self)
439 self.toolbarManager.setMainWindow(self) 441 self.toolbarManager.setMainWindow(self)
440 442
441 # Initialize the tool groups and list of started tools 443 # Initialize the tool groups and list of started tools
442 splash.showMessage(self.trUtf8("Initializing Tools...")) 444 splash.showMessage(self.tr("Initializing Tools..."))
443 self.toolGroups, self.currentToolGroup = Preferences.readToolGroups() 445 self.toolGroups, self.currentToolGroup = Preferences.readToolGroups()
444 self.toolProcs = [] 446 self.toolProcs = []
445 self.__initExternalToolsActions() 447 self.__initExternalToolsActions()
446 448
447 # create a dummy help window for shortcuts handling 449 # create a dummy help window for shortcuts handling
448 from Helpviewer.HelpWindow import HelpWindow 450 from Helpviewer.HelpWindow import HelpWindow
449 self.dummyHelpViewer = \ 451 self.dummyHelpViewer = \
450 HelpWindow(None, '.', None, 'help viewer', True, True) 452 HelpWindow(None, '.', None, 'help viewer', True, True)
451 453
452 # register all relevant objects 454 # register all relevant objects
453 splash.showMessage(self.trUtf8("Registering Objects...")) 455 splash.showMessage(self.tr("Registering Objects..."))
454 e5App().registerObject("UserInterface", self) 456 e5App().registerObject("UserInterface", self)
455 e5App().registerObject("DebugUI", self.debuggerUI) 457 e5App().registerObject("DebugUI", self.debuggerUI)
456 e5App().registerObject("DebugServer", debugServer) 458 e5App().registerObject("DebugServer", debugServer)
457 e5App().registerObject("BackgroundService", self.backgroundService) 459 e5App().registerObject("BackgroundService", self.backgroundService)
458 e5App().registerObject("ViewManager", self.viewmanager) 460 e5App().registerObject("ViewManager", self.viewmanager)
469 e5App().registerObject("IRC", self.irc) 471 e5App().registerObject("IRC", self.irc)
470 e5App().registerObject("Symbols", self.symbolsViewer) 472 e5App().registerObject("Symbols", self.symbolsViewer)
471 e5App().registerObject("Numbers", self.numbersViewer) 473 e5App().registerObject("Numbers", self.numbersViewer)
472 474
473 # Initialize the actions, menus, toolbars and statusbar 475 # Initialize the actions, menus, toolbars and statusbar
474 splash.showMessage(self.trUtf8("Initializing Actions...")) 476 splash.showMessage(self.tr("Initializing Actions..."))
475 self.__initActions() 477 self.__initActions()
476 splash.showMessage(self.trUtf8("Initializing Menus...")) 478 splash.showMessage(self.tr("Initializing Menus..."))
477 self.__initMenus() 479 self.__initMenus()
478 splash.showMessage(self.trUtf8("Initializing Toolbars...")) 480 splash.showMessage(self.tr("Initializing Toolbars..."))
479 self.__initToolbars() 481 self.__initToolbars()
480 splash.showMessage(self.trUtf8("Initializing Statusbar...")) 482 splash.showMessage(self.tr("Initializing Statusbar..."))
481 self.__initStatusbar() 483 self.__initStatusbar()
482 484
483 # connect the appFocusChanged signal after all actions are ready 485 # connect the appFocusChanged signal after all actions are ready
484 app.focusChanged.connect(self.viewmanager.appFocusChanged) 486 app.focusChanged.connect(self.viewmanager.appFocusChanged)
485 487
503 ## sys.stderr = self.stderr 505 ## sys.stderr = self.stderr
504 506
505 # now fire up the single application server 507 # now fire up the single application server
506 if Preferences.getUI("SingleApplicationMode"): 508 if Preferences.getUI("SingleApplicationMode"):
507 splash.showMessage( 509 splash.showMessage(
508 self.trUtf8("Initializing Single Application Server...")) 510 self.tr("Initializing Single Application Server..."))
509 self.SAServer = E5SingleApplicationServer() 511 self.SAServer = E5SingleApplicationServer()
510 else: 512 else:
511 self.SAServer = None 513 self.SAServer = None
512 514
513 # now finalize the plugin manager setup 515 # now finalize the plugin manager setup
514 self.pluginManager.finalizeSetup() 516 self.pluginManager.finalizeSetup()
515 # now activate plugins having autoload set to True 517 # now activate plugins having autoload set to True
516 splash.showMessage(self.trUtf8("Activating Plugins...")) 518 splash.showMessage(self.tr("Activating Plugins..."))
517 self.pluginManager.activatePlugins() 519 self.pluginManager.activatePlugins()
518 520
519 # now read the keyboard shortcuts for all the actions 521 # now read the keyboard shortcuts for all the actions
520 from Preferences import Shortcuts 522 from Preferences import Shortcuts
521 Shortcuts.readShortcuts() 523 Shortcuts.readShortcuts()
522 524
523 # restore toolbar manager state 525 # restore toolbar manager state
524 splash.showMessage(self.trUtf8("Restoring Toolbarmanager...")) 526 splash.showMessage(self.tr("Restoring Toolbarmanager..."))
525 self.toolbarManager.restoreState( 527 self.toolbarManager.restoreState(
526 Preferences.getUI("ToolbarManagerState")) 528 Preferences.getUI("ToolbarManagerState"))
527 529
528 # now activate the initial view profile 530 # now activate the initial view profile
529 splash.showMessage(self.trUtf8("Setting View Profile...")) 531 splash.showMessage(self.tr("Setting View Profile..."))
530 self.__setEditProfile() 532 self.__setEditProfile()
531 533
532 # now read the saved tasks 534 # now read the saved tasks
533 splash.showMessage(self.trUtf8("Reading Tasks...")) 535 splash.showMessage(self.tr("Reading Tasks..."))
534 self.__readTasks() 536 self.__readTasks()
535 537
536 # now read the saved templates 538 # now read the saved templates
537 splash.showMessage(self.trUtf8("Reading Templates...")) 539 splash.showMessage(self.tr("Reading Templates..."))
538 self.templateViewer.readTemplates() 540 self.templateViewer.readTemplates()
539 541
540 # now start the debug client 542 # now start the debug client
541 splash.showMessage(self.trUtf8("Starting Debugger...")) 543 splash.showMessage(self.tr("Starting Debugger..."))
542 debugServer.startClient(False) 544 debugServer.startClient(False)
543 545
544 # attributes for the network objects 546 # attributes for the network objects
545 self.__networkManager = QNetworkAccessManager(self) 547 self.__networkManager = QNetworkAccessManager(self)
546 self.__networkManager.proxyAuthenticationRequired.connect( 548 self.__networkManager.proxyAuthenticationRequired.connect(
626 628
627 # Create the left toolbox 629 # Create the left toolbox
628 self.lToolboxDock = self.__createDockWindow("lToolboxDock") 630 self.lToolboxDock = self.__createDockWindow("lToolboxDock")
629 self.lToolbox = E5VerticalToolBox(self.lToolboxDock) 631 self.lToolbox = E5VerticalToolBox(self.lToolboxDock)
630 self.__setupDockWindow(self.lToolboxDock, Qt.LeftDockWidgetArea, 632 self.__setupDockWindow(self.lToolboxDock, Qt.LeftDockWidgetArea,
631 self.lToolbox, self.trUtf8("Left Toolbox")) 633 self.lToolbox, self.tr("Left Toolbox"))
632 634
633 # Create the horizontal toolbox 635 # Create the horizontal toolbox
634 self.hToolboxDock = self.__createDockWindow("hToolboxDock") 636 self.hToolboxDock = self.__createDockWindow("hToolboxDock")
635 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) 637 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock)
636 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea, 638 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea,
637 self.hToolbox, 639 self.hToolbox,
638 self.trUtf8("Horizontal Toolbox")) 640 self.tr("Horizontal Toolbox"))
639 641
640 # Create the right toolbox 642 # Create the right toolbox
641 self.rToolboxDock = self.__createDockWindow("rToolboxDock") 643 self.rToolboxDock = self.__createDockWindow("rToolboxDock")
642 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) 644 self.rToolbox = E5VerticalToolBox(self.rToolboxDock)
643 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, 645 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea,
644 self.rToolbox, self.trUtf8("Right Toolbox")) 646 self.rToolbox, self.tr("Right Toolbox"))
645 647
646 # Create the project browser 648 # Create the project browser
647 from Project.ProjectBrowser import ProjectBrowser 649 from Project.ProjectBrowser import ProjectBrowser
648 self.projectBrowser = ProjectBrowser( 650 self.projectBrowser = ProjectBrowser(
649 self.project, None, 651 self.project, None,
650 embeddedBrowser=(self.embeddedFileBrowser == 2)) 652 embeddedBrowser=(self.embeddedFileBrowser == 2))
651 self.lToolbox.addItem(self.projectBrowser, 653 self.lToolbox.addItem(self.projectBrowser,
652 UI.PixmapCache.getIcon("projectViewer.png"), 654 UI.PixmapCache.getIcon("projectViewer.png"),
653 self.trUtf8("Project-Viewer")) 655 self.tr("Project-Viewer"))
654 656
655 # Create the multi project browser 657 # Create the multi project browser
656 from MultiProject.MultiProjectBrowser import MultiProjectBrowser 658 from MultiProject.MultiProjectBrowser import MultiProjectBrowser
657 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject) 659 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject)
658 self.lToolbox.addItem(self.multiProjectBrowser, 660 self.lToolbox.addItem(self.multiProjectBrowser,
659 UI.PixmapCache.getIcon("multiProjectViewer.png"), 661 UI.PixmapCache.getIcon("multiProjectViewer.png"),
660 self.trUtf8("Multiproject-Viewer")) 662 self.tr("Multiproject-Viewer"))
661 663
662 # Create the template viewer part of the user interface 664 # Create the template viewer part of the user interface
663 from Templates.TemplateViewer import TemplateViewer 665 from Templates.TemplateViewer import TemplateViewer
664 self.templateViewer = TemplateViewer(None, 666 self.templateViewer = TemplateViewer(None,
665 self.viewmanager) 667 self.viewmanager)
666 self.lToolbox.addItem(self.templateViewer, 668 self.lToolbox.addItem(self.templateViewer,
667 UI.PixmapCache.getIcon("templateViewer.png"), 669 UI.PixmapCache.getIcon("templateViewer.png"),
668 self.trUtf8("Template-Viewer")) 670 self.tr("Template-Viewer"))
669 671
670 # Create the debug viewer maybe without the embedded shell 672 # Create the debug viewer maybe without the embedded shell
671 from Debugger.DebugViewer import DebugViewer 673 from Debugger.DebugViewer import DebugViewer
672 self.debugViewer = DebugViewer( 674 self.debugViewer = DebugViewer(
673 debugServer, True, self.viewmanager, None, 675 debugServer, True, self.viewmanager, None,
674 embeddedShell=self.embeddedShell, 676 embeddedShell=self.embeddedShell,
675 embeddedBrowser=(self.embeddedFileBrowser == 1)) 677 embeddedBrowser=(self.embeddedFileBrowser == 1))
676 self.rToolbox.addItem(self.debugViewer, 678 self.rToolbox.addItem(self.debugViewer,
677 UI.PixmapCache.getIcon("debugViewer.png"), 679 UI.PixmapCache.getIcon("debugViewer.png"),
678 self.trUtf8("Debug-Viewer")) 680 self.tr("Debug-Viewer"))
679 681
680 # Create the chat part of the user interface 682 # Create the chat part of the user interface
681 from Cooperation.ChatWidget import ChatWidget 683 from Cooperation.ChatWidget import ChatWidget
682 self.cooperation = ChatWidget(self) 684 self.cooperation = ChatWidget(self)
683 self.rToolbox.addItem(self.cooperation, 685 self.rToolbox.addItem(self.cooperation,
684 UI.PixmapCache.getIcon("cooperation.png"), 686 UI.PixmapCache.getIcon("cooperation.png"),
685 self.trUtf8("Cooperation")) 687 self.tr("Cooperation"))
686 688
687 # Create the IRC part of the user interface 689 # Create the IRC part of the user interface
688 from Network.IRC.IrcWidget import IrcWidget 690 from Network.IRC.IrcWidget import IrcWidget
689 self.irc = IrcWidget(self) 691 self.irc = IrcWidget(self)
690 self.rToolbox.addItem(self.irc, 692 self.rToolbox.addItem(self.irc,
691 UI.PixmapCache.getIcon("irc.png"), 693 UI.PixmapCache.getIcon("irc.png"),
692 self.trUtf8("IRC")) 694 self.tr("IRC"))
693 695
694 # Create the task viewer part of the user interface 696 # Create the task viewer part of the user interface
695 from Tasks.TaskViewer import TaskViewer 697 from Tasks.TaskViewer import TaskViewer
696 self.taskViewer = TaskViewer(None, self.project) 698 self.taskViewer = TaskViewer(None, self.project)
697 self.hToolbox.addItem(self.taskViewer, 699 self.hToolbox.addItem(self.taskViewer,
698 UI.PixmapCache.getIcon("task.png"), 700 UI.PixmapCache.getIcon("task.png"),
699 self.trUtf8("Task-Viewer")) 701 self.tr("Task-Viewer"))
700 702
701 # Create the log viewer part of the user interface 703 # Create the log viewer part of the user interface
702 from .LogView import LogViewer 704 from .LogView import LogViewer
703 self.logViewer = LogViewer() 705 self.logViewer = LogViewer()
704 self.hToolbox.addItem(self.logViewer, 706 self.hToolbox.addItem(self.logViewer,
705 UI.PixmapCache.getIcon("logViewer.png"), 707 UI.PixmapCache.getIcon("logViewer.png"),
706 self.trUtf8("Log-Viewer")) 708 self.tr("Log-Viewer"))
707 709
708 if self.embeddedShell: 710 if self.embeddedShell:
709 self.shell = self.debugViewer.shell 711 self.shell = self.debugViewer.shell
710 else: 712 else:
711 # Create the shell 713 # Create the shell
713 self.shellAssembly = \ 715 self.shellAssembly = \
714 ShellAssembly(debugServer, self.viewmanager, True) 716 ShellAssembly(debugServer, self.viewmanager, True)
715 self.shell = self.shellAssembly.shell() 717 self.shell = self.shellAssembly.shell()
716 self.hToolbox.insertItem(0, self.shellAssembly, 718 self.hToolbox.insertItem(0, self.shellAssembly,
717 UI.PixmapCache.getIcon("shell.png"), 719 UI.PixmapCache.getIcon("shell.png"),
718 self.trUtf8("Shell")) 720 self.tr("Shell"))
719 721
720 if self.embeddedFileBrowser == 0: # separate window 722 if self.embeddedFileBrowser == 0: # separate window
721 # Create the file browser 723 # Create the file browser
722 from .Browser import Browser 724 from .Browser import Browser
723 self.browser = Browser() 725 self.browser = Browser()
724 self.lToolbox.addItem(self.browser, 726 self.lToolbox.addItem(self.browser,
725 UI.PixmapCache.getIcon("browser.png"), 727 UI.PixmapCache.getIcon("browser.png"),
726 self.trUtf8("File-Browser")) 728 self.tr("File-Browser"))
727 elif self.embeddedFileBrowser == 1: # embedded in debug browser 729 elif self.embeddedFileBrowser == 1: # embedded in debug browser
728 self.browser = self.debugViewer.browser 730 self.browser = self.debugViewer.browser
729 else: # embedded in project browser 731 else: # embedded in project browser
730 self.browser = self.projectBrowser.fileBrowser 732 self.browser = self.projectBrowser.fileBrowser
731 733
732 # Create the symbols viewer 734 # Create the symbols viewer
733 from .SymbolsWidget import SymbolsWidget 735 from .SymbolsWidget import SymbolsWidget
734 self.symbolsViewer = SymbolsWidget() 736 self.symbolsViewer = SymbolsWidget()
735 self.lToolbox.addItem(self.symbolsViewer, 737 self.lToolbox.addItem(self.symbolsViewer,
736 UI.PixmapCache.getIcon("symbols.png"), 738 UI.PixmapCache.getIcon("symbols.png"),
737 self.trUtf8("Symbols")) 739 self.tr("Symbols"))
738 740
739 # Create the numbers viewer 741 # Create the numbers viewer
740 from .NumbersWidget import NumbersWidget 742 from .NumbersWidget import NumbersWidget
741 self.numbersViewer = NumbersWidget() 743 self.numbersViewer = NumbersWidget()
742 self.hToolbox.addItem(self.numbersViewer, 744 self.hToolbox.addItem(self.numbersViewer,
743 UI.PixmapCache.getIcon("numbers.png"), 745 UI.PixmapCache.getIcon("numbers.png"),
744 self.trUtf8("Numbers")) 746 self.tr("Numbers"))
745 747
746 self.hToolbox.setCurrentIndex(0) 748 self.hToolbox.setCurrentIndex(0)
747 749
748 def __createSidebarsLayout(self, debugServer): 750 def __createSidebarsLayout(self, debugServer):
749 """ 751 """
770 self.project, None, 772 self.project, None,
771 embeddedBrowser=(self.embeddedFileBrowser == 2)) 773 embeddedBrowser=(self.embeddedFileBrowser == 2))
772 self.leftSidebar.addTab( 774 self.leftSidebar.addTab(
773 self.projectBrowser, 775 self.projectBrowser,
774 UI.PixmapCache.getIcon("projectViewer.png"), 776 UI.PixmapCache.getIcon("projectViewer.png"),
775 self.trUtf8("Project-Viewer")) 777 self.tr("Project-Viewer"))
776 778
777 # Create the multi project browser 779 # Create the multi project browser
778 logging.debug("Creating Multiproject Browser...") 780 logging.debug("Creating Multiproject Browser...")
779 from MultiProject.MultiProjectBrowser import MultiProjectBrowser 781 from MultiProject.MultiProjectBrowser import MultiProjectBrowser
780 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject) 782 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject)
781 self.leftSidebar.addTab( 783 self.leftSidebar.addTab(
782 self.multiProjectBrowser, 784 self.multiProjectBrowser,
783 UI.PixmapCache.getIcon("multiProjectViewer.png"), 785 UI.PixmapCache.getIcon("multiProjectViewer.png"),
784 self.trUtf8("Multiproject-Viewer")) 786 self.tr("Multiproject-Viewer"))
785 787
786 # Create the template viewer part of the user interface 788 # Create the template viewer part of the user interface
787 logging.debug("Creating Template Viewer...") 789 logging.debug("Creating Template Viewer...")
788 from Templates.TemplateViewer import TemplateViewer 790 from Templates.TemplateViewer import TemplateViewer
789 self.templateViewer = TemplateViewer(None, 791 self.templateViewer = TemplateViewer(None,
790 self.viewmanager) 792 self.viewmanager)
791 self.leftSidebar.addTab( 793 self.leftSidebar.addTab(
792 self.templateViewer, 794 self.templateViewer,
793 UI.PixmapCache.getIcon("templateViewer.png"), 795 UI.PixmapCache.getIcon("templateViewer.png"),
794 self.trUtf8("Template-Viewer")) 796 self.tr("Template-Viewer"))
795 797
796 # Create the debug viewer maybe without the embedded shell 798 # Create the debug viewer maybe without the embedded shell
797 logging.debug("Creating Debug Viewer...") 799 logging.debug("Creating Debug Viewer...")
798 from Debugger.DebugViewer import DebugViewer 800 from Debugger.DebugViewer import DebugViewer
799 self.debugViewer = DebugViewer( 801 self.debugViewer = DebugViewer(
800 debugServer, True, self.viewmanager, None, 802 debugServer, True, self.viewmanager, None,
801 embeddedShell=self.embeddedShell, 803 embeddedShell=self.embeddedShell,
802 embeddedBrowser=(self.embeddedFileBrowser == 1)) 804 embeddedBrowser=(self.embeddedFileBrowser == 1))
803 self.rightSidebar.addTab( 805 self.rightSidebar.addTab(
804 self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"), 806 self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"),
805 self.trUtf8("Debug-Viewer")) 807 self.tr("Debug-Viewer"))
806 808
807 # Create the chat part of the user interface 809 # Create the chat part of the user interface
808 logging.debug("Creating Chat Widget...") 810 logging.debug("Creating Chat Widget...")
809 from Cooperation.ChatWidget import ChatWidget 811 from Cooperation.ChatWidget import ChatWidget
810 self.cooperation = ChatWidget(self) 812 self.cooperation = ChatWidget(self)
811 self.rightSidebar.addTab( 813 self.rightSidebar.addTab(
812 self.cooperation, UI.PixmapCache.getIcon("cooperation.png"), 814 self.cooperation, UI.PixmapCache.getIcon("cooperation.png"),
813 self.trUtf8("Cooperation")) 815 self.tr("Cooperation"))
814 816
815 # Create the IRC part of the user interface 817 # Create the IRC part of the user interface
816 logging.debug("Creating IRC Widget...") 818 logging.debug("Creating IRC Widget...")
817 from Network.IRC.IrcWidget import IrcWidget 819 from Network.IRC.IrcWidget import IrcWidget
818 self.irc = IrcWidget(self) 820 self.irc = IrcWidget(self)
819 self.rightSidebar.addTab( 821 self.rightSidebar.addTab(
820 self.irc, UI.PixmapCache.getIcon("irc.png"), self.trUtf8("IRC")) 822 self.irc, UI.PixmapCache.getIcon("irc.png"), self.tr("IRC"))
821 823
822 # Create the task viewer part of the user interface 824 # Create the task viewer part of the user interface
823 logging.debug("Creating Task Viewer...") 825 logging.debug("Creating Task Viewer...")
824 from Tasks.TaskViewer import TaskViewer 826 from Tasks.TaskViewer import TaskViewer
825 self.taskViewer = TaskViewer(None, self.project) 827 self.taskViewer = TaskViewer(None, self.project)
826 self.bottomSidebar.addTab(self.taskViewer, 828 self.bottomSidebar.addTab(self.taskViewer,
827 UI.PixmapCache.getIcon("task.png"), 829 UI.PixmapCache.getIcon("task.png"),
828 self.trUtf8("Task-Viewer")) 830 self.tr("Task-Viewer"))
829 831
830 # Create the log viewer part of the user interface 832 # Create the log viewer part of the user interface
831 logging.debug("Creating Log Viewer...") 833 logging.debug("Creating Log Viewer...")
832 from .LogView import LogViewer 834 from .LogView import LogViewer
833 self.logViewer = LogViewer() 835 self.logViewer = LogViewer()
834 self.bottomSidebar.addTab(self.logViewer, 836 self.bottomSidebar.addTab(self.logViewer,
835 UI.PixmapCache.getIcon("logViewer.png"), 837 UI.PixmapCache.getIcon("logViewer.png"),
836 self.trUtf8("Log-Viewer")) 838 self.tr("Log-Viewer"))
837 839
838 if self.embeddedShell: 840 if self.embeddedShell:
839 self.shell = self.debugViewer.shell 841 self.shell = self.debugViewer.shell
840 else: 842 else:
841 # Create the shell 843 # Create the shell
844 self.shellAssembly = \ 846 self.shellAssembly = \
845 ShellAssembly(debugServer, self.viewmanager, True) 847 ShellAssembly(debugServer, self.viewmanager, True)
846 self.shell = self.shellAssembly.shell() 848 self.shell = self.shellAssembly.shell()
847 self.bottomSidebar.insertTab(0, self.shellAssembly, 849 self.bottomSidebar.insertTab(0, self.shellAssembly,
848 UI.PixmapCache.getIcon("shell.png"), 850 UI.PixmapCache.getIcon("shell.png"),
849 self.trUtf8("Shell")) 851 self.tr("Shell"))
850 852
851 if self.embeddedFileBrowser == 0: # separate window 853 if self.embeddedFileBrowser == 0: # separate window
852 # Create the file browser 854 # Create the file browser
853 logging.debug("Creating File Browser...") 855 logging.debug("Creating File Browser...")
854 from .Browser import Browser 856 from .Browser import Browser
855 self.browser = Browser() 857 self.browser = Browser()
856 self.leftSidebar.addTab(self.browser, 858 self.leftSidebar.addTab(self.browser,
857 UI.PixmapCache.getIcon("browser.png"), 859 UI.PixmapCache.getIcon("browser.png"),
858 self.trUtf8("File-Browser")) 860 self.tr("File-Browser"))
859 elif self.embeddedFileBrowser == 1: # embedded in debug browser 861 elif self.embeddedFileBrowser == 1: # embedded in debug browser
860 self.browser = self.debugViewer.browser 862 self.browser = self.debugViewer.browser
861 else: # embedded in project browser 863 else: # embedded in project browser
862 self.browser = self.projectBrowser.fileBrowser 864 self.browser = self.projectBrowser.fileBrowser
863 865
865 logging.debug("Creating Symbols Viewer...") 867 logging.debug("Creating Symbols Viewer...")
866 from .SymbolsWidget import SymbolsWidget 868 from .SymbolsWidget import SymbolsWidget
867 self.symbolsViewer = SymbolsWidget() 869 self.symbolsViewer = SymbolsWidget()
868 self.leftSidebar.addTab(self.symbolsViewer, 870 self.leftSidebar.addTab(self.symbolsViewer,
869 UI.PixmapCache.getIcon("symbols.png"), 871 UI.PixmapCache.getIcon("symbols.png"),
870 self.trUtf8("Symbols")) 872 self.tr("Symbols"))
871 873
872 # Create the numbers viewer 874 # Create the numbers viewer
873 logging.debug("Creating Numbers Viewer...") 875 logging.debug("Creating Numbers Viewer...")
874 from .NumbersWidget import NumbersWidget 876 from .NumbersWidget import NumbersWidget
875 self.numbersViewer = NumbersWidget() 877 self.numbersViewer = NumbersWidget()
876 self.bottomSidebar.addTab(self.numbersViewer, 878 self.bottomSidebar.addTab(self.numbersViewer,
877 UI.PixmapCache.getIcon("numbers.png"), 879 UI.PixmapCache.getIcon("numbers.png"),
878 self.trUtf8("Numbers")) 880 self.tr("Numbers"))
879 881
880 self.bottomSidebar.setCurrentIndex(0) 882 self.bottomSidebar.setCurrentIndex(0)
881 883
882 # create the central widget 884 # create the central widget
883 logging.debug("Creating central widget...") 885 logging.debug("Creating central widget...")
1155 self.capProject = project 1157 self.capProject = project
1156 1158
1157 if self.passiveMode: 1159 if self.passiveMode:
1158 if not self.capProject and not self.capEditor: 1160 if not self.capProject and not self.capEditor:
1159 self.setWindowTitle( 1161 self.setWindowTitle(
1160 self.trUtf8("{0} - Passive Mode").format(Program)) 1162 self.tr("{0} - Passive Mode").format(Program))
1161 elif self.capProject and not self.capEditor: 1163 elif self.capProject and not self.capEditor:
1162 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode") 1164 self.setWindowTitle(self.tr("{0} - {1} - Passive Mode")
1163 .format(self.capProject, Program)) 1165 .format(self.capProject, Program))
1164 elif not self.capProject and self.capEditor: 1166 elif not self.capProject and self.capEditor:
1165 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode") 1167 self.setWindowTitle(self.tr("{0} - {1} - Passive Mode")
1166 .format(self.capEditor, Program)) 1168 .format(self.capEditor, Program))
1167 else: 1169 else:
1168 self.setWindowTitle( 1170 self.setWindowTitle(
1169 self.trUtf8("{0} - {1} - {2} - Passive Mode") 1171 self.tr("{0} - {1} - {2} - Passive Mode")
1170 .format(self.capProject, self.capEditor, Program)) 1172 .format(self.capProject, self.capEditor, Program))
1171 else: 1173 else:
1172 if not self.capProject and not self.capEditor: 1174 if not self.capProject and not self.capEditor:
1173 self.setWindowTitle(Program) 1175 self.setWindowTitle(Program)
1174 elif self.capProject and not self.capEditor: 1176 elif self.capProject and not self.capEditor:
1187 """ 1189 """
1188 self.actions = [] 1190 self.actions = []
1189 self.wizardsActions = [] 1191 self.wizardsActions = []
1190 1192
1191 self.exitAct = E5Action( 1193 self.exitAct = E5Action(
1192 self.trUtf8('Quit'), 1194 self.tr('Quit'),
1193 UI.PixmapCache.getIcon("exit.png"), 1195 UI.PixmapCache.getIcon("exit.png"),
1194 self.trUtf8('&Quit'), 1196 self.tr('&Quit'),
1195 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), 1197 QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
1196 0, self, 'quit') 1198 0, self, 'quit')
1197 self.exitAct.setStatusTip(self.trUtf8('Quit the IDE')) 1199 self.exitAct.setStatusTip(self.tr('Quit the IDE'))
1198 self.exitAct.setWhatsThis(self.trUtf8( 1200 self.exitAct.setWhatsThis(self.tr(
1199 """<b>Quit the IDE</b>""" 1201 """<b>Quit the IDE</b>"""
1200 """<p>This quits the IDE. Any unsaved changes may be saved""" 1202 """<p>This quits the IDE. Any unsaved changes may be saved"""
1201 """ first. Any Python program being debugged will be stopped""" 1203 """ first. Any Python program being debugged will be stopped"""
1202 """ and the preferences will be written to disc.</p>""" 1204 """ and the preferences will be written to disc.</p>"""
1203 )) 1205 ))
1204 self.exitAct.triggered[()].connect(self.__quit) 1206 self.exitAct.triggered.connect(self.__quit)
1205 self.exitAct.setMenuRole(QAction.QuitRole) 1207 self.exitAct.setMenuRole(QAction.QuitRole)
1206 self.actions.append(self.exitAct) 1208 self.actions.append(self.exitAct)
1207 1209
1208 self.newWindowAct = E5Action( 1210 self.newWindowAct = E5Action(
1209 self.trUtf8('New Window'), 1211 self.tr('New Window'),
1210 UI.PixmapCache.getIcon("newWindow.png"), 1212 UI.PixmapCache.getIcon("newWindow.png"),
1211 self.trUtf8('New &Window'), 1213 self.tr('New &Window'),
1212 QKeySequence(self.trUtf8("Ctrl+Shift+N", "File|New Window")), 1214 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
1213 0, self, 'new_window') 1215 0, self, 'new_window')
1214 self.newWindowAct.setStatusTip(self.trUtf8( 1216 self.newWindowAct.setStatusTip(self.tr(
1215 'Open a new eric5 instance')) 1217 'Open a new eric5 instance'))
1216 self.newWindowAct.setWhatsThis(self.trUtf8( 1218 self.newWindowAct.setWhatsThis(self.tr(
1217 """<b>New Window</b>""" 1219 """<b>New Window</b>"""
1218 """<p>This opens a new instance of the eric5 IDE.</p>""" 1220 """<p>This opens a new instance of the eric5 IDE.</p>"""
1219 )) 1221 ))
1220 self.newWindowAct.triggered[()].connect(self.__newWindow) 1222 self.newWindowAct.triggered.connect(self.__newWindow)
1221 self.actions.append(self.newWindowAct) 1223 self.actions.append(self.newWindowAct)
1222 self.newWindowAct.setEnabled( 1224 self.newWindowAct.setEnabled(
1223 not Preferences.getUI("SingleApplicationMode")) 1225 not Preferences.getUI("SingleApplicationMode"))
1224 1226
1225 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) 1227 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True)
1226 1228
1227 self.setEditProfileAct = E5Action( 1229 self.setEditProfileAct = E5Action(
1228 self.trUtf8('Edit Profile'), 1230 self.tr('Edit Profile'),
1229 UI.PixmapCache.getIcon("viewProfileEdit.png"), 1231 UI.PixmapCache.getIcon("viewProfileEdit.png"),
1230 self.trUtf8('Edit Profile'), 1232 self.tr('Edit Profile'),
1231 0, 0, 1233 0, 0,
1232 self.viewProfileActGrp, 'edit_profile', True) 1234 self.viewProfileActGrp, 'edit_profile', True)
1233 self.setEditProfileAct.setStatusTip(self.trUtf8( 1235 self.setEditProfileAct.setStatusTip(self.tr(
1234 'Activate the edit view profile')) 1236 'Activate the edit view profile'))
1235 self.setEditProfileAct.setWhatsThis(self.trUtf8( 1237 self.setEditProfileAct.setWhatsThis(self.tr(
1236 """<b>Edit Profile</b>""" 1238 """<b>Edit Profile</b>"""
1237 """<p>Activate the "Edit View Profile". Windows being shown,""" 1239 """<p>Activate the "Edit View Profile". Windows being shown,"""
1238 """ if this profile is active, may be configured with the""" 1240 """ if this profile is active, may be configured with the"""
1239 """ "View Profile Configuration" dialog.</p>""" 1241 """ "View Profile Configuration" dialog.</p>"""
1240 )) 1242 ))
1241 self.setEditProfileAct.triggered[()].connect(self.__setEditProfile) 1243 self.setEditProfileAct.triggered.connect(self.__setEditProfile)
1242 self.actions.append(self.setEditProfileAct) 1244 self.actions.append(self.setEditProfileAct)
1243 1245
1244 self.setDebugProfileAct = E5Action( 1246 self.setDebugProfileAct = E5Action(
1245 self.trUtf8('Debug Profile'), 1247 self.tr('Debug Profile'),
1246 UI.PixmapCache.getIcon("viewProfileDebug.png"), 1248 UI.PixmapCache.getIcon("viewProfileDebug.png"),
1247 self.trUtf8('Debug Profile'), 1249 self.tr('Debug Profile'),
1248 0, 0, 1250 0, 0,
1249 self.viewProfileActGrp, 'debug_profile', True) 1251 self.viewProfileActGrp, 'debug_profile', True)
1250 self.setDebugProfileAct.setStatusTip( 1252 self.setDebugProfileAct.setStatusTip(
1251 self.trUtf8('Activate the debug view profile')) 1253 self.tr('Activate the debug view profile'))
1252 self.setDebugProfileAct.setWhatsThis(self.trUtf8( 1254 self.setDebugProfileAct.setWhatsThis(self.tr(
1253 """<b>Debug Profile</b>""" 1255 """<b>Debug Profile</b>"""
1254 """<p>Activate the "Debug View Profile". Windows being shown,""" 1256 """<p>Activate the "Debug View Profile". Windows being shown,"""
1255 """ if this profile is active, may be configured with the""" 1257 """ if this profile is active, may be configured with the"""
1256 """ "View Profile Configuration" dialog.</p>""" 1258 """ "View Profile Configuration" dialog.</p>"""
1257 )) 1259 ))
1258 self.setDebugProfileAct.triggered[()].connect(self.setDebugProfile) 1260 self.setDebugProfileAct.triggered.connect(self.setDebugProfile)
1259 self.actions.append(self.setDebugProfileAct) 1261 self.actions.append(self.setDebugProfileAct)
1260 1262
1261 self.pbActivateAct = E5Action( 1263 self.pbActivateAct = E5Action(
1262 self.trUtf8('Project-Viewer'), 1264 self.tr('Project-Viewer'),
1263 self.trUtf8('&Project-Viewer'), 1265 self.tr('&Project-Viewer'),
1264 QKeySequence(self.trUtf8("Alt+Shift+P")), 1266 QKeySequence(self.tr("Alt+Shift+P")),
1265 0, self, 1267 0, self,
1266 'project_viewer_activate') 1268 'project_viewer_activate')
1267 self.pbActivateAct.setStatusTip(self.trUtf8( 1269 self.pbActivateAct.setStatusTip(self.tr(
1268 "Switch the input focus to the Project-Viewer window.")) 1270 "Switch the input focus to the Project-Viewer window."))
1269 self.pbActivateAct.setWhatsThis(self.trUtf8( 1271 self.pbActivateAct.setWhatsThis(self.tr(
1270 """<b>Activate Project-Viewer</b>""" 1272 """<b>Activate Project-Viewer</b>"""
1271 """<p>This switches the input focus to the Project-Viewer""" 1273 """<p>This switches the input focus to the Project-Viewer"""
1272 """ window.</p>""" 1274 """ window.</p>"""
1273 )) 1275 ))
1274 self.pbActivateAct.triggered[()].connect(self.__activateProjectBrowser) 1276 self.pbActivateAct.triggered.connect(self.__activateProjectBrowser)
1275 self.actions.append(self.pbActivateAct) 1277 self.actions.append(self.pbActivateAct)
1276 self.addAction(self.pbActivateAct) 1278 self.addAction(self.pbActivateAct)
1277 1279
1278 self.mpbActivateAct = E5Action( 1280 self.mpbActivateAct = E5Action(
1279 self.trUtf8('Multiproject-Viewer'), 1281 self.tr('Multiproject-Viewer'),
1280 self.trUtf8('&Multiproject-Viewer'), 1282 self.tr('&Multiproject-Viewer'),
1281 QKeySequence(self.trUtf8("Alt+Shift+M")), 1283 QKeySequence(self.tr("Alt+Shift+M")),
1282 0, self, 1284 0, self,
1283 'multi_project_viewer_activate') 1285 'multi_project_viewer_activate')
1284 self.mpbActivateAct.setStatusTip(self.trUtf8( 1286 self.mpbActivateAct.setStatusTip(self.tr(
1285 "Switch the input focus to the Multiproject-Viewer window.")) 1287 "Switch the input focus to the Multiproject-Viewer window."))
1286 self.mpbActivateAct.setWhatsThis(self.trUtf8( 1288 self.mpbActivateAct.setWhatsThis(self.tr(
1287 """<b>Activate Multiproject-Viewer</b>""" 1289 """<b>Activate Multiproject-Viewer</b>"""
1288 """<p>This switches the input focus to the Multiproject-Viewer""" 1290 """<p>This switches the input focus to the Multiproject-Viewer"""
1289 """ window.</p>""" 1291 """ window.</p>"""
1290 )) 1292 ))
1291 self.mpbActivateAct.triggered[()].connect( 1293 self.mpbActivateAct.triggered.connect(
1292 self.__activateMultiProjectBrowser) 1294 self.__activateMultiProjectBrowser)
1293 self.actions.append(self.mpbActivateAct) 1295 self.actions.append(self.mpbActivateAct)
1294 self.addAction(self.mpbActivateAct) 1296 self.addAction(self.mpbActivateAct)
1295 1297
1296 self.debugViewerActivateAct = E5Action( 1298 self.debugViewerActivateAct = E5Action(
1297 self.trUtf8('Debug-Viewer'), 1299 self.tr('Debug-Viewer'),
1298 self.trUtf8('&Debug-Viewer'), 1300 self.tr('&Debug-Viewer'),
1299 QKeySequence(self.trUtf8("Alt+Shift+D")), 1301 QKeySequence(self.tr("Alt+Shift+D")),
1300 0, self, 1302 0, self,
1301 'debug_viewer_activate') 1303 'debug_viewer_activate')
1302 self.debugViewerActivateAct.setStatusTip(self.trUtf8( 1304 self.debugViewerActivateAct.setStatusTip(self.tr(
1303 "Switch the input focus to the Debug-Viewer window.")) 1305 "Switch the input focus to the Debug-Viewer window."))
1304 self.debugViewerActivateAct.setWhatsThis(self.trUtf8( 1306 self.debugViewerActivateAct.setWhatsThis(self.tr(
1305 """<b>Activate Debug-Viewer</b>""" 1307 """<b>Activate Debug-Viewer</b>"""
1306 """<p>This switches the input focus to the Debug-Viewer""" 1308 """<p>This switches the input focus to the Debug-Viewer"""
1307 """ window.</p>""" 1309 """ window.</p>"""
1308 )) 1310 ))
1309 self.debugViewerActivateAct.triggered[()].connect( 1311 self.debugViewerActivateAct.triggered.connect(
1310 self.__activateDebugViewer) 1312 self.__activateDebugViewer)
1311 self.actions.append(self.debugViewerActivateAct) 1313 self.actions.append(self.debugViewerActivateAct)
1312 self.addAction(self.debugViewerActivateAct) 1314 self.addAction(self.debugViewerActivateAct)
1313 1315
1314 self.shellActivateAct = E5Action( 1316 self.shellActivateAct = E5Action(
1315 self.trUtf8('Shell'), 1317 self.tr('Shell'),
1316 self.trUtf8('&Shell'), 1318 self.tr('&Shell'),
1317 QKeySequence(self.trUtf8("Alt+Shift+S")), 1319 QKeySequence(self.tr("Alt+Shift+S")),
1318 0, self, 1320 0, self,
1319 'interprter_shell_activate') 1321 'interprter_shell_activate')
1320 self.shellActivateAct.setStatusTip(self.trUtf8( 1322 self.shellActivateAct.setStatusTip(self.tr(
1321 "Switch the input focus to the Shell window.")) 1323 "Switch the input focus to the Shell window."))
1322 self.shellActivateAct.setWhatsThis(self.trUtf8( 1324 self.shellActivateAct.setWhatsThis(self.tr(
1323 """<b>Activate Shell</b>""" 1325 """<b>Activate Shell</b>"""
1324 """<p>This switches the input focus to the Shell window.</p>""" 1326 """<p>This switches the input focus to the Shell window.</p>"""
1325 )) 1327 ))
1326 self.shellActivateAct.triggered[()].connect(self.__activateShell) 1328 self.shellActivateAct.triggered.connect(self.__activateShell)
1327 self.actions.append(self.shellActivateAct) 1329 self.actions.append(self.shellActivateAct)
1328 self.addAction(self.shellActivateAct) 1330 self.addAction(self.shellActivateAct)
1329 1331
1330 self.browserActivateAct = E5Action( 1332 self.browserActivateAct = E5Action(
1331 self.trUtf8('File-Browser'), 1333 self.tr('File-Browser'),
1332 self.trUtf8('&File-Browser'), 1334 self.tr('&File-Browser'),
1333 QKeySequence(self.trUtf8("Alt+Shift+F")), 1335 QKeySequence(self.tr("Alt+Shift+F")),
1334 0, self, 1336 0, self,
1335 'file_browser_activate') 1337 'file_browser_activate')
1336 self.browserActivateAct.setStatusTip(self.trUtf8( 1338 self.browserActivateAct.setStatusTip(self.tr(
1337 "Switch the input focus to the File-Browser window.")) 1339 "Switch the input focus to the File-Browser window."))
1338 self.browserActivateAct.setWhatsThis(self.trUtf8( 1340 self.browserActivateAct.setWhatsThis(self.tr(
1339 """<b>Activate File-Browser</b>""" 1341 """<b>Activate File-Browser</b>"""
1340 """<p>This switches the input focus to the File-Browser""" 1342 """<p>This switches the input focus to the File-Browser"""
1341 """ window.</p>""" 1343 """ window.</p>"""
1342 )) 1344 ))
1343 self.browserActivateAct.triggered[()].connect(self.__activateBrowser) 1345 self.browserActivateAct.triggered.connect(self.__activateBrowser)
1344 self.actions.append(self.browserActivateAct) 1346 self.actions.append(self.browserActivateAct)
1345 self.addAction(self.browserActivateAct) 1347 self.addAction(self.browserActivateAct)
1346 1348
1347 self.logViewerActivateAct = E5Action( 1349 self.logViewerActivateAct = E5Action(
1348 self.trUtf8('Log-Viewer'), 1350 self.tr('Log-Viewer'),
1349 self.trUtf8('Lo&g-Viewer'), 1351 self.tr('Lo&g-Viewer'),
1350 QKeySequence(self.trUtf8("Alt+Shift+G")), 1352 QKeySequence(self.tr("Alt+Shift+G")),
1351 0, self, 1353 0, self,
1352 'log_viewer_activate') 1354 'log_viewer_activate')
1353 self.logViewerActivateAct.setStatusTip(self.trUtf8( 1355 self.logViewerActivateAct.setStatusTip(self.tr(
1354 "Switch the input focus to the Log-Viewer window.")) 1356 "Switch the input focus to the Log-Viewer window."))
1355 self.logViewerActivateAct.setWhatsThis(self.trUtf8( 1357 self.logViewerActivateAct.setWhatsThis(self.tr(
1356 """<b>Activate Log-Viewer</b>""" 1358 """<b>Activate Log-Viewer</b>"""
1357 """<p>This switches the input focus to the Log-Viewer""" 1359 """<p>This switches the input focus to the Log-Viewer"""
1358 """ window.</p>""" 1360 """ window.</p>"""
1359 )) 1361 ))
1360 self.logViewerActivateAct.triggered[()].connect( 1362 self.logViewerActivateAct.triggered.connect(
1361 self.__activateLogViewer) 1363 self.__activateLogViewer)
1362 self.actions.append(self.logViewerActivateAct) 1364 self.actions.append(self.logViewerActivateAct)
1363 self.addAction(self.logViewerActivateAct) 1365 self.addAction(self.logViewerActivateAct)
1364 1366
1365 self.taskViewerActivateAct = E5Action( 1367 self.taskViewerActivateAct = E5Action(
1366 self.trUtf8('Task-Viewer'), 1368 self.tr('Task-Viewer'),
1367 self.trUtf8('&Task-Viewer'), 1369 self.tr('&Task-Viewer'),
1368 QKeySequence(self.trUtf8("Alt+Shift+T")), 1370 QKeySequence(self.tr("Alt+Shift+T")),
1369 0, self, 1371 0, self,
1370 'task_viewer_activate') 1372 'task_viewer_activate')
1371 self.taskViewerActivateAct.setStatusTip(self.trUtf8( 1373 self.taskViewerActivateAct.setStatusTip(self.tr(
1372 "Switch the input focus to the Task-Viewer window.")) 1374 "Switch the input focus to the Task-Viewer window."))
1373 self.taskViewerActivateAct.setWhatsThis(self.trUtf8( 1375 self.taskViewerActivateAct.setWhatsThis(self.tr(
1374 """<b>Activate Task-Viewer</b>""" 1376 """<b>Activate Task-Viewer</b>"""
1375 """<p>This switches the input focus to the Task-Viewer""" 1377 """<p>This switches the input focus to the Task-Viewer"""
1376 """ window.</p>""" 1378 """ window.</p>"""
1377 )) 1379 ))
1378 self.taskViewerActivateAct.triggered[()].connect( 1380 self.taskViewerActivateAct.triggered.connect(
1379 self.__activateTaskViewer) 1381 self.__activateTaskViewer)
1380 self.actions.append(self.taskViewerActivateAct) 1382 self.actions.append(self.taskViewerActivateAct)
1381 self.addAction(self.taskViewerActivateAct) 1383 self.addAction(self.taskViewerActivateAct)
1382 1384
1383 self.templateViewerActivateAct = E5Action( 1385 self.templateViewerActivateAct = E5Action(
1384 self.trUtf8('Template-Viewer'), 1386 self.tr('Template-Viewer'),
1385 self.trUtf8('Templ&ate-Viewer'), 1387 self.tr('Templ&ate-Viewer'),
1386 QKeySequence(self.trUtf8("Alt+Shift+A")), 1388 QKeySequence(self.tr("Alt+Shift+A")),
1387 0, self, 1389 0, self,
1388 'template_viewer_activate') 1390 'template_viewer_activate')
1389 self.templateViewerActivateAct.setStatusTip(self.trUtf8( 1391 self.templateViewerActivateAct.setStatusTip(self.tr(
1390 "Switch the input focus to the Template-Viewer window.")) 1392 "Switch the input focus to the Template-Viewer window."))
1391 self.templateViewerActivateAct.setWhatsThis(self.trUtf8( 1393 self.templateViewerActivateAct.setWhatsThis(self.tr(
1392 """<b>Activate Template-Viewer</b>""" 1394 """<b>Activate Template-Viewer</b>"""
1393 """<p>This switches the input focus to the Template-Viewer""" 1395 """<p>This switches the input focus to the Template-Viewer"""
1394 """ window.</p>""" 1396 """ window.</p>"""
1395 )) 1397 ))
1396 self.templateViewerActivateAct.triggered[()].connect( 1398 self.templateViewerActivateAct.triggered.connect(
1397 self.__activateTemplateViewer) 1399 self.__activateTemplateViewer)
1398 self.actions.append(self.templateViewerActivateAct) 1400 self.actions.append(self.templateViewerActivateAct)
1399 self.addAction(self.templateViewerActivateAct) 1401 self.addAction(self.templateViewerActivateAct)
1400 1402
1401 self.ltAct = E5Action( 1403 self.ltAct = E5Action(
1402 self.trUtf8('Left Toolbox'), 1404 self.tr('Left Toolbox'),
1403 self.trUtf8('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) 1405 self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True)
1404 self.ltAct.setStatusTip(self.trUtf8('Toggle the Left Toolbox window')) 1406 self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window'))
1405 self.ltAct.setWhatsThis(self.trUtf8( 1407 self.ltAct.setWhatsThis(self.tr(
1406 """<b>Toggle the Left Toolbox window</b>""" 1408 """<b>Toggle the Left Toolbox window</b>"""
1407 """<p>If the Left Toolbox window is hidden then display it.""" 1409 """<p>If the Left Toolbox window is hidden then display it."""
1408 """ If it is displayed then close it.</p>""" 1410 """ If it is displayed then close it.</p>"""
1409 )) 1411 ))
1410 self.ltAct.triggered[()].connect(self.__toggleLeftToolbox) 1412 self.ltAct.triggered.connect(self.__toggleLeftToolbox)
1411 self.actions.append(self.ltAct) 1413 self.actions.append(self.ltAct)
1412 1414
1413 self.rtAct = E5Action( 1415 self.rtAct = E5Action(
1414 self.trUtf8('Right Toolbox'), 1416 self.tr('Right Toolbox'),
1415 self.trUtf8('&Right Toolbox'), 1417 self.tr('&Right Toolbox'),
1416 0, 0, self, 'vertical_toolbox', True) 1418 0, 0, self, 'vertical_toolbox', True)
1417 self.rtAct.setStatusTip(self.trUtf8('Toggle the Right Toolbox window')) 1419 self.rtAct.setStatusTip(self.tr('Toggle the Right Toolbox window'))
1418 self.rtAct.setWhatsThis(self.trUtf8( 1420 self.rtAct.setWhatsThis(self.tr(
1419 """<b>Toggle the Right Toolbox window</b>""" 1421 """<b>Toggle the Right Toolbox window</b>"""
1420 """<p>If the Right Toolbox window is hidden then display it.""" 1422 """<p>If the Right Toolbox window is hidden then display it."""
1421 """ If it is displayed then close it.</p>""" 1423 """ If it is displayed then close it.</p>"""
1422 )) 1424 ))
1423 self.rtAct.triggered[()].connect(self.__toggleRightToolbox) 1425 self.rtAct.triggered.connect(self.__toggleRightToolbox)
1424 self.actions.append(self.rtAct) 1426 self.actions.append(self.rtAct)
1425 1427
1426 self.htAct = E5Action( 1428 self.htAct = E5Action(
1427 self.trUtf8('Horizontal Toolbox'), 1429 self.tr('Horizontal Toolbox'),
1428 self.trUtf8('&Horizontal Toolbox'), 0, 0, self, 1430 self.tr('&Horizontal Toolbox'), 0, 0, self,
1429 'horizontal_toolbox', True) 1431 'horizontal_toolbox', True)
1430 self.htAct.setStatusTip(self.trUtf8( 1432 self.htAct.setStatusTip(self.tr(
1431 'Toggle the Horizontal Toolbox window')) 1433 'Toggle the Horizontal Toolbox window'))
1432 self.htAct.setWhatsThis(self.trUtf8( 1434 self.htAct.setWhatsThis(self.tr(
1433 """<b>Toggle the Horizontal Toolbox window</b>""" 1435 """<b>Toggle the Horizontal Toolbox window</b>"""
1434 """<p>If the Horizontal Toolbox window is hidden then display""" 1436 """<p>If the Horizontal Toolbox window is hidden then display"""
1435 """ it. If it is displayed then close it.</p>""" 1437 """ it. If it is displayed then close it.</p>"""
1436 )) 1438 ))
1437 self.htAct.triggered[()].connect(self.__toggleHorizontalToolbox) 1439 self.htAct.triggered.connect(self.__toggleHorizontalToolbox)
1438 self.actions.append(self.htAct) 1440 self.actions.append(self.htAct)
1439 1441
1440 self.lsbAct = E5Action( 1442 self.lsbAct = E5Action(
1441 self.trUtf8('Left Sidebar'), 1443 self.tr('Left Sidebar'),
1442 self.trUtf8('&Left Sidebar'), 1444 self.tr('&Left Sidebar'),
1443 0, 0, self, 'left_sidebar', True) 1445 0, 0, self, 'left_sidebar', True)
1444 self.lsbAct.setStatusTip(self.trUtf8('Toggle the left sidebar window')) 1446 self.lsbAct.setStatusTip(self.tr('Toggle the left sidebar window'))
1445 self.lsbAct.setWhatsThis(self.trUtf8( 1447 self.lsbAct.setWhatsThis(self.tr(
1446 """<b>Toggle the left sidebar window</b>""" 1448 """<b>Toggle the left sidebar window</b>"""
1447 """<p>If the left sidebar window is hidden then display it.""" 1449 """<p>If the left sidebar window is hidden then display it."""
1448 """ If it is displayed then close it.</p>""" 1450 """ If it is displayed then close it.</p>"""
1449 )) 1451 ))
1450 self.lsbAct.triggered[()].connect(self.__toggleLeftSidebar) 1452 self.lsbAct.triggered.connect(self.__toggleLeftSidebar)
1451 self.actions.append(self.lsbAct) 1453 self.actions.append(self.lsbAct)
1452 1454
1453 self.rsbAct = E5Action( 1455 self.rsbAct = E5Action(
1454 self.trUtf8('Right Sidebar'), 1456 self.tr('Right Sidebar'),
1455 self.trUtf8('&Right Sidebar'), 1457 self.tr('&Right Sidebar'),
1456 0, 0, self, 'right_sidebar', True) 1458 0, 0, self, 'right_sidebar', True)
1457 self.rsbAct.setStatusTip(self.trUtf8( 1459 self.rsbAct.setStatusTip(self.tr(
1458 'Toggle the right sidebar window')) 1460 'Toggle the right sidebar window'))
1459 self.rsbAct.setWhatsThis(self.trUtf8( 1461 self.rsbAct.setWhatsThis(self.tr(
1460 """<b>Toggle the right sidebar window</b>""" 1462 """<b>Toggle the right sidebar window</b>"""
1461 """<p>If the right sidebar window is hidden then display it.""" 1463 """<p>If the right sidebar window is hidden then display it."""
1462 """ If it is displayed then close it.</p>""" 1464 """ If it is displayed then close it.</p>"""
1463 )) 1465 ))
1464 self.rsbAct.triggered[()].connect(self.__toggleRightSidebar) 1466 self.rsbAct.triggered.connect(self.__toggleRightSidebar)
1465 self.actions.append(self.rsbAct) 1467 self.actions.append(self.rsbAct)
1466 1468
1467 self.bsbAct = E5Action( 1469 self.bsbAct = E5Action(
1468 self.trUtf8('Bottom Sidebar'), 1470 self.tr('Bottom Sidebar'),
1469 self.trUtf8('&Bottom Sidebar'), 0, 0, self, 1471 self.tr('&Bottom Sidebar'), 0, 0, self,
1470 'bottom_sidebar', True) 1472 'bottom_sidebar', True)
1471 self.bsbAct.setStatusTip(self.trUtf8( 1473 self.bsbAct.setStatusTip(self.tr(
1472 'Toggle the bottom sidebar window')) 1474 'Toggle the bottom sidebar window'))
1473 self.bsbAct.setWhatsThis(self.trUtf8( 1475 self.bsbAct.setWhatsThis(self.tr(
1474 """<b>Toggle the bottom sidebar window</b>""" 1476 """<b>Toggle the bottom sidebar window</b>"""
1475 """<p>If the bottom sidebar window is hidden then display it.""" 1477 """<p>If the bottom sidebar window is hidden then display it."""
1476 """ If it is displayed then close it.</p>""" 1478 """ If it is displayed then close it.</p>"""
1477 )) 1479 ))
1478 self.bsbAct.triggered[()].connect(self.__toggleBottomSidebar) 1480 self.bsbAct.triggered.connect(self.__toggleBottomSidebar)
1479 self.actions.append(self.bsbAct) 1481 self.actions.append(self.bsbAct)
1480 1482
1481 self.cooperationViewerActivateAct = E5Action( 1483 self.cooperationViewerActivateAct = E5Action(
1482 self.trUtf8('Cooperation-Viewer'), 1484 self.tr('Cooperation-Viewer'),
1483 self.trUtf8('Co&operation-Viewer'), 1485 self.tr('Co&operation-Viewer'),
1484 QKeySequence(self.trUtf8("Alt+Shift+O")), 1486 QKeySequence(self.tr("Alt+Shift+O")),
1485 0, self, 1487 0, self,
1486 'cooperation_viewer_activate') 1488 'cooperation_viewer_activate')
1487 self.cooperationViewerActivateAct.setStatusTip(self.trUtf8( 1489 self.cooperationViewerActivateAct.setStatusTip(self.tr(
1488 "Switch the input focus to the Cooperation-Viewer window.")) 1490 "Switch the input focus to the Cooperation-Viewer window."))
1489 self.cooperationViewerActivateAct.setWhatsThis(self.trUtf8( 1491 self.cooperationViewerActivateAct.setWhatsThis(self.tr(
1490 """<b>Activate Cooperation-Viewer</b>""" 1492 """<b>Activate Cooperation-Viewer</b>"""
1491 """<p>This switches the input focus to the Cooperation-Viewer""" 1493 """<p>This switches the input focus to the Cooperation-Viewer"""
1492 """ window.</p>""" 1494 """ window.</p>"""
1493 )) 1495 ))
1494 self.cooperationViewerActivateAct.triggered[()].connect( 1496 self.cooperationViewerActivateAct.triggered.connect(
1495 self.activateCooperationViewer) 1497 self.activateCooperationViewer)
1496 self.actions.append(self.cooperationViewerActivateAct) 1498 self.actions.append(self.cooperationViewerActivateAct)
1497 self.addAction(self.cooperationViewerActivateAct) 1499 self.addAction(self.cooperationViewerActivateAct)
1498 1500
1499 self.ircActivateAct = E5Action( 1501 self.ircActivateAct = E5Action(
1500 self.trUtf8('IRC'), 1502 self.tr('IRC'),
1501 self.trUtf8('&IRC'), 1503 self.tr('&IRC'),
1502 QKeySequence(self.trUtf8("Meta+Shift+I")), 1504 QKeySequence(self.tr("Meta+Shift+I")),
1503 0, self, 1505 0, self,
1504 'irc_widget_activate') 1506 'irc_widget_activate')
1505 self.ircActivateAct.setStatusTip(self.trUtf8( 1507 self.ircActivateAct.setStatusTip(self.tr(
1506 "Switch the input focus to the IRC window.")) 1508 "Switch the input focus to the IRC window."))
1507 self.ircActivateAct.setWhatsThis(self.trUtf8( 1509 self.ircActivateAct.setWhatsThis(self.tr(
1508 """<b>Activate IRC</b>""" 1510 """<b>Activate IRC</b>"""
1509 """<p>This switches the input focus to the IRC window.</p>""" 1511 """<p>This switches the input focus to the IRC window.</p>"""
1510 )) 1512 ))
1511 self.ircActivateAct.triggered[()].connect( 1513 self.ircActivateAct.triggered.connect(
1512 self.__activateIRC) 1514 self.__activateIRC)
1513 self.actions.append(self.ircActivateAct) 1515 self.actions.append(self.ircActivateAct)
1514 self.addAction(self.ircActivateAct) 1516 self.addAction(self.ircActivateAct)
1515 1517
1516 self.symbolsViewerActivateAct = E5Action( 1518 self.symbolsViewerActivateAct = E5Action(
1517 self.trUtf8('Symbols-Viewer'), 1519 self.tr('Symbols-Viewer'),
1518 self.trUtf8('S&ymbols-Viewer'), 1520 self.tr('S&ymbols-Viewer'),
1519 QKeySequence(self.trUtf8("Alt+Shift+Y")), 1521 QKeySequence(self.tr("Alt+Shift+Y")),
1520 0, self, 1522 0, self,
1521 'symbols_viewer_activate') 1523 'symbols_viewer_activate')
1522 self.symbolsViewerActivateAct.setStatusTip(self.trUtf8( 1524 self.symbolsViewerActivateAct.setStatusTip(self.tr(
1523 "Switch the input focus to the Symbols-Viewer window.")) 1525 "Switch the input focus to the Symbols-Viewer window."))
1524 self.symbolsViewerActivateAct.setWhatsThis(self.trUtf8( 1526 self.symbolsViewerActivateAct.setWhatsThis(self.tr(
1525 """<b>Activate Symbols-Viewer</b>""" 1527 """<b>Activate Symbols-Viewer</b>"""
1526 """<p>This switches the input focus to the Symbols-Viewer""" 1528 """<p>This switches the input focus to the Symbols-Viewer"""
1527 """ window.</p>""" 1529 """ window.</p>"""
1528 )) 1530 ))
1529 self.symbolsViewerActivateAct.triggered[()].connect( 1531 self.symbolsViewerActivateAct.triggered.connect(
1530 self.__activateSymbolsViewer) 1532 self.__activateSymbolsViewer)
1531 self.actions.append(self.symbolsViewerActivateAct) 1533 self.actions.append(self.symbolsViewerActivateAct)
1532 self.addAction(self.symbolsViewerActivateAct) 1534 self.addAction(self.symbolsViewerActivateAct)
1533 1535
1534 self.numbersViewerActivateAct = E5Action( 1536 self.numbersViewerActivateAct = E5Action(
1535 self.trUtf8('Numbers-Viewer'), 1537 self.tr('Numbers-Viewer'),
1536 self.trUtf8('Num&bers-Viewer'), 1538 self.tr('Num&bers-Viewer'),
1537 QKeySequence(self.trUtf8("Alt+Shift+B")), 1539 QKeySequence(self.tr("Alt+Shift+B")),
1538 0, self, 1540 0, self,
1539 'numbers_viewer_activate') 1541 'numbers_viewer_activate')
1540 self.numbersViewerActivateAct.setStatusTip(self.trUtf8( 1542 self.numbersViewerActivateAct.setStatusTip(self.tr(
1541 "Switch the input focus to the Numbers-Viewer window.")) 1543 "Switch the input focus to the Numbers-Viewer window."))
1542 self.numbersViewerActivateAct.setWhatsThis(self.trUtf8( 1544 self.numbersViewerActivateAct.setWhatsThis(self.tr(
1543 """<b>Activate Numbers-Viewer</b>""" 1545 """<b>Activate Numbers-Viewer</b>"""
1544 """<p>This switches the input focus to the Numbers-Viewer""" 1546 """<p>This switches the input focus to the Numbers-Viewer"""
1545 """ window.</p>""" 1547 """ window.</p>"""
1546 )) 1548 ))
1547 self.numbersViewerActivateAct.triggered[()].connect( 1549 self.numbersViewerActivateAct.triggered.connect(
1548 self.__activateNumbersViewer) 1550 self.__activateNumbersViewer)
1549 self.actions.append(self.numbersViewerActivateAct) 1551 self.actions.append(self.numbersViewerActivateAct)
1550 self.addAction(self.numbersViewerActivateAct) 1552 self.addAction(self.numbersViewerActivateAct)
1551 1553
1552 self.whatsThisAct = E5Action( 1554 self.whatsThisAct = E5Action(
1553 self.trUtf8('What\'s This?'), 1555 self.tr('What\'s This?'),
1554 UI.PixmapCache.getIcon("whatsThis.png"), 1556 UI.PixmapCache.getIcon("whatsThis.png"),
1555 self.trUtf8('&What\'s This?'), 1557 self.tr('&What\'s This?'),
1556 QKeySequence(self.trUtf8("Shift+F1")), 1558 QKeySequence(self.tr("Shift+F1")),
1557 0, self, 'whatsThis') 1559 0, self, 'whatsThis')
1558 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) 1560 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help'))
1559 self.whatsThisAct.setWhatsThis(self.trUtf8( 1561 self.whatsThisAct.setWhatsThis(self.tr(
1560 """<b>Display context sensitive help</b>""" 1562 """<b>Display context sensitive help</b>"""
1561 """<p>In What's This? mode, the mouse cursor shows an arrow with""" 1563 """<p>In What's This? mode, the mouse cursor shows an arrow with"""
1562 """ a question mark, and you can click on the interface elements""" 1564 """ a question mark, and you can click on the interface elements"""
1563 """ to get a short description of what they do and how to use""" 1565 """ to get a short description of what they do and how to use"""
1564 """ them. In dialogs, this feature can be accessed using the""" 1566 """ them. In dialogs, this feature can be accessed using the"""
1565 """ context help button in the titlebar.</p>""" 1567 """ context help button in the titlebar.</p>"""
1566 )) 1568 ))
1567 self.whatsThisAct.triggered[()].connect(self.__whatsThis) 1569 self.whatsThisAct.triggered.connect(self.__whatsThis)
1568 self.actions.append(self.whatsThisAct) 1570 self.actions.append(self.whatsThisAct)
1569 1571
1570 self.helpviewerAct = E5Action( 1572 self.helpviewerAct = E5Action(
1571 self.trUtf8('Helpviewer'), 1573 self.tr('Helpviewer'),
1572 UI.PixmapCache.getIcon("help.png"), 1574 UI.PixmapCache.getIcon("help.png"),
1573 self.trUtf8('&Helpviewer...'), 1575 self.tr('&Helpviewer...'),
1574 QKeySequence(self.trUtf8("F1")), 1576 QKeySequence(self.tr("F1")),
1575 0, self, 'helpviewer') 1577 0, self, 'helpviewer')
1576 self.helpviewerAct.setStatusTip(self.trUtf8( 1578 self.helpviewerAct.setStatusTip(self.tr(
1577 'Open the helpviewer window')) 1579 'Open the helpviewer window'))
1578 self.helpviewerAct.setWhatsThis(self.trUtf8( 1580 self.helpviewerAct.setWhatsThis(self.tr(
1579 """<b>Helpviewer</b>""" 1581 """<b>Helpviewer</b>"""
1580 """<p>Display the eric5 web browser. This window will show""" 1582 """<p>Display the eric5 web browser. This window will show"""
1581 """ HTML help files and help from Qt help collections. It has""" 1583 """ HTML help files and help from Qt help collections. It has"""
1582 """ the capability to navigate to links, set bookmarks, print""" 1584 """ the capability to navigate to links, set bookmarks, print"""
1583 """ the displayed help and some more features. You may use it to""" 1585 """ the displayed help and some more features. You may use it to"""
1584 """ browse the internet as well</p><p>If called with a word""" 1586 """ browse the internet as well</p><p>If called with a word"""
1585 """ selected, this word is search in the Qt help collection.</p>""" 1587 """ selected, this word is search in the Qt help collection.</p>"""
1586 )) 1588 ))
1587 self.helpviewerAct.triggered[()].connect(self.__helpViewer) 1589 self.helpviewerAct.triggered.connect(self.__helpViewer)
1588 self.actions.append(self.helpviewerAct) 1590 self.actions.append(self.helpviewerAct)
1589 1591
1590 self.__initQtDocActions() 1592 self.__initQtDocActions()
1591 self.__initPythonDocActions() 1593 self.__initPythonDocActions()
1592 self.__initEricDocAction() 1594 self.__initEricDocAction()
1593 self.__initPySideDocAction() 1595 self.__initPySideDocAction()
1594 1596
1595 self.versionAct = E5Action( 1597 self.versionAct = E5Action(
1596 self.trUtf8('Show Versions'), 1598 self.tr('Show Versions'),
1597 self.trUtf8('Show &Versions'), 1599 self.tr('Show &Versions'),
1598 0, 0, self, 'show_versions') 1600 0, 0, self, 'show_versions')
1599 self.versionAct.setStatusTip(self.trUtf8( 1601 self.versionAct.setStatusTip(self.tr(
1600 'Display version information')) 1602 'Display version information'))
1601 self.versionAct.setWhatsThis(self.trUtf8( 1603 self.versionAct.setWhatsThis(self.tr(
1602 """<b>Show Versions</b>""" 1604 """<b>Show Versions</b>"""
1603 """<p>Display version information.</p>""" 1605 """<p>Display version information.</p>"""
1604 )) 1606 ))
1605 self.versionAct.triggered[()].connect(self.__showVersions) 1607 self.versionAct.triggered.connect(self.__showVersions)
1606 self.actions.append(self.versionAct) 1608 self.actions.append(self.versionAct)
1607 1609
1608 self.checkUpdateAct = E5Action( 1610 self.checkUpdateAct = E5Action(
1609 self.trUtf8('Check for Updates'), 1611 self.tr('Check for Updates'),
1610 self.trUtf8('Check for &Updates...'), 0, 0, self, 'check_updates') 1612 self.tr('Check for &Updates...'), 0, 0, self, 'check_updates')
1611 self.checkUpdateAct.setStatusTip(self.trUtf8('Check for Updates')) 1613 self.checkUpdateAct.setStatusTip(self.tr('Check for Updates'))
1612 self.checkUpdateAct.setWhatsThis(self.trUtf8( 1614 self.checkUpdateAct.setWhatsThis(self.tr(
1613 """<b>Check for Updates...</b>""" 1615 """<b>Check for Updates...</b>"""
1614 """<p>Checks the internet for updates of eric5.</p>""" 1616 """<p>Checks the internet for updates of eric5.</p>"""
1615 )) 1617 ))
1616 self.checkUpdateAct.triggered[()].connect(self.performVersionCheck) 1618 self.checkUpdateAct.triggered.connect(self.performVersionCheck)
1617 self.actions.append(self.checkUpdateAct) 1619 self.actions.append(self.checkUpdateAct)
1618 1620
1619 self.showVersionsAct = E5Action( 1621 self.showVersionsAct = E5Action(
1620 self.trUtf8('Show downloadable versions'), 1622 self.tr('Show downloadable versions'),
1621 self.trUtf8('Show &downloadable versions...'), 1623 self.tr('Show &downloadable versions...'),
1622 0, 0, self, 'show_downloadable_versions') 1624 0, 0, self, 'show_downloadable_versions')
1623 self.showVersionsAct.setStatusTip( 1625 self.showVersionsAct.setStatusTip(
1624 self.trUtf8('Show the versions available for download')) 1626 self.tr('Show the versions available for download'))
1625 self.showVersionsAct.setWhatsThis(self.trUtf8( 1627 self.showVersionsAct.setWhatsThis(self.tr(
1626 """<b>Show downloadable versions...</b>""" 1628 """<b>Show downloadable versions...</b>"""
1627 """<p>Shows the eric5 versions available for download """ 1629 """<p>Shows the eric5 versions available for download """
1628 """from the internet.</p>""" 1630 """from the internet.</p>"""
1629 )) 1631 ))
1630 self.showVersionsAct.triggered[()].connect( 1632 self.showVersionsAct.triggered.connect(
1631 self.showAvailableVersionsInfo) 1633 self.showAvailableVersionsInfo)
1632 self.actions.append(self.showVersionsAct) 1634 self.actions.append(self.showVersionsAct)
1633 1635
1634 self.showErrorLogAct = E5Action( 1636 self.showErrorLogAct = E5Action(
1635 self.trUtf8('Show Error Log'), 1637 self.tr('Show Error Log'),
1636 self.trUtf8('Show Error &Log...'), 1638 self.tr('Show Error &Log...'),
1637 0, 0, self, 'show_error_log') 1639 0, 0, self, 'show_error_log')
1638 self.showErrorLogAct.setStatusTip(self.trUtf8('Show Error Log')) 1640 self.showErrorLogAct.setStatusTip(self.tr('Show Error Log'))
1639 self.showErrorLogAct.setWhatsThis(self.trUtf8( 1641 self.showErrorLogAct.setWhatsThis(self.tr(
1640 """<b>Show Error Log...</b>""" 1642 """<b>Show Error Log...</b>"""
1641 """<p>Opens a dialog showing the most recent error log.</p>""" 1643 """<p>Opens a dialog showing the most recent error log.</p>"""
1642 )) 1644 ))
1643 self.showErrorLogAct.triggered[()].connect(self.__showErrorLog) 1645 self.showErrorLogAct.triggered.connect(self.__showErrorLog)
1644 self.actions.append(self.showErrorLogAct) 1646 self.actions.append(self.showErrorLogAct)
1645 1647
1646 self.reportBugAct = E5Action( 1648 self.reportBugAct = E5Action(
1647 self.trUtf8('Report Bug'), 1649 self.tr('Report Bug'),
1648 self.trUtf8('Report &Bug...'), 1650 self.tr('Report &Bug...'),
1649 0, 0, self, 'report_bug') 1651 0, 0, self, 'report_bug')
1650 self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) 1652 self.reportBugAct.setStatusTip(self.tr('Report a bug'))
1651 self.reportBugAct.setWhatsThis(self.trUtf8( 1653 self.reportBugAct.setWhatsThis(self.tr(
1652 """<b>Report Bug...</b>""" 1654 """<b>Report Bug...</b>"""
1653 """<p>Opens a dialog to report a bug.</p>""" 1655 """<p>Opens a dialog to report a bug.</p>"""
1654 )) 1656 ))
1655 self.reportBugAct.triggered[()].connect(self.__reportBug) 1657 self.reportBugAct.triggered.connect(self.__reportBug)
1656 self.actions.append(self.reportBugAct) 1658 self.actions.append(self.reportBugAct)
1657 1659
1658 self.requestFeatureAct = E5Action( 1660 self.requestFeatureAct = E5Action(
1659 self.trUtf8('Request Feature'), 1661 self.tr('Request Feature'),
1660 self.trUtf8('Request &Feature...'), 1662 self.tr('Request &Feature...'),
1661 0, 0, self, 'request_feature') 1663 0, 0, self, 'request_feature')
1662 self.requestFeatureAct.setStatusTip(self.trUtf8( 1664 self.requestFeatureAct.setStatusTip(self.tr(
1663 'Send a feature request')) 1665 'Send a feature request'))
1664 self.requestFeatureAct.setWhatsThis(self.trUtf8( 1666 self.requestFeatureAct.setWhatsThis(self.tr(
1665 """<b>Request Feature...</b>""" 1667 """<b>Request Feature...</b>"""
1666 """<p>Opens a dialog to send a feature request.</p>""" 1668 """<p>Opens a dialog to send a feature request.</p>"""
1667 )) 1669 ))
1668 self.requestFeatureAct.triggered[()].connect(self.__requestFeature) 1670 self.requestFeatureAct.triggered.connect(self.__requestFeature)
1669 self.actions.append(self.requestFeatureAct) 1671 self.actions.append(self.requestFeatureAct)
1670 1672
1671 self.utActGrp = createActionGroup(self) 1673 self.utActGrp = createActionGroup(self)
1672 1674
1673 self.utDialogAct = E5Action( 1675 self.utDialogAct = E5Action(
1674 self.trUtf8('Unittest'), 1676 self.tr('Unittest'),
1675 UI.PixmapCache.getIcon("unittest.png"), 1677 UI.PixmapCache.getIcon("unittest.png"),
1676 self.trUtf8('&Unittest...'), 1678 self.tr('&Unittest...'),
1677 0, 0, self.utActGrp, 'unittest') 1679 0, 0, self.utActGrp, 'unittest')
1678 self.utDialogAct.setStatusTip(self.trUtf8('Start unittest dialog')) 1680 self.utDialogAct.setStatusTip(self.tr('Start unittest dialog'))
1679 self.utDialogAct.setWhatsThis(self.trUtf8( 1681 self.utDialogAct.setWhatsThis(self.tr(
1680 """<b>Unittest</b>""" 1682 """<b>Unittest</b>"""
1681 """<p>Perform unit tests. The dialog gives you the""" 1683 """<p>Perform unit tests. The dialog gives you the"""
1682 """ ability to select and run a unittest suite.</p>""" 1684 """ ability to select and run a unittest suite.</p>"""
1683 )) 1685 ))
1684 self.utDialogAct.triggered[()].connect(self.__unittest) 1686 self.utDialogAct.triggered.connect(self.__unittest)
1685 self.actions.append(self.utDialogAct) 1687 self.actions.append(self.utDialogAct)
1686 1688
1687 self.utRestartAct = E5Action( 1689 self.utRestartAct = E5Action(
1688 self.trUtf8('Unittest Restart'), 1690 self.tr('Unittest Restart'),
1689 UI.PixmapCache.getIcon("unittestRestart.png"), 1691 UI.PixmapCache.getIcon("unittestRestart.png"),
1690 self.trUtf8('&Restart Unittest...'), 1692 self.tr('&Restart Unittest...'),
1691 0, 0, self.utActGrp, 'unittest_restart') 1693 0, 0, self.utActGrp, 'unittest_restart')
1692 self.utRestartAct.setStatusTip(self.trUtf8('Restart last unittest')) 1694 self.utRestartAct.setStatusTip(self.tr('Restart last unittest'))
1693 self.utRestartAct.setWhatsThis(self.trUtf8( 1695 self.utRestartAct.setWhatsThis(self.tr(
1694 """<b>Restart Unittest</b>""" 1696 """<b>Restart Unittest</b>"""
1695 """<p>Restart the unittest performed last.</p>""" 1697 """<p>Restart the unittest performed last.</p>"""
1696 )) 1698 ))
1697 self.utRestartAct.triggered[()].connect(self.__unittestRestart) 1699 self.utRestartAct.triggered.connect(self.__unittestRestart)
1698 self.utRestartAct.setEnabled(False) 1700 self.utRestartAct.setEnabled(False)
1699 self.actions.append(self.utRestartAct) 1701 self.actions.append(self.utRestartAct)
1700 1702
1701 self.utRerunFailedAct = E5Action( 1703 self.utRerunFailedAct = E5Action(
1702 self.trUtf8('Unittest Rerun Failed'), 1704 self.tr('Unittest Rerun Failed'),
1703 UI.PixmapCache.getIcon("unittestRerunFailed.png"), 1705 UI.PixmapCache.getIcon("unittestRerunFailed.png"),
1704 self.trUtf8('Rerun Failed Tests...'), 1706 self.tr('Rerun Failed Tests...'),
1705 0, 0, self.utActGrp, 'unittest_rerun_failed') 1707 0, 0, self.utActGrp, 'unittest_rerun_failed')
1706 self.utRerunFailedAct.setStatusTip(self.trUtf8( 1708 self.utRerunFailedAct.setStatusTip(self.tr(
1707 'Rerun failed tests of the last run')) 1709 'Rerun failed tests of the last run'))
1708 self.utRerunFailedAct.setWhatsThis(self.trUtf8( 1710 self.utRerunFailedAct.setWhatsThis(self.tr(
1709 """<b>Rerun Failed Tests</b>""" 1711 """<b>Rerun Failed Tests</b>"""
1710 """<p>Rerun all tests that failed during the last unittest""" 1712 """<p>Rerun all tests that failed during the last unittest"""
1711 """ run.</p>""" 1713 """ run.</p>"""
1712 )) 1714 ))
1713 self.utRerunFailedAct.triggered[()].connect(self.__unittestRerunFailed) 1715 self.utRerunFailedAct.triggered.connect(self.__unittestRerunFailed)
1714 self.utRerunFailedAct.setEnabled(False) 1716 self.utRerunFailedAct.setEnabled(False)
1715 self.actions.append(self.utRerunFailedAct) 1717 self.actions.append(self.utRerunFailedAct)
1716 1718
1717 self.utScriptAct = E5Action( 1719 self.utScriptAct = E5Action(
1718 self.trUtf8('Unittest Script'), 1720 self.tr('Unittest Script'),
1719 UI.PixmapCache.getIcon("unittestScript.png"), 1721 UI.PixmapCache.getIcon("unittestScript.png"),
1720 self.trUtf8('Unittest &Script...'), 1722 self.tr('Unittest &Script...'),
1721 0, 0, self.utActGrp, 'unittest_script') 1723 0, 0, self.utActGrp, 'unittest_script')
1722 self.utScriptAct.setStatusTip(self.trUtf8( 1724 self.utScriptAct.setStatusTip(self.tr(
1723 'Run unittest with current script')) 1725 'Run unittest with current script'))
1724 self.utScriptAct.setWhatsThis(self.trUtf8( 1726 self.utScriptAct.setWhatsThis(self.tr(
1725 """<b>Unittest Script</b>""" 1727 """<b>Unittest Script</b>"""
1726 """<p>Run unittest with current script.</p>""" 1728 """<p>Run unittest with current script.</p>"""
1727 )) 1729 ))
1728 self.utScriptAct.triggered[()].connect(self.__unittestScript) 1730 self.utScriptAct.triggered.connect(self.__unittestScript)
1729 self.utScriptAct.setEnabled(False) 1731 self.utScriptAct.setEnabled(False)
1730 self.actions.append(self.utScriptAct) 1732 self.actions.append(self.utScriptAct)
1731 1733
1732 self.utProjectAct = E5Action( 1734 self.utProjectAct = E5Action(
1733 self.trUtf8('Unittest Project'), 1735 self.tr('Unittest Project'),
1734 UI.PixmapCache.getIcon("unittestProject.png"), 1736 UI.PixmapCache.getIcon("unittestProject.png"),
1735 self.trUtf8('Unittest &Project...'), 1737 self.tr('Unittest &Project...'),
1736 0, 0, self.utActGrp, 'unittest_project') 1738 0, 0, self.utActGrp, 'unittest_project')
1737 self.utProjectAct.setStatusTip(self.trUtf8( 1739 self.utProjectAct.setStatusTip(self.tr(
1738 'Run unittest with current project')) 1740 'Run unittest with current project'))
1739 self.utProjectAct.setWhatsThis(self.trUtf8( 1741 self.utProjectAct.setWhatsThis(self.tr(
1740 """<b>Unittest Project</b>""" 1742 """<b>Unittest Project</b>"""
1741 """<p>Run unittest with current project.</p>""" 1743 """<p>Run unittest with current project.</p>"""
1742 )) 1744 ))
1743 self.utProjectAct.triggered[()].connect(self.__unittestProject) 1745 self.utProjectAct.triggered.connect(self.__unittestProject)
1744 self.utProjectAct.setEnabled(False) 1746 self.utProjectAct.setEnabled(False)
1745 self.actions.append(self.utProjectAct) 1747 self.actions.append(self.utProjectAct)
1746 1748
1747 # check for Qt4/Qt5 designer and linguist 1749 # check for Qt4/Qt5 designer and linguist
1748 if Utilities.isWindowsPlatform(): 1750 if Utilities.isWindowsPlatform():
1755 designerExe = os.path.join( 1757 designerExe = os.path.join(
1756 Utilities.getQtBinariesPath(), 1758 Utilities.getQtBinariesPath(),
1757 Utilities.generateQtToolName("designer")) 1759 Utilities.generateQtToolName("designer"))
1758 if os.path.exists(designerExe): 1760 if os.path.exists(designerExe):
1759 self.designer4Act = E5Action( 1761 self.designer4Act = E5Action(
1760 self.trUtf8('Qt-Designer'), 1762 self.tr('Qt-Designer'),
1761 UI.PixmapCache.getIcon("designer4.png"), 1763 UI.PixmapCache.getIcon("designer4.png"),
1762 self.trUtf8('Qt-&Designer...'), 1764 self.tr('Qt-&Designer...'),
1763 0, 0, self, 'qt_designer4') 1765 0, 0, self, 'qt_designer4')
1764 self.designer4Act.setStatusTip(self.trUtf8('Start Qt-Designer')) 1766 self.designer4Act.setStatusTip(self.tr('Start Qt-Designer'))
1765 self.designer4Act.setWhatsThis(self.trUtf8( 1767 self.designer4Act.setWhatsThis(self.tr(
1766 """<b>Qt-Designer</b>""" 1768 """<b>Qt-Designer</b>"""
1767 """<p>Start Qt-Designer.</p>""" 1769 """<p>Start Qt-Designer.</p>"""
1768 )) 1770 ))
1769 self.designer4Act.triggered[()].connect(self.__designer4) 1771 self.designer4Act.triggered.connect(self.__designer4)
1770 self.actions.append(self.designer4Act) 1772 self.actions.append(self.designer4Act)
1771 else: 1773 else:
1772 self.designer4Act = None 1774 self.designer4Act = None
1773 1775
1774 if Utilities.isWindowsPlatform(): 1776 if Utilities.isWindowsPlatform():
1781 linguistExe = os.path.join( 1783 linguistExe = os.path.join(
1782 Utilities.getQtBinariesPath(), 1784 Utilities.getQtBinariesPath(),
1783 Utilities.generateQtToolName("linguist")) 1785 Utilities.generateQtToolName("linguist"))
1784 if os.path.exists(linguistExe): 1786 if os.path.exists(linguistExe):
1785 self.linguist4Act = E5Action( 1787 self.linguist4Act = E5Action(
1786 self.trUtf8('Qt-Linguist'), 1788 self.tr('Qt-Linguist'),
1787 UI.PixmapCache.getIcon("linguist4.png"), 1789 UI.PixmapCache.getIcon("linguist4.png"),
1788 self.trUtf8('Qt-&Linguist...'), 1790 self.tr('Qt-&Linguist...'),
1789 0, 0, self, 'qt_linguist4') 1791 0, 0, self, 'qt_linguist4')
1790 self.linguist4Act.setStatusTip(self.trUtf8('Start Qt-Linguist')) 1792 self.linguist4Act.setStatusTip(self.tr('Start Qt-Linguist'))
1791 self.linguist4Act.setWhatsThis(self.trUtf8( 1793 self.linguist4Act.setWhatsThis(self.tr(
1792 """<b>Qt-Linguist</b>""" 1794 """<b>Qt-Linguist</b>"""
1793 """<p>Start Qt-Linguist.</p>""" 1795 """<p>Start Qt-Linguist.</p>"""
1794 )) 1796 ))
1795 self.linguist4Act.triggered[()].connect(self.__linguist4) 1797 self.linguist4Act.triggered.connect(self.__linguist4)
1796 self.actions.append(self.linguist4Act) 1798 self.actions.append(self.linguist4Act)
1797 else: 1799 else:
1798 self.linguist4Act = None 1800 self.linguist4Act = None
1799 1801
1800 self.uipreviewerAct = E5Action( 1802 self.uipreviewerAct = E5Action(
1801 self.trUtf8('UI Previewer'), 1803 self.tr('UI Previewer'),
1802 UI.PixmapCache.getIcon("uiPreviewer.png"), 1804 UI.PixmapCache.getIcon("uiPreviewer.png"),
1803 self.trUtf8('&UI Previewer...'), 1805 self.tr('&UI Previewer...'),
1804 0, 0, self, 'ui_previewer') 1806 0, 0, self, 'ui_previewer')
1805 self.uipreviewerAct.setStatusTip(self.trUtf8('Start the UI Previewer')) 1807 self.uipreviewerAct.setStatusTip(self.tr('Start the UI Previewer'))
1806 self.uipreviewerAct.setWhatsThis(self.trUtf8( 1808 self.uipreviewerAct.setWhatsThis(self.tr(
1807 """<b>UI Previewer</b>""" 1809 """<b>UI Previewer</b>"""
1808 """<p>Start the UI Previewer.</p>""" 1810 """<p>Start the UI Previewer.</p>"""
1809 )) 1811 ))
1810 self.uipreviewerAct.triggered[()].connect(self.__UIPreviewer) 1812 self.uipreviewerAct.triggered.connect(self.__UIPreviewer)
1811 self.actions.append(self.uipreviewerAct) 1813 self.actions.append(self.uipreviewerAct)
1812 1814
1813 self.trpreviewerAct = E5Action( 1815 self.trpreviewerAct = E5Action(
1814 self.trUtf8('Translations Previewer'), 1816 self.tr('Translations Previewer'),
1815 UI.PixmapCache.getIcon("trPreviewer.png"), 1817 UI.PixmapCache.getIcon("trPreviewer.png"),
1816 self.trUtf8('&Translations Previewer...'), 1818 self.tr('&Translations Previewer...'),
1817 0, 0, self, 'tr_previewer') 1819 0, 0, self, 'tr_previewer')
1818 self.trpreviewerAct.setStatusTip(self.trUtf8( 1820 self.trpreviewerAct.setStatusTip(self.tr(
1819 'Start the Translations Previewer')) 1821 'Start the Translations Previewer'))
1820 self.trpreviewerAct.setWhatsThis(self.trUtf8( 1822 self.trpreviewerAct.setWhatsThis(self.tr(
1821 """<b>Translations Previewer</b>""" 1823 """<b>Translations Previewer</b>"""
1822 """<p>Start the Translations Previewer.</p>""" 1824 """<p>Start the Translations Previewer.</p>"""
1823 )) 1825 ))
1824 self.trpreviewerAct.triggered[()].connect(self.__TRPreviewer) 1826 self.trpreviewerAct.triggered.connect(self.__TRPreviewer)
1825 self.actions.append(self.trpreviewerAct) 1827 self.actions.append(self.trpreviewerAct)
1826 1828
1827 self.diffAct = E5Action( 1829 self.diffAct = E5Action(
1828 self.trUtf8('Compare Files'), 1830 self.tr('Compare Files'),
1829 UI.PixmapCache.getIcon("diffFiles.png"), 1831 UI.PixmapCache.getIcon("diffFiles.png"),
1830 self.trUtf8('&Compare Files...'), 1832 self.tr('&Compare Files...'),
1831 0, 0, self, 'diff_files') 1833 0, 0, self, 'diff_files')
1832 self.diffAct.setStatusTip(self.trUtf8('Compare two files')) 1834 self.diffAct.setStatusTip(self.tr('Compare two files'))
1833 self.diffAct.setWhatsThis(self.trUtf8( 1835 self.diffAct.setWhatsThis(self.tr(
1834 """<b>Compare Files</b>""" 1836 """<b>Compare Files</b>"""
1835 """<p>Open a dialog to compare two files.</p>""" 1837 """<p>Open a dialog to compare two files.</p>"""
1836 )) 1838 ))
1837 self.diffAct.triggered[()].connect(self.__compareFiles) 1839 self.diffAct.triggered.connect(self.__compareFiles)
1838 self.actions.append(self.diffAct) 1840 self.actions.append(self.diffAct)
1839 1841
1840 self.compareAct = E5Action( 1842 self.compareAct = E5Action(
1841 self.trUtf8('Compare Files side by side'), 1843 self.tr('Compare Files side by side'),
1842 UI.PixmapCache.getIcon("compareFiles.png"), 1844 UI.PixmapCache.getIcon("compareFiles.png"),
1843 self.trUtf8('Compare &Files side by side...'), 1845 self.tr('Compare &Files side by side...'),
1844 0, 0, self, 'compare_files') 1846 0, 0, self, 'compare_files')
1845 self.compareAct.setStatusTip(self.trUtf8('Compare two files')) 1847 self.compareAct.setStatusTip(self.tr('Compare two files'))
1846 self.compareAct.setWhatsThis(self.trUtf8( 1848 self.compareAct.setWhatsThis(self.tr(
1847 """<b>Compare Files side by side</b>""" 1849 """<b>Compare Files side by side</b>"""
1848 """<p>Open a dialog to compare two files and show the result""" 1850 """<p>Open a dialog to compare two files and show the result"""
1849 """ side by side.</p>""" 1851 """ side by side.</p>"""
1850 )) 1852 ))
1851 self.compareAct.triggered[()].connect(self.__compareFilesSbs) 1853 self.compareAct.triggered.connect(self.__compareFilesSbs)
1852 self.actions.append(self.compareAct) 1854 self.actions.append(self.compareAct)
1853 1855
1854 self.sqlBrowserAct = E5Action( 1856 self.sqlBrowserAct = E5Action(
1855 self.trUtf8('SQL Browser'), 1857 self.tr('SQL Browser'),
1856 UI.PixmapCache.getIcon("sqlBrowser.png"), 1858 UI.PixmapCache.getIcon("sqlBrowser.png"),
1857 self.trUtf8('SQL &Browser...'), 1859 self.tr('SQL &Browser...'),
1858 0, 0, self, 'sql_browser') 1860 0, 0, self, 'sql_browser')
1859 self.sqlBrowserAct.setStatusTip(self.trUtf8('Browse a SQL database')) 1861 self.sqlBrowserAct.setStatusTip(self.tr('Browse a SQL database'))
1860 self.sqlBrowserAct.setWhatsThis(self.trUtf8( 1862 self.sqlBrowserAct.setWhatsThis(self.tr(
1861 """<b>SQL Browser</b>""" 1863 """<b>SQL Browser</b>"""
1862 """<p>Browse a SQL database.</p>""" 1864 """<p>Browse a SQL database.</p>"""
1863 )) 1865 ))
1864 self.sqlBrowserAct.triggered[()].connect(self.__sqlBrowser) 1866 self.sqlBrowserAct.triggered.connect(self.__sqlBrowser)
1865 self.actions.append(self.sqlBrowserAct) 1867 self.actions.append(self.sqlBrowserAct)
1866 1868
1867 self.miniEditorAct = E5Action( 1869 self.miniEditorAct = E5Action(
1868 self.trUtf8('Mini Editor'), 1870 self.tr('Mini Editor'),
1869 UI.PixmapCache.getIcon("editor.png"), 1871 UI.PixmapCache.getIcon("editor.png"),
1870 self.trUtf8('Mini &Editor...'), 1872 self.tr('Mini &Editor...'),
1871 0, 0, self, 'mini_editor') 1873 0, 0, self, 'mini_editor')
1872 self.miniEditorAct.setStatusTip(self.trUtf8('Mini Editor')) 1874 self.miniEditorAct.setStatusTip(self.tr('Mini Editor'))
1873 self.miniEditorAct.setWhatsThis(self.trUtf8( 1875 self.miniEditorAct.setWhatsThis(self.tr(
1874 """<b>Mini Editor</b>""" 1876 """<b>Mini Editor</b>"""
1875 """<p>Open a dialog with a simplified editor.</p>""" 1877 """<p>Open a dialog with a simplified editor.</p>"""
1876 )) 1878 ))
1877 self.miniEditorAct.triggered[()].connect(self.__openMiniEditor) 1879 self.miniEditorAct.triggered.connect(self.__openMiniEditor)
1878 self.actions.append(self.miniEditorAct) 1880 self.actions.append(self.miniEditorAct)
1879 1881
1880 self.webBrowserAct = E5Action( 1882 self.webBrowserAct = E5Action(
1881 self.trUtf8('eric5 Web Browser'), 1883 self.tr('eric5 Web Browser'),
1882 UI.PixmapCache.getIcon("ericWeb.png"), 1884 UI.PixmapCache.getIcon("ericWeb.png"),
1883 self.trUtf8('eric5 &Web Browser...'), 1885 self.tr('eric5 &Web Browser...'),
1884 0, 0, self, 'web_browser') 1886 0, 0, self, 'web_browser')
1885 self.webBrowserAct.setStatusTip(self.trUtf8( 1887 self.webBrowserAct.setStatusTip(self.tr(
1886 'Start the eric5 Web Browser')) 1888 'Start the eric5 Web Browser'))
1887 self.webBrowserAct.setWhatsThis(self.trUtf8( 1889 self.webBrowserAct.setWhatsThis(self.tr(
1888 """<b>eric5 Web Browser</b>""" 1890 """<b>eric5 Web Browser</b>"""
1889 """<p>Browse the Internet with the eric5 Web Browser.</p>""" 1891 """<p>Browse the Internet with the eric5 Web Browser.</p>"""
1890 )) 1892 ))
1891 self.webBrowserAct.triggered[()].connect(self.__startWebBrowser) 1893 self.webBrowserAct.triggered.connect(self.__startWebBrowser)
1892 self.actions.append(self.webBrowserAct) 1894 self.actions.append(self.webBrowserAct)
1893 1895
1894 self.iconEditorAct = E5Action( 1896 self.iconEditorAct = E5Action(
1895 self.trUtf8('Icon Editor'), 1897 self.tr('Icon Editor'),
1896 UI.PixmapCache.getIcon("iconEditor.png"), 1898 UI.PixmapCache.getIcon("iconEditor.png"),
1897 self.trUtf8('&Icon Editor...'), 1899 self.tr('&Icon Editor...'),
1898 0, 0, self, 'icon_editor') 1900 0, 0, self, 'icon_editor')
1899 self.iconEditorAct.setStatusTip(self.trUtf8( 1901 self.iconEditorAct.setStatusTip(self.tr(
1900 'Start the eric5 Icon Editor')) 1902 'Start the eric5 Icon Editor'))
1901 self.iconEditorAct.setWhatsThis(self.trUtf8( 1903 self.iconEditorAct.setWhatsThis(self.tr(
1902 """<b>Icon Editor</b>""" 1904 """<b>Icon Editor</b>"""
1903 """<p>Starts the eric5 Icon Editor for editing simple icons.</p>""" 1905 """<p>Starts the eric5 Icon Editor for editing simple icons.</p>"""
1904 )) 1906 ))
1905 self.iconEditorAct.triggered[()].connect(self.__editPixmap) 1907 self.iconEditorAct.triggered.connect(self.__editPixmap)
1906 self.actions.append(self.iconEditorAct) 1908 self.actions.append(self.iconEditorAct)
1907 1909
1908 self.snapshotAct = E5Action( 1910 self.snapshotAct = E5Action(
1909 self.trUtf8('Snapshot'), 1911 self.tr('Snapshot'),
1910 UI.PixmapCache.getIcon("ericSnap.png"), 1912 UI.PixmapCache.getIcon("ericSnap.png"),
1911 self.trUtf8('&Snapshot...'), 1913 self.tr('&Snapshot...'),
1912 0, 0, self, 'snapshot') 1914 0, 0, self, 'snapshot')
1913 self.snapshotAct.setStatusTip(self.trUtf8( 1915 self.snapshotAct.setStatusTip(self.tr(
1914 'Take snapshots of a screen region')) 1916 'Take snapshots of a screen region'))
1915 self.snapshotAct.setWhatsThis(self.trUtf8( 1917 self.snapshotAct.setWhatsThis(self.tr(
1916 """<b>Snapshot</b>""" 1918 """<b>Snapshot</b>"""
1917 """<p>This opens a dialog to take snapshots of a screen""" 1919 """<p>This opens a dialog to take snapshots of a screen"""
1918 """ region.</p>""" 1920 """ region.</p>"""
1919 )) 1921 ))
1920 self.snapshotAct.triggered[()].connect(self.__snapshot) 1922 self.snapshotAct.triggered.connect(self.__snapshot)
1921 self.actions.append(self.snapshotAct) 1923 self.actions.append(self.snapshotAct)
1922 1924
1923 self.prefAct = E5Action( 1925 self.prefAct = E5Action(
1924 self.trUtf8('Preferences'), 1926 self.tr('Preferences'),
1925 UI.PixmapCache.getIcon("configure.png"), 1927 UI.PixmapCache.getIcon("configure.png"),
1926 self.trUtf8('&Preferences...'), 1928 self.tr('&Preferences...'),
1927 0, 0, self, 'preferences') 1929 0, 0, self, 'preferences')
1928 self.prefAct.setStatusTip(self.trUtf8( 1930 self.prefAct.setStatusTip(self.tr(
1929 'Set the prefered configuration')) 1931 'Set the prefered configuration'))
1930 self.prefAct.setWhatsThis(self.trUtf8( 1932 self.prefAct.setWhatsThis(self.tr(
1931 """<b>Preferences</b>""" 1933 """<b>Preferences</b>"""
1932 """<p>Set the configuration items of the application""" 1934 """<p>Set the configuration items of the application"""
1933 """ with your prefered values.</p>""" 1935 """ with your prefered values.</p>"""
1934 )) 1936 ))
1935 self.prefAct.triggered[()].connect(self.showPreferences) 1937 self.prefAct.triggered.connect(self.showPreferences)
1936 self.prefAct.setMenuRole(QAction.PreferencesRole) 1938 self.prefAct.setMenuRole(QAction.PreferencesRole)
1937 self.actions.append(self.prefAct) 1939 self.actions.append(self.prefAct)
1938 1940
1939 self.prefExportAct = E5Action( 1941 self.prefExportAct = E5Action(
1940 self.trUtf8('Export Preferences'), 1942 self.tr('Export Preferences'),
1941 UI.PixmapCache.getIcon("configureExport.png"), 1943 UI.PixmapCache.getIcon("configureExport.png"),
1942 self.trUtf8('E&xport Preferences...'), 1944 self.tr('E&xport Preferences...'),
1943 0, 0, self, 'export_preferences') 1945 0, 0, self, 'export_preferences')
1944 self.prefExportAct.setStatusTip(self.trUtf8( 1946 self.prefExportAct.setStatusTip(self.tr(
1945 'Export the current configuration')) 1947 'Export the current configuration'))
1946 self.prefExportAct.setWhatsThis(self.trUtf8( 1948 self.prefExportAct.setWhatsThis(self.tr(
1947 """<b>Export Preferences</b>""" 1949 """<b>Export Preferences</b>"""
1948 """<p>Export the current configuration to a file.</p>""" 1950 """<p>Export the current configuration to a file.</p>"""
1949 )) 1951 ))
1950 self.prefExportAct.triggered[()].connect(self.__exportPreferences) 1952 self.prefExportAct.triggered.connect(self.__exportPreferences)
1951 self.actions.append(self.prefExportAct) 1953 self.actions.append(self.prefExportAct)
1952 1954
1953 self.prefImportAct = E5Action( 1955 self.prefImportAct = E5Action(
1954 self.trUtf8('Import Preferences'), 1956 self.tr('Import Preferences'),
1955 UI.PixmapCache.getIcon("configureImport.png"), 1957 UI.PixmapCache.getIcon("configureImport.png"),
1956 self.trUtf8('I&mport Preferences...'), 1958 self.tr('I&mport Preferences...'),
1957 0, 0, self, 'import_preferences') 1959 0, 0, self, 'import_preferences')
1958 self.prefImportAct.setStatusTip(self.trUtf8( 1960 self.prefImportAct.setStatusTip(self.tr(
1959 'Import a previously exported configuration')) 1961 'Import a previously exported configuration'))
1960 self.prefImportAct.setWhatsThis(self.trUtf8( 1962 self.prefImportAct.setWhatsThis(self.tr(
1961 """<b>Import Preferences</b>""" 1963 """<b>Import Preferences</b>"""
1962 """<p>Import a previously exported configuration.</p>""" 1964 """<p>Import a previously exported configuration.</p>"""
1963 )) 1965 ))
1964 self.prefImportAct.triggered[()].connect(self.__importPreferences) 1966 self.prefImportAct.triggered.connect(self.__importPreferences)
1965 self.actions.append(self.prefImportAct) 1967 self.actions.append(self.prefImportAct)
1966 1968
1967 self.reloadAPIsAct = E5Action( 1969 self.reloadAPIsAct = E5Action(
1968 self.trUtf8('Reload APIs'), 1970 self.tr('Reload APIs'),
1969 self.trUtf8('Reload &APIs'), 1971 self.tr('Reload &APIs'),
1970 0, 0, self, 'reload_apis') 1972 0, 0, self, 'reload_apis')
1971 self.reloadAPIsAct.setStatusTip(self.trUtf8( 1973 self.reloadAPIsAct.setStatusTip(self.tr(
1972 'Reload the API information')) 1974 'Reload the API information'))
1973 self.reloadAPIsAct.setWhatsThis(self.trUtf8( 1975 self.reloadAPIsAct.setWhatsThis(self.tr(
1974 """<b>Reload APIs</b>""" 1976 """<b>Reload APIs</b>"""
1975 """<p>Reload the API information.</p>""" 1977 """<p>Reload the API information.</p>"""
1976 )) 1978 ))
1977 self.reloadAPIsAct.triggered[()].connect(self.__reloadAPIs) 1979 self.reloadAPIsAct.triggered.connect(self.__reloadAPIs)
1978 self.actions.append(self.reloadAPIsAct) 1980 self.actions.append(self.reloadAPIsAct)
1979 1981
1980 self.showExternalToolsAct = E5Action( 1982 self.showExternalToolsAct = E5Action(
1981 self.trUtf8('Show external tools'), 1983 self.tr('Show external tools'),
1982 UI.PixmapCache.getIcon("showPrograms.png"), 1984 UI.PixmapCache.getIcon("showPrograms.png"),
1983 self.trUtf8('Show external &tools'), 1985 self.tr('Show external &tools'),
1984 0, 0, self, 'show_external_tools') 1986 0, 0, self, 'show_external_tools')
1985 self.showExternalToolsAct.setStatusTip(self.trUtf8( 1987 self.showExternalToolsAct.setStatusTip(self.tr(
1986 'Show external tools')) 1988 'Show external tools'))
1987 self.showExternalToolsAct.setWhatsThis(self.trUtf8( 1989 self.showExternalToolsAct.setWhatsThis(self.tr(
1988 """<b>Show external tools</b>""" 1990 """<b>Show external tools</b>"""
1989 """<p>Opens a dialog to show the path and versions of all""" 1991 """<p>Opens a dialog to show the path and versions of all"""
1990 """ extenal tools used by eric5.</p>""" 1992 """ extenal tools used by eric5.</p>"""
1991 )) 1993 ))
1992 self.showExternalToolsAct.triggered[()].connect( 1994 self.showExternalToolsAct.triggered.connect(
1993 self.__showExternalTools) 1995 self.__showExternalTools)
1994 self.actions.append(self.showExternalToolsAct) 1996 self.actions.append(self.showExternalToolsAct)
1995 1997
1996 self.configViewProfilesAct = E5Action( 1998 self.configViewProfilesAct = E5Action(
1997 self.trUtf8('View Profiles'), 1999 self.tr('View Profiles'),
1998 UI.PixmapCache.getIcon("configureViewProfiles.png"), 2000 UI.PixmapCache.getIcon("configureViewProfiles.png"),
1999 self.trUtf8('&View Profiles...'), 2001 self.tr('&View Profiles...'),
2000 0, 0, self, 'view_profiles') 2002 0, 0, self, 'view_profiles')
2001 self.configViewProfilesAct.setStatusTip(self.trUtf8( 2003 self.configViewProfilesAct.setStatusTip(self.tr(
2002 'Configure view profiles')) 2004 'Configure view profiles'))
2003 self.configViewProfilesAct.setWhatsThis(self.trUtf8( 2005 self.configViewProfilesAct.setWhatsThis(self.tr(
2004 """<b>View Profiles</b>""" 2006 """<b>View Profiles</b>"""
2005 """<p>Configure the view profiles. With this dialog you may""" 2007 """<p>Configure the view profiles. With this dialog you may"""
2006 """ set the visibility of the various windows for the""" 2008 """ set the visibility of the various windows for the"""
2007 """ predetermined view profiles.</p>""" 2009 """ predetermined view profiles.</p>"""
2008 )) 2010 ))
2009 self.configViewProfilesAct.triggered[()].connect( 2011 self.configViewProfilesAct.triggered.connect(
2010 self.__configViewProfiles) 2012 self.__configViewProfiles)
2011 self.actions.append(self.configViewProfilesAct) 2013 self.actions.append(self.configViewProfilesAct)
2012 2014
2013 self.configToolBarsAct = E5Action( 2015 self.configToolBarsAct = E5Action(
2014 self.trUtf8('Toolbars'), 2016 self.tr('Toolbars'),
2015 UI.PixmapCache.getIcon("toolbarsConfigure.png"), 2017 UI.PixmapCache.getIcon("toolbarsConfigure.png"),
2016 self.trUtf8('Tool&bars...'), 2018 self.tr('Tool&bars...'),
2017 0, 0, self, 'configure_toolbars') 2019 0, 0, self, 'configure_toolbars')
2018 self.configToolBarsAct.setStatusTip(self.trUtf8('Configure toolbars')) 2020 self.configToolBarsAct.setStatusTip(self.tr('Configure toolbars'))
2019 self.configToolBarsAct.setWhatsThis(self.trUtf8( 2021 self.configToolBarsAct.setWhatsThis(self.tr(
2020 """<b>Toolbars</b>""" 2022 """<b>Toolbars</b>"""
2021 """<p>Configure the toolbars. With this dialog you may""" 2023 """<p>Configure the toolbars. With this dialog you may"""
2022 """ change the actions shown on the various toolbars and""" 2024 """ change the actions shown on the various toolbars and"""
2023 """ define your own toolbars.</p>""" 2025 """ define your own toolbars.</p>"""
2024 )) 2026 ))
2025 self.configToolBarsAct.triggered[()].connect(self.__configToolBars) 2027 self.configToolBarsAct.triggered.connect(self.__configToolBars)
2026 self.actions.append(self.configToolBarsAct) 2028 self.actions.append(self.configToolBarsAct)
2027 2029
2028 self.shortcutsAct = E5Action( 2030 self.shortcutsAct = E5Action(
2029 self.trUtf8('Keyboard Shortcuts'), 2031 self.tr('Keyboard Shortcuts'),
2030 UI.PixmapCache.getIcon("configureShortcuts.png"), 2032 UI.PixmapCache.getIcon("configureShortcuts.png"),
2031 self.trUtf8('Keyboard &Shortcuts...'), 2033 self.tr('Keyboard &Shortcuts...'),
2032 0, 0, self, 'keyboard_shortcuts') 2034 0, 0, self, 'keyboard_shortcuts')
2033 self.shortcutsAct.setStatusTip(self.trUtf8( 2035 self.shortcutsAct.setStatusTip(self.tr(
2034 'Set the keyboard shortcuts')) 2036 'Set the keyboard shortcuts'))
2035 self.shortcutsAct.setWhatsThis(self.trUtf8( 2037 self.shortcutsAct.setWhatsThis(self.tr(
2036 """<b>Keyboard Shortcuts</b>""" 2038 """<b>Keyboard Shortcuts</b>"""
2037 """<p>Set the keyboard shortcuts of the application""" 2039 """<p>Set the keyboard shortcuts of the application"""
2038 """ with your prefered values.</p>""" 2040 """ with your prefered values.</p>"""
2039 )) 2041 ))
2040 self.shortcutsAct.triggered[()].connect(self.__configShortcuts) 2042 self.shortcutsAct.triggered.connect(self.__configShortcuts)
2041 self.actions.append(self.shortcutsAct) 2043 self.actions.append(self.shortcutsAct)
2042 2044
2043 self.exportShortcutsAct = E5Action( 2045 self.exportShortcutsAct = E5Action(
2044 self.trUtf8('Export Keyboard Shortcuts'), 2046 self.tr('Export Keyboard Shortcuts'),
2045 UI.PixmapCache.getIcon("exportShortcuts.png"), 2047 UI.PixmapCache.getIcon("exportShortcuts.png"),
2046 self.trUtf8('&Export Keyboard Shortcuts...'), 2048 self.tr('&Export Keyboard Shortcuts...'),
2047 0, 0, self, 'export_keyboard_shortcuts') 2049 0, 0, self, 'export_keyboard_shortcuts')
2048 self.exportShortcutsAct.setStatusTip(self.trUtf8( 2050 self.exportShortcutsAct.setStatusTip(self.tr(
2049 'Export the keyboard shortcuts')) 2051 'Export the keyboard shortcuts'))
2050 self.exportShortcutsAct.setWhatsThis(self.trUtf8( 2052 self.exportShortcutsAct.setWhatsThis(self.tr(
2051 """<b>Export Keyboard Shortcuts</b>""" 2053 """<b>Export Keyboard Shortcuts</b>"""
2052 """<p>Export the keyboard shortcuts of the application.</p>""" 2054 """<p>Export the keyboard shortcuts of the application.</p>"""
2053 )) 2055 ))
2054 self.exportShortcutsAct.triggered[()].connect(self.__exportShortcuts) 2056 self.exportShortcutsAct.triggered.connect(self.__exportShortcuts)
2055 self.actions.append(self.exportShortcutsAct) 2057 self.actions.append(self.exportShortcutsAct)
2056 2058
2057 self.importShortcutsAct = E5Action( 2059 self.importShortcutsAct = E5Action(
2058 self.trUtf8('Import Keyboard Shortcuts'), 2060 self.tr('Import Keyboard Shortcuts'),
2059 UI.PixmapCache.getIcon("importShortcuts.png"), 2061 UI.PixmapCache.getIcon("importShortcuts.png"),
2060 self.trUtf8('&Import Keyboard Shortcuts...'), 2062 self.tr('&Import Keyboard Shortcuts...'),
2061 0, 0, self, 'import_keyboard_shortcuts') 2063 0, 0, self, 'import_keyboard_shortcuts')
2062 self.importShortcutsAct.setStatusTip(self.trUtf8( 2064 self.importShortcutsAct.setStatusTip(self.tr(
2063 'Import the keyboard shortcuts')) 2065 'Import the keyboard shortcuts'))
2064 self.importShortcutsAct.setWhatsThis(self.trUtf8( 2066 self.importShortcutsAct.setWhatsThis(self.tr(
2065 """<b>Import Keyboard Shortcuts</b>""" 2067 """<b>Import Keyboard Shortcuts</b>"""
2066 """<p>Import the keyboard shortcuts of the application.</p>""" 2068 """<p>Import the keyboard shortcuts of the application.</p>"""
2067 )) 2069 ))
2068 self.importShortcutsAct.triggered[()].connect(self.__importShortcuts) 2070 self.importShortcutsAct.triggered.connect(self.__importShortcuts)
2069 self.actions.append(self.importShortcutsAct) 2071 self.actions.append(self.importShortcutsAct)
2070 2072
2071 if SSL_AVAILABLE: 2073 if SSL_AVAILABLE:
2072 self.certificatesAct = E5Action( 2074 self.certificatesAct = E5Action(
2073 self.trUtf8('Manage SSL Certificates'), 2075 self.tr('Manage SSL Certificates'),
2074 UI.PixmapCache.getIcon("certificates.png"), 2076 UI.PixmapCache.getIcon("certificates.png"),
2075 self.trUtf8('Manage SSL Certificates...'), 2077 self.tr('Manage SSL Certificates...'),
2076 0, 0, self, 'manage_ssl_certificates') 2078 0, 0, self, 'manage_ssl_certificates')
2077 self.certificatesAct.setStatusTip(self.trUtf8( 2079 self.certificatesAct.setStatusTip(self.tr(
2078 'Manage the saved SSL certificates')) 2080 'Manage the saved SSL certificates'))
2079 self.certificatesAct.setWhatsThis(self.trUtf8( 2081 self.certificatesAct.setWhatsThis(self.tr(
2080 """<b>Manage SSL Certificates...</b>""" 2082 """<b>Manage SSL Certificates...</b>"""
2081 """<p>Opens a dialog to manage the saved SSL certificates.""" 2083 """<p>Opens a dialog to manage the saved SSL certificates."""
2082 """</p>""" 2084 """</p>"""
2083 )) 2085 ))
2084 self.certificatesAct.triggered[()].connect( 2086 self.certificatesAct.triggered.connect(
2085 self.__showCertificatesDialog) 2087 self.__showCertificatesDialog)
2086 self.actions.append(self.certificatesAct) 2088 self.actions.append(self.certificatesAct)
2087 2089
2088 self.editMessageFilterAct = E5Action( 2090 self.editMessageFilterAct = E5Action(
2089 self.trUtf8('Edit Message Filters'), 2091 self.tr('Edit Message Filters'),
2090 UI.PixmapCache.getIcon("warning.png"), 2092 UI.PixmapCache.getIcon("warning.png"),
2091 self.trUtf8('Edit Message Filters...'), 2093 self.tr('Edit Message Filters...'),
2092 0, 0, self, 'manage_message_filters') 2094 0, 0, self, 'manage_message_filters')
2093 self.editMessageFilterAct.setStatusTip(self.trUtf8( 2095 self.editMessageFilterAct.setStatusTip(self.tr(
2094 'Edit the message filters used to suppress unwanted messages')) 2096 'Edit the message filters used to suppress unwanted messages'))
2095 self.editMessageFilterAct.setWhatsThis(self.trUtf8( 2097 self.editMessageFilterAct.setWhatsThis(self.tr(
2096 """<b>Edit Message Filters</b>""" 2098 """<b>Edit Message Filters</b>"""
2097 """<p>Opens a dialog to edit the message filters used to""" 2099 """<p>Opens a dialog to edit the message filters used to"""
2098 """ suppress unwanted messages been shown in an error""" 2100 """ suppress unwanted messages been shown in an error"""
2099 """ window.</p>""" 2101 """ window.</p>"""
2100 )) 2102 ))
2101 self.editMessageFilterAct.triggered[()].connect( 2103 self.editMessageFilterAct.triggered.connect(
2102 E5ErrorMessage.editMessageFilters) 2104 E5ErrorMessage.editMessageFilters)
2103 self.actions.append(self.editMessageFilterAct) 2105 self.actions.append(self.editMessageFilterAct)
2104 2106
2105 self.viewmanagerActivateAct = E5Action( 2107 self.viewmanagerActivateAct = E5Action(
2106 self.trUtf8('Activate current editor'), 2108 self.tr('Activate current editor'),
2107 self.trUtf8('Activate current editor'), 2109 self.tr('Activate current editor'),
2108 QKeySequence(self.trUtf8("Alt+Shift+E")), 2110 QKeySequence(self.tr("Alt+Shift+E")),
2109 0, self, 'viewmanager_activate', 1) 2111 0, self, 'viewmanager_activate', 1)
2110 self.viewmanagerActivateAct.triggered[()].connect( 2112 self.viewmanagerActivateAct.triggered.connect(
2111 self.__activateViewmanager) 2113 self.__activateViewmanager)
2112 self.actions.append(self.viewmanagerActivateAct) 2114 self.actions.append(self.viewmanagerActivateAct)
2113 self.addAction(self.viewmanagerActivateAct) 2115 self.addAction(self.viewmanagerActivateAct)
2114 2116
2115 self.nextTabAct = E5Action( 2117 self.nextTabAct = E5Action(
2116 self.trUtf8('Show next'), 2118 self.tr('Show next'),
2117 self.trUtf8('Show next'), 2119 self.tr('Show next'),
2118 QKeySequence(self.trUtf8('Ctrl+Alt+Tab')), 0, 2120 QKeySequence(self.tr('Ctrl+Alt+Tab')), 0,
2119 self, 'view_next_tab') 2121 self, 'view_next_tab')
2120 self.nextTabAct.triggered[()].connect(self.__showNext) 2122 self.nextTabAct.triggered.connect(self.__showNext)
2121 self.actions.append(self.nextTabAct) 2123 self.actions.append(self.nextTabAct)
2122 self.addAction(self.nextTabAct) 2124 self.addAction(self.nextTabAct)
2123 2125
2124 self.prevTabAct = E5Action( 2126 self.prevTabAct = E5Action(
2125 self.trUtf8('Show previous'), 2127 self.tr('Show previous'),
2126 self.trUtf8('Show previous'), 2128 self.tr('Show previous'),
2127 QKeySequence(self.trUtf8('Shift+Ctrl+Alt+Tab')), 0, 2129 QKeySequence(self.tr('Shift+Ctrl+Alt+Tab')), 0,
2128 self, 'view_previous_tab') 2130 self, 'view_previous_tab')
2129 self.prevTabAct.triggered[()].connect(self.__showPrevious) 2131 self.prevTabAct.triggered.connect(self.__showPrevious)
2130 self.actions.append(self.prevTabAct) 2132 self.actions.append(self.prevTabAct)
2131 self.addAction(self.prevTabAct) 2133 self.addAction(self.prevTabAct)
2132 2134
2133 self.switchTabAct = E5Action( 2135 self.switchTabAct = E5Action(
2134 self.trUtf8('Switch between tabs'), 2136 self.tr('Switch between tabs'),
2135 self.trUtf8('Switch between tabs'), 2137 self.tr('Switch between tabs'),
2136 QKeySequence(self.trUtf8('Ctrl+1')), 0, 2138 QKeySequence(self.tr('Ctrl+1')), 0,
2137 self, 'switch_tabs') 2139 self, 'switch_tabs')
2138 self.switchTabAct.triggered[()].connect(self.__switchTab) 2140 self.switchTabAct.triggered.connect(self.__switchTab)
2139 self.actions.append(self.switchTabAct) 2141 self.actions.append(self.switchTabAct)
2140 self.addAction(self.switchTabAct) 2142 self.addAction(self.switchTabAct)
2141 2143
2142 self.pluginInfoAct = E5Action( 2144 self.pluginInfoAct = E5Action(
2143 self.trUtf8('Plugin Infos'), 2145 self.tr('Plugin Infos'),
2144 UI.PixmapCache.getIcon("plugin.png"), 2146 UI.PixmapCache.getIcon("plugin.png"),
2145 self.trUtf8('&Plugin Infos...'), 0, 0, self, 'plugin_infos') 2147 self.tr('&Plugin Infos...'), 0, 0, self, 'plugin_infos')
2146 self.pluginInfoAct.setStatusTip(self.trUtf8('Show Plugin Infos')) 2148 self.pluginInfoAct.setStatusTip(self.tr('Show Plugin Infos'))
2147 self.pluginInfoAct.setWhatsThis(self.trUtf8( 2149 self.pluginInfoAct.setWhatsThis(self.tr(
2148 """<b>Plugin Infos...</b>""" 2150 """<b>Plugin Infos...</b>"""
2149 """<p>This opens a dialog, that show some information about""" 2151 """<p>This opens a dialog, that show some information about"""
2150 """ loaded plugins.</p>""" 2152 """ loaded plugins.</p>"""
2151 )) 2153 ))
2152 self.pluginInfoAct.triggered[()].connect(self.__showPluginInfo) 2154 self.pluginInfoAct.triggered.connect(self.__showPluginInfo)
2153 self.actions.append(self.pluginInfoAct) 2155 self.actions.append(self.pluginInfoAct)
2154 2156
2155 self.pluginInstallAct = E5Action( 2157 self.pluginInstallAct = E5Action(
2156 self.trUtf8('Install Plugins'), 2158 self.tr('Install Plugins'),
2157 UI.PixmapCache.getIcon("pluginInstall.png"), 2159 UI.PixmapCache.getIcon("pluginInstall.png"),
2158 self.trUtf8('&Install Plugins...'), 2160 self.tr('&Install Plugins...'),
2159 0, 0, self, 'plugin_install') 2161 0, 0, self, 'plugin_install')
2160 self.pluginInstallAct.setStatusTip(self.trUtf8('Install Plugins')) 2162 self.pluginInstallAct.setStatusTip(self.tr('Install Plugins'))
2161 self.pluginInstallAct.setWhatsThis(self.trUtf8( 2163 self.pluginInstallAct.setWhatsThis(self.tr(
2162 """<b>Install Plugins...</b>""" 2164 """<b>Install Plugins...</b>"""
2163 """<p>This opens a dialog to install or update plugins.</p>""" 2165 """<p>This opens a dialog to install or update plugins.</p>"""
2164 )) 2166 ))
2165 self.pluginInstallAct.triggered[()].connect(self.__installPlugins) 2167 self.pluginInstallAct.triggered.connect(self.__installPlugins)
2166 self.actions.append(self.pluginInstallAct) 2168 self.actions.append(self.pluginInstallAct)
2167 2169
2168 self.pluginDeinstallAct = E5Action( 2170 self.pluginDeinstallAct = E5Action(
2169 self.trUtf8('Uninstall Plugin'), 2171 self.tr('Uninstall Plugin'),
2170 UI.PixmapCache.getIcon("pluginUninstall.png"), 2172 UI.PixmapCache.getIcon("pluginUninstall.png"),
2171 self.trUtf8('&Uninstall Plugin...'), 2173 self.tr('&Uninstall Plugin...'),
2172 0, 0, self, 'plugin_deinstall') 2174 0, 0, self, 'plugin_deinstall')
2173 self.pluginDeinstallAct.setStatusTip(self.trUtf8('Uninstall Plugin')) 2175 self.pluginDeinstallAct.setStatusTip(self.tr('Uninstall Plugin'))
2174 self.pluginDeinstallAct.setWhatsThis(self.trUtf8( 2176 self.pluginDeinstallAct.setWhatsThis(self.tr(
2175 """<b>Uninstall Plugin...</b>""" 2177 """<b>Uninstall Plugin...</b>"""
2176 """<p>This opens a dialog to uninstall a plugin.</p>""" 2178 """<p>This opens a dialog to uninstall a plugin.</p>"""
2177 )) 2179 ))
2178 self.pluginDeinstallAct.triggered[()].connect(self.__deinstallPlugin) 2180 self.pluginDeinstallAct.triggered.connect(self.__deinstallPlugin)
2179 self.actions.append(self.pluginDeinstallAct) 2181 self.actions.append(self.pluginDeinstallAct)
2180 2182
2181 self.pluginRepoAct = E5Action( 2183 self.pluginRepoAct = E5Action(
2182 self.trUtf8('Plugin Repository'), 2184 self.tr('Plugin Repository'),
2183 UI.PixmapCache.getIcon("pluginRepository.png"), 2185 UI.PixmapCache.getIcon("pluginRepository.png"),
2184 self.trUtf8('Plugin &Repository...'), 2186 self.tr('Plugin &Repository...'),
2185 0, 0, self, 'plugin_repository') 2187 0, 0, self, 'plugin_repository')
2186 self.pluginRepoAct.setStatusTip(self.trUtf8( 2188 self.pluginRepoAct.setStatusTip(self.tr(
2187 'Show Plugins available for download')) 2189 'Show Plugins available for download'))
2188 self.pluginRepoAct.setWhatsThis(self.trUtf8( 2190 self.pluginRepoAct.setWhatsThis(self.tr(
2189 """<b>Plugin Repository...</b>""" 2191 """<b>Plugin Repository...</b>"""
2190 """<p>This opens a dialog, that shows a list of plugins """ 2192 """<p>This opens a dialog, that shows a list of plugins """
2191 """available on the Internet.</p>""" 2193 """available on the Internet.</p>"""
2192 )) 2194 ))
2193 self.pluginRepoAct.triggered[()].connect(self.showPluginsAvailable) 2195 self.pluginRepoAct.triggered.connect(self.showPluginsAvailable)
2194 self.actions.append(self.pluginRepoAct) 2196 self.actions.append(self.pluginRepoAct)
2195 2197
2196 # initialize viewmanager actions 2198 # initialize viewmanager actions
2197 self.viewmanager.initActions() 2199 self.viewmanager.initActions()
2198 2200
2208 def __initQtDocActions(self): 2210 def __initQtDocActions(self):
2209 """ 2211 """
2210 Private slot to initialize the action to show the Qt documentation. 2212 Private slot to initialize the action to show the Qt documentation.
2211 """ 2213 """
2212 self.qt4DocAct = E5Action( 2214 self.qt4DocAct = E5Action(
2213 self.trUtf8('Qt4 Documentation'), 2215 self.tr('Qt4 Documentation'),
2214 self.trUtf8('Qt&4 Documentation'), 2216 self.tr('Qt&4 Documentation'),
2215 0, 0, self, 'qt4_documentation') 2217 0, 0, self, 'qt4_documentation')
2216 self.qt4DocAct.setStatusTip(self.trUtf8('Open Qt4 Documentation')) 2218 self.qt4DocAct.setStatusTip(self.tr('Open Qt4 Documentation'))
2217 self.qt4DocAct.setWhatsThis(self.trUtf8( 2219 self.qt4DocAct.setWhatsThis(self.tr(
2218 """<b>Qt4 Documentation</b>""" 2220 """<b>Qt4 Documentation</b>"""
2219 """<p>Display the Qt4 Documentation. Dependent upon your""" 2221 """<p>Display the Qt4 Documentation. Dependent upon your"""
2220 """ settings, this will either show the help in Eric's internal""" 2222 """ settings, this will either show the help in Eric's internal"""
2221 """ help viewer, or execute a web browser or Qt Assistant. </p>""" 2223 """ help viewer, or execute a web browser or Qt Assistant. </p>"""
2222 )) 2224 ))
2223 self.qt4DocAct.triggered[()].connect(self.__showQt4Doc) 2225 self.qt4DocAct.triggered.connect(self.__showQt4Doc)
2224 self.actions.append(self.qt4DocAct) 2226 self.actions.append(self.qt4DocAct)
2225 2227
2226 self.qt5DocAct = E5Action( 2228 self.qt5DocAct = E5Action(
2227 self.trUtf8('Qt5 Documentation'), 2229 self.tr('Qt5 Documentation'),
2228 self.trUtf8('Qt&5 Documentation'), 2230 self.tr('Qt&5 Documentation'),
2229 0, 0, self, 'qt5_documentation') 2231 0, 0, self, 'qt5_documentation')
2230 self.qt5DocAct.setStatusTip(self.trUtf8('Open Qt5 Documentation')) 2232 self.qt5DocAct.setStatusTip(self.tr('Open Qt5 Documentation'))
2231 self.qt5DocAct.setWhatsThis(self.trUtf8( 2233 self.qt5DocAct.setWhatsThis(self.tr(
2232 """<b>Qt5 Documentation</b>""" 2234 """<b>Qt5 Documentation</b>"""
2233 """<p>Display the Qt5 Documentation. Dependent upon your""" 2235 """<p>Display the Qt5 Documentation. Dependent upon your"""
2234 """ settings, this will either show the help in Eric's internal""" 2236 """ settings, this will either show the help in Eric's internal"""
2235 """ help viewer, or execute a web browser or Qt Assistant. </p>""" 2237 """ help viewer, or execute a web browser or Qt Assistant. </p>"""
2236 )) 2238 ))
2237 self.qt5DocAct.triggered[()].connect(self.__showQt5Doc) 2239 self.qt5DocAct.triggered.connect(self.__showQt5Doc)
2238 self.actions.append(self.qt5DocAct) 2240 self.actions.append(self.qt5DocAct)
2239 2241
2240 self.pyqt4DocAct = E5Action( 2242 self.pyqt4DocAct = E5Action(
2241 self.trUtf8('PyQt4 Documentation'), 2243 self.tr('PyQt4 Documentation'),
2242 self.trUtf8('PyQt&4 Documentation'), 2244 self.tr('PyQt&4 Documentation'),
2243 0, 0, self, 'pyqt4_documentation') 2245 0, 0, self, 'pyqt4_documentation')
2244 self.pyqt4DocAct.setStatusTip(self.trUtf8('Open PyQt4 Documentation')) 2246 self.pyqt4DocAct.setStatusTip(self.tr('Open PyQt4 Documentation'))
2245 self.pyqt4DocAct.setWhatsThis(self.trUtf8( 2247 self.pyqt4DocAct.setWhatsThis(self.tr(
2246 """<b>PyQt4 Documentation</b>""" 2248 """<b>PyQt4 Documentation</b>"""
2247 """<p>Display the PyQt4 Documentation. Dependent upon your""" 2249 """<p>Display the PyQt4 Documentation. Dependent upon your"""
2248 """ settings, this will either show the help in Eric's internal""" 2250 """ settings, this will either show the help in Eric's internal"""
2249 """ help viewer, or execute a web browser or Qt Assistant. </p>""" 2251 """ help viewer, or execute a web browser or Qt Assistant. </p>"""
2250 )) 2252 ))
2251 self.pyqt4DocAct.triggered[()].connect(self.__showPyQt4Doc) 2253 self.pyqt4DocAct.triggered.connect(self.__showPyQt4Doc)
2252 self.actions.append(self.pyqt4DocAct) 2254 self.actions.append(self.pyqt4DocAct)
2253 2255
2254 try: 2256 try:
2255 import PyQt5 # __IGNORE_WARNING__ 2257 import PyQt5 # __IGNORE_WARNING__
2256 self.pyqt5DocAct = E5Action( 2258 self.pyqt5DocAct = E5Action(
2257 self.trUtf8('PyQt5 Documentation'), 2259 self.tr('PyQt5 Documentation'),
2258 self.trUtf8('PyQt&5 Documentation'), 2260 self.tr('PyQt&5 Documentation'),
2259 0, 0, self, 'pyqt5_documentation') 2261 0, 0, self, 'pyqt5_documentation')
2260 self.pyqt5DocAct.setStatusTip(self.trUtf8( 2262 self.pyqt5DocAct.setStatusTip(self.tr(
2261 'Open PyQt5 Documentation')) 2263 'Open PyQt5 Documentation'))
2262 self.pyqt5DocAct.setWhatsThis(self.trUtf8( 2264 self.pyqt5DocAct.setWhatsThis(self.tr(
2263 """<b>PyQt5 Documentation</b>""" 2265 """<b>PyQt5 Documentation</b>"""
2264 """<p>Display the PyQt5 Documentation. Dependent upon your""" 2266 """<p>Display the PyQt5 Documentation. Dependent upon your"""
2265 """ settings, this will either show the help in Eric's""" 2267 """ settings, this will either show the help in Eric's"""
2266 """ internal help viewer, or execute a web browser or""" 2268 """ internal help viewer, or execute a web browser or"""
2267 """ Qt Assistant. </p>""" 2269 """ Qt Assistant. </p>"""
2268 )) 2270 ))
2269 self.pyqt5DocAct.triggered[()].connect(self.__showPyQt5Doc) 2271 self.pyqt5DocAct.triggered.connect(self.__showPyQt5Doc)
2270 self.actions.append(self.pyqt5DocAct) 2272 self.actions.append(self.pyqt5DocAct)
2271 except ImportError: 2273 except ImportError:
2272 self.pyqt5DocAct = None 2274 self.pyqt5DocAct = None
2273 2275
2274 def __initPythonDocActions(self): 2276 def __initPythonDocActions(self):
2275 """ 2277 """
2276 Private slot to initialize the actions to show the Python 2278 Private slot to initialize the actions to show the Python
2277 documentation. 2279 documentation.
2278 """ 2280 """
2279 self.pythonDocAct = E5Action( 2281 self.pythonDocAct = E5Action(
2280 self.trUtf8('Python 3 Documentation'), 2282 self.tr('Python 3 Documentation'),
2281 self.trUtf8('Python &3 Documentation'), 2283 self.tr('Python &3 Documentation'),
2282 0, 0, self, 'python3_documentation') 2284 0, 0, self, 'python3_documentation')
2283 self.pythonDocAct.setStatusTip(self.trUtf8( 2285 self.pythonDocAct.setStatusTip(self.tr(
2284 'Open Python 3 Documentation')) 2286 'Open Python 3 Documentation'))
2285 self.pythonDocAct.setWhatsThis(self.trUtf8( 2287 self.pythonDocAct.setWhatsThis(self.tr(
2286 """<b>Python 3 Documentation</b>""" 2288 """<b>Python 3 Documentation</b>"""
2287 """<p>Display the Python 3 documentation. If no documentation""" 2289 """<p>Display the Python 3 documentation. If no documentation"""
2288 """ directory is configured, the location of the Python 3""" 2290 """ directory is configured, the location of the Python 3"""
2289 """ documentation is assumed to be the doc directory underneath""" 2291 """ documentation is assumed to be the doc directory underneath"""
2290 """ the location of the Python 3 executable on Windows and""" 2292 """ the location of the Python 3 executable on Windows and"""
2291 """ <i>/usr/share/doc/packages/python/html</i> on Unix. Set""" 2293 """ <i>/usr/share/doc/packages/python/html</i> on Unix. Set"""
2292 """ PYTHON3DOCDIR in your environment to override this.</p>""" 2294 """ PYTHON3DOCDIR in your environment to override this.</p>"""
2293 )) 2295 ))
2294 self.pythonDocAct.triggered[()].connect(self.__showPythonDoc) 2296 self.pythonDocAct.triggered.connect(self.__showPythonDoc)
2295 self.actions.append(self.pythonDocAct) 2297 self.actions.append(self.pythonDocAct)
2296 2298
2297 self.python2DocAct = E5Action( 2299 self.python2DocAct = E5Action(
2298 self.trUtf8('Python 2 Documentation'), 2300 self.tr('Python 2 Documentation'),
2299 self.trUtf8('Python &2 Documentation'), 2301 self.tr('Python &2 Documentation'),
2300 0, 0, self, 'python2_documentation') 2302 0, 0, self, 'python2_documentation')
2301 self.python2DocAct.setStatusTip(self.trUtf8( 2303 self.python2DocAct.setStatusTip(self.tr(
2302 'Open Python 2 Documentation')) 2304 'Open Python 2 Documentation'))
2303 self.python2DocAct.setWhatsThis(self.trUtf8( 2305 self.python2DocAct.setWhatsThis(self.tr(
2304 """<b>Python 2 Documentation</b>""" 2306 """<b>Python 2 Documentation</b>"""
2305 """<p>Display the Python 2 documentation. If no documentation""" 2307 """<p>Display the Python 2 documentation. If no documentation"""
2306 """ directory is configured, the location of the Python 2""" 2308 """ directory is configured, the location of the Python 2"""
2307 """ documentation is assumed to be the doc directory underneath""" 2309 """ documentation is assumed to be the doc directory underneath"""
2308 """ the location of the configured Python 2 executable on""" 2310 """ the location of the configured Python 2 executable on"""
2309 """ Windows and""" 2311 """ Windows and"""
2310 """ <i>/usr/share/doc/packages/python/html/python-docs-html</i>""" 2312 """ <i>/usr/share/doc/packages/python/html/python-docs-html</i>"""
2311 """ on Unix. Set PYTHON2DOCDIR in your environment to override""" 2313 """ on Unix. Set PYTHON2DOCDIR in your environment to override"""
2312 """ this. </p>""" 2314 """ this. </p>"""
2313 )) 2315 ))
2314 self.python2DocAct.triggered[()].connect(self.__showPython2Doc) 2316 self.python2DocAct.triggered.connect(self.__showPython2Doc)
2315 self.actions.append(self.python2DocAct) 2317 self.actions.append(self.python2DocAct)
2316 2318
2317 def __initEricDocAction(self): 2319 def __initEricDocAction(self):
2318 """ 2320 """
2319 Private slot to initialize the action to show the eric5 documentation. 2321 Private slot to initialize the action to show the eric5 documentation.
2320 """ 2322 """
2321 self.ericDocAct = E5Action( 2323 self.ericDocAct = E5Action(
2322 self.trUtf8("Eric API Documentation"), 2324 self.tr("Eric API Documentation"),
2323 self.trUtf8('&Eric API Documentation'), 2325 self.tr('&Eric API Documentation'),
2324 0, 0, self, 'eric_documentation') 2326 0, 0, self, 'eric_documentation')
2325 self.ericDocAct.setStatusTip(self.trUtf8( 2327 self.ericDocAct.setStatusTip(self.tr(
2326 "Open Eric API Documentation")) 2328 "Open Eric API Documentation"))
2327 self.ericDocAct.setWhatsThis(self.trUtf8( 2329 self.ericDocAct.setWhatsThis(self.tr(
2328 """<b>Eric API Documentation</b>""" 2330 """<b>Eric API Documentation</b>"""
2329 """<p>Display the Eric API documentation. The location for the""" 2331 """<p>Display the Eric API documentation. The location for the"""
2330 """ documentation is the Documentation/Source subdirectory of""" 2332 """ documentation is the Documentation/Source subdirectory of"""
2331 """ the eric5 installation directory.</p>""" 2333 """ the eric5 installation directory.</p>"""
2332 )) 2334 ))
2333 self.ericDocAct.triggered[()].connect(self.__showEricDoc) 2335 self.ericDocAct.triggered.connect(self.__showEricDoc)
2334 self.actions.append(self.ericDocAct) 2336 self.actions.append(self.ericDocAct)
2335 2337
2336 def __initPySideDocAction(self): 2338 def __initPySideDocAction(self):
2337 """ 2339 """
2338 Private slot to initialize the action to show the PySide documentation. 2340 Private slot to initialize the action to show the PySide documentation.
2339 """ 2341 """
2340 pyside2, pyside3 = Utilities.checkPyside() 2342 pyside2, pyside3 = Utilities.checkPyside()
2341 if pyside2 or pyside3: 2343 if pyside2 or pyside3:
2342 self.pysideDocAct = E5Action( 2344 self.pysideDocAct = E5Action(
2343 self.trUtf8('PySide Documentation'), 2345 self.tr('PySide Documentation'),
2344 self.trUtf8('Py&Side Documentation'), 2346 self.tr('Py&Side Documentation'),
2345 0, 0, self, 'pyside_documentation') 2347 0, 0, self, 'pyside_documentation')
2346 self.pysideDocAct.setStatusTip(self.trUtf8( 2348 self.pysideDocAct.setStatusTip(self.tr(
2347 'Open PySide Documentation')) 2349 'Open PySide Documentation'))
2348 self.pysideDocAct.setWhatsThis(self.trUtf8( 2350 self.pysideDocAct.setWhatsThis(self.tr(
2349 """<b>PySide Documentation</b>""" 2351 """<b>PySide Documentation</b>"""
2350 """<p>Display the PySide Documentation. Dependent upon your""" 2352 """<p>Display the PySide Documentation. Dependent upon your"""
2351 """ settings, this will either show the help in Eric's""" 2353 """ settings, this will either show the help in Eric's"""
2352 """ internal help viewer, or execute a web browser or""" 2354 """ internal help viewer, or execute a web browser or"""
2353 """ Qt Assistant. </p>""" 2355 """ Qt Assistant. </p>"""
2354 )) 2356 ))
2355 self.pysideDocAct.triggered[()].connect(self.__showPySideDoc) 2357 self.pysideDocAct.triggered.connect(self.__showPySideDoc)
2356 self.actions.append(self.pysideDocAct) 2358 self.actions.append(self.pysideDocAct)
2357 else: 2359 else:
2358 self.pysideDocAct = None 2360 self.pysideDocAct = None
2359 2361
2360 def __initMenus(self): 2362 def __initMenus(self):
2382 self.__menus["start"], self.__menus["debug"] = \ 2384 self.__menus["start"], self.__menus["debug"] = \
2383 self.debuggerUI.initMenus() 2385 self.debuggerUI.initMenus()
2384 mb.addMenu(self.__menus["start"]) 2386 mb.addMenu(self.__menus["start"])
2385 mb.addMenu(self.__menus["debug"]) 2387 mb.addMenu(self.__menus["debug"])
2386 2388
2387 self.__menus["unittest"] = QMenu(self.trUtf8('&Unittest'), self) 2389 self.__menus["unittest"] = QMenu(self.tr('&Unittest'), self)
2388 self.__menus["unittest"].setTearOffEnabled(True) 2390 self.__menus["unittest"].setTearOffEnabled(True)
2389 mb.addMenu(self.__menus["unittest"]) 2391 mb.addMenu(self.__menus["unittest"])
2390 self.__menus["unittest"].addAction(self.utDialogAct) 2392 self.__menus["unittest"].addAction(self.utDialogAct)
2391 self.__menus["unittest"].addSeparator() 2393 self.__menus["unittest"].addSeparator()
2392 self.__menus["unittest"].addAction(self.utRestartAct) 2394 self.__menus["unittest"].addAction(self.utRestartAct)
2399 mb.addMenu(self.__menus["multiproject"]) 2401 mb.addMenu(self.__menus["multiproject"])
2400 2402
2401 self.__menus["project"] = self.project.initMenu() 2403 self.__menus["project"] = self.project.initMenu()
2402 mb.addMenu(self.__menus["project"]) 2404 mb.addMenu(self.__menus["project"])
2403 2405
2404 self.__menus["extras"] = QMenu(self.trUtf8('E&xtras'), self) 2406 self.__menus["extras"] = QMenu(self.tr('E&xtras'), self)
2405 self.__menus["extras"].setTearOffEnabled(True) 2407 self.__menus["extras"].setTearOffEnabled(True)
2406 self.__menus["extras"].aboutToShow.connect(self.__showExtrasMenu) 2408 self.__menus["extras"].aboutToShow.connect(self.__showExtrasMenu)
2407 mb.addMenu(self.__menus["extras"]) 2409 mb.addMenu(self.__menus["extras"])
2408 self.viewmanager.addToExtrasMenu(self.__menus["extras"]) 2410 self.viewmanager.addToExtrasMenu(self.__menus["extras"])
2409 self.__menus["wizards"] = QMenu(self.trUtf8('Wi&zards'), self) 2411 self.__menus["wizards"] = QMenu(self.tr('Wi&zards'), self)
2410 self.__menus["wizards"].setTearOffEnabled(True) 2412 self.__menus["wizards"].setTearOffEnabled(True)
2411 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu) 2413 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu)
2412 self.wizardsMenuAct = self.__menus["extras"].addMenu( 2414 self.wizardsMenuAct = self.__menus["extras"].addMenu(
2413 self.__menus["wizards"]) 2415 self.__menus["wizards"])
2414 self.wizardsMenuAct.setEnabled(False) 2416 self.wizardsMenuAct.setEnabled(False)
2415 self.__menus["macros"] = self.viewmanager.initMacroMenu() 2417 self.__menus["macros"] = self.viewmanager.initMacroMenu()
2416 self.__menus["extras"].addMenu(self.__menus["macros"]) 2418 self.__menus["extras"].addMenu(self.__menus["macros"])
2417 self.__menus["tools"] = QMenu(self.trUtf8('&Tools'), self) 2419 self.__menus["tools"] = QMenu(self.tr('&Tools'), self)
2418 self.__menus["tools"].aboutToShow.connect(self.__showToolsMenu) 2420 self.__menus["tools"].aboutToShow.connect(self.__showToolsMenu)
2419 self.__menus["tools"].triggered.connect(self.__toolExecute) 2421 self.__menus["tools"].triggered.connect(self.__toolExecute)
2420 self.toolGroupsMenu = QMenu(self.trUtf8("Select Tool Group"), self) 2422 self.toolGroupsMenu = QMenu(self.tr("Select Tool Group"), self)
2421 self.toolGroupsMenu.aboutToShow.connect(self.__showToolGroupsMenu) 2423 self.toolGroupsMenu.aboutToShow.connect(self.__showToolGroupsMenu)
2422 self.toolGroupsMenu.triggered.connect(self.__toolGroupSelected) 2424 self.toolGroupsMenu.triggered.connect(self.__toolGroupSelected)
2423 self.toolGroupsMenuTriggered = False 2425 self.toolGroupsMenuTriggered = False
2424 self.__menus["extras"].addMenu(self.__menus["tools"]) 2426 self.__menus["extras"].addMenu(self.__menus["tools"])
2425 2427
2426 self.__menus["settings"] = QMenu(self.trUtf8('Se&ttings'), self) 2428 self.__menus["settings"] = QMenu(self.tr('Se&ttings'), self)
2427 mb.addMenu(self.__menus["settings"]) 2429 mb.addMenu(self.__menus["settings"])
2428 self.__menus["settings"].setTearOffEnabled(True) 2430 self.__menus["settings"].setTearOffEnabled(True)
2429 self.__menus["settings"].addAction(self.prefAct) 2431 self.__menus["settings"].addAction(self.prefAct)
2430 self.__menus["settings"].addAction(self.prefExportAct) 2432 self.__menus["settings"].addAction(self.prefExportAct)
2431 self.__menus["settings"].addAction(self.prefImportAct) 2433 self.__menus["settings"].addAction(self.prefImportAct)
2444 self.__menus["settings"].addSeparator() 2446 self.__menus["settings"].addSeparator()
2445 self.__menus["settings"].addAction(self.certificatesAct) 2447 self.__menus["settings"].addAction(self.certificatesAct)
2446 self.__menus["settings"].addSeparator() 2448 self.__menus["settings"].addSeparator()
2447 self.__menus["settings"].addAction(self.editMessageFilterAct) 2449 self.__menus["settings"].addAction(self.editMessageFilterAct)
2448 2450
2449 self.__menus["window"] = QMenu(self.trUtf8('&Window'), self) 2451 self.__menus["window"] = QMenu(self.tr('&Window'), self)
2450 mb.addMenu(self.__menus["window"]) 2452 mb.addMenu(self.__menus["window"])
2451 self.__menus["window"].setTearOffEnabled(True) 2453 self.__menus["window"].setTearOffEnabled(True)
2452 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu) 2454 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu)
2453 2455
2454 self.__menus["subwindow"] = QMenu(self.trUtf8("&Windows"), 2456 self.__menus["subwindow"] = QMenu(self.tr("&Windows"),
2455 self.__menus["window"]) 2457 self.__menus["window"])
2456 self.__menus["subwindow"].setTearOffEnabled(True) 2458 self.__menus["subwindow"].setTearOffEnabled(True)
2457 # left side 2459 # left side
2458 self.__menus["subwindow"].addAction(self.pbActivateAct) 2460 self.__menus["subwindow"].addAction(self.pbActivateAct)
2459 self.__menus["subwindow"].addAction(self.mpbActivateAct) 2461 self.__menus["subwindow"].addAction(self.mpbActivateAct)
2469 self.__menus["subwindow"].addAction(self.debugViewerActivateAct) 2471 self.__menus["subwindow"].addAction(self.debugViewerActivateAct)
2470 self.__menus["subwindow"].addAction(self.cooperationViewerActivateAct) 2472 self.__menus["subwindow"].addAction(self.cooperationViewerActivateAct)
2471 self.__menus["subwindow"].addAction(self.ircActivateAct) 2473 self.__menus["subwindow"].addAction(self.ircActivateAct)
2472 2474
2473 self.__menus["toolbars"] = \ 2475 self.__menus["toolbars"] = \
2474 QMenu(self.trUtf8("&Toolbars"), self.__menus["window"]) 2476 QMenu(self.tr("&Toolbars"), self.__menus["window"])
2475 self.__menus["toolbars"].setTearOffEnabled(True) 2477 self.__menus["toolbars"].setTearOffEnabled(True)
2476 self.__menus["toolbars"].aboutToShow.connect(self.__showToolbarsMenu) 2478 self.__menus["toolbars"].aboutToShow.connect(self.__showToolbarsMenu)
2477 self.__menus["toolbars"].triggered.connect(self.__TBMenuTriggered) 2479 self.__menus["toolbars"].triggered.connect(self.__TBMenuTriggered)
2478 2480
2479 self.__showWindowMenu() # to initialize these actions 2481 self.__showWindowMenu() # to initialize these actions
2480 2482
2481 self.__menus["bookmarks"] = self.viewmanager.initBookmarkMenu() 2483 self.__menus["bookmarks"] = self.viewmanager.initBookmarkMenu()
2482 mb.addMenu(self.__menus["bookmarks"]) 2484 mb.addMenu(self.__menus["bookmarks"])
2483 self.__menus["bookmarks"].setTearOffEnabled(True) 2485 self.__menus["bookmarks"].setTearOffEnabled(True)
2484 2486
2485 self.__menus["plugins"] = QMenu(self.trUtf8('P&lugins'), self) 2487 self.__menus["plugins"] = QMenu(self.tr('P&lugins'), self)
2486 mb.addMenu(self.__menus["plugins"]) 2488 mb.addMenu(self.__menus["plugins"])
2487 self.__menus["plugins"].setTearOffEnabled(True) 2489 self.__menus["plugins"].setTearOffEnabled(True)
2488 self.__menus["plugins"].addAction(self.pluginInfoAct) 2490 self.__menus["plugins"].addAction(self.pluginInfoAct)
2489 self.__menus["plugins"].addAction(self.pluginInstallAct) 2491 self.__menus["plugins"].addAction(self.pluginInstallAct)
2490 self.__menus["plugins"].addAction(self.pluginDeinstallAct) 2492 self.__menus["plugins"].addAction(self.pluginDeinstallAct)
2491 self.__menus["plugins"].addSeparator() 2493 self.__menus["plugins"].addSeparator()
2492 self.__menus["plugins"].addAction(self.pluginRepoAct) 2494 self.__menus["plugins"].addAction(self.pluginRepoAct)
2493 self.__menus["plugins"].addSeparator() 2495 self.__menus["plugins"].addSeparator()
2494 self.__menus["plugins"].addAction( 2496 self.__menus["plugins"].addAction(
2495 self.trUtf8("Configure..."), self.__pluginsConfigure) 2497 self.tr("Configure..."), self.__pluginsConfigure)
2496 2498
2497 mb.addSeparator() 2499 mb.addSeparator()
2498 2500
2499 self.__menus["help"] = QMenu(self.trUtf8('&Help'), self) 2501 self.__menus["help"] = QMenu(self.tr('&Help'), self)
2500 mb.addMenu(self.__menus["help"]) 2502 mb.addMenu(self.__menus["help"])
2501 self.__menus["help"].setTearOffEnabled(True) 2503 self.__menus["help"].setTearOffEnabled(True)
2502 self.__menus["help"].addAction(self.helpviewerAct) 2504 self.__menus["help"].addAction(self.helpviewerAct)
2503 self.__menus["help"].addSeparator() 2505 self.__menus["help"].addSeparator()
2504 self.__menus["help"].addAction(self.ericDocAct) 2506 self.__menus["help"].addAction(self.ericDocAct)
2542 self.toolbarManager) 2544 self.toolbarManager)
2543 viewtb = self.viewmanager.initViewToolbar(self.toolbarManager) 2545 viewtb = self.viewmanager.initViewToolbar(self.toolbarManager)
2544 starttb, debugtb = self.debuggerUI.initToolbars(self.toolbarManager) 2546 starttb, debugtb = self.debuggerUI.initToolbars(self.toolbarManager)
2545 multiprojecttb = self.multiProject.initToolbar(self.toolbarManager) 2547 multiprojecttb = self.multiProject.initToolbar(self.toolbarManager)
2546 projecttb = self.project.initToolbar(self.toolbarManager) 2548 projecttb = self.project.initToolbar(self.toolbarManager)
2547 toolstb = QToolBar(self.trUtf8("Tools"), self) 2549 toolstb = QToolBar(self.tr("Tools"), self)
2548 unittesttb = QToolBar(self.trUtf8("Unittest"), self) 2550 unittesttb = QToolBar(self.tr("Unittest"), self)
2549 bookmarktb = self.viewmanager.initBookmarkToolbar(self.toolbarManager) 2551 bookmarktb = self.viewmanager.initBookmarkToolbar(self.toolbarManager)
2550 spellingtb = self.viewmanager.initSpellingToolbar(self.toolbarManager) 2552 spellingtb = self.viewmanager.initSpellingToolbar(self.toolbarManager)
2551 settingstb = QToolBar(self.trUtf8("Settings"), self) 2553 settingstb = QToolBar(self.tr("Settings"), self)
2552 helptb = QToolBar(self.trUtf8("Help"), self) 2554 helptb = QToolBar(self.tr("Help"), self)
2553 profilestb = QToolBar(self.trUtf8("Profiles"), self) 2555 profilestb = QToolBar(self.tr("Profiles"), self)
2554 pluginstb = QToolBar(self.trUtf8("Plugins"), self) 2556 pluginstb = QToolBar(self.tr("Plugins"), self)
2555 2557
2556 toolstb.setIconSize(Config.ToolBarIconSize) 2558 toolstb.setIconSize(Config.ToolBarIconSize)
2557 unittesttb.setIconSize(Config.ToolBarIconSize) 2559 unittesttb.setIconSize(Config.ToolBarIconSize)
2558 settingstb.setIconSize(Config.ToolBarIconSize) 2560 settingstb.setIconSize(Config.ToolBarIconSize)
2559 helptb.setIconSize(Config.ToolBarIconSize) 2561 helptb.setIconSize(Config.ToolBarIconSize)
2565 settingstb.setObjectName("SettingsToolbar") 2567 settingstb.setObjectName("SettingsToolbar")
2566 helptb.setObjectName("HelpToolbar") 2568 helptb.setObjectName("HelpToolbar")
2567 profilestb.setObjectName("ProfilesToolbar") 2569 profilestb.setObjectName("ProfilesToolbar")
2568 pluginstb.setObjectName("PluginsToolbar") 2570 pluginstb.setObjectName("PluginsToolbar")
2569 2571
2570 toolstb.setToolTip(self.trUtf8("Tools")) 2572 toolstb.setToolTip(self.tr("Tools"))
2571 unittesttb.setToolTip(self.trUtf8("Unittest")) 2573 unittesttb.setToolTip(self.tr("Unittest"))
2572 settingstb.setToolTip(self.trUtf8("Settings")) 2574 settingstb.setToolTip(self.tr("Settings"))
2573 helptb.setToolTip(self.trUtf8("Help")) 2575 helptb.setToolTip(self.tr("Help"))
2574 profilestb.setToolTip(self.trUtf8("Profiles")) 2576 profilestb.setToolTip(self.tr("Profiles"))
2575 pluginstb.setToolTip(self.trUtf8("Plugins")) 2577 pluginstb.setToolTip(self.tr("Plugins"))
2576 2578
2577 filetb.addSeparator() 2579 filetb.addSeparator()
2578 filetb.addAction(self.exitAct) 2580 filetb.addAction(self.exitAct)
2579 act = filetb.actions()[0] 2581 act = filetb.actions()[0]
2580 sep = filetb.insertSeparator(act) 2582 sep = filetb.insertSeparator(act)
2715 Private slot to set up the status bar. 2717 Private slot to set up the status bar.
2716 """ 2718 """
2717 self.__statusBar = self.statusBar() 2719 self.__statusBar = self.statusBar()
2718 self.__statusBar.setSizeGripEnabled(True) 2720 self.__statusBar.setSizeGripEnabled(True)
2719 2721
2720 self.sbLanguage = QLabel(self.__statusBar) 2722 self.sbLanguage = E5ClickableLabel(self.__statusBar)
2721 self.__statusBar.addPermanentWidget(self.sbLanguage) 2723 self.__statusBar.addPermanentWidget(self.sbLanguage)
2722 self.sbLanguage.setWhatsThis(self.trUtf8( 2724 self.sbLanguage.setWhatsThis(self.tr(
2723 """<p>This part of the status bar displays the""" 2725 """<p>This part of the status bar displays the"""
2724 """ current editors language.</p>""" 2726 """ current editors language.</p>"""
2725 )) 2727 ))
2726 2728
2727 self.sbEncoding = QLabel(self.__statusBar) 2729 self.sbEncoding = E5ClickableLabel(self.__statusBar)
2728 self.__statusBar.addPermanentWidget(self.sbEncoding) 2730 self.__statusBar.addPermanentWidget(self.sbEncoding)
2729 self.sbEncoding.setWhatsThis(self.trUtf8( 2731 self.sbEncoding.setWhatsThis(self.tr(
2730 """<p>This part of the status bar displays the""" 2732 """<p>This part of the status bar displays the"""
2731 """ current editors encoding.</p>""" 2733 """ current editors encoding.</p>"""
2732 )) 2734 ))
2733 2735
2734 self.sbEol = QLabel(self.__statusBar) 2736 self.sbEol = E5ClickableLabel(self.__statusBar)
2735 self.__statusBar.addPermanentWidget(self.sbEol) 2737 self.__statusBar.addPermanentWidget(self.sbEol)
2736 self.sbEol.setWhatsThis(self.trUtf8( 2738 self.sbEol.setWhatsThis(self.tr(
2737 """<p>This part of the status bar displays the""" 2739 """<p>This part of the status bar displays the"""
2738 """ current editors eol setting.</p>""" 2740 """ current editors eol setting.</p>"""
2739 )) 2741 ))
2740 2742
2741 self.sbWritable = QLabel(self.__statusBar) 2743 self.sbWritable = QLabel(self.__statusBar)
2742 self.__statusBar.addPermanentWidget(self.sbWritable) 2744 self.__statusBar.addPermanentWidget(self.sbWritable)
2743 self.sbWritable.setWhatsThis(self.trUtf8( 2745 self.sbWritable.setWhatsThis(self.tr(
2744 """<p>This part of the status bar displays an indication of the""" 2746 """<p>This part of the status bar displays an indication of the"""
2745 """ current editors files writability.</p>""" 2747 """ current editors files writability.</p>"""
2746 )) 2748 ))
2747 2749
2748 self.sbLine = QLabel(self.__statusBar) 2750 self.sbLine = QLabel(self.__statusBar)
2749 self.__statusBar.addPermanentWidget(self.sbLine) 2751 self.__statusBar.addPermanentWidget(self.sbLine)
2750 self.sbLine.setWhatsThis(self.trUtf8( 2752 self.sbLine.setWhatsThis(self.tr(
2751 """<p>This part of the status bar displays the line number of""" 2753 """<p>This part of the status bar displays the line number of"""
2752 """ the current editor.</p>""" 2754 """ the current editor.</p>"""
2753 )) 2755 ))
2754 2756
2755 self.sbPos = QLabel(self.__statusBar) 2757 self.sbPos = QLabel(self.__statusBar)
2756 self.__statusBar.addPermanentWidget(self.sbPos) 2758 self.__statusBar.addPermanentWidget(self.sbPos)
2757 self.sbPos.setWhatsThis(self.trUtf8( 2759 self.sbPos.setWhatsThis(self.tr(
2758 """<p>This part of the status bar displays the cursor position""" 2760 """<p>This part of the status bar displays the cursor position"""
2759 """ of the current editor.</p>""" 2761 """ of the current editor.</p>"""
2760 )) 2762 ))
2761 2763
2762 self.sbZoom = E5ZoomWidget( 2764 self.sbZoom = E5ZoomWidget(
2763 UI.PixmapCache.getPixmap("zoomOut.png"), 2765 UI.PixmapCache.getPixmap("zoomOut.png"),
2764 UI.PixmapCache.getPixmap("zoomIn.png"), 2766 UI.PixmapCache.getPixmap("zoomIn.png"),
2765 UI.PixmapCache.getPixmap("zoomReset.png"), 2767 UI.PixmapCache.getPixmap("zoomReset.png"),
2766 self.__statusBar) 2768 self.__statusBar)
2767 self.__statusBar.addPermanentWidget(self.sbZoom) 2769 self.__statusBar.addPermanentWidget(self.sbZoom)
2768 self.sbZoom.setWhatsThis(self.trUtf8( 2770 self.sbZoom.setWhatsThis(self.tr(
2769 """<p>This part of the status bar allows zooming the current""" 2771 """<p>This part of the status bar allows zooming the current"""
2770 """ editor, shell or terminal.</p>""" 2772 """ editor, shell or terminal.</p>"""
2771 )) 2773 ))
2772 2774
2773 self.viewmanager.setSbInfo( 2775 self.viewmanager.setSbInfo(
2782 """ 2784 """
2783 Private slot to create actions for the configured external tools. 2785 Private slot to create actions for the configured external tools.
2784 """ 2786 """
2785 self.toolGroupActions = {} 2787 self.toolGroupActions = {}
2786 for toolGroup in self.toolGroups: 2788 for toolGroup in self.toolGroups:
2787 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) 2789 category = self.tr("External Tools/{0}").format(toolGroup[0])
2788 for tool in toolGroup[1]: 2790 for tool in toolGroup[1]:
2789 if tool['menutext'] != '--': 2791 if tool['menutext'] != '--':
2790 act = QAction(UI.PixmapCache.getIcon(tool['icon']), 2792 act = QAction(UI.PixmapCache.getIcon(tool['icon']),
2791 tool['menutext'], self) 2793 tool['menutext'], self)
2792 act.setObjectName("{0}@@{1}".format(toolGroup[0], 2794 act.setObjectName("{0}@@{1}".format(toolGroup[0],
2793 tool['menutext'])) 2795 tool['menutext']))
2794 act.triggered[()].connect(self.__toolActionTriggered) 2796 act.triggered.connect(self.__toolActionTriggered)
2795 self.toolGroupActions[act.objectName()] = act 2797 self.toolGroupActions[act.objectName()] = act
2796 2798
2797 self.toolbarManager.addAction(act, category) 2799 self.toolbarManager.addAction(act, category)
2798 2800
2799 def __updateExternalToolsActions(self): 2801 def __updateExternalToolsActions(self):
2817 2819
2818 # step 3: remove all actions not configured any more 2820 # step 3: remove all actions not configured any more
2819 for key in groupActionKeys: 2821 for key in groupActionKeys:
2820 if key not in ckeys: 2822 if key not in ckeys:
2821 self.toolbarManager.removeAction(self.toolGroupActions[key]) 2823 self.toolbarManager.removeAction(self.toolGroupActions[key])
2822 self.toolGroupActions[key].triggered[()].disconnect( 2824 self.toolGroupActions[key].triggered.disconnect(
2823 self.__toolActionTriggered) 2825 self.__toolActionTriggered)
2824 del self.toolGroupActions[key] 2826 del self.toolGroupActions[key]
2825 2827
2826 # step 4: add all newly configured tools 2828 # step 4: add all newly configured tools
2827 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) 2829 category = self.tr("External Tools/{0}").format(toolGroup[0])
2828 for tool in toolGroup[1]: 2830 for tool in toolGroup[1]:
2829 if tool['menutext'] != '--': 2831 if tool['menutext'] != '--':
2830 key = "{0}@@{1}".format(toolGroup[0], tool['menutext']) 2832 key = "{0}@@{1}".format(toolGroup[0], tool['menutext'])
2831 if key not in groupActionKeys: 2833 if key not in groupActionKeys:
2832 act = QAction(UI.PixmapCache.getIcon(tool['icon']), 2834 act = QAction(UI.PixmapCache.getIcon(tool['icon']),
2833 tool['menutext'], self) 2835 tool['menutext'], self)
2834 act.setObjectName(key) 2836 act.setObjectName(key)
2835 act.triggered[()].connect(self.__toolActionTriggered) 2837 act.triggered.connect(self.__toolActionTriggered)
2836 self.toolGroupActions[key] = act 2838 self.toolGroupActions[key] = act
2837 2839
2838 self.toolbarManager.addAction(act, category) 2840 self.toolbarManager.addAction(act, category)
2839 2841
2840 def __showFileMenu(self): 2842 def __showFileMenu(self):
2919 import sipconfig 2921 import sipconfig
2920 sip_version_str = sipconfig.Configuration().sip_version_str 2922 sip_version_str = sipconfig.Configuration().sip_version_str
2921 except ImportError: 2923 except ImportError:
2922 sip_version_str = "sip version not available" 2924 sip_version_str = "sip version not available"
2923 2925
2924 versionText = self.trUtf8( 2926 versionText = self.tr(
2925 """<h3>Version Numbers</h3>""" 2927 """<h3>Version Numbers</h3>"""
2926 """<table>""") 2928 """<table>""")
2927 versionText += """<tr><td><b>Python</b></td><td>{0}</td></tr>"""\ 2929 versionText += """<tr><td><b>Python</b></td><td>{0}</td></tr>"""\
2928 .format(sys.version.split()[0]) 2930 .format(sys.version.split()[0])
2929 versionText += """<tr><td><b>Qt</b></td><td>{0}</td></tr>"""\ 2931 versionText += """<tr><td><b>Qt</b></td><td>{0}</td></tr>"""\
2940 .format(qWebKitVersion()) 2942 .format(qWebKitVersion())
2941 except ImportError: 2943 except ImportError:
2942 pass 2944 pass
2943 versionText += """<tr><td><b>{0}</b></td><td>{1}</td></tr>"""\ 2945 versionText += """<tr><td><b>{0}</b></td><td>{1}</td></tr>"""\
2944 .format(Program, Version) 2946 .format(Program, Version)
2945 versionText += self.trUtf8("""</table>""") 2947 versionText += self.tr("""</table>""")
2946 2948
2947 E5MessageBox.about(self, Program, versionText) 2949 E5MessageBox.about(self, Program, versionText)
2948 2950
2949 def __reportBug(self): 2951 def __reportBug(self):
2950 """ 2952 """
2972 else: 2974 else:
2973 if Preferences.getUser("Email") == "" or \ 2975 if Preferences.getUser("Email") == "" or \
2974 Preferences.getUser("MailServer") == "": 2976 Preferences.getUser("MailServer") == "":
2975 E5MessageBox.critical( 2977 E5MessageBox.critical(
2976 self, 2978 self,
2977 self.trUtf8("Report Bug"), 2979 self.tr("Report Bug"),
2978 self.trUtf8( 2980 self.tr(
2979 """Email address or mail server address is empty.""" 2981 """Email address or mail server address is empty."""
2980 """ Please configure your Email settings in the""" 2982 """ Please configure your Email settings in the"""
2981 """ Preferences Dialog.""")) 2983 """ Preferences Dialog."""))
2982 self.showPreferences("emailPage") 2984 self.showPreferences("emailPage")
2983 return 2985 return
3245 """ 3247 """
3246 Private method to restart the application. 3248 Private method to restart the application.
3247 """ 3249 """
3248 res = E5MessageBox.yesNo( 3250 res = E5MessageBox.yesNo(
3249 self, 3251 self,
3250 self.trUtf8("Restart application"), 3252 self.tr("Restart application"),
3251 self.trUtf8( 3253 self.tr(
3252 """The application needs to be restarted. Do it now?"""), 3254 """The application needs to be restarted. Do it now?"""),
3253 yesDefault=True) 3255 yesDefault=True)
3254 3256
3255 if res and self.__shutdown(): 3257 if res and self.__shutdown():
3256 e5App().closeAllWindows() 3258 e5App().closeAllWindows()
3278 """ 3280 """
3279 self.__menus["tools"].clear() 3281 self.__menus["tools"].clear()
3280 3282
3281 self.__menus["tools"].addMenu(self.toolGroupsMenu) 3283 self.__menus["tools"].addMenu(self.toolGroupsMenu)
3282 act = self.__menus["tools"].addAction( 3284 act = self.__menus["tools"].addAction(
3283 self.trUtf8("Configure Tool Groups ..."), 3285 self.tr("Configure Tool Groups ..."),
3284 self.__toolGroupsConfiguration) 3286 self.__toolGroupsConfiguration)
3285 act.setData(-1) 3287 act.setData(-1)
3286 act = self.__menus["tools"].addAction( 3288 act = self.__menus["tools"].addAction(
3287 self.trUtf8("Configure current Tool Group ..."), 3289 self.tr("Configure current Tool Group ..."),
3288 self.__toolsConfiguration) 3290 self.__toolsConfiguration)
3289 act.setData(-2) 3291 act.setData(-2)
3290 self.__menus["tools"].addSeparator() 3292 self.__menus["tools"].addSeparator()
3291 3293
3292 if self.currentToolGroup == -1: 3294 if self.currentToolGroup == -1:
3331 Private slot to display the Tool Groups menu. 3333 Private slot to display the Tool Groups menu.
3332 """ 3334 """
3333 self.toolGroupsMenu.clear() 3335 self.toolGroupsMenu.clear()
3334 3336
3335 # add the default entry 3337 # add the default entry
3336 act = self.toolGroupsMenu.addAction(self.trUtf8("&Builtin Tools")) 3338 act = self.toolGroupsMenu.addAction(self.tr("&Builtin Tools"))
3337 act.setData(-1) 3339 act.setData(-1)
3338 if self.currentToolGroup == -1: 3340 if self.currentToolGroup == -1:
3339 font = act.font() 3341 font = act.font()
3340 font.setBold(True) 3342 font.setBold(True)
3341 act.setFont(font) 3343 act.setFont(font)
3342 3344
3343 # add the plugins entry 3345 # add the plugins entry
3344 act = self.toolGroupsMenu.addAction(self.trUtf8("&Plugin Tools")) 3346 act = self.toolGroupsMenu.addAction(self.tr("&Plugin Tools"))
3345 act.setData(-2) 3347 act.setData(-2)
3346 if self.currentToolGroup == -2: 3348 if self.currentToolGroup == -2:
3347 font = act.font() 3349 font = act.font()
3348 font.setBold(True) 3350 font.setBold(True)
3349 act.setFont(font) 3351 act.setFont(font)
3429 act.setCheckable(True) 3431 act.setCheckable(True)
3430 act.setData(name) 3432 act.setData(name)
3431 act.setChecked(not tb.isHidden()) 3433 act.setChecked(not tb.isHidden())
3432 self.__menus["toolbars"].addSeparator() 3434 self.__menus["toolbars"].addSeparator()
3433 self.__toolbarsShowAllAct = \ 3435 self.__toolbarsShowAllAct = \
3434 self.__menus["toolbars"].addAction(self.trUtf8("&Show all")) 3436 self.__menus["toolbars"].addAction(self.tr("&Show all"))
3435 self.__toolbarsHideAllAct = \ 3437 self.__toolbarsHideAllAct = \
3436 self.__menus["toolbars"].addAction(self.trUtf8("&Hide all")) 3438 self.__menus["toolbars"].addAction(self.tr("&Hide all"))
3437 3439
3438 def __TBMenuTriggered(self, act): 3440 def __TBMenuTriggered(self, act):
3439 """ 3441 """
3440 Private method to handle the toggle of a toolbar. 3442 Private method to handle the toggle of a toolbar.
3441 3443
3598 self.bottomSidebar.setCurrentWidget(self.__currentBottomWidget) 3600 self.bottomSidebar.setCurrentWidget(self.__currentBottomWidget)
3599 self.__currentRightWidget = None 3601 self.__currentRightWidget = None
3600 self.__currentBottomWidget = None 3602 self.__currentBottomWidget = None
3601 self.__activateViewmanager() 3603 self.__activateViewmanager()
3602 3604
3605 @pyqtSlot()
3603 def __setEditProfile(self, save=True): 3606 def __setEditProfile(self, save=True):
3604 """ 3607 """
3605 Private slot to activate the edit view profile. 3608 Private slot to activate the edit view profile.
3606 3609
3607 @param save flag indicating that the current profile should 3610 @param save flag indicating that the current profile should
3608 be saved (boolean) 3611 be saved (boolean)
3609 """ 3612 """
3610 self.__activateViewProfile("edit", save) 3613 self.__activateViewProfile("edit", save)
3611 self.setEditProfileAct.setChecked(True) 3614 self.setEditProfileAct.setChecked(True)
3612 3615
3616 @pyqtSlot()
3613 def setDebugProfile(self, save=True): 3617 def setDebugProfile(self, save=True):
3614 """ 3618 """
3615 Public slot to activate the debug view profile. 3619 Public slot to activate the debug view profile.
3616 3620
3617 @param save flag indicating that the current profile should 3621 @param save flag indicating that the current profile should
3974 Private slot for displaying the unittest dialog. 3978 Private slot for displaying the unittest dialog.
3975 """ 3979 """
3976 self.__createUnitTestDialog() 3980 self.__createUnitTestDialog()
3977 self.unittestDialog.show() 3981 self.unittestDialog.show()
3978 self.unittestDialog.raise_() 3982 self.unittestDialog.raise_()
3979 3983
3984 @pyqtSlot()
3985 @pyqtSlot(str)
3980 def __unittestScript(self, prog=None): 3986 def __unittestScript(self, prog=None):
3981 """ 3987 """
3982 Private slot for displaying the unittest dialog and run the current 3988 Private slot for displaying the unittest dialog and run the current
3983 script. 3989 script.
3984 3990
4013 else: 4019 else:
4014 prog = fn 4020 prog = fn
4015 else: 4021 else:
4016 E5MessageBox.critical( 4022 E5MessageBox.critical(
4017 self, 4023 self,
4018 self.trUtf8("Unittest Project"), 4024 self.tr("Unittest Project"),
4019 self.trUtf8( 4025 self.tr(
4020 "There is no main script defined for the" 4026 "There is no main script defined for the"
4021 " current project. Aborting")) 4027 " current project. Aborting"))
4022 return 4028 return
4023 4029
4024 self.__createUnitTestDialog() 4030 self.__createUnitTestDialog()
4076 pass 4082 pass
4077 4083
4078 if version == 3: 4084 if version == 3:
4079 E5MessageBox.information( 4085 E5MessageBox.information(
4080 self, 4086 self,
4081 self.trUtf8("Qt 3 support"), 4087 self.tr("Qt 3 support"),
4082 self.trUtf8("""Qt v.3 is not supported by eric5.""")) 4088 self.tr("""Qt v.3 is not supported by eric5."""))
4083 return 4089 return
4084 4090
4085 args = [] 4091 args = []
4086 if fn is not None: 4092 if fn is not None:
4087 try: 4093 try:
4088 if os.path.isfile(fn) and os.path.getsize(fn): 4094 if os.path.isfile(fn) and os.path.getsize(fn):
4089 args.append(fn) 4095 args.append(fn)
4090 else: 4096 else:
4091 E5MessageBox.critical( 4097 E5MessageBox.critical(
4092 self, 4098 self,
4093 self.trUtf8('Problem'), 4099 self.tr('Problem'),
4094 self.trUtf8( 4100 self.tr(
4095 '<p>The file <b>{0}</b> does not exist or' 4101 '<p>The file <b>{0}</b> does not exist or'
4096 ' is zero length.</p>') 4102 ' is zero length.</p>')
4097 .format(fn)) 4103 .format(fn))
4098 return 4104 return
4099 except EnvironmentError: 4105 except EnvironmentError:
4100 E5MessageBox.critical( 4106 E5MessageBox.critical(
4101 self, 4107 self,
4102 self.trUtf8('Problem'), 4108 self.tr('Problem'),
4103 self.trUtf8( 4109 self.tr(
4104 '<p>The file <b>{0}</b> does not exist or' 4110 '<p>The file <b>{0}</b> does not exist or'
4105 ' is zero length.</p>') 4111 ' is zero length.</p>')
4106 .format(fn)) 4112 .format(fn))
4107 return 4113 return
4108 4114
4119 4125
4120 proc = QProcess() 4126 proc = QProcess()
4121 if not proc.startDetached(designer, args): 4127 if not proc.startDetached(designer, args):
4122 E5MessageBox.critical( 4128 E5MessageBox.critical(
4123 self, 4129 self,
4124 self.trUtf8('Process Generation Error'), 4130 self.tr('Process Generation Error'),
4125 self.trUtf8( 4131 self.tr(
4126 '<p>Could not start Qt-Designer.<br>' 4132 '<p>Could not start Qt-Designer.<br>'
4127 'Ensure that it is available as <b>{0}</b>.</p>' 4133 'Ensure that it is available as <b>{0}</b>.</p>'
4128 ).format(designer)) 4134 ).format(designer))
4129 4135
4130 def __designer4(self): 4136 def __designer4(self):
4141 @param version indication for the requested version (Qt 4) (integer) 4147 @param version indication for the requested version (Qt 4) (integer)
4142 """ 4148 """
4143 if version < 4: 4149 if version < 4:
4144 E5MessageBox.information( 4150 E5MessageBox.information(
4145 self, 4151 self,
4146 self.trUtf8("Qt 3 support"), 4152 self.tr("Qt 3 support"),
4147 self.trUtf8("""Qt v.3 is not supported by eric5.""")) 4153 self.tr("""Qt v.3 is not supported by eric5."""))
4148 return 4154 return
4149 4155
4150 args = [] 4156 args = []
4151 if fn is not None: 4157 if fn is not None:
4152 fn = fn.replace('.qm', '.ts') 4158 fn = fn.replace('.qm', '.ts')
4155 fn not in args: 4161 fn not in args:
4156 args.append(fn) 4162 args.append(fn)
4157 else: 4163 else:
4158 E5MessageBox.critical( 4164 E5MessageBox.critical(
4159 self, 4165 self,
4160 self.trUtf8('Problem'), 4166 self.tr('Problem'),
4161 self.trUtf8( 4167 self.tr(
4162 '<p>The file <b>{0}</b> does not exist or' 4168 '<p>The file <b>{0}</b> does not exist or'
4163 ' is zero length.</p>') 4169 ' is zero length.</p>')
4164 .format(fn)) 4170 .format(fn))
4165 return 4171 return
4166 except EnvironmentError: 4172 except EnvironmentError:
4167 E5MessageBox.critical( 4173 E5MessageBox.critical(
4168 self, 4174 self,
4169 self.trUtf8('Problem'), 4175 self.tr('Problem'),
4170 self.trUtf8( 4176 self.tr(
4171 '<p>The file <b>{0}</b> does not exist or' 4177 '<p>The file <b>{0}</b> does not exist or'
4172 ' is zero length.</p>') 4178 ' is zero length.</p>')
4173 .format(fn)) 4179 .format(fn))
4174 return 4180 return
4175 4181
4186 4192
4187 proc = QProcess() 4193 proc = QProcess()
4188 if not proc.startDetached(linguist, args): 4194 if not proc.startDetached(linguist, args):
4189 E5MessageBox.critical( 4195 E5MessageBox.critical(
4190 self, 4196 self,
4191 self.trUtf8('Process Generation Error'), 4197 self.tr('Process Generation Error'),
4192 self.trUtf8( 4198 self.tr(
4193 '<p>Could not start Qt-Linguist.<br>' 4199 '<p>Could not start Qt-Linguist.<br>'
4194 'Ensure that it is available as <b>{0}</b>.</p>' 4200 'Ensure that it is available as <b>{0}</b>.</p>'
4195 ).format(linguist)) 4201 ).format(linguist))
4196 4202
4203 @pyqtSlot()
4204 @pyqtSlot(str)
4197 def __linguist4(self, fn=None): 4205 def __linguist4(self, fn=None):
4198 """ 4206 """
4199 Private slot to start the Qt-Linguist 4 executable. 4207 Private slot to start the Qt-Linguist 4 executable.
4200 4208
4201 @param fn filename of the translation file to be opened 4209 @param fn filename of the translation file to be opened
4210 @param version indication for the requested version (Qt 4) (integer) 4218 @param version indication for the requested version (Qt 4) (integer)
4211 """ 4219 """
4212 if version < 4: 4220 if version < 4:
4213 E5MessageBox.information( 4221 E5MessageBox.information(
4214 self, 4222 self,
4215 self.trUtf8("Qt 3 support"), 4223 self.tr("Qt 3 support"),
4216 self.trUtf8("""Qt v.3 is not supported by eric5.""")) 4224 self.tr("""Qt v.3 is not supported by eric5."""))
4217 return 4225 return
4218 4226
4219 args = [] 4227 args = []
4220 if home: 4228 if home:
4221 if version == 4: 4229 if version == 4:
4235 4243
4236 proc = QProcess() 4244 proc = QProcess()
4237 if not proc.startDetached(assistant, args): 4245 if not proc.startDetached(assistant, args):
4238 E5MessageBox.critical( 4246 E5MessageBox.critical(
4239 self, 4247 self,
4240 self.trUtf8('Process Generation Error'), 4248 self.tr('Process Generation Error'),
4241 self.trUtf8( 4249 self.tr(
4242 '<p>Could not start Qt-Assistant.<br>' 4250 '<p>Could not start Qt-Assistant.<br>'
4243 'Ensure that it is available as <b>{0}</b>.</p>' 4251 'Ensure that it is available as <b>{0}</b>.</p>'
4244 ).format(assistant)) 4252 ).format(assistant))
4245 4253
4246 def __assistant4(self): 4254 def __assistant4(self):
4263 """ 4271 """
4264 customViewer = Preferences.getHelp("CustomViewer") 4272 customViewer = Preferences.getHelp("CustomViewer")
4265 if not customViewer: 4273 if not customViewer:
4266 E5MessageBox.information( 4274 E5MessageBox.information(
4267 self, 4275 self,
4268 self.trUtf8("Help"), 4276 self.tr("Help"),
4269 self.trUtf8( 4277 self.tr(
4270 """Currently no custom viewer is selected.""" 4278 """Currently no custom viewer is selected."""
4271 """ Please use the preferences dialog to specify one.""")) 4279 """ Please use the preferences dialog to specify one."""))
4272 return 4280 return
4273 4281
4274 proc = QProcess() 4282 proc = QProcess()
4277 args.append(home) 4285 args.append(home)
4278 4286
4279 if not proc.startDetached(customViewer, args): 4287 if not proc.startDetached(customViewer, args):
4280 E5MessageBox.critical( 4288 E5MessageBox.critical(
4281 self, 4289 self,
4282 self.trUtf8('Process Generation Error'), 4290 self.tr('Process Generation Error'),
4283 self.trUtf8( 4291 self.tr(
4284 '<p>Could not start custom viewer.<br>' 4292 '<p>Could not start custom viewer.<br>'
4285 'Ensure that it is available as <b>{0}</b>.</p>' 4293 'Ensure that it is available as <b>{0}</b>.</p>'
4286 ).format(customViewer)) 4294 ).format(customViewer))
4287 4295
4288 def __chmViewer(self, home=None): 4296 def __chmViewer(self, home=None):
4297 args.append(home) 4305 args.append(home)
4298 4306
4299 if not proc.startDetached("hh", args): 4307 if not proc.startDetached("hh", args):
4300 E5MessageBox.critical( 4308 E5MessageBox.critical(
4301 self, 4309 self,
4302 self.trUtf8('Process Generation Error'), 4310 self.tr('Process Generation Error'),
4303 self.trUtf8( 4311 self.tr(
4304 '<p>Could not start the help viewer.<br>' 4312 '<p>Could not start the help viewer.<br>'
4305 'Ensure that it is available as <b>hh</b>.</p>' 4313 'Ensure that it is available as <b>hh</b>.</p>'
4306 )) 4314 ))
4307 4315
4316 @pyqtSlot()
4317 @pyqtSlot(str)
4308 def __UIPreviewer(self, fn=None): 4318 def __UIPreviewer(self, fn=None):
4309 """ 4319 """
4310 Private slot to start the UI Previewer executable. 4320 Private slot to start the UI Previewer executable.
4311 4321
4312 @param fn filename of the form to be previewed (string) 4322 @param fn filename of the form to be previewed (string)
4323 if os.path.isfile(fn) and os.path.getsize(fn): 4333 if os.path.isfile(fn) and os.path.getsize(fn):
4324 args.append(fn) 4334 args.append(fn)
4325 else: 4335 else:
4326 E5MessageBox.critical( 4336 E5MessageBox.critical(
4327 self, 4337 self,
4328 self.trUtf8('Problem'), 4338 self.tr('Problem'),
4329 self.trUtf8( 4339 self.tr(
4330 '<p>The file <b>{0}</b> does not exist or' 4340 '<p>The file <b>{0}</b> does not exist or'
4331 ' is zero length.</p>') 4341 ' is zero length.</p>')
4332 .format(fn)) 4342 .format(fn))
4333 return 4343 return
4334 except EnvironmentError: 4344 except EnvironmentError:
4335 E5MessageBox.critical( 4345 E5MessageBox.critical(
4336 self, 4346 self,
4337 self.trUtf8('Problem'), 4347 self.tr('Problem'),
4338 self.trUtf8( 4348 self.tr(
4339 '<p>The file <b>{0}</b> does not exist or' 4349 '<p>The file <b>{0}</b> does not exist or'
4340 ' is zero length.</p>') 4350 ' is zero length.</p>')
4341 .format(fn)) 4351 .format(fn))
4342 return 4352 return
4343 4353
4344 if not os.path.isfile(viewer) or \ 4354 if not os.path.isfile(viewer) or \
4345 not proc.startDetached(sys.executable, args): 4355 not proc.startDetached(sys.executable, args):
4346 E5MessageBox.critical( 4356 E5MessageBox.critical(
4347 self, 4357 self,
4348 self.trUtf8('Process Generation Error'), 4358 self.tr('Process Generation Error'),
4349 self.trUtf8( 4359 self.tr(
4350 '<p>Could not start UI Previewer.<br>' 4360 '<p>Could not start UI Previewer.<br>'
4351 'Ensure that it is available as <b>{0}</b>.</p>' 4361 'Ensure that it is available as <b>{0}</b>.</p>'
4352 ).format(viewer)) 4362 ).format(viewer))
4353 4363
4364 @pyqtSlot()
4365 @pyqtSlot(str)
4366 @pyqtSlot(str, bool)
4354 def __TRPreviewer(self, fileNames=None, ignore=False): 4367 def __TRPreviewer(self, fileNames=None, ignore=False):
4355 """ 4368 """
4356 Private slot to start the Translation Previewer executable. 4369 Private slot to start the Translation Previewer executable.
4357 4370
4358 @param fileNames filenames of forms and/or translations to be previewed 4371 @param fileNames filenames of forms and/or translations to be previewed
4374 args.append(fn) 4387 args.append(fn)
4375 else: 4388 else:
4376 if not ignore: 4389 if not ignore:
4377 E5MessageBox.critical( 4390 E5MessageBox.critical(
4378 self, 4391 self,
4379 self.trUtf8('Problem'), 4392 self.tr('Problem'),
4380 self.trUtf8( 4393 self.tr(
4381 '<p>The file <b>{0}</b> does not exist or' 4394 '<p>The file <b>{0}</b> does not exist or'
4382 ' is zero length.</p>') 4395 ' is zero length.</p>')
4383 .format(fn)) 4396 .format(fn))
4384 return 4397 return
4385 except EnvironmentError: 4398 except EnvironmentError:
4386 if not ignore: 4399 if not ignore:
4387 E5MessageBox.critical( 4400 E5MessageBox.critical(
4388 self, 4401 self,
4389 self.trUtf8('Problem'), 4402 self.tr('Problem'),
4390 self.trUtf8( 4403 self.tr(
4391 '<p>The file <b>{0}</b> does not exist or' 4404 '<p>The file <b>{0}</b> does not exist or'
4392 ' is zero length.</p>') 4405 ' is zero length.</p>')
4393 .format(fn)) 4406 .format(fn))
4394 return 4407 return
4395 4408
4396 if not os.path.isfile(viewer) or \ 4409 if not os.path.isfile(viewer) or \
4397 not proc.startDetached(sys.executable, args): 4410 not proc.startDetached(sys.executable, args):
4398 E5MessageBox.critical( 4411 E5MessageBox.critical(
4399 self, 4412 self,
4400 self.trUtf8('Process Generation Error'), 4413 self.tr('Process Generation Error'),
4401 self.trUtf8( 4414 self.tr(
4402 '<p>Could not start Translation Previewer.<br>' 4415 '<p>Could not start Translation Previewer.<br>'
4403 'Ensure that it is available as <b>{0}</b>.</p>' 4416 'Ensure that it is available as <b>{0}</b>.</p>'
4404 ).format(viewer)) 4417 ).format(viewer))
4405 4418
4406 def __sqlBrowser(self): 4419 def __sqlBrowser(self):
4416 4429
4417 if not os.path.isfile(browser) or \ 4430 if not os.path.isfile(browser) or \
4418 not proc.startDetached(sys.executable, args): 4431 not proc.startDetached(sys.executable, args):
4419 E5MessageBox.critical( 4432 E5MessageBox.critical(
4420 self, 4433 self,
4421 self.trUtf8('Process Generation Error'), 4434 self.tr('Process Generation Error'),
4422 self.trUtf8( 4435 self.tr(
4423 '<p>Could not start SQL Browser.<br>' 4436 '<p>Could not start SQL Browser.<br>'
4424 'Ensure that it is available as <b>{0}</b>.</p>' 4437 'Ensure that it is available as <b>{0}</b>.</p>'
4425 ).format(browser)) 4438 ).format(browser))
4426 4439
4440 @pyqtSlot()
4441 @pyqtSlot(str)
4427 def __editPixmap(self, fn=""): 4442 def __editPixmap(self, fn=""):
4428 """ 4443 """
4429 Private slot to show a pixmap in a dialog. 4444 Private slot to show a pixmap in a dialog.
4430 4445
4431 @param fn filename of the file to show (string) 4446 @param fn filename of the file to show (string)
4432 """ 4447 """
4433 from IconEditor.IconEditorWindow import IconEditorWindow 4448 from IconEditor.IconEditorWindow import IconEditorWindow
4434 dlg = IconEditorWindow(fn, self, fromEric=True, project=self.project) 4449 dlg = IconEditorWindow(fn, self, fromEric=True, project=self.project)
4435 dlg.show() 4450 dlg.show()
4436 4451
4452 @pyqtSlot()
4453 @pyqtSlot(str)
4437 def __showPixmap(self, fn): 4454 def __showPixmap(self, fn):
4438 """ 4455 """
4439 Private slot to show a pixmap in a dialog. 4456 Private slot to show a pixmap in a dialog.
4440 4457
4441 @param fn filename of the file to show (string) 4458 @param fn filename of the file to show (string)
4443 from Graphics.PixmapDiagram import PixmapDiagram 4460 from Graphics.PixmapDiagram import PixmapDiagram
4444 dlg = PixmapDiagram(fn, self) 4461 dlg = PixmapDiagram(fn, self)
4445 if dlg.getStatus(): 4462 if dlg.getStatus():
4446 dlg.show() 4463 dlg.show()
4447 4464
4465 @pyqtSlot()
4466 @pyqtSlot(str)
4448 def __showSvg(self, fn): 4467 def __showSvg(self, fn):
4449 """ 4468 """
4450 Private slot to show a SVG file in a dialog. 4469 Private slot to show a SVG file in a dialog.
4451 4470
4452 @param fn filename of the file to show (string) 4471 @param fn filename of the file to show (string)
4468 4487
4469 if not os.path.isfile(snap) or \ 4488 if not os.path.isfile(snap) or \
4470 not proc.startDetached(sys.executable, args): 4489 not proc.startDetached(sys.executable, args):
4471 E5MessageBox.critical( 4490 E5MessageBox.critical(
4472 self, 4491 self,
4473 self.trUtf8('Process Generation Error'), 4492 self.tr('Process Generation Error'),
4474 self.trUtf8( 4493 self.tr(
4475 '<p>Could not start Snapshot tool.<br>' 4494 '<p>Could not start Snapshot tool.<br>'
4476 'Ensure that it is available as <b>{0}</b>.</p>' 4495 'Ensure that it is available as <b>{0}</b>.</p>'
4477 ).format(snap)) 4496 ).format(snap))
4478 4497
4479 def __toolActionTriggered(self): 4498 def __toolActionTriggered(self):
4489 self.__startToolProcess(tool) 4508 self.__startToolProcess(tool)
4490 return 4509 return
4491 4510
4492 E5MessageBox.information( 4511 E5MessageBox.information(
4493 self, 4512 self,
4494 self.trUtf8("External Tools"), 4513 self.tr("External Tools"),
4495 self.trUtf8( 4514 self.tr(
4496 """No tool entry found for external tool '{0}' """ 4515 """No tool entry found for external tool '{0}' """
4497 """in tool group '{1}'.""") 4516 """in tool group '{1}'.""")
4498 .format(toolMenuText, toolGroupName)) 4517 .format(toolMenuText, toolGroupName))
4499 return 4518 return
4500 4519
4501 E5MessageBox.information( 4520 E5MessageBox.information(
4502 self, 4521 self,
4503 self.trUtf8("External Tools"), 4522 self.tr("External Tools"),
4504 self.trUtf8("""No toolgroup entry '{0}' found.""") 4523 self.tr("""No toolgroup entry '{0}' found.""")
4505 .format(toolGroupName) 4524 .format(toolGroupName)
4506 ) 4525 )
4507 4526
4508 def __toolExecute(self, act): 4527 def __toolExecute(self, act):
4509 """ 4528 """
4535 procData = (None,) 4554 procData = (None,)
4536 program = tool['executable'] 4555 program = tool['executable']
4537 args = [] 4556 args = []
4538 argv = Utilities.parseOptionString(tool['arguments']) 4557 argv = Utilities.parseOptionString(tool['arguments'])
4539 args.extend(argv) 4558 args.extend(argv)
4540 t = self.trUtf8("Starting process '{0} {1}'.\n")\ 4559 t = self.tr("Starting process '{0} {1}'.\n")\
4541 .format(program, tool['arguments']) 4560 .format(program, tool['arguments'])
4542 self.appendToStdout(t) 4561 self.appendToStdout(t)
4543 4562
4544 proc.finished.connect(self.__toolFinished) 4563 proc.finished.connect(self.__toolFinished)
4545 if tool['redirect'] != 'no': 4564 if tool['redirect'] != 'no':
4553 4572
4554 proc.start(program, args) 4573 proc.start(program, args)
4555 if not proc.waitForStarted(): 4574 if not proc.waitForStarted():
4556 E5MessageBox.critical( 4575 E5MessageBox.critical(
4557 self, 4576 self,
4558 self.trUtf8('Process Generation Error'), 4577 self.tr('Process Generation Error'),
4559 self.trUtf8( 4578 self.tr(
4560 '<p>Could not start the tool entry <b>{0}</b>.<br>' 4579 '<p>Could not start the tool entry <b>{0}</b>.<br>'
4561 'Ensure that it is available as <b>{1}</b>.</p>') 4580 'Ensure that it is available as <b>{1}</b>.</p>')
4562 .format(tool['menutext'], tool['executable'])) 4581 .format(tool['menutext'], tool['executable']))
4563 else: 4582 else:
4564 self.toolProcs.append((program, proc, procData)) 4583 self.toolProcs.append((program, proc, procData))
4627 toolProcData[0].endUndoAction() 4646 toolProcData[0].endUndoAction()
4628 4647
4629 # now delete the exited procs from the list of running processes 4648 # now delete the exited procs from the list of running processes
4630 for proc in exitedProcs: 4649 for proc in exitedProcs:
4631 self.toolProcs.remove(proc) 4650 self.toolProcs.remove(proc)
4632 t = self.trUtf8("Process '{0}' has exited.\n").format(proc[0]) 4651 t = self.tr("Process '{0}' has exited.\n").format(proc[0])
4633 self.appendToStdout(t) 4652 self.appendToStdout(t)
4634 4653
4635 def __showPythonDoc(self): 4654 def __showPythonDoc(self):
4636 """ 4655 """
4637 Private slot to show the Python 3 documentation. 4656 Private slot to show the Python 3 documentation.
4663 home = pythonDocDir 4682 home = pythonDocDir
4664 4683
4665 if not os.path.exists(home): 4684 if not os.path.exists(home):
4666 E5MessageBox.warning( 4685 E5MessageBox.warning(
4667 self, 4686 self,
4668 self.trUtf8("Documentation Missing"), 4687 self.tr("Documentation Missing"),
4669 self.trUtf8("""<p>The documentation starting point""" 4688 self.tr("""<p>The documentation starting point"""
4670 """ "<b>{0}</b>" could not be found.</p>""") 4689 """ "<b>{0}</b>" could not be found.</p>""")
4671 .format(home)) 4690 .format(home))
4672 return 4691 return
4673 4692
4674 if not home.endswith(".chm"): 4693 if not home.endswith(".chm"):
4675 if Utilities.isWindowsPlatform(): 4694 if Utilities.isWindowsPlatform():
4720 home = pythonDocDir 4739 home = pythonDocDir
4721 4740
4722 if not os.path.exists(home): 4741 if not os.path.exists(home):
4723 E5MessageBox.warning( 4742 E5MessageBox.warning(
4724 self, 4743 self,
4725 self.trUtf8("Documentation Missing"), 4744 self.tr("Documentation Missing"),
4726 self.trUtf8("""<p>The documentation starting point""" 4745 self.tr("""<p>The documentation starting point"""
4727 """ "<b>{0}</b>" could not be found.</p>""") 4746 """ "<b>{0}</b>" could not be found.</p>""")
4728 .format(home)) 4747 .format(home))
4729 return 4748 return
4730 4749
4731 if not home.endswith(".chm"): 4750 if not home.endswith(".chm"):
4732 if Utilities.isWindowsPlatform(): 4751 if Utilities.isWindowsPlatform():
4789 home = qtDocDir 4808 home = qtDocDir
4790 4809
4791 if not os.path.exists(home): 4810 if not os.path.exists(home):
4792 E5MessageBox.warning( 4811 E5MessageBox.warning(
4793 self, 4812 self,
4794 self.trUtf8("Documentation Missing"), 4813 self.tr("Documentation Missing"),
4795 self.trUtf8("""<p>The documentation starting point""" 4814 self.tr("""<p>The documentation starting point"""
4796 """ "<b>{0}</b>" could not be found.</p>""") 4815 """ "<b>{0}</b>" could not be found.</p>""")
4797 .format(home)) 4816 .format(home))
4798 return 4817 return
4799 4818
4800 if Utilities.isWindowsPlatform(): 4819 if Utilities.isWindowsPlatform():
4801 home = "file:///" + Utilities.fromNativeSeparators(home) 4820 home = "file:///" + Utilities.fromNativeSeparators(home)
4821 pyqt4DocDir = Utilities.getEnvironmentEntry("PYQT4DOCDIR", None) 4840 pyqt4DocDir = Utilities.getEnvironmentEntry("PYQT4DOCDIR", None)
4822 4841
4823 if not pyqt4DocDir: 4842 if not pyqt4DocDir:
4824 E5MessageBox.warning( 4843 E5MessageBox.warning(
4825 self, 4844 self,
4826 self.trUtf8("Documentation"), 4845 self.tr("Documentation"),
4827 self.trUtf8("""<p>The PyQt4 documentation starting point""" 4846 self.tr("""<p>The PyQt4 documentation starting point"""
4828 """ has not been configured.</p>""")) 4847 """ has not been configured.</p>"""))
4829 return 4848 return
4830 4849
4831 if not pyqt4DocDir.startswith("http://") and \ 4850 if not pyqt4DocDir.startswith("http://") and \
4832 not pyqt4DocDir.startswith("https://"): 4851 not pyqt4DocDir.startswith("https://"):
4833 home = "" 4852 home = ""
4847 home = pyqt4DocDir 4866 home = pyqt4DocDir
4848 4867
4849 if not home or not os.path.exists(home): 4868 if not home or not os.path.exists(home):
4850 E5MessageBox.warning( 4869 E5MessageBox.warning(
4851 self, 4870 self,
4852 self.trUtf8("Documentation Missing"), 4871 self.tr("Documentation Missing"),
4853 self.trUtf8("""<p>The documentation starting point""" 4872 self.tr("""<p>The documentation starting point"""
4854 """ "<b>{0}</b>" could not be found.</p>""") 4873 """ "<b>{0}</b>" could not be found.</p>""")
4855 .format(home)) 4874 .format(home))
4856 return 4875 return
4857 4876
4858 if Utilities.isWindowsPlatform(): 4877 if Utilities.isWindowsPlatform():
4859 home = "file:///" + Utilities.fromNativeSeparators(home) 4878 home = "file:///" + Utilities.fromNativeSeparators(home)
4881 pyqt5DocDir = Utilities.getEnvironmentEntry("PYQT5DOCDIR", None) 4900 pyqt5DocDir = Utilities.getEnvironmentEntry("PYQT5DOCDIR", None)
4882 4901
4883 if not pyqt5DocDir: 4902 if not pyqt5DocDir:
4884 E5MessageBox.warning( 4903 E5MessageBox.warning(
4885 self, 4904 self,
4886 self.trUtf8("Documentation"), 4905 self.tr("Documentation"),
4887 self.trUtf8("""<p>The PyQt5 documentation starting point""" 4906 self.tr("""<p>The PyQt5 documentation starting point"""
4888 """ has not been configured.</p>""")) 4907 """ has not been configured.</p>"""))
4889 return 4908 return
4890 4909
4891 if not pyqt5DocDir.startswith("http://") and \ 4910 if not pyqt5DocDir.startswith("http://") and \
4892 not pyqt5DocDir.startswith("https://"): 4911 not pyqt5DocDir.startswith("https://"):
4893 home = "" 4912 home = ""
4909 home = pyqt5DocDir 4928 home = pyqt5DocDir
4910 4929
4911 if not home or not os.path.exists(home): 4930 if not home or not os.path.exists(home):
4912 E5MessageBox.warning( 4931 E5MessageBox.warning(
4913 self, 4932 self,
4914 self.trUtf8("Documentation Missing"), 4933 self.tr("Documentation Missing"),
4915 self.trUtf8("""<p>The documentation starting point""" 4934 self.tr("""<p>The documentation starting point"""
4916 """ "<b>{0}</b>" could not be found.</p>""") 4935 """ "<b>{0}</b>" could not be found.</p>""")
4917 .format(home)) 4936 .format(home))
4918 return 4937 return
4919 4938
4920 if Utilities.isWindowsPlatform(): 4939 if Utilities.isWindowsPlatform():
4921 home = "file:///" + Utilities.fromNativeSeparators(home) 4940 home = "file:///" + Utilities.fromNativeSeparators(home)
4945 not home.startswith("https://") and \ 4964 not home.startswith("https://") and \
4946 not home.startswith("qthelp://"): 4965 not home.startswith("qthelp://"):
4947 if not os.path.exists(home): 4966 if not os.path.exists(home):
4948 E5MessageBox.warning( 4967 E5MessageBox.warning(
4949 self, 4968 self,
4950 self.trUtf8("Documentation Missing"), 4969 self.tr("Documentation Missing"),
4951 self.trUtf8("""<p>The documentation starting point""" 4970 self.tr("""<p>The documentation starting point"""
4952 """ "<b>{0}</b>" could not be found.</p>""") 4971 """ "<b>{0}</b>" could not be found.</p>""")
4953 .format(home)) 4972 .format(home))
4954 return 4973 return
4955 4974
4956 if Utilities.isWindowsPlatform(): 4975 if Utilities.isWindowsPlatform():
4957 home = "file:///" + Utilities.fromNativeSeparators(home) 4976 home = "file:///" + Utilities.fromNativeSeparators(home)
4977 pysideDocDir = Utilities.getEnvironmentEntry("PYSIDEDOCDIR", None) 4996 pysideDocDir = Utilities.getEnvironmentEntry("PYSIDEDOCDIR", None)
4978 4997
4979 if not pysideDocDir: 4998 if not pysideDocDir:
4980 E5MessageBox.warning( 4999 E5MessageBox.warning(
4981 self, 5000 self,
4982 self.trUtf8("Documentation"), 5001 self.tr("Documentation"),
4983 self.trUtf8("""<p>The PySide documentation starting point""" 5002 self.tr("""<p>The PySide documentation starting point"""
4984 """ has not been configured.</p>""")) 5003 """ has not been configured.</p>"""))
4985 return 5004 return
4986 5005
4987 if not pysideDocDir.startswith("http://") and \ 5006 if not pysideDocDir.startswith("http://") and \
4988 not pysideDocDir.startswith("https://"): 5007 not pysideDocDir.startswith("https://"):
4989 if pysideDocDir.startswith("file://"): 5008 if pysideDocDir.startswith("file://"):
4993 else: 5012 else:
4994 home = pysideDocDir 5013 home = pysideDocDir
4995 if not os.path.exists(home): 5014 if not os.path.exists(home):
4996 E5MessageBox.warning( 5015 E5MessageBox.warning(
4997 self, 5016 self,
4998 self.trUtf8("Documentation Missing"), 5017 self.tr("Documentation Missing"),
4999 self.trUtf8("""<p>The documentation starting point""" 5018 self.tr("""<p>The documentation starting point"""
5000 """ "<b>{0}</b>" could not be found.</p>""") 5019 """ "<b>{0}</b>" could not be found.</p>""")
5001 .format(home)) 5020 .format(home))
5002 return 5021 return
5003 5022
5004 if Utilities.isWindowsPlatform(): 5023 if Utilities.isWindowsPlatform():
5005 home = "file:///" + Utilities.fromNativeSeparators(home) 5024 home = "file:///" + Utilities.fromNativeSeparators(home)
5086 """ 5105 """
5087 started = QDesktopServices.openUrl(QUrl(home)) 5106 started = QDesktopServices.openUrl(QUrl(home))
5088 if not started: 5107 if not started:
5089 E5MessageBox.critical( 5108 E5MessageBox.critical(
5090 self, 5109 self,
5091 self.trUtf8('Open Browser'), 5110 self.tr('Open Browser'),
5092 self.trUtf8('Could not start a web browser')) 5111 self.tr('Could not start a web browser'))
5093 5112
5094 def getHelpViewer(self, preview=False): 5113 def getHelpViewer(self, preview=False):
5095 """ 5114 """
5096 Public method to get a reference to the help window instance. 5115 Public method to get a reference to the help window instance.
5097 5116
5102 if self.helpWindow is None: 5121 if self.helpWindow is None:
5103 self.launchHelpViewer("", useSingle=True) 5122 self.launchHelpViewer("", useSingle=True)
5104 self.helpWindow.raise_() 5123 self.helpWindow.raise_()
5105 return self.helpWindow 5124 return self.helpWindow
5106 5125
5126 @pyqtSlot()
5127 @pyqtSlot(str)
5107 def showPreferences(self, pageName=None): 5128 def showPreferences(self, pageName=None):
5108 """ 5129 """
5109 Public slot to set the preferences. 5130 Public slot to set the preferences.
5110 5131
5111 @param pageName name of the configuration page to show (string) 5132 @param pageName name of the configuration page to show (string)
5260 """ 5281 """
5261 Private slot to export the keyboard shortcuts. 5282 Private slot to export the keyboard shortcuts.
5262 """ 5283 """
5263 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( 5284 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
5264 None, 5285 None,
5265 self.trUtf8("Export Keyboard Shortcuts"), 5286 self.tr("Export Keyboard Shortcuts"),
5266 "", 5287 "",
5267 self.trUtf8("Keyboard shortcut file (*.e4k)"), 5288 self.tr("Keyboard shortcut file (*.e4k)"),
5268 "", 5289 "",
5269 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) 5290 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
5270 5291
5271 if not fn: 5292 if not fn:
5272 return 5293 return
5284 """ 5305 """
5285 Private slot to import the keyboard shortcuts. 5306 Private slot to import the keyboard shortcuts.
5286 """ 5307 """
5287 fn = E5FileDialog.getOpenFileName( 5308 fn = E5FileDialog.getOpenFileName(
5288 None, 5309 None,
5289 self.trUtf8("Import Keyboard Shortcuts"), 5310 self.tr("Import Keyboard Shortcuts"),
5290 "", 5311 "",
5291 self.trUtf8("Keyboard shortcut file (*.e4k)")) 5312 self.tr("Keyboard shortcut file (*.e4k)"))
5292 5313
5293 if fn: 5314 if fn:
5294 from Preferences import Shortcuts 5315 from Preferences import Shortcuts
5295 Shortcuts.importShortcuts(fn) 5316 Shortcuts.importShortcuts(fn)
5296 5317
5375 cap = dbs.getClientCapabilities(language) 5396 cap = dbs.getClientCapabilities(language)
5376 self.utScriptAct.setEnabled(cap & HasUnittest) 5397 self.utScriptAct.setEnabled(cap & HasUnittest)
5377 self.utEditorOpen = cap & HasUnittest 5398 self.utEditorOpen = cap & HasUnittest
5378 return 5399 return
5379 5400
5380 if self.viewmanager.getOpenEditor(fn).getPyVersion(): 5401 if self.viewmanager.getOpenEditor(fn).isPyFile():
5381 self.utScriptAct.setEnabled(True) 5402 self.utScriptAct.setEnabled(True)
5382 self.utEditorOpen = True 5403 self.utEditorOpen = True
5383 5404
5384 def __checkActions(self, editor): 5405 def __checkActions(self, editor):
5385 """ 5406 """
5401 cap = dbs.getClientCapabilities(language) 5422 cap = dbs.getClientCapabilities(language)
5402 self.utScriptAct.setEnabled(cap & HasUnittest) 5423 self.utScriptAct.setEnabled(cap & HasUnittest)
5403 self.utEditorOpen = cap & HasUnittest 5424 self.utEditorOpen = cap & HasUnittest
5404 return 5425 return
5405 5426
5406 if editor.getPyVersion(): 5427 if editor.isPyFile():
5407 self.utScriptAct.setEnabled(True) 5428 self.utScriptAct.setEnabled(True)
5408 self.utEditorOpen = True 5429 self.utEditorOpen = True
5409 return 5430 return
5410 5431
5411 self.utScriptAct.setEnabled(False) 5432 self.utScriptAct.setEnabled(False)
5418 f = QFile(fn) 5439 f = QFile(fn)
5419 ok = f.open(QIODevice.WriteOnly) 5440 ok = f.open(QIODevice.WriteOnly)
5420 if not ok: 5441 if not ok:
5421 E5MessageBox.critical( 5442 E5MessageBox.critical(
5422 self, 5443 self,
5423 self.trUtf8("Save tasks"), 5444 self.tr("Save tasks"),
5424 self.trUtf8( 5445 self.tr(
5425 "<p>The tasks file <b>{0}</b> could not be written.</p>") 5446 "<p>The tasks file <b>{0}</b> could not be written.</p>")
5426 .format(fn)) 5447 .format(fn))
5427 return 5448 return
5428 5449
5429 from E5XML.TasksWriter import TasksWriter 5450 from E5XML.TasksWriter import TasksWriter
5444 reader.readXML() 5465 reader.readXML()
5445 f.close() 5466 f.close()
5446 else: 5467 else:
5447 E5MessageBox.critical( 5468 E5MessageBox.critical(
5448 self, 5469 self,
5449 self.trUtf8("Read tasks"), 5470 self.tr("Read tasks"),
5450 self.trUtf8( 5471 self.tr(
5451 "<p>The tasks file <b>{0}</b> could not be read.</p>") 5472 "<p>The tasks file <b>{0}</b> could not be read.</p>")
5452 .format(fn)) 5473 .format(fn))
5453 5474
5454 def __writeSession(self): 5475 def __writeSession(self):
5455 """ 5476 """
5462 SessionWriter(f, None).writeXML() 5483 SessionWriter(f, None).writeXML()
5463 f.close() 5484 f.close()
5464 else: 5485 else:
5465 E5MessageBox.critical( 5486 E5MessageBox.critical(
5466 self, 5487 self,
5467 self.trUtf8("Save session"), 5488 self.tr("Save session"),
5468 self.trUtf8( 5489 self.tr(
5469 "<p>The session file <b>{0}</b> could not be written.</p>") 5490 "<p>The session file <b>{0}</b> could not be written.</p>")
5470 .format(fn)) 5491 .format(fn))
5471 5492
5472 def __readSession(self): 5493 def __readSession(self):
5473 """ 5494 """
5475 """ 5496 """
5476 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") 5497 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s")
5477 if not os.path.exists(fn): 5498 if not os.path.exists(fn):
5478 E5MessageBox.critical( 5499 E5MessageBox.critical(
5479 self, 5500 self,
5480 self.trUtf8("Read session"), 5501 self.tr("Read session"),
5481 self.trUtf8( 5502 self.tr(
5482 "<p>The session file <b>{0}</b> could not be read.</p>") 5503 "<p>The session file <b>{0}</b> could not be read.</p>")
5483 .format(fn)) 5504 .format(fn))
5484 return 5505 return
5485 5506
5486 f = QFile(fn) 5507 f = QFile(fn)
5490 reader.readXML() 5511 reader.readXML()
5491 f.close() 5512 f.close()
5492 else: 5513 else:
5493 E5MessageBox.critical( 5514 E5MessageBox.critical(
5494 self, 5515 self,
5495 self.trUtf8("Read session"), 5516 self.tr("Read session"),
5496 self.trUtf8( 5517 self.tr(
5497 "<p>The session file <b>{0}</b> could not be read.</p>") 5518 "<p>The session file <b>{0}</b> could not be read.</p>")
5498 .format(fn)) 5519 .format(fn))
5499 5520
5500 def showFindFileByNameDialog(self): 5521 def showFindFileByNameDialog(self):
5501 """ 5522 """
5588 """ 5609 """
5589 from PluginManager.PluginInfoDialog import PluginInfoDialog 5610 from PluginManager.PluginInfoDialog import PluginInfoDialog
5590 self.__pluginInfoDialog = PluginInfoDialog(self.pluginManager, self) 5611 self.__pluginInfoDialog = PluginInfoDialog(self.pluginManager, self)
5591 self.__pluginInfoDialog.show() 5612 self.__pluginInfoDialog.show()
5592 5613
5614 @pyqtSlot()
5593 def __installPlugins(self, pluginFileNames=[]): 5615 def __installPlugins(self, pluginFileNames=[]):
5594 """ 5616 """
5595 Private slot to show a dialog to install a new plugin. 5617 Private slot to show a dialog to install a new plugin.
5596 5618
5597 @param pluginFileNames list of plugin files suggested for 5619 @param pluginFileNames list of plugin files suggested for
5679 if QFileInfo(fname).isFile(): 5701 if QFileInfo(fname).isFile():
5680 self.viewmanager.openSourceFile(fname) 5702 self.viewmanager.openSourceFile(fname)
5681 else: 5703 else:
5682 E5MessageBox.information( 5704 E5MessageBox.information(
5683 self, 5705 self,
5684 self.trUtf8("Drop Error"), 5706 self.tr("Drop Error"),
5685 self.trUtf8("""<p><b>{0}</b> is not a file.</p>""") 5707 self.tr("""<p><b>{0}</b> is not a file.</p>""")
5686 .format(fname)) 5708 .format(fname))
5687 5709
5688 self.inDragDrop = False 5710 self.inDragDrop = False
5689 5711
5690 ########################################################## 5712 ##########################################################
5781 """ 5803 """
5782 Public method to show the eric5 versions available for download. 5804 Public method to show the eric5 versions available for download.
5783 """ 5805 """
5784 self.performVersionCheck(manual=True, showVersions=True) 5806 self.performVersionCheck(manual=True, showVersions=True)
5785 5807
5808 @pyqtSlot()
5786 def performVersionCheck(self, manual=True, alternative=0, 5809 def performVersionCheck(self, manual=True, alternative=0,
5787 showVersions=False): 5810 showVersions=False):
5788 """ 5811 """
5789 Public method to check the internet for an eric5 update. 5812 Public method to check the internet for an eric5 update.
5790 5813
5805 if lastCheck.isValid(): 5828 if lastCheck.isValid():
5806 now = QDate.currentDate() 5829 now = QDate.currentDate()
5807 if period == 2 and lastCheck.day() == now.day(): 5830 if period == 2 and lastCheck.day() == now.day():
5808 # daily 5831 # daily
5809 return 5832 return
5810 elif (period == 3 and 5833 elif period == 3 and lastCheck.daysTo(now) < 7:
5811 lastCheck.weekNumber() == now.weekNumber()):
5812 # weekly 5834 # weekly
5813 return 5835 return
5814 elif period == 4 and lastCheck.month() == now.month(): 5836 elif period == 4 and (lastCheck.daysTo(now) <
5837 lastCheck.daysInMonth()):
5815 # monthly 5838 # monthly
5816 return 5839 return
5817 5840
5818 self.__inVersionCheck = True 5841 self.__inVersionCheck = True
5819 self.manualUpdatesCheck = manual 5842 self.manualUpdatesCheck = manual
5822 url = QUrl(self.__httpAlternatives[alternative]) 5845 url = QUrl(self.__httpAlternatives[alternative])
5823 self.__versionCheckCanceled = False 5846 self.__versionCheckCanceled = False
5824 if manual: 5847 if manual:
5825 if self.__versionCheckProgress is None: 5848 if self.__versionCheckProgress is None:
5826 self.__versionCheckProgress = E5ProgressDialog( 5849 self.__versionCheckProgress = E5ProgressDialog(
5827 "", self.trUtf8("&Cancel"), 5850 "", self.tr("&Cancel"),
5828 0, len(self.__httpAlternatives), 5851 0, len(self.__httpAlternatives),
5829 self.trUtf8("%v/%m"), self) 5852 self.tr("%v/%m"), self)
5830 self.__versionCheckProgress.setMinimumDuration(0) 5853 self.__versionCheckProgress.setMinimumDuration(0)
5831 self.__versionCheckProgress.canceled.connect( 5854 self.__versionCheckProgress.canceled.connect(
5832 self.__versionsDownloadCanceled) 5855 self.__versionsDownloadCanceled)
5833 self.__versionCheckProgress.setLabelText( 5856 self.__versionCheckProgress.setLabelText(
5834 self.trUtf8("Trying host {0}").format(url.host())) 5857 self.tr("Trying host {0}").format(url.host()))
5835 self.__versionCheckProgress.setValue(alternative) 5858 self.__versionCheckProgress.setValue(alternative)
5836 request = QNetworkRequest(url) 5859 request = QNetworkRequest(url)
5837 request.setAttribute(QNetworkRequest.CacheLoadControlAttribute, 5860 request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
5838 QNetworkRequest.AlwaysNetwork) 5861 QNetworkRequest.AlwaysNetwork)
5839 reply = self.__networkManager.get(request) 5862 reply = self.__networkManager.get(request)
5840 reply.finished[()].connect(self.__versionsDownloadDone) 5863 reply.finished.connect(self.__versionsDownloadDone)
5841 self.__replies.append(reply) 5864 self.__replies.append(reply)
5842 5865
5843 def __versionsDownloadDone(self): 5866 def __versionsDownloadDone(self):
5844 """ 5867 """
5845 Private method called, after the versions file has been downloaded 5868 Private method called, after the versions file has been downloaded
5874 Preferences.Prefs.settings.setValue( 5897 Preferences.Prefs.settings.setValue(
5875 "Updates/FirstFailedCheckDate", firstFailure) 5898 "Updates/FirstFailedCheckDate", firstFailure)
5876 if self.manualUpdatesCheck: 5899 if self.manualUpdatesCheck:
5877 E5MessageBox.warning( 5900 E5MessageBox.warning(
5878 self, 5901 self,
5879 self.trUtf8("Error getting versions information"), 5902 self.tr("Error getting versions information"),
5880 self.trUtf8("""The versions information could not be""" 5903 self.tr("""The versions information could not be"""
5881 """ downloaded.""" 5904 """ downloaded."""
5882 """ Please go online and try again.""")) 5905 """ Please go online and try again."""))
5883 elif failedDuration > 7: 5906 elif failedDuration > 7:
5884 E5MessageBox.warning( 5907 E5MessageBox.warning(
5885 self, 5908 self,
5886 self.trUtf8("Error getting versions information"), 5909 self.tr("Error getting versions information"),
5887 self.trUtf8("""The versions information could not be""" 5910 self.tr("""The versions information could not be"""
5888 """ downloaded for the last 7 days.""" 5911 """ downloaded for the last 7 days."""
5889 """ Please go online and try again.""")) 5912 """ Please go online and try again."""))
5890 return 5913 return
5891 else: 5914 else:
5892 self.performVersionCheck(self.manualUpdatesCheck, 5915 self.performVersionCheck(self.manualUpdatesCheck,
5893 self.httpAlternative, 5916 self.httpAlternative,
5894 self.showAvailableVersions) 5917 self.showAvailableVersions)
5936 if "-snapshot-" in Version: 5959 if "-snapshot-" in Version:
5937 # check snapshot version 5960 # check snapshot version
5938 if versions[2][0] == "5" and versions[2] > Version: 5961 if versions[2][0] == "5" and versions[2] > Version:
5939 res = E5MessageBox.yesNo( 5962 res = E5MessageBox.yesNo(
5940 self, 5963 self,
5941 self.trUtf8("Update available"), 5964 self.tr("Update available"),
5942 self.trUtf8( 5965 self.tr(
5943 """The update to <b>{0}</b> of eric5 is""" 5966 """The update to <b>{0}</b> of eric5 is"""
5944 """ available at <b>{1}</b>. Would you like to""" 5967 """ available at <b>{1}</b>. Would you like to"""
5945 """ get it?""") 5968 """ get it?""")
5946 .format(versions[2], versions[3]), 5969 .format(versions[2], versions[3]),
5947 yesDefault=True) 5970 yesDefault=True)
5948 url = res and versions[3] or '' 5971 url = res and versions[3] or ''
5949 elif versions[0] > Version: 5972 elif versions[0] > Version:
5950 res = E5MessageBox.yesNo( 5973 res = E5MessageBox.yesNo(
5951 self, 5974 self,
5952 self.trUtf8("Update available"), 5975 self.tr("Update available"),
5953 self.trUtf8( 5976 self.tr(
5954 """The update to <b>{0}</b> of eric5 is""" 5977 """The update to <b>{0}</b> of eric5 is"""
5955 """ available at <b>{1}</b>. Would you like to""" 5978 """ available at <b>{1}</b>. Would you like to"""
5956 """ get it?""") 5979 """ get it?""")
5957 .format(versions[0], versions[1]), 5980 .format(versions[0], versions[1]),
5958 yesDefault=True) 5981 yesDefault=True)
5959 url = res and versions[1] or '' 5982 url = res and versions[1] or ''
5960 else: 5983 else:
5961 if self.manualUpdatesCheck: 5984 if self.manualUpdatesCheck:
5962 E5MessageBox.information( 5985 E5MessageBox.information(
5963 self, 5986 self,
5964 self.trUtf8("Eric5 is up to date"), 5987 self.tr("Eric5 is up to date"),
5965 self.trUtf8( 5988 self.tr(
5966 """You are using the latest version of""" 5989 """You are using the latest version of"""
5967 """ eric5""")) 5990 """ eric5"""))
5968 else: 5991 else:
5969 # check release version 5992 # check release version
5970 if versions[0] > Version: 5993 if versions[0] > Version:
5971 res = E5MessageBox.yesNo( 5994 res = E5MessageBox.yesNo(
5972 self, 5995 self,
5973 self.trUtf8("Update available"), 5996 self.tr("Update available"),
5974 self.trUtf8( 5997 self.tr(
5975 """The update to <b>{0}</b> of eric5 is""" 5998 """The update to <b>{0}</b> of eric5 is"""
5976 """ available at <b>{1}</b>. Would you like""" 5999 """ available at <b>{1}</b>. Would you like"""
5977 """ to get it?""") 6000 """ to get it?""")
5978 .format(versions[0], versions[1]), 6001 .format(versions[0], versions[1]),
5979 yesDefault=True) 6002 yesDefault=True)
5980 url = res and versions[1] or '' 6003 url = res and versions[1] or ''
5981 else: 6004 else:
5982 if self.manualUpdatesCheck: 6005 if self.manualUpdatesCheck:
5983 E5MessageBox.information( 6006 E5MessageBox.information(
5984 self, 6007 self,
5985 self.trUtf8("Eric5 is up to date"), 6008 self.tr("Eric5 is up to date"),
5986 self.trUtf8( 6009 self.tr(
5987 """You are using the latest version of""" 6010 """You are using the latest version of"""
5988 """ eric5""")) 6011 """ eric5"""))
5989 except IndexError: 6012 except IndexError:
5990 E5MessageBox.warning( 6013 E5MessageBox.warning(
5991 self, 6014 self,
5992 self.trUtf8("Error during updates check"), 6015 self.tr("Error during updates check"),
5993 self.trUtf8("""Could not perform updates check.""")) 6016 self.tr("""Could not perform updates check."""))
5994 6017
5995 if url: 6018 if url:
5996 QDesktopServices.openUrl(QUrl(url)) 6019 QDesktopServices.openUrl(QUrl(url))
5997 6020
5998 def __versionsDownloadCanceled(self): 6021 def __versionsDownloadCanceled(self):
6008 Private method to show the versions available for download. 6031 Private method to show the versions available for download.
6009 6032
6010 @param versions contents of the downloaded versions file (list of 6033 @param versions contents of the downloaded versions file (list of
6011 strings) 6034 strings)
6012 """ 6035 """
6013 versionText = self.trUtf8( 6036 versionText = self.tr(
6014 """<h3>Available versions</h3>""" 6037 """<h3>Available versions</h3>"""
6015 """<table>""") 6038 """<table>""")
6016 line = 0 6039 line = 0
6017 while line < len(versions): 6040 while line < len(versions):
6018 if versions[line] == "---": 6041 if versions[line] == "---":
6022 """</td></tr>""".format( 6045 """</td></tr>""".format(
6023 versions[line], versions[line + 1], 6046 versions[line], versions[line + 1],
6024 'sourceforge' in versions[line + 1] and 6047 'sourceforge' in versions[line + 1] and
6025 "SourceForge" or versions[line + 1]) 6048 "SourceForge" or versions[line + 1])
6026 line += 2 6049 line += 2
6027 versionText += self.trUtf8("""</table>""") 6050 versionText += self.tr("""</table>""")
6028 6051
6029 E5MessageBox.about(self, Program, versionText) 6052 E5MessageBox.about(self, Program, versionText)
6030 6053
6031 def __sslErrors(self, reply, errors): 6054 def __sslErrors(self, reply, errors):
6032 """ 6055 """
6051 if not Preferences.isConfigured(): 6074 if not Preferences.isConfigured():
6052 self.__initDebugToolbarsLayout() 6075 self.__initDebugToolbarsLayout()
6053 6076
6054 E5MessageBox.information( 6077 E5MessageBox.information(
6055 self, 6078 self,
6056 self.trUtf8("First time usage"), 6079 self.tr("First time usage"),
6057 self.trUtf8("""eric5 has not been configured yet. """ 6080 self.tr("""eric5 has not been configured yet. """
6058 """The configuration dialog will be started.""")) 6081 """The configuration dialog will be started."""))
6059 self.showPreferences() 6082 self.showPreferences()
6060 6083
6061 def checkProjectsWorkspace(self): 6084 def checkProjectsWorkspace(self):
6062 """ 6085 """
6063 Public method to check, if a projects workspace has been configured. If 6086 Public method to check, if a projects workspace has been configured. If
6070 workspace = Preferences.getMultiProject("Workspace") 6093 workspace = Preferences.getMultiProject("Workspace")
6071 if workspace == "": 6094 if workspace == "":
6072 default = Utilities.getHomeDir() 6095 default = Utilities.getHomeDir()
6073 workspace = E5FileDialog.getExistingDirectory( 6096 workspace = E5FileDialog.getExistingDirectory(
6074 None, 6097 None,
6075 self.trUtf8("Select Workspace Directory"), 6098 self.tr("Select Workspace Directory"),
6076 default, 6099 default,
6077 E5FileDialog.Options(E5FileDialog.Option(0))) 6100 E5FileDialog.Options(E5FileDialog.Option(0)))
6078 Preferences.setMultiProject("Workspace", workspace) 6101 Preferences.setMultiProject("Workspace", workspace)
6079 6102
6080 def versionIsNewer(self, required, snapshot=None): 6103 def versionIsNewer(self, required, snapshot=None):

eric ide

mercurial