eric7/UI/UserInterface.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8354
12ebd3934fef
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
34 34
35 from .Info import Version, VersionOnly, BugAddress, Program, FeatureAddress 35 from .Info import Version, VersionOnly, BugAddress, Program, FeatureAddress
36 from . import Config 36 from . import Config
37 from .NotificationWidget import NotificationTypes 37 from .NotificationWidget import NotificationTypes
38 38
39 from E5Gui.E5SingleApplication import E5SingleApplicationServer 39 from E5Gui.EricSingleApplication import EricSingleApplicationServer
40 from E5Gui.E5Action import E5Action, createActionGroup 40 from E5Gui.EricAction import EricAction, createActionGroup
41 from E5Gui.E5ToolBarManager import E5ToolBarManager 41 from E5Gui.EricToolBarManager import EricToolBarManager
42 from E5Gui import E5MessageBox, E5FileDialog, E5ErrorMessage 42 from E5Gui import EricMessageBox, EricFileDialog, EricErrorMessage
43 from E5Gui.E5Application import e5App 43 from E5Gui.EricApplication import ericApp
44 from E5Gui.E5MainWindow import E5MainWindow 44 from E5Gui.EricMainWindow import EricMainWindow
45 from E5Gui.E5ZoomWidget import E5ZoomWidget 45 from E5Gui.EricZoomWidget import EricZoomWidget
46 from E5Gui.E5ProgressDialog import E5ProgressDialog 46 from E5Gui.EricProgressDialog import EricProgressDialog
47 from E5Gui.E5ClickableLabel import E5ClickableLabel 47 from E5Gui.EricClickableLabel import EricClickableLabel
48 48
49 import Preferences 49 import Preferences
50 import Utilities 50 import Utilities
51 import Globals 51 import Globals
52 52
128 """ 128 """
129 self.buffer += str(s) 129 self.buffer += str(s)
130 self.__nWrite(self.__bufferedWrite()) 130 self.__nWrite(self.__bufferedWrite())
131 131
132 132
133 class UserInterface(E5MainWindow): 133 class UserInterface(EricMainWindow):
134 """ 134 """
135 Class implementing the main user interface. 135 Class implementing the main user interface.
136 136
137 @signal appendStderr(str) emitted to write data to stderr logger 137 @signal appendStderr(str) emitted to write data to stderr logger
138 @signal appendStdout(str) emitted to write data to stdout logger 138 @signal appendStdout(str) emitted to write data to stdout logger
164 restartArguments, originalPathString): 164 restartArguments, originalPathString):
165 """ 165 """
166 Constructor 166 Constructor
167 167
168 @param app reference to the application object 168 @param app reference to the application object
169 @type E5Application 169 @type EricApplication
170 @param locale locale to be used by the UI 170 @param locale locale to be used by the UI
171 @type str 171 @type str
172 @param splash reference to the splashscreen 172 @param splash reference to the splashscreen
173 @type UI.SplashScreen.SplashScreen 173 @type UI.SplashScreen.SplashScreen
174 @param plugin filename of a plug-in to be loaded (used for plugin 174 @param plugin filename of a plug-in to be loaded (used for plugin
240 self.profiles = Preferences.getUI("ViewProfiles") 240 self.profiles = Preferences.getUI("ViewProfiles")
241 241
242 # Generate the conda interface 242 # Generate the conda interface
243 from CondaInterface.Conda import Conda 243 from CondaInterface.Conda import Conda
244 self.condaInterface = Conda(self) 244 self.condaInterface = Conda(self)
245 e5App().registerObject("Conda", self.condaInterface) 245 ericApp().registerObject("Conda", self.condaInterface)
246 246
247 # Generate the pip interface 247 # Generate the pip interface
248 from PipInterface.Pip import Pip 248 from PipInterface.Pip import Pip
249 self.pipInterface = Pip(self) 249 self.pipInterface = Pip(self)
250 e5App().registerObject("Pip", self.pipInterface) 250 ericApp().registerObject("Pip", self.pipInterface)
251 251
252 # Generate the virtual environment manager 252 # Generate the virtual environment manager
253 from VirtualEnv.VirtualenvManager import VirtualenvManager 253 from VirtualEnv.VirtualenvManager import VirtualenvManager
254 self.virtualenvManager = VirtualenvManager(self) 254 self.virtualenvManager = VirtualenvManager(self)
255 # register it early because it is needed very soon 255 # register it early because it is needed very soon
256 e5App().registerObject("VirtualEnvManager", self.virtualenvManager) 256 ericApp().registerObject("VirtualEnvManager", self.virtualenvManager)
257 257
258 # Generate an empty project object and multi project object 258 # Generate an empty project object and multi project object
259 from Project.Project import Project 259 from Project.Project import Project
260 self.project = Project(self) 260 self.project = Project(self)
261 e5App().registerObject("Project", self.project) 261 ericApp().registerObject("Project", self.project)
262 262
263 from MultiProject.MultiProject import MultiProject 263 from MultiProject.MultiProject import MultiProject
264 self.multiProject = MultiProject(self.project, self) 264 self.multiProject = MultiProject(self.project, self)
265 265
266 # Generate the debug server object 266 # Generate the debug server object
570 570
571 if self.irc is not None: 571 if self.irc is not None:
572 self.irc.autoConnected.connect(self.__ircAutoConnected) 572 self.irc.autoConnected.connect(self.__ircAutoConnected)
573 573
574 # create the toolbar manager object 574 # create the toolbar manager object
575 self.toolbarManager = E5ToolBarManager(self, self) 575 self.toolbarManager = EricToolBarManager(self, self)
576 self.toolbarManager.setMainWindow(self) 576 self.toolbarManager.setMainWindow(self)
577 577
578 # Initialize the tool groups and list of started tools 578 # Initialize the tool groups and list of started tools
579 splash.showMessage(self.tr("Initializing Tools...")) 579 splash.showMessage(self.tr("Initializing Tools..."))
580 self.toolGroups, self.currentToolGroup = Preferences.readToolGroups() 580 self.toolGroups, self.currentToolGroup = Preferences.readToolGroups()
585 QDesktopServices.setUrlHandler("http", self.handleUrl) 585 QDesktopServices.setUrlHandler("http", self.handleUrl)
586 QDesktopServices.setUrlHandler("https", self.handleUrl) 586 QDesktopServices.setUrlHandler("https", self.handleUrl)
587 587
588 # register all relevant objects 588 # register all relevant objects
589 splash.showMessage(self.tr("Registering Objects...")) 589 splash.showMessage(self.tr("Registering Objects..."))
590 e5App().registerObject("UserInterface", self) 590 ericApp().registerObject("UserInterface", self)
591 e5App().registerObject("DebugUI", self.debuggerUI) 591 ericApp().registerObject("DebugUI", self.debuggerUI)
592 e5App().registerObject("DebugServer", debugServer) 592 ericApp().registerObject("DebugServer", debugServer)
593 e5App().registerObject("BackgroundService", self.backgroundService) 593 ericApp().registerObject("BackgroundService", self.backgroundService)
594 e5App().registerObject("ViewManager", self.viewmanager) 594 ericApp().registerObject("ViewManager", self.viewmanager)
595 e5App().registerObject("ProjectBrowser", self.projectBrowser) 595 ericApp().registerObject("ProjectBrowser", self.projectBrowser)
596 e5App().registerObject("MultiProject", self.multiProject) 596 ericApp().registerObject("MultiProject", self.multiProject)
597 e5App().registerObject("TaskViewer", self.taskViewer) 597 ericApp().registerObject("TaskViewer", self.taskViewer)
598 if self.templateViewer is not None: 598 if self.templateViewer is not None:
599 e5App().registerObject("TemplateViewer", self.templateViewer) 599 ericApp().registerObject("TemplateViewer", self.templateViewer)
600 e5App().registerObject("Shell", self.shell) 600 ericApp().registerObject("Shell", self.shell)
601 e5App().registerObject("PluginManager", self.pluginManager) 601 ericApp().registerObject("PluginManager", self.pluginManager)
602 e5App().registerObject("ToolbarManager", self.toolbarManager) 602 ericApp().registerObject("ToolbarManager", self.toolbarManager)
603 if self.cooperation is not None: 603 if self.cooperation is not None:
604 e5App().registerObject("Cooperation", self.cooperation) 604 ericApp().registerObject("Cooperation", self.cooperation)
605 if self.irc is not None: 605 if self.irc is not None:
606 e5App().registerObject("IRC", self.irc) 606 ericApp().registerObject("IRC", self.irc)
607 if self.symbolsViewer is not None: 607 if self.symbolsViewer is not None:
608 e5App().registerObject("Symbols", self.symbolsViewer) 608 ericApp().registerObject("Symbols", self.symbolsViewer)
609 if self.numbersViewer is not None: 609 if self.numbersViewer is not None:
610 e5App().registerObject("Numbers", self.numbersViewer) 610 ericApp().registerObject("Numbers", self.numbersViewer)
611 if self.codeDocumentationViewer is not None: 611 if self.codeDocumentationViewer is not None:
612 e5App().registerObject("DocuViewer", self.codeDocumentationViewer) 612 ericApp().registerObject("DocuViewer", self.codeDocumentationViewer)
613 if self.microPythonWidget is not None: 613 if self.microPythonWidget is not None:
614 e5App().registerObject("MicroPython", self.microPythonWidget) 614 ericApp().registerObject("MicroPython", self.microPythonWidget)
615 615
616 # list of web addresses serving the versions file 616 # list of web addresses serving the versions file
617 self.__httpAlternatives = Preferences.getUI("VersionsUrls7") 617 self.__httpAlternatives = Preferences.getUI("VersionsUrls7")
618 self.__inVersionCheck = False 618 self.__inVersionCheck = False
619 self.__versionCheckProgress = None 619 self.__versionCheckProgress = None
656 656
657 # now fire up the single application server 657 # now fire up the single application server
658 if Preferences.getUI("SingleApplicationMode"): 658 if Preferences.getUI("SingleApplicationMode"):
659 splash.showMessage( 659 splash.showMessage(
660 self.tr("Initializing Single Application Server...")) 660 self.tr("Initializing Single Application Server..."))
661 self.SAServer = E5SingleApplicationServer() 661 self.SAServer = EricSingleApplicationServer()
662 else: 662 else:
663 self.SAServer = None 663 self.SAServer = None
664 664
665 # now finalize the plugin manager setup 665 # now finalize the plugin manager setup
666 splash.showMessage(self.tr("Initializing Plugins...")) 666 splash.showMessage(self.tr("Initializing Plugins..."))
821 """ 821 """
822 Private method to create the Toolboxes layout. 822 Private method to create the Toolboxes layout.
823 823
824 @param debugServer reference to the debug server object 824 @param debugServer reference to the debug server object
825 """ 825 """
826 from E5Gui.E5ToolBox import E5VerticalToolBox, E5HorizontalToolBox 826 from E5Gui.EricToolBox import EricVerticalToolBox, EricHorizontalToolBox
827 827
828 logging.debug("Creating Toolboxes Layout...") 828 logging.debug("Creating Toolboxes Layout...")
829 829
830 # Create the left toolbox 830 # Create the left toolbox
831 self.lToolboxDock = self.__createDockWindow("lToolboxDock") 831 self.lToolboxDock = self.__createDockWindow("lToolboxDock")
832 self.lToolbox = E5VerticalToolBox(self.lToolboxDock) 832 self.lToolbox = EricVerticalToolBox(self.lToolboxDock)
833 self.__setupDockWindow(self.lToolboxDock, 833 self.__setupDockWindow(self.lToolboxDock,
834 Qt.DockWidgetArea.LeftDockWidgetArea, 834 Qt.DockWidgetArea.LeftDockWidgetArea,
835 self.lToolbox, 835 self.lToolbox,
836 self.tr("Left Toolbox")) 836 self.tr("Left Toolbox"))
837 837
838 # Create the horizontal toolbox 838 # Create the horizontal toolbox
839 self.hToolboxDock = self.__createDockWindow("hToolboxDock") 839 self.hToolboxDock = self.__createDockWindow("hToolboxDock")
840 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) 840 self.hToolbox = EricHorizontalToolBox(self.hToolboxDock)
841 self.__setupDockWindow(self.hToolboxDock, 841 self.__setupDockWindow(self.hToolboxDock,
842 Qt.DockWidgetArea.BottomDockWidgetArea, 842 Qt.DockWidgetArea.BottomDockWidgetArea,
843 self.hToolbox, 843 self.hToolbox,
844 self.tr("Horizontal Toolbox")) 844 self.tr("Horizontal Toolbox"))
845 845
846 # Create the right toolbox 846 # Create the right toolbox
847 self.rToolboxDock = self.__createDockWindow("rToolboxDock") 847 self.rToolboxDock = self.__createDockWindow("rToolboxDock")
848 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) 848 self.rToolbox = EricVerticalToolBox(self.rToolboxDock)
849 self.__setupDockWindow(self.rToolboxDock, 849 self.__setupDockWindow(self.rToolboxDock,
850 Qt.DockWidgetArea.RightDockWidgetArea, 850 Qt.DockWidgetArea.RightDockWidgetArea,
851 self.rToolbox, 851 self.rToolbox,
852 self.tr("Right Toolbox")) 852 self.tr("Right Toolbox"))
853 853
1028 """ 1028 """
1029 Private method to create the Sidebars layout. 1029 Private method to create the Sidebars layout.
1030 1030
1031 @param debugServer reference to the debug server object 1031 @param debugServer reference to the debug server object
1032 """ 1032 """
1033 from E5Gui.E5SideBar import E5SideBar, E5SideBarSide 1033 from E5Gui.EricSideBar import EricSideBar, EricSideBarSide
1034 1034
1035 logging.debug("Creating Sidebars Layout...") 1035 logging.debug("Creating Sidebars Layout...")
1036 1036
1037 delay = Preferences.getUI("SidebarDelay") 1037 delay = Preferences.getUI("SidebarDelay")
1038 # Create the left sidebar 1038 # Create the left sidebar
1039 self.leftSidebar = E5SideBar(E5SideBarSide.WEST, delay) 1039 self.leftSidebar = EricSideBar(EricSideBarSide.WEST, delay)
1040 1040
1041 # Create the bottom sidebar 1041 # Create the bottom sidebar
1042 self.bottomSidebar = E5SideBar(E5SideBarSide.SOUTH, delay) 1042 self.bottomSidebar = EricSideBar(EricSideBarSide.SOUTH, delay)
1043 1043
1044 # Create the right sidebar 1044 # Create the right sidebar
1045 self.rightSidebar = E5SideBar(E5SideBarSide.EAST, delay) 1045 self.rightSidebar = EricSideBar(EricSideBarSide.EAST, delay)
1046 1046
1047 #################################################### 1047 ####################################################
1048 ## Populate the left side bar 1048 ## Populate the left side bar
1049 #################################################### 1049 ####################################################
1050 1050
1631 Private method to define the user interface actions. 1631 Private method to define the user interface actions.
1632 """ 1632 """
1633 self.actions = [] 1633 self.actions = []
1634 self.wizardsActions = [] 1634 self.wizardsActions = []
1635 1635
1636 self.exitAct = E5Action( 1636 self.exitAct = EricAction(
1637 self.tr('Quit'), 1637 self.tr('Quit'),
1638 UI.PixmapCache.getIcon("exit"), 1638 UI.PixmapCache.getIcon("exit"),
1639 self.tr('&Quit'), 1639 self.tr('&Quit'),
1640 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), 1640 QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
1641 0, self, 'quit') 1641 0, self, 'quit')
1648 )) 1648 ))
1649 self.exitAct.triggered.connect(self.__quit) 1649 self.exitAct.triggered.connect(self.__quit)
1650 self.exitAct.setMenuRole(QAction.MenuRole.QuitRole) 1650 self.exitAct.setMenuRole(QAction.MenuRole.QuitRole)
1651 self.actions.append(self.exitAct) 1651 self.actions.append(self.exitAct)
1652 1652
1653 self.restartAct = E5Action( 1653 self.restartAct = EricAction(
1654 self.tr('Restart'), 1654 self.tr('Restart'),
1655 UI.PixmapCache.getIcon("restart"), 1655 UI.PixmapCache.getIcon("restart"),
1656 self.tr('Restart'), 1656 self.tr('Restart'),
1657 QKeySequence(self.tr("Ctrl+Shift+Q", "File|Quit")), 1657 QKeySequence(self.tr("Ctrl+Shift+Q", "File|Quit")),
1658 0, self, 'restart_eric') 1658 0, self, 'restart_eric')
1664 """ and the preferences will be written to disc.</p>""" 1664 """ and the preferences will be written to disc.</p>"""
1665 )) 1665 ))
1666 self.restartAct.triggered.connect(self.__restart) 1666 self.restartAct.triggered.connect(self.__restart)
1667 self.actions.append(self.restartAct) 1667 self.actions.append(self.restartAct)
1668 1668
1669 self.saveSessionAct = E5Action( 1669 self.saveSessionAct = EricAction(
1670 self.tr('Save session'), 1670 self.tr('Save session'),
1671 self.tr('Save session...'), 1671 self.tr('Save session...'),
1672 0, 0, self, 'save_session_to_file') 1672 0, 0, self, 'save_session_to_file')
1673 self.saveSessionAct.setStatusTip(self.tr('Save session')) 1673 self.saveSessionAct.setStatusTip(self.tr('Save session'))
1674 self.saveSessionAct.setWhatsThis(self.tr( 1674 self.saveSessionAct.setWhatsThis(self.tr(
1677 """ opened to select the file name.</p>""" 1677 """ opened to select the file name.</p>"""
1678 )) 1678 ))
1679 self.saveSessionAct.triggered.connect(self.__saveSessionToFile) 1679 self.saveSessionAct.triggered.connect(self.__saveSessionToFile)
1680 self.actions.append(self.saveSessionAct) 1680 self.actions.append(self.saveSessionAct)
1681 1681
1682 self.loadSessionAct = E5Action( 1682 self.loadSessionAct = EricAction(
1683 self.tr('Load session'), 1683 self.tr('Load session'),
1684 self.tr('Load session...'), 1684 self.tr('Load session...'),
1685 0, 0, self, 'load_session_from_file') 1685 0, 0, self, 'load_session_from_file')
1686 self.loadSessionAct.setStatusTip(self.tr('Load session')) 1686 self.loadSessionAct.setStatusTip(self.tr('Load session'))
1687 self.loadSessionAct.setWhatsThis(self.tr( 1687 self.loadSessionAct.setWhatsThis(self.tr(
1690 """ opened to select the file name.</p>""" 1690 """ opened to select the file name.</p>"""
1691 )) 1691 ))
1692 self.loadSessionAct.triggered.connect(self.__loadSessionFromFile) 1692 self.loadSessionAct.triggered.connect(self.__loadSessionFromFile)
1693 self.actions.append(self.loadSessionAct) 1693 self.actions.append(self.loadSessionAct)
1694 1694
1695 self.newWindowAct = E5Action( 1695 self.newWindowAct = EricAction(
1696 self.tr('New Window'), 1696 self.tr('New Window'),
1697 UI.PixmapCache.getIcon("newWindow"), 1697 UI.PixmapCache.getIcon("newWindow"),
1698 self.tr('New &Window'), 1698 self.tr('New &Window'),
1699 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), 1699 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
1700 0, self, 'new_window') 1700 0, self, 'new_window')
1709 self.newWindowAct.setEnabled( 1709 self.newWindowAct.setEnabled(
1710 not Preferences.getUI("SingleApplicationMode")) 1710 not Preferences.getUI("SingleApplicationMode"))
1711 1711
1712 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) 1712 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True)
1713 1713
1714 self.setEditProfileAct = E5Action( 1714 self.setEditProfileAct = EricAction(
1715 self.tr('Edit Profile'), 1715 self.tr('Edit Profile'),
1716 UI.PixmapCache.getIcon("viewProfileEdit"), 1716 UI.PixmapCache.getIcon("viewProfileEdit"),
1717 self.tr('Edit Profile'), 1717 self.tr('Edit Profile'),
1718 0, 0, 1718 0, 0,
1719 self.viewProfileActGrp, 'edit_profile', True) 1719 self.viewProfileActGrp, 'edit_profile', True)
1726 """ "View Profile Configuration" dialog.</p>""" 1726 """ "View Profile Configuration" dialog.</p>"""
1727 )) 1727 ))
1728 self.setEditProfileAct.triggered.connect(self.__setEditProfile) 1728 self.setEditProfileAct.triggered.connect(self.__setEditProfile)
1729 self.actions.append(self.setEditProfileAct) 1729 self.actions.append(self.setEditProfileAct)
1730 1730
1731 self.setDebugProfileAct = E5Action( 1731 self.setDebugProfileAct = EricAction(
1732 self.tr('Debug Profile'), 1732 self.tr('Debug Profile'),
1733 UI.PixmapCache.getIcon("viewProfileDebug"), 1733 UI.PixmapCache.getIcon("viewProfileDebug"),
1734 self.tr('Debug Profile'), 1734 self.tr('Debug Profile'),
1735 0, 0, 1735 0, 0,
1736 self.viewProfileActGrp, 'debug_profile', True) 1736 self.viewProfileActGrp, 'debug_profile', True)
1743 """ "View Profile Configuration" dialog.</p>""" 1743 """ "View Profile Configuration" dialog.</p>"""
1744 )) 1744 ))
1745 self.setDebugProfileAct.triggered.connect(self.setDebugProfile) 1745 self.setDebugProfileAct.triggered.connect(self.setDebugProfile)
1746 self.actions.append(self.setDebugProfileAct) 1746 self.actions.append(self.setDebugProfileAct)
1747 1747
1748 self.pbActivateAct = E5Action( 1748 self.pbActivateAct = EricAction(
1749 self.tr('Project-Viewer'), 1749 self.tr('Project-Viewer'),
1750 self.tr('&Project-Viewer'), 1750 self.tr('&Project-Viewer'),
1751 QKeySequence(self.tr("Alt+Shift+P")), 1751 QKeySequence(self.tr("Alt+Shift+P")),
1752 0, self, 1752 0, self,
1753 'project_viewer_activate') 1753 'project_viewer_activate')
1760 )) 1760 ))
1761 self.pbActivateAct.triggered.connect(self.__activateProjectBrowser) 1761 self.pbActivateAct.triggered.connect(self.__activateProjectBrowser)
1762 self.actions.append(self.pbActivateAct) 1762 self.actions.append(self.pbActivateAct)
1763 self.addAction(self.pbActivateAct) 1763 self.addAction(self.pbActivateAct)
1764 1764
1765 self.mpbActivateAct = E5Action( 1765 self.mpbActivateAct = EricAction(
1766 self.tr('Multiproject-Viewer'), 1766 self.tr('Multiproject-Viewer'),
1767 self.tr('&Multiproject-Viewer'), 1767 self.tr('&Multiproject-Viewer'),
1768 QKeySequence(self.tr("Alt+Shift+M")), 1768 QKeySequence(self.tr("Alt+Shift+M")),
1769 0, self, 1769 0, self,
1770 'multi_project_viewer_activate') 1770 'multi_project_viewer_activate')
1778 self.mpbActivateAct.triggered.connect( 1778 self.mpbActivateAct.triggered.connect(
1779 self.__activateMultiProjectBrowser) 1779 self.__activateMultiProjectBrowser)
1780 self.actions.append(self.mpbActivateAct) 1780 self.actions.append(self.mpbActivateAct)
1781 self.addAction(self.mpbActivateAct) 1781 self.addAction(self.mpbActivateAct)
1782 1782
1783 self.debugViewerActivateAct = E5Action( 1783 self.debugViewerActivateAct = EricAction(
1784 self.tr('Debug-Viewer'), 1784 self.tr('Debug-Viewer'),
1785 self.tr('&Debug-Viewer'), 1785 self.tr('&Debug-Viewer'),
1786 QKeySequence(self.tr("Alt+Shift+D")), 1786 QKeySequence(self.tr("Alt+Shift+D")),
1787 0, self, 1787 0, self,
1788 'debug_viewer_activate') 1788 'debug_viewer_activate')
1796 self.debugViewerActivateAct.triggered.connect( 1796 self.debugViewerActivateAct.triggered.connect(
1797 self.activateDebugViewer) 1797 self.activateDebugViewer)
1798 self.actions.append(self.debugViewerActivateAct) 1798 self.actions.append(self.debugViewerActivateAct)
1799 self.addAction(self.debugViewerActivateAct) 1799 self.addAction(self.debugViewerActivateAct)
1800 1800
1801 self.shellActivateAct = E5Action( 1801 self.shellActivateAct = EricAction(
1802 self.tr('Shell'), 1802 self.tr('Shell'),
1803 self.tr('&Shell'), 1803 self.tr('&Shell'),
1804 QKeySequence(self.tr("Alt+Shift+S")), 1804 QKeySequence(self.tr("Alt+Shift+S")),
1805 0, self, 1805 0, self,
1806 'interpreter_shell_activate') 1806 'interpreter_shell_activate')
1813 self.shellActivateAct.triggered.connect(self.__activateShell) 1813 self.shellActivateAct.triggered.connect(self.__activateShell)
1814 self.actions.append(self.shellActivateAct) 1814 self.actions.append(self.shellActivateAct)
1815 self.addAction(self.shellActivateAct) 1815 self.addAction(self.shellActivateAct)
1816 1816
1817 if self.browser is not None: 1817 if self.browser is not None:
1818 self.browserActivateAct = E5Action( 1818 self.browserActivateAct = EricAction(
1819 self.tr('File-Browser'), 1819 self.tr('File-Browser'),
1820 self.tr('&File-Browser'), 1820 self.tr('&File-Browser'),
1821 QKeySequence(self.tr("Alt+Shift+F")), 1821 QKeySequence(self.tr("Alt+Shift+F")),
1822 0, self, 1822 0, self,
1823 'file_browser_activate') 1823 'file_browser_activate')
1830 )) 1830 ))
1831 self.browserActivateAct.triggered.connect(self.__activateBrowser) 1831 self.browserActivateAct.triggered.connect(self.__activateBrowser)
1832 self.actions.append(self.browserActivateAct) 1832 self.actions.append(self.browserActivateAct)
1833 self.addAction(self.browserActivateAct) 1833 self.addAction(self.browserActivateAct)
1834 1834
1835 self.logViewerActivateAct = E5Action( 1835 self.logViewerActivateAct = EricAction(
1836 self.tr('Log-Viewer'), 1836 self.tr('Log-Viewer'),
1837 self.tr('Lo&g-Viewer'), 1837 self.tr('Lo&g-Viewer'),
1838 QKeySequence(self.tr("Alt+Shift+G")), 1838 QKeySequence(self.tr("Alt+Shift+G")),
1839 0, self, 1839 0, self,
1840 'log_viewer_activate') 1840 'log_viewer_activate')
1848 self.logViewerActivateAct.triggered.connect( 1848 self.logViewerActivateAct.triggered.connect(
1849 self.__activateLogViewer) 1849 self.__activateLogViewer)
1850 self.actions.append(self.logViewerActivateAct) 1850 self.actions.append(self.logViewerActivateAct)
1851 self.addAction(self.logViewerActivateAct) 1851 self.addAction(self.logViewerActivateAct)
1852 1852
1853 self.taskViewerActivateAct = E5Action( 1853 self.taskViewerActivateAct = EricAction(
1854 self.tr('Task-Viewer'), 1854 self.tr('Task-Viewer'),
1855 self.tr('&Task-Viewer'), 1855 self.tr('&Task-Viewer'),
1856 QKeySequence(self.tr("Alt+Shift+T")), 1856 QKeySequence(self.tr("Alt+Shift+T")),
1857 0, self, 1857 0, self,
1858 'task_viewer_activate') 1858 'task_viewer_activate')
1867 self.__activateTaskViewer) 1867 self.__activateTaskViewer)
1868 self.actions.append(self.taskViewerActivateAct) 1868 self.actions.append(self.taskViewerActivateAct)
1869 self.addAction(self.taskViewerActivateAct) 1869 self.addAction(self.taskViewerActivateAct)
1870 1870
1871 if self.templateViewer is not None: 1871 if self.templateViewer is not None:
1872 self.templateViewerActivateAct = E5Action( 1872 self.templateViewerActivateAct = EricAction(
1873 self.tr('Template-Viewer'), 1873 self.tr('Template-Viewer'),
1874 self.tr('Templ&ate-Viewer'), 1874 self.tr('Templ&ate-Viewer'),
1875 QKeySequence(self.tr("Alt+Shift+A")), 1875 QKeySequence(self.tr("Alt+Shift+A")),
1876 0, self, 1876 0, self,
1877 'template_viewer_activate') 1877 'template_viewer_activate')
1885 self.templateViewerActivateAct.triggered.connect( 1885 self.templateViewerActivateAct.triggered.connect(
1886 self.__activateTemplateViewer) 1886 self.__activateTemplateViewer)
1887 self.actions.append(self.templateViewerActivateAct) 1887 self.actions.append(self.templateViewerActivateAct)
1888 self.addAction(self.templateViewerActivateAct) 1888 self.addAction(self.templateViewerActivateAct)
1889 1889
1890 self.ltAct = E5Action( 1890 self.ltAct = EricAction(
1891 self.tr('Left Toolbox'), 1891 self.tr('Left Toolbox'),
1892 self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) 1892 self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True)
1893 self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window')) 1893 self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window'))
1894 self.ltAct.setWhatsThis(self.tr( 1894 self.ltAct.setWhatsThis(self.tr(
1895 """<b>Toggle the Left Toolbox window</b>""" 1895 """<b>Toggle the Left Toolbox window</b>"""
1897 """ If it is displayed then close it.</p>""" 1897 """ If it is displayed then close it.</p>"""
1898 )) 1898 ))
1899 self.ltAct.triggered.connect(self.__toggleLeftToolbox) 1899 self.ltAct.triggered.connect(self.__toggleLeftToolbox)
1900 self.actions.append(self.ltAct) 1900 self.actions.append(self.ltAct)
1901 1901
1902 self.rtAct = E5Action( 1902 self.rtAct = EricAction(
1903 self.tr('Right Toolbox'), 1903 self.tr('Right Toolbox'),
1904 self.tr('&Right Toolbox'), 1904 self.tr('&Right Toolbox'),
1905 0, 0, self, 'vertical_toolbox', True) 1905 0, 0, self, 'vertical_toolbox', True)
1906 self.rtAct.setStatusTip(self.tr('Toggle the Right Toolbox window')) 1906 self.rtAct.setStatusTip(self.tr('Toggle the Right Toolbox window'))
1907 self.rtAct.setWhatsThis(self.tr( 1907 self.rtAct.setWhatsThis(self.tr(
1910 """ If it is displayed then close it.</p>""" 1910 """ If it is displayed then close it.</p>"""
1911 )) 1911 ))
1912 self.rtAct.triggered.connect(self.__toggleRightToolbox) 1912 self.rtAct.triggered.connect(self.__toggleRightToolbox)
1913 self.actions.append(self.rtAct) 1913 self.actions.append(self.rtAct)
1914 1914
1915 self.htAct = E5Action( 1915 self.htAct = EricAction(
1916 self.tr('Horizontal Toolbox'), 1916 self.tr('Horizontal Toolbox'),
1917 self.tr('&Horizontal Toolbox'), 0, 0, self, 1917 self.tr('&Horizontal Toolbox'), 0, 0, self,
1918 'horizontal_toolbox', True) 1918 'horizontal_toolbox', True)
1919 self.htAct.setStatusTip(self.tr( 1919 self.htAct.setStatusTip(self.tr(
1920 'Toggle the Horizontal Toolbox window')) 1920 'Toggle the Horizontal Toolbox window'))
1924 """ it. If it is displayed then close it.</p>""" 1924 """ it. If it is displayed then close it.</p>"""
1925 )) 1925 ))
1926 self.htAct.triggered.connect(self.__toggleHorizontalToolbox) 1926 self.htAct.triggered.connect(self.__toggleHorizontalToolbox)
1927 self.actions.append(self.htAct) 1927 self.actions.append(self.htAct)
1928 1928
1929 self.lsbAct = E5Action( 1929 self.lsbAct = EricAction(
1930 self.tr('Left Sidebar'), 1930 self.tr('Left Sidebar'),
1931 self.tr('&Left Sidebar'), 1931 self.tr('&Left Sidebar'),
1932 0, 0, self, 'left_sidebar', True) 1932 0, 0, self, 'left_sidebar', True)
1933 self.lsbAct.setStatusTip(self.tr('Toggle the left sidebar window')) 1933 self.lsbAct.setStatusTip(self.tr('Toggle the left sidebar window'))
1934 self.lsbAct.setWhatsThis(self.tr( 1934 self.lsbAct.setWhatsThis(self.tr(
1937 """ If it is displayed then close it.</p>""" 1937 """ If it is displayed then close it.</p>"""
1938 )) 1938 ))
1939 self.lsbAct.triggered.connect(self.__toggleLeftSidebar) 1939 self.lsbAct.triggered.connect(self.__toggleLeftSidebar)
1940 self.actions.append(self.lsbAct) 1940 self.actions.append(self.lsbAct)
1941 1941
1942 self.rsbAct = E5Action( 1942 self.rsbAct = EricAction(
1943 self.tr('Right Sidebar'), 1943 self.tr('Right Sidebar'),
1944 self.tr('&Right Sidebar'), 1944 self.tr('&Right Sidebar'),
1945 0, 0, self, 'right_sidebar', True) 1945 0, 0, self, 'right_sidebar', True)
1946 self.rsbAct.setStatusTip(self.tr( 1946 self.rsbAct.setStatusTip(self.tr(
1947 'Toggle the right sidebar window')) 1947 'Toggle the right sidebar window'))
1951 """ If it is displayed then close it.</p>""" 1951 """ If it is displayed then close it.</p>"""
1952 )) 1952 ))
1953 self.rsbAct.triggered.connect(self.__toggleRightSidebar) 1953 self.rsbAct.triggered.connect(self.__toggleRightSidebar)
1954 self.actions.append(self.rsbAct) 1954 self.actions.append(self.rsbAct)
1955 1955
1956 self.bsbAct = E5Action( 1956 self.bsbAct = EricAction(
1957 self.tr('Bottom Sidebar'), 1957 self.tr('Bottom Sidebar'),
1958 self.tr('&Bottom Sidebar'), 0, 0, self, 1958 self.tr('&Bottom Sidebar'), 0, 0, self,
1959 'bottom_sidebar', True) 1959 'bottom_sidebar', True)
1960 self.bsbAct.setStatusTip(self.tr( 1960 self.bsbAct.setStatusTip(self.tr(
1961 'Toggle the bottom sidebar window')) 1961 'Toggle the bottom sidebar window'))
1966 )) 1966 ))
1967 self.bsbAct.triggered.connect(self.__toggleBottomSidebar) 1967 self.bsbAct.triggered.connect(self.__toggleBottomSidebar)
1968 self.actions.append(self.bsbAct) 1968 self.actions.append(self.bsbAct)
1969 1969
1970 if self.cooperation is not None: 1970 if self.cooperation is not None:
1971 self.cooperationViewerActivateAct = E5Action( 1971 self.cooperationViewerActivateAct = EricAction(
1972 self.tr('Cooperation-Viewer'), 1972 self.tr('Cooperation-Viewer'),
1973 self.tr('Co&operation-Viewer'), 1973 self.tr('Co&operation-Viewer'),
1974 QKeySequence(self.tr("Alt+Shift+O")), 1974 QKeySequence(self.tr("Alt+Shift+O")),
1975 0, self, 1975 0, self,
1976 'cooperation_viewer_activate') 1976 'cooperation_viewer_activate')
1985 self.activateCooperationViewer) 1985 self.activateCooperationViewer)
1986 self.actions.append(self.cooperationViewerActivateAct) 1986 self.actions.append(self.cooperationViewerActivateAct)
1987 self.addAction(self.cooperationViewerActivateAct) 1987 self.addAction(self.cooperationViewerActivateAct)
1988 1988
1989 if self.irc is not None: 1989 if self.irc is not None:
1990 self.ircActivateAct = E5Action( 1990 self.ircActivateAct = EricAction(
1991 self.tr('IRC'), 1991 self.tr('IRC'),
1992 self.tr('&IRC'), 1992 self.tr('&IRC'),
1993 QKeySequence(self.tr("Ctrl+Alt+Shift+I")), 1993 QKeySequence(self.tr("Ctrl+Alt+Shift+I")),
1994 0, self, 1994 0, self,
1995 'irc_widget_activate') 1995 'irc_widget_activate')
2003 self.__activateIRC) 2003 self.__activateIRC)
2004 self.actions.append(self.ircActivateAct) 2004 self.actions.append(self.ircActivateAct)
2005 self.addAction(self.ircActivateAct) 2005 self.addAction(self.ircActivateAct)
2006 2006
2007 if self.symbolsViewer is not None: 2007 if self.symbolsViewer is not None:
2008 self.symbolsViewerActivateAct = E5Action( 2008 self.symbolsViewerActivateAct = EricAction(
2009 self.tr('Symbols-Viewer'), 2009 self.tr('Symbols-Viewer'),
2010 self.tr('S&ymbols-Viewer'), 2010 self.tr('S&ymbols-Viewer'),
2011 QKeySequence(self.tr("Alt+Shift+Y")), 2011 QKeySequence(self.tr("Alt+Shift+Y")),
2012 0, self, 2012 0, self,
2013 'symbols_viewer_activate') 2013 'symbols_viewer_activate')
2022 self.__activateSymbolsViewer) 2022 self.__activateSymbolsViewer)
2023 self.actions.append(self.symbolsViewerActivateAct) 2023 self.actions.append(self.symbolsViewerActivateAct)
2024 self.addAction(self.symbolsViewerActivateAct) 2024 self.addAction(self.symbolsViewerActivateAct)
2025 2025
2026 if self.numbersViewer is not None: 2026 if self.numbersViewer is not None:
2027 self.numbersViewerActivateAct = E5Action( 2027 self.numbersViewerActivateAct = EricAction(
2028 self.tr('Numbers-Viewer'), 2028 self.tr('Numbers-Viewer'),
2029 self.tr('Num&bers-Viewer'), 2029 self.tr('Num&bers-Viewer'),
2030 QKeySequence(self.tr("Alt+Shift+B")), 2030 QKeySequence(self.tr("Alt+Shift+B")),
2031 0, self, 2031 0, self,
2032 'numbers_viewer_activate') 2032 'numbers_viewer_activate')
2041 self.__activateNumbersViewer) 2041 self.__activateNumbersViewer)
2042 self.actions.append(self.numbersViewerActivateAct) 2042 self.actions.append(self.numbersViewerActivateAct)
2043 self.addAction(self.numbersViewerActivateAct) 2043 self.addAction(self.numbersViewerActivateAct)
2044 2044
2045 if self.codeDocumentationViewer is not None: 2045 if self.codeDocumentationViewer is not None:
2046 self.codeDocumentationViewerActivateAct = E5Action( 2046 self.codeDocumentationViewerActivateAct = EricAction(
2047 self.tr('Code Documentation Viewer'), 2047 self.tr('Code Documentation Viewer'),
2048 self.tr('Code Documentation Viewer'), 2048 self.tr('Code Documentation Viewer'),
2049 QKeySequence(self.tr("Ctrl+Alt+Shift+D")), 2049 QKeySequence(self.tr("Ctrl+Alt+Shift+D")),
2050 0, self, 2050 0, self,
2051 'code_documentation_viewer_activate') 2051 'code_documentation_viewer_activate')
2061 self.activateCodeDocumentationViewer) 2061 self.activateCodeDocumentationViewer)
2062 self.actions.append(self.codeDocumentationViewerActivateAct) 2062 self.actions.append(self.codeDocumentationViewerActivateAct)
2063 self.addAction(self.codeDocumentationViewerActivateAct) 2063 self.addAction(self.codeDocumentationViewerActivateAct)
2064 2064
2065 if self.pipWidget is not None: 2065 if self.pipWidget is not None:
2066 self.pipWidgetActivateAct = E5Action( 2066 self.pipWidgetActivateAct = EricAction(
2067 self.tr('PyPI'), 2067 self.tr('PyPI'),
2068 self.tr('PyPI'), 2068 self.tr('PyPI'),
2069 QKeySequence(self.tr("Ctrl+Alt+Shift+P")), 2069 QKeySequence(self.tr("Ctrl+Alt+Shift+P")),
2070 0, self, 2070 0, self,
2071 'pip_widget_activate') 2071 'pip_widget_activate')
2079 self.__activatePipWidget) 2079 self.__activatePipWidget)
2080 self.actions.append(self.pipWidgetActivateAct) 2080 self.actions.append(self.pipWidgetActivateAct)
2081 self.addAction(self.pipWidgetActivateAct) 2081 self.addAction(self.pipWidgetActivateAct)
2082 2082
2083 if self.condaWidget is not None: 2083 if self.condaWidget is not None:
2084 self.condaWidgetActivateAct = E5Action( 2084 self.condaWidgetActivateAct = EricAction(
2085 self.tr('Conda'), 2085 self.tr('Conda'),
2086 self.tr('Conda'), 2086 self.tr('Conda'),
2087 QKeySequence(self.tr("Ctrl+Alt+Shift+C")), 2087 QKeySequence(self.tr("Ctrl+Alt+Shift+C")),
2088 0, self, 2088 0, self,
2089 'conda_widget_activate') 2089 'conda_widget_activate')
2097 self.__activateCondaWidget) 2097 self.__activateCondaWidget)
2098 self.actions.append(self.condaWidgetActivateAct) 2098 self.actions.append(self.condaWidgetActivateAct)
2099 self.addAction(self.condaWidgetActivateAct) 2099 self.addAction(self.condaWidgetActivateAct)
2100 2100
2101 if self.microPythonWidget is not None: 2101 if self.microPythonWidget is not None:
2102 self.microPythonWidgetActivateAct = E5Action( 2102 self.microPythonWidgetActivateAct = EricAction(
2103 self.tr('MicroPython'), 2103 self.tr('MicroPython'),
2104 self.tr('MicroPython'), 2104 self.tr('MicroPython'),
2105 QKeySequence(self.tr("Ctrl+Alt+Shift+M")), 2105 QKeySequence(self.tr("Ctrl+Alt+Shift+M")),
2106 0, self, 2106 0, self,
2107 'micropython_widget_activate') 2107 'micropython_widget_activate')
2115 self.microPythonWidgetActivateAct.triggered.connect( 2115 self.microPythonWidgetActivateAct.triggered.connect(
2116 self.__activateMicroPython) 2116 self.__activateMicroPython)
2117 self.actions.append(self.microPythonWidgetActivateAct) 2117 self.actions.append(self.microPythonWidgetActivateAct)
2118 self.addAction(self.microPythonWidgetActivateAct) 2118 self.addAction(self.microPythonWidgetActivateAct)
2119 2119
2120 self.whatsThisAct = E5Action( 2120 self.whatsThisAct = EricAction(
2121 self.tr('What\'s This?'), 2121 self.tr('What\'s This?'),
2122 UI.PixmapCache.getIcon("whatsThis"), 2122 UI.PixmapCache.getIcon("whatsThis"),
2123 self.tr('&What\'s This?'), 2123 self.tr('&What\'s This?'),
2124 QKeySequence(self.tr("Shift+F1")), 2124 QKeySequence(self.tr("Shift+F1")),
2125 0, self, 'whatsThis') 2125 0, self, 'whatsThis')
2133 """ context help button in the titlebar.</p>""" 2133 """ context help button in the titlebar.</p>"""
2134 )) 2134 ))
2135 self.whatsThisAct.triggered.connect(self.__whatsThis) 2135 self.whatsThisAct.triggered.connect(self.__whatsThis)
2136 self.actions.append(self.whatsThisAct) 2136 self.actions.append(self.whatsThisAct)
2137 2137
2138 self.helpviewerAct = E5Action( 2138 self.helpviewerAct = EricAction(
2139 self.tr('Helpviewer'), 2139 self.tr('Helpviewer'),
2140 UI.PixmapCache.getIcon("help"), 2140 UI.PixmapCache.getIcon("help"),
2141 self.tr('&Helpviewer...'), 2141 self.tr('&Helpviewer...'),
2142 QKeySequence(self.tr("F1")), 2142 QKeySequence(self.tr("F1")),
2143 0, self, 'helpviewer') 2143 0, self, 'helpviewer')
2159 self.__initQtDocActions() 2159 self.__initQtDocActions()
2160 self.__initPythonDocActions() 2160 self.__initPythonDocActions()
2161 self.__initEricDocAction() 2161 self.__initEricDocAction()
2162 self.__initPySideDocActions() 2162 self.__initPySideDocActions()
2163 2163
2164 self.versionAct = E5Action( 2164 self.versionAct = EricAction(
2165 self.tr('Show Versions'), 2165 self.tr('Show Versions'),
2166 self.tr('Show &Versions'), 2166 self.tr('Show &Versions'),
2167 0, 0, self, 'show_versions') 2167 0, 0, self, 'show_versions')
2168 self.versionAct.setStatusTip(self.tr( 2168 self.versionAct.setStatusTip(self.tr(
2169 'Display version information')) 2169 'Display version information'))
2172 """<p>Display version information.</p>""" 2172 """<p>Display version information.</p>"""
2173 )) 2173 ))
2174 self.versionAct.triggered.connect(self.__showVersions) 2174 self.versionAct.triggered.connect(self.__showVersions)
2175 self.actions.append(self.versionAct) 2175 self.actions.append(self.versionAct)
2176 2176
2177 self.checkUpdateAct = E5Action( 2177 self.checkUpdateAct = EricAction(
2178 self.tr('Check for Updates'), 2178 self.tr('Check for Updates'),
2179 self.tr('Check for &Updates...'), 0, 0, self, 'check_updates') 2179 self.tr('Check for &Updates...'), 0, 0, self, 'check_updates')
2180 self.checkUpdateAct.setStatusTip(self.tr('Check for Updates')) 2180 self.checkUpdateAct.setStatusTip(self.tr('Check for Updates'))
2181 self.checkUpdateAct.setWhatsThis(self.tr( 2181 self.checkUpdateAct.setWhatsThis(self.tr(
2182 """<b>Check for Updates...</b>""" 2182 """<b>Check for Updates...</b>"""
2183 """<p>Checks the internet for updates of eric.</p>""" 2183 """<p>Checks the internet for updates of eric.</p>"""
2184 )) 2184 ))
2185 self.checkUpdateAct.triggered.connect(self.performVersionCheck) 2185 self.checkUpdateAct.triggered.connect(self.performVersionCheck)
2186 self.actions.append(self.checkUpdateAct) 2186 self.actions.append(self.checkUpdateAct)
2187 2187
2188 self.showVersionsAct = E5Action( 2188 self.showVersionsAct = EricAction(
2189 self.tr('Show downloadable versions'), 2189 self.tr('Show downloadable versions'),
2190 self.tr('Show &downloadable versions...'), 2190 self.tr('Show &downloadable versions...'),
2191 0, 0, self, 'show_downloadable_versions') 2191 0, 0, self, 'show_downloadable_versions')
2192 self.showVersionsAct.setStatusTip( 2192 self.showVersionsAct.setStatusTip(
2193 self.tr('Show the versions available for download')) 2193 self.tr('Show the versions available for download'))
2198 )) 2198 ))
2199 self.showVersionsAct.triggered.connect( 2199 self.showVersionsAct.triggered.connect(
2200 self.showAvailableVersionsInfo) 2200 self.showAvailableVersionsInfo)
2201 self.actions.append(self.showVersionsAct) 2201 self.actions.append(self.showVersionsAct)
2202 2202
2203 self.showErrorLogAct = E5Action( 2203 self.showErrorLogAct = EricAction(
2204 self.tr('Show Error Log'), 2204 self.tr('Show Error Log'),
2205 self.tr('Show Error &Log...'), 2205 self.tr('Show Error &Log...'),
2206 0, 0, self, 'show_error_log') 2206 0, 0, self, 'show_error_log')
2207 self.showErrorLogAct.setStatusTip(self.tr('Show Error Log')) 2207 self.showErrorLogAct.setStatusTip(self.tr('Show Error Log'))
2208 self.showErrorLogAct.setWhatsThis(self.tr( 2208 self.showErrorLogAct.setWhatsThis(self.tr(
2210 """<p>Opens a dialog showing the most recent error log.</p>""" 2210 """<p>Opens a dialog showing the most recent error log.</p>"""
2211 )) 2211 ))
2212 self.showErrorLogAct.triggered.connect(self.__showErrorLog) 2212 self.showErrorLogAct.triggered.connect(self.__showErrorLog)
2213 self.actions.append(self.showErrorLogAct) 2213 self.actions.append(self.showErrorLogAct)
2214 2214
2215 self.showInstallInfoAct = E5Action( 2215 self.showInstallInfoAct = EricAction(
2216 self.tr('Show Install Info'), 2216 self.tr('Show Install Info'),
2217 self.tr('Show Install &Info...'), 2217 self.tr('Show Install &Info...'),
2218 0, 0, self, 'show_install_info') 2218 0, 0, self, 'show_install_info')
2219 self.showInstallInfoAct.setStatusTip(self.tr( 2219 self.showInstallInfoAct.setStatusTip(self.tr(
2220 'Show Installation Information')) 2220 'Show Installation Information'))
2224 """ installation process.</p>""" 2224 """ installation process.</p>"""
2225 )) 2225 ))
2226 self.showInstallInfoAct.triggered.connect(self.__showInstallInfo) 2226 self.showInstallInfoAct.triggered.connect(self.__showInstallInfo)
2227 self.actions.append(self.showInstallInfoAct) 2227 self.actions.append(self.showInstallInfoAct)
2228 2228
2229 self.reportBugAct = E5Action( 2229 self.reportBugAct = EricAction(
2230 self.tr('Report Bug'), 2230 self.tr('Report Bug'),
2231 self.tr('Report &Bug...'), 2231 self.tr('Report &Bug...'),
2232 0, 0, self, 'report_bug') 2232 0, 0, self, 'report_bug')
2233 self.reportBugAct.setStatusTip(self.tr('Report a bug')) 2233 self.reportBugAct.setStatusTip(self.tr('Report a bug'))
2234 self.reportBugAct.setWhatsThis(self.tr( 2234 self.reportBugAct.setWhatsThis(self.tr(
2236 """<p>Opens a dialog to report a bug.</p>""" 2236 """<p>Opens a dialog to report a bug.</p>"""
2237 )) 2237 ))
2238 self.reportBugAct.triggered.connect(self.__reportBug) 2238 self.reportBugAct.triggered.connect(self.__reportBug)
2239 self.actions.append(self.reportBugAct) 2239 self.actions.append(self.reportBugAct)
2240 2240
2241 self.requestFeatureAct = E5Action( 2241 self.requestFeatureAct = EricAction(
2242 self.tr('Request Feature'), 2242 self.tr('Request Feature'),
2243 self.tr('Request &Feature...'), 2243 self.tr('Request &Feature...'),
2244 0, 0, self, 'request_feature') 2244 0, 0, self, 'request_feature')
2245 self.requestFeatureAct.setStatusTip(self.tr( 2245 self.requestFeatureAct.setStatusTip(self.tr(
2246 'Send a feature request')) 2246 'Send a feature request'))
2251 self.requestFeatureAct.triggered.connect(self.__requestFeature) 2251 self.requestFeatureAct.triggered.connect(self.__requestFeature)
2252 self.actions.append(self.requestFeatureAct) 2252 self.actions.append(self.requestFeatureAct)
2253 2253
2254 self.utActGrp = createActionGroup(self) 2254 self.utActGrp = createActionGroup(self)
2255 2255
2256 self.utDialogAct = E5Action( 2256 self.utDialogAct = EricAction(
2257 self.tr('Unittest'), 2257 self.tr('Unittest'),
2258 UI.PixmapCache.getIcon("unittest"), 2258 UI.PixmapCache.getIcon("unittest"),
2259 self.tr('&Unittest...'), 2259 self.tr('&Unittest...'),
2260 0, 0, self.utActGrp, 'unittest') 2260 0, 0, self.utActGrp, 'unittest')
2261 self.utDialogAct.setStatusTip(self.tr('Start unittest dialog')) 2261 self.utDialogAct.setStatusTip(self.tr('Start unittest dialog'))
2265 """ ability to select and run a unittest suite.</p>""" 2265 """ ability to select and run a unittest suite.</p>"""
2266 )) 2266 ))
2267 self.utDialogAct.triggered.connect(self.__unittest) 2267 self.utDialogAct.triggered.connect(self.__unittest)
2268 self.actions.append(self.utDialogAct) 2268 self.actions.append(self.utDialogAct)
2269 2269
2270 self.utRestartAct = E5Action( 2270 self.utRestartAct = EricAction(
2271 self.tr('Unittest Restart'), 2271 self.tr('Unittest Restart'),
2272 UI.PixmapCache.getIcon("unittestRestart"), 2272 UI.PixmapCache.getIcon("unittestRestart"),
2273 self.tr('&Restart Unittest...'), 2273 self.tr('&Restart Unittest...'),
2274 0, 0, self.utActGrp, 'unittest_restart') 2274 0, 0, self.utActGrp, 'unittest_restart')
2275 self.utRestartAct.setStatusTip(self.tr('Restart last unittest')) 2275 self.utRestartAct.setStatusTip(self.tr('Restart last unittest'))
2279 )) 2279 ))
2280 self.utRestartAct.triggered.connect(self.__unittestRestart) 2280 self.utRestartAct.triggered.connect(self.__unittestRestart)
2281 self.utRestartAct.setEnabled(False) 2281 self.utRestartAct.setEnabled(False)
2282 self.actions.append(self.utRestartAct) 2282 self.actions.append(self.utRestartAct)
2283 2283
2284 self.utRerunFailedAct = E5Action( 2284 self.utRerunFailedAct = EricAction(
2285 self.tr('Unittest Rerun Failed'), 2285 self.tr('Unittest Rerun Failed'),
2286 UI.PixmapCache.getIcon("unittestRerunFailed"), 2286 UI.PixmapCache.getIcon("unittestRerunFailed"),
2287 self.tr('Rerun Failed Tests...'), 2287 self.tr('Rerun Failed Tests...'),
2288 0, 0, self.utActGrp, 'unittest_rerun_failed') 2288 0, 0, self.utActGrp, 'unittest_rerun_failed')
2289 self.utRerunFailedAct.setStatusTip(self.tr( 2289 self.utRerunFailedAct.setStatusTip(self.tr(
2295 )) 2295 ))
2296 self.utRerunFailedAct.triggered.connect(self.__unittestRerunFailed) 2296 self.utRerunFailedAct.triggered.connect(self.__unittestRerunFailed)
2297 self.utRerunFailedAct.setEnabled(False) 2297 self.utRerunFailedAct.setEnabled(False)
2298 self.actions.append(self.utRerunFailedAct) 2298 self.actions.append(self.utRerunFailedAct)
2299 2299
2300 self.utScriptAct = E5Action( 2300 self.utScriptAct = EricAction(
2301 self.tr('Unittest Script'), 2301 self.tr('Unittest Script'),
2302 UI.PixmapCache.getIcon("unittestScript"), 2302 UI.PixmapCache.getIcon("unittestScript"),
2303 self.tr('Unittest &Script...'), 2303 self.tr('Unittest &Script...'),
2304 0, 0, self.utActGrp, 'unittest_script') 2304 0, 0, self.utActGrp, 'unittest_script')
2305 self.utScriptAct.setStatusTip(self.tr( 2305 self.utScriptAct.setStatusTip(self.tr(
2310 )) 2310 ))
2311 self.utScriptAct.triggered.connect(self.__unittestScript) 2311 self.utScriptAct.triggered.connect(self.__unittestScript)
2312 self.utScriptAct.setEnabled(False) 2312 self.utScriptAct.setEnabled(False)
2313 self.actions.append(self.utScriptAct) 2313 self.actions.append(self.utScriptAct)
2314 2314
2315 self.utProjectAct = E5Action( 2315 self.utProjectAct = EricAction(
2316 self.tr('Unittest Project'), 2316 self.tr('Unittest Project'),
2317 UI.PixmapCache.getIcon("unittestProject"), 2317 UI.PixmapCache.getIcon("unittestProject"),
2318 self.tr('Unittest &Project...'), 2318 self.tr('Unittest &Project...'),
2319 0, 0, self.utActGrp, 'unittest_project') 2319 0, 0, self.utActGrp, 'unittest_project')
2320 self.utProjectAct.setStatusTip(self.tr( 2320 self.utProjectAct.setStatusTip(self.tr(
2337 else: 2337 else:
2338 designerExe = os.path.join( 2338 designerExe = os.path.join(
2339 Utilities.getQtBinariesPath(), 2339 Utilities.getQtBinariesPath(),
2340 Utilities.generateQtToolName("designer")) 2340 Utilities.generateQtToolName("designer"))
2341 if os.path.exists(designerExe): 2341 if os.path.exists(designerExe):
2342 self.designer4Act = E5Action( 2342 self.designer4Act = EricAction(
2343 self.tr('Qt-Designer'), 2343 self.tr('Qt-Designer'),
2344 UI.PixmapCache.getIcon("designer4"), 2344 UI.PixmapCache.getIcon("designer4"),
2345 self.tr('Qt-&Designer...'), 2345 self.tr('Qt-&Designer...'),
2346 0, 0, self, 'qt_designer4') 2346 0, 0, self, 'qt_designer4')
2347 self.designer4Act.setStatusTip(self.tr('Start Qt-Designer')) 2347 self.designer4Act.setStatusTip(self.tr('Start Qt-Designer'))
2363 else: 2363 else:
2364 linguistExe = os.path.join( 2364 linguistExe = os.path.join(
2365 Utilities.getQtBinariesPath(), 2365 Utilities.getQtBinariesPath(),
2366 Utilities.generateQtToolName("linguist")) 2366 Utilities.generateQtToolName("linguist"))
2367 if os.path.exists(linguistExe): 2367 if os.path.exists(linguistExe):
2368 self.linguist4Act = E5Action( 2368 self.linguist4Act = EricAction(
2369 self.tr('Qt-Linguist'), 2369 self.tr('Qt-Linguist'),
2370 UI.PixmapCache.getIcon("linguist4"), 2370 UI.PixmapCache.getIcon("linguist4"),
2371 self.tr('Qt-&Linguist...'), 2371 self.tr('Qt-&Linguist...'),
2372 0, 0, self, 'qt_linguist4') 2372 0, 0, self, 'qt_linguist4')
2373 self.linguist4Act.setStatusTip(self.tr('Start Qt-Linguist')) 2373 self.linguist4Act.setStatusTip(self.tr('Start Qt-Linguist'))
2378 self.linguist4Act.triggered.connect(self.__linguist) 2378 self.linguist4Act.triggered.connect(self.__linguist)
2379 self.actions.append(self.linguist4Act) 2379 self.actions.append(self.linguist4Act)
2380 else: 2380 else:
2381 self.linguist4Act = None 2381 self.linguist4Act = None
2382 2382
2383 self.uipreviewerAct = E5Action( 2383 self.uipreviewerAct = EricAction(
2384 self.tr('UI Previewer'), 2384 self.tr('UI Previewer'),
2385 UI.PixmapCache.getIcon("uiPreviewer"), 2385 UI.PixmapCache.getIcon("uiPreviewer"),
2386 self.tr('&UI Previewer...'), 2386 self.tr('&UI Previewer...'),
2387 0, 0, self, 'ui_previewer') 2387 0, 0, self, 'ui_previewer')
2388 self.uipreviewerAct.setStatusTip(self.tr('Start the UI Previewer')) 2388 self.uipreviewerAct.setStatusTip(self.tr('Start the UI Previewer'))
2391 """<p>Start the UI Previewer.</p>""" 2391 """<p>Start the UI Previewer.</p>"""
2392 )) 2392 ))
2393 self.uipreviewerAct.triggered.connect(self.__UIPreviewer) 2393 self.uipreviewerAct.triggered.connect(self.__UIPreviewer)
2394 self.actions.append(self.uipreviewerAct) 2394 self.actions.append(self.uipreviewerAct)
2395 2395
2396 self.trpreviewerAct = E5Action( 2396 self.trpreviewerAct = EricAction(
2397 self.tr('Translations Previewer'), 2397 self.tr('Translations Previewer'),
2398 UI.PixmapCache.getIcon("trPreviewer"), 2398 UI.PixmapCache.getIcon("trPreviewer"),
2399 self.tr('&Translations Previewer...'), 2399 self.tr('&Translations Previewer...'),
2400 0, 0, self, 'tr_previewer') 2400 0, 0, self, 'tr_previewer')
2401 self.trpreviewerAct.setStatusTip(self.tr( 2401 self.trpreviewerAct.setStatusTip(self.tr(
2405 """<p>Start the Translations Previewer.</p>""" 2405 """<p>Start the Translations Previewer.</p>"""
2406 )) 2406 ))
2407 self.trpreviewerAct.triggered.connect(self.__TRPreviewer) 2407 self.trpreviewerAct.triggered.connect(self.__TRPreviewer)
2408 self.actions.append(self.trpreviewerAct) 2408 self.actions.append(self.trpreviewerAct)
2409 2409
2410 self.diffAct = E5Action( 2410 self.diffAct = EricAction(
2411 self.tr('Compare Files'), 2411 self.tr('Compare Files'),
2412 UI.PixmapCache.getIcon("diffFiles"), 2412 UI.PixmapCache.getIcon("diffFiles"),
2413 self.tr('&Compare Files...'), 2413 self.tr('&Compare Files...'),
2414 0, 0, self, 'diff_files') 2414 0, 0, self, 'diff_files')
2415 self.diffAct.setStatusTip(self.tr('Compare two files')) 2415 self.diffAct.setStatusTip(self.tr('Compare two files'))
2418 """<p>Open a dialog to compare two files.</p>""" 2418 """<p>Open a dialog to compare two files.</p>"""
2419 )) 2419 ))
2420 self.diffAct.triggered.connect(self.__compareFiles) 2420 self.diffAct.triggered.connect(self.__compareFiles)
2421 self.actions.append(self.diffAct) 2421 self.actions.append(self.diffAct)
2422 2422
2423 self.compareAct = E5Action( 2423 self.compareAct = EricAction(
2424 self.tr('Compare Files side by side'), 2424 self.tr('Compare Files side by side'),
2425 UI.PixmapCache.getIcon("compareFiles"), 2425 UI.PixmapCache.getIcon("compareFiles"),
2426 self.tr('Compare &Files side by side...'), 2426 self.tr('Compare &Files side by side...'),
2427 0, 0, self, 'compare_files') 2427 0, 0, self, 'compare_files')
2428 self.compareAct.setStatusTip(self.tr('Compare two files')) 2428 self.compareAct.setStatusTip(self.tr('Compare two files'))
2432 """ side by side.</p>""" 2432 """ side by side.</p>"""
2433 )) 2433 ))
2434 self.compareAct.triggered.connect(self.__compareFilesSbs) 2434 self.compareAct.triggered.connect(self.__compareFilesSbs)
2435 self.actions.append(self.compareAct) 2435 self.actions.append(self.compareAct)
2436 2436
2437 self.sqlBrowserAct = E5Action( 2437 self.sqlBrowserAct = EricAction(
2438 self.tr('SQL Browser'), 2438 self.tr('SQL Browser'),
2439 UI.PixmapCache.getIcon("sqlBrowser"), 2439 UI.PixmapCache.getIcon("sqlBrowser"),
2440 self.tr('SQL &Browser...'), 2440 self.tr('SQL &Browser...'),
2441 0, 0, self, 'sql_browser') 2441 0, 0, self, 'sql_browser')
2442 self.sqlBrowserAct.setStatusTip(self.tr('Browse a SQL database')) 2442 self.sqlBrowserAct.setStatusTip(self.tr('Browse a SQL database'))
2445 """<p>Browse a SQL database.</p>""" 2445 """<p>Browse a SQL database.</p>"""
2446 )) 2446 ))
2447 self.sqlBrowserAct.triggered.connect(self.__sqlBrowser) 2447 self.sqlBrowserAct.triggered.connect(self.__sqlBrowser)
2448 self.actions.append(self.sqlBrowserAct) 2448 self.actions.append(self.sqlBrowserAct)
2449 2449
2450 self.miniEditorAct = E5Action( 2450 self.miniEditorAct = EricAction(
2451 self.tr('Mini Editor'), 2451 self.tr('Mini Editor'),
2452 UI.PixmapCache.getIcon("editor"), 2452 UI.PixmapCache.getIcon("editor"),
2453 self.tr('Mini &Editor...'), 2453 self.tr('Mini &Editor...'),
2454 0, 0, self, 'mini_editor') 2454 0, 0, self, 'mini_editor')
2455 self.miniEditorAct.setStatusTip(self.tr('Mini Editor')) 2455 self.miniEditorAct.setStatusTip(self.tr('Mini Editor'))
2458 """<p>Open a dialog with a simplified editor.</p>""" 2458 """<p>Open a dialog with a simplified editor.</p>"""
2459 )) 2459 ))
2460 self.miniEditorAct.triggered.connect(self.__openMiniEditor) 2460 self.miniEditorAct.triggered.connect(self.__openMiniEditor)
2461 self.actions.append(self.miniEditorAct) 2461 self.actions.append(self.miniEditorAct)
2462 2462
2463 self.hexEditorAct = E5Action( 2463 self.hexEditorAct = EricAction(
2464 self.tr('Hex Editor'), 2464 self.tr('Hex Editor'),
2465 UI.PixmapCache.getIcon("hexEditor"), 2465 UI.PixmapCache.getIcon("hexEditor"),
2466 self.tr('&Hex Editor...'), 2466 self.tr('&Hex Editor...'),
2467 0, 0, self, 'hex_editor') 2467 0, 0, self, 'hex_editor')
2468 self.hexEditorAct.setStatusTip(self.tr( 2468 self.hexEditorAct.setStatusTip(self.tr(
2473 """ binary files.</p>""" 2473 """ binary files.</p>"""
2474 )) 2474 ))
2475 self.hexEditorAct.triggered.connect(self.__openHexEditor) 2475 self.hexEditorAct.triggered.connect(self.__openHexEditor)
2476 self.actions.append(self.hexEditorAct) 2476 self.actions.append(self.hexEditorAct)
2477 2477
2478 self.webBrowserAct = E5Action( 2478 self.webBrowserAct = EricAction(
2479 self.tr('eric Web Browser'), 2479 self.tr('eric Web Browser'),
2480 UI.PixmapCache.getIcon("ericWeb"), 2480 UI.PixmapCache.getIcon("ericWeb"),
2481 self.tr('eric &Web Browser...'), 2481 self.tr('eric &Web Browser...'),
2482 0, 0, self, 'web_browser') 2482 0, 0, self, 'web_browser')
2483 self.webBrowserAct.setStatusTip(self.tr( 2483 self.webBrowserAct.setStatusTip(self.tr(
2487 """<p>Browse the Internet with the eric Web Browser.</p>""" 2487 """<p>Browse the Internet with the eric Web Browser.</p>"""
2488 )) 2488 ))
2489 self.webBrowserAct.triggered.connect(self.__startWebBrowser) 2489 self.webBrowserAct.triggered.connect(self.__startWebBrowser)
2490 self.actions.append(self.webBrowserAct) 2490 self.actions.append(self.webBrowserAct)
2491 2491
2492 self.iconEditorAct = E5Action( 2492 self.iconEditorAct = EricAction(
2493 self.tr('Icon Editor'), 2493 self.tr('Icon Editor'),
2494 UI.PixmapCache.getIcon("iconEditor"), 2494 UI.PixmapCache.getIcon("iconEditor"),
2495 self.tr('&Icon Editor...'), 2495 self.tr('&Icon Editor...'),
2496 0, 0, self, 'icon_editor') 2496 0, 0, self, 'icon_editor')
2497 self.iconEditorAct.setStatusTip(self.tr( 2497 self.iconEditorAct.setStatusTip(self.tr(
2501 """<p>Starts the eric Icon Editor for editing simple icons.</p>""" 2501 """<p>Starts the eric Icon Editor for editing simple icons.</p>"""
2502 )) 2502 ))
2503 self.iconEditorAct.triggered.connect(self.__editPixmap) 2503 self.iconEditorAct.triggered.connect(self.__editPixmap)
2504 self.actions.append(self.iconEditorAct) 2504 self.actions.append(self.iconEditorAct)
2505 2505
2506 self.snapshotAct = E5Action( 2506 self.snapshotAct = EricAction(
2507 self.tr('Snapshot'), 2507 self.tr('Snapshot'),
2508 UI.PixmapCache.getIcon("ericSnap"), 2508 UI.PixmapCache.getIcon("ericSnap"),
2509 self.tr('&Snapshot...'), 2509 self.tr('&Snapshot...'),
2510 0, 0, self, 'snapshot') 2510 0, 0, self, 'snapshot')
2511 self.snapshotAct.setStatusTip(self.tr( 2511 self.snapshotAct.setStatusTip(self.tr(
2516 """ region.</p>""" 2516 """ region.</p>"""
2517 )) 2517 ))
2518 self.snapshotAct.triggered.connect(self.__snapshot) 2518 self.snapshotAct.triggered.connect(self.__snapshot)
2519 self.actions.append(self.snapshotAct) 2519 self.actions.append(self.snapshotAct)
2520 2520
2521 self.prefAct = E5Action( 2521 self.prefAct = EricAction(
2522 self.tr('Preferences'), 2522 self.tr('Preferences'),
2523 UI.PixmapCache.getIcon("configure"), 2523 UI.PixmapCache.getIcon("configure"),
2524 self.tr('&Preferences...'), 2524 self.tr('&Preferences...'),
2525 0, 0, self, 'preferences') 2525 0, 0, self, 'preferences')
2526 self.prefAct.setStatusTip(self.tr( 2526 self.prefAct.setStatusTip(self.tr(
2532 )) 2532 ))
2533 self.prefAct.triggered.connect(self.showPreferences) 2533 self.prefAct.triggered.connect(self.showPreferences)
2534 self.prefAct.setMenuRole(QAction.MenuRole.PreferencesRole) 2534 self.prefAct.setMenuRole(QAction.MenuRole.PreferencesRole)
2535 self.actions.append(self.prefAct) 2535 self.actions.append(self.prefAct)
2536 2536
2537 self.prefExportAct = E5Action( 2537 self.prefExportAct = EricAction(
2538 self.tr('Export Preferences'), 2538 self.tr('Export Preferences'),
2539 UI.PixmapCache.getIcon("configureExport"), 2539 UI.PixmapCache.getIcon("configureExport"),
2540 self.tr('E&xport Preferences...'), 2540 self.tr('E&xport Preferences...'),
2541 0, 0, self, 'export_preferences') 2541 0, 0, self, 'export_preferences')
2542 self.prefExportAct.setStatusTip(self.tr( 2542 self.prefExportAct.setStatusTip(self.tr(
2546 """<p>Export the current configuration to a file.</p>""" 2546 """<p>Export the current configuration to a file.</p>"""
2547 )) 2547 ))
2548 self.prefExportAct.triggered.connect(self.__exportPreferences) 2548 self.prefExportAct.triggered.connect(self.__exportPreferences)
2549 self.actions.append(self.prefExportAct) 2549 self.actions.append(self.prefExportAct)
2550 2550
2551 self.prefImportAct = E5Action( 2551 self.prefImportAct = EricAction(
2552 self.tr('Import Preferences'), 2552 self.tr('Import Preferences'),
2553 UI.PixmapCache.getIcon("configureImport"), 2553 UI.PixmapCache.getIcon("configureImport"),
2554 self.tr('I&mport Preferences...'), 2554 self.tr('I&mport Preferences...'),
2555 0, 0, self, 'import_preferences') 2555 0, 0, self, 'import_preferences')
2556 self.prefImportAct.setStatusTip(self.tr( 2556 self.prefImportAct.setStatusTip(self.tr(
2560 """<p>Import a previously exported configuration.</p>""" 2560 """<p>Import a previously exported configuration.</p>"""
2561 )) 2561 ))
2562 self.prefImportAct.triggered.connect(self.__importPreferences) 2562 self.prefImportAct.triggered.connect(self.__importPreferences)
2563 self.actions.append(self.prefImportAct) 2563 self.actions.append(self.prefImportAct)
2564 2564
2565 self.reloadAPIsAct = E5Action( 2565 self.reloadAPIsAct = EricAction(
2566 self.tr('Reload APIs'), 2566 self.tr('Reload APIs'),
2567 self.tr('Reload &APIs'), 2567 self.tr('Reload &APIs'),
2568 0, 0, self, 'reload_apis') 2568 0, 0, self, 'reload_apis')
2569 self.reloadAPIsAct.setStatusTip(self.tr( 2569 self.reloadAPIsAct.setStatusTip(self.tr(
2570 'Reload the API information')) 2570 'Reload the API information'))
2573 """<p>Reload the API information.</p>""" 2573 """<p>Reload the API information.</p>"""
2574 )) 2574 ))
2575 self.reloadAPIsAct.triggered.connect(self.__reloadAPIs) 2575 self.reloadAPIsAct.triggered.connect(self.__reloadAPIs)
2576 self.actions.append(self.reloadAPIsAct) 2576 self.actions.append(self.reloadAPIsAct)
2577 2577
2578 self.showExternalToolsAct = E5Action( 2578 self.showExternalToolsAct = EricAction(
2579 self.tr('Show external tools'), 2579 self.tr('Show external tools'),
2580 UI.PixmapCache.getIcon("showPrograms"), 2580 UI.PixmapCache.getIcon("showPrograms"),
2581 self.tr('Show external &tools'), 2581 self.tr('Show external &tools'),
2582 0, 0, self, 'show_external_tools') 2582 0, 0, self, 'show_external_tools')
2583 self.showExternalToolsAct.setStatusTip(self.tr( 2583 self.showExternalToolsAct.setStatusTip(self.tr(
2589 )) 2589 ))
2590 self.showExternalToolsAct.triggered.connect( 2590 self.showExternalToolsAct.triggered.connect(
2591 self.__showExternalTools) 2591 self.__showExternalTools)
2592 self.actions.append(self.showExternalToolsAct) 2592 self.actions.append(self.showExternalToolsAct)
2593 2593
2594 self.configViewProfilesAct = E5Action( 2594 self.configViewProfilesAct = EricAction(
2595 self.tr('View Profiles'), 2595 self.tr('View Profiles'),
2596 UI.PixmapCache.getIcon("configureViewProfiles"), 2596 UI.PixmapCache.getIcon("configureViewProfiles"),
2597 self.tr('&View Profiles...'), 2597 self.tr('&View Profiles...'),
2598 0, 0, self, 'view_profiles') 2598 0, 0, self, 'view_profiles')
2599 self.configViewProfilesAct.setStatusTip(self.tr( 2599 self.configViewProfilesAct.setStatusTip(self.tr(
2606 )) 2606 ))
2607 self.configViewProfilesAct.triggered.connect( 2607 self.configViewProfilesAct.triggered.connect(
2608 self.__configViewProfiles) 2608 self.__configViewProfiles)
2609 self.actions.append(self.configViewProfilesAct) 2609 self.actions.append(self.configViewProfilesAct)
2610 2610
2611 self.configToolBarsAct = E5Action( 2611 self.configToolBarsAct = EricAction(
2612 self.tr('Toolbars'), 2612 self.tr('Toolbars'),
2613 UI.PixmapCache.getIcon("toolbarsConfigure"), 2613 UI.PixmapCache.getIcon("toolbarsConfigure"),
2614 self.tr('Tool&bars...'), 2614 self.tr('Tool&bars...'),
2615 0, 0, self, 'configure_toolbars') 2615 0, 0, self, 'configure_toolbars')
2616 self.configToolBarsAct.setStatusTip(self.tr('Configure toolbars')) 2616 self.configToolBarsAct.setStatusTip(self.tr('Configure toolbars'))
2621 """ define your own toolbars.</p>""" 2621 """ define your own toolbars.</p>"""
2622 )) 2622 ))
2623 self.configToolBarsAct.triggered.connect(self.__configToolBars) 2623 self.configToolBarsAct.triggered.connect(self.__configToolBars)
2624 self.actions.append(self.configToolBarsAct) 2624 self.actions.append(self.configToolBarsAct)
2625 2625
2626 self.shortcutsAct = E5Action( 2626 self.shortcutsAct = EricAction(
2627 self.tr('Keyboard Shortcuts'), 2627 self.tr('Keyboard Shortcuts'),
2628 UI.PixmapCache.getIcon("configureShortcuts"), 2628 UI.PixmapCache.getIcon("configureShortcuts"),
2629 self.tr('Keyboard &Shortcuts...'), 2629 self.tr('Keyboard &Shortcuts...'),
2630 0, 0, self, 'keyboard_shortcuts') 2630 0, 0, self, 'keyboard_shortcuts')
2631 self.shortcutsAct.setStatusTip(self.tr( 2631 self.shortcutsAct.setStatusTip(self.tr(
2636 """ with your prefered values.</p>""" 2636 """ with your prefered values.</p>"""
2637 )) 2637 ))
2638 self.shortcutsAct.triggered.connect(self.__configShortcuts) 2638 self.shortcutsAct.triggered.connect(self.__configShortcuts)
2639 self.actions.append(self.shortcutsAct) 2639 self.actions.append(self.shortcutsAct)
2640 2640
2641 self.exportShortcutsAct = E5Action( 2641 self.exportShortcutsAct = EricAction(
2642 self.tr('Export Keyboard Shortcuts'), 2642 self.tr('Export Keyboard Shortcuts'),
2643 UI.PixmapCache.getIcon("exportShortcuts"), 2643 UI.PixmapCache.getIcon("exportShortcuts"),
2644 self.tr('&Export Keyboard Shortcuts...'), 2644 self.tr('&Export Keyboard Shortcuts...'),
2645 0, 0, self, 'export_keyboard_shortcuts') 2645 0, 0, self, 'export_keyboard_shortcuts')
2646 self.exportShortcutsAct.setStatusTip(self.tr( 2646 self.exportShortcutsAct.setStatusTip(self.tr(
2650 """<p>Export the keyboard shortcuts of the application.</p>""" 2650 """<p>Export the keyboard shortcuts of the application.</p>"""
2651 )) 2651 ))
2652 self.exportShortcutsAct.triggered.connect(self.__exportShortcuts) 2652 self.exportShortcutsAct.triggered.connect(self.__exportShortcuts)
2653 self.actions.append(self.exportShortcutsAct) 2653 self.actions.append(self.exportShortcutsAct)
2654 2654
2655 self.importShortcutsAct = E5Action( 2655 self.importShortcutsAct = EricAction(
2656 self.tr('Import Keyboard Shortcuts'), 2656 self.tr('Import Keyboard Shortcuts'),
2657 UI.PixmapCache.getIcon("importShortcuts"), 2657 UI.PixmapCache.getIcon("importShortcuts"),
2658 self.tr('&Import Keyboard Shortcuts...'), 2658 self.tr('&Import Keyboard Shortcuts...'),
2659 0, 0, self, 'import_keyboard_shortcuts') 2659 0, 0, self, 'import_keyboard_shortcuts')
2660 self.importShortcutsAct.setStatusTip(self.tr( 2660 self.importShortcutsAct.setStatusTip(self.tr(
2665 )) 2665 ))
2666 self.importShortcutsAct.triggered.connect(self.__importShortcuts) 2666 self.importShortcutsAct.triggered.connect(self.__importShortcuts)
2667 self.actions.append(self.importShortcutsAct) 2667 self.actions.append(self.importShortcutsAct)
2668 2668
2669 if SSL_AVAILABLE: 2669 if SSL_AVAILABLE:
2670 self.certificatesAct = E5Action( 2670 self.certificatesAct = EricAction(
2671 self.tr('Manage SSL Certificates'), 2671 self.tr('Manage SSL Certificates'),
2672 UI.PixmapCache.getIcon("certificates"), 2672 UI.PixmapCache.getIcon("certificates"),
2673 self.tr('Manage SSL Certificates...'), 2673 self.tr('Manage SSL Certificates...'),
2674 0, 0, self, 'manage_ssl_certificates') 2674 0, 0, self, 'manage_ssl_certificates')
2675 self.certificatesAct.setStatusTip(self.tr( 2675 self.certificatesAct.setStatusTip(self.tr(
2681 )) 2681 ))
2682 self.certificatesAct.triggered.connect( 2682 self.certificatesAct.triggered.connect(
2683 self.__showCertificatesDialog) 2683 self.__showCertificatesDialog)
2684 self.actions.append(self.certificatesAct) 2684 self.actions.append(self.certificatesAct)
2685 2685
2686 self.editMessageFilterAct = E5Action( 2686 self.editMessageFilterAct = EricAction(
2687 self.tr('Edit Message Filters'), 2687 self.tr('Edit Message Filters'),
2688 UI.PixmapCache.getIcon("warning"), 2688 UI.PixmapCache.getIcon("warning"),
2689 self.tr('Edit Message Filters...'), 2689 self.tr('Edit Message Filters...'),
2690 0, 0, self, 'manage_message_filters') 2690 0, 0, self, 'manage_message_filters')
2691 self.editMessageFilterAct.setStatusTip(self.tr( 2691 self.editMessageFilterAct.setStatusTip(self.tr(
2695 """<p>Opens a dialog to edit the message filters used to""" 2695 """<p>Opens a dialog to edit the message filters used to"""
2696 """ suppress unwanted messages been shown in an error""" 2696 """ suppress unwanted messages been shown in an error"""
2697 """ window.</p>""" 2697 """ window.</p>"""
2698 )) 2698 ))
2699 self.editMessageFilterAct.triggered.connect( 2699 self.editMessageFilterAct.triggered.connect(
2700 E5ErrorMessage.editMessageFilters) 2700 EricErrorMessage.editMessageFilters)
2701 self.actions.append(self.editMessageFilterAct) 2701 self.actions.append(self.editMessageFilterAct)
2702 2702
2703 self.clearPrivateDataAct = E5Action( 2703 self.clearPrivateDataAct = EricAction(
2704 self.tr('Clear private data'), 2704 self.tr('Clear private data'),
2705 UI.PixmapCache.getIcon("clearPrivateData"), 2705 UI.PixmapCache.getIcon("clearPrivateData"),
2706 self.tr('Clear private data'), 2706 self.tr('Clear private data'),
2707 0, 0, 2707 0, 0,
2708 self, 'clear_private_data') 2708 self, 'clear_private_data')
2715 )) 2715 ))
2716 self.clearPrivateDataAct.triggered.connect( 2716 self.clearPrivateDataAct.triggered.connect(
2717 self.__clearPrivateData) 2717 self.__clearPrivateData)
2718 self.actions.append(self.clearPrivateDataAct) 2718 self.actions.append(self.clearPrivateDataAct)
2719 2719
2720 self.viewmanagerActivateAct = E5Action( 2720 self.viewmanagerActivateAct = EricAction(
2721 self.tr('Activate current editor'), 2721 self.tr('Activate current editor'),
2722 self.tr('Activate current editor'), 2722 self.tr('Activate current editor'),
2723 QKeySequence(self.tr("Alt+Shift+E")), 2723 QKeySequence(self.tr("Alt+Shift+E")),
2724 0, self, 'viewmanager_activate') 2724 0, self, 'viewmanager_activate')
2725 self.viewmanagerActivateAct.triggered.connect( 2725 self.viewmanagerActivateAct.triggered.connect(
2726 self.__activateViewmanager) 2726 self.__activateViewmanager)
2727 self.actions.append(self.viewmanagerActivateAct) 2727 self.actions.append(self.viewmanagerActivateAct)
2728 self.addAction(self.viewmanagerActivateAct) 2728 self.addAction(self.viewmanagerActivateAct)
2729 2729
2730 self.nextTabAct = E5Action( 2730 self.nextTabAct = EricAction(
2731 self.tr('Show next'), 2731 self.tr('Show next'),
2732 self.tr('Show next'), 2732 self.tr('Show next'),
2733 QKeySequence(self.tr('Ctrl+Alt+Tab')), 0, 2733 QKeySequence(self.tr('Ctrl+Alt+Tab')), 0,
2734 self, 'view_next_tab') 2734 self, 'view_next_tab')
2735 self.nextTabAct.triggered.connect(self.__showNext) 2735 self.nextTabAct.triggered.connect(self.__showNext)
2736 self.actions.append(self.nextTabAct) 2736 self.actions.append(self.nextTabAct)
2737 self.addAction(self.nextTabAct) 2737 self.addAction(self.nextTabAct)
2738 2738
2739 self.prevTabAct = E5Action( 2739 self.prevTabAct = EricAction(
2740 self.tr('Show previous'), 2740 self.tr('Show previous'),
2741 self.tr('Show previous'), 2741 self.tr('Show previous'),
2742 QKeySequence(self.tr('Shift+Ctrl+Alt+Tab')), 0, 2742 QKeySequence(self.tr('Shift+Ctrl+Alt+Tab')), 0,
2743 self, 'view_previous_tab') 2743 self, 'view_previous_tab')
2744 self.prevTabAct.triggered.connect(self.__showPrevious) 2744 self.prevTabAct.triggered.connect(self.__showPrevious)
2745 self.actions.append(self.prevTabAct) 2745 self.actions.append(self.prevTabAct)
2746 self.addAction(self.prevTabAct) 2746 self.addAction(self.prevTabAct)
2747 2747
2748 self.switchTabAct = E5Action( 2748 self.switchTabAct = EricAction(
2749 self.tr('Switch between tabs'), 2749 self.tr('Switch between tabs'),
2750 self.tr('Switch between tabs'), 2750 self.tr('Switch between tabs'),
2751 QKeySequence(self.tr('Ctrl+1')), 0, 2751 QKeySequence(self.tr('Ctrl+1')), 0,
2752 self, 'switch_tabs') 2752 self, 'switch_tabs')
2753 self.switchTabAct.triggered.connect(self.__switchTab) 2753 self.switchTabAct.triggered.connect(self.__switchTab)
2754 self.actions.append(self.switchTabAct) 2754 self.actions.append(self.switchTabAct)
2755 self.addAction(self.switchTabAct) 2755 self.addAction(self.switchTabAct)
2756 2756
2757 self.pluginInfoAct = E5Action( 2757 self.pluginInfoAct = EricAction(
2758 self.tr('Plugin Infos'), 2758 self.tr('Plugin Infos'),
2759 UI.PixmapCache.getIcon("plugin"), 2759 UI.PixmapCache.getIcon("plugin"),
2760 self.tr('&Plugin Infos...'), 0, 0, self, 'plugin_infos') 2760 self.tr('&Plugin Infos...'), 0, 0, self, 'plugin_infos')
2761 self.pluginInfoAct.setStatusTip(self.tr('Show Plugin Infos')) 2761 self.pluginInfoAct.setStatusTip(self.tr('Show Plugin Infos'))
2762 self.pluginInfoAct.setWhatsThis(self.tr( 2762 self.pluginInfoAct.setWhatsThis(self.tr(
2765 """ loaded plugins.</p>""" 2765 """ loaded plugins.</p>"""
2766 )) 2766 ))
2767 self.pluginInfoAct.triggered.connect(self.__showPluginInfo) 2767 self.pluginInfoAct.triggered.connect(self.__showPluginInfo)
2768 self.actions.append(self.pluginInfoAct) 2768 self.actions.append(self.pluginInfoAct)
2769 2769
2770 self.pluginInstallAct = E5Action( 2770 self.pluginInstallAct = EricAction(
2771 self.tr('Install Plugins'), 2771 self.tr('Install Plugins'),
2772 UI.PixmapCache.getIcon("pluginInstall"), 2772 UI.PixmapCache.getIcon("pluginInstall"),
2773 self.tr('&Install Plugins...'), 2773 self.tr('&Install Plugins...'),
2774 0, 0, self, 'plugin_install') 2774 0, 0, self, 'plugin_install')
2775 self.pluginInstallAct.setStatusTip(self.tr('Install Plugins')) 2775 self.pluginInstallAct.setStatusTip(self.tr('Install Plugins'))
2778 """<p>This opens a dialog to install or update plugins.</p>""" 2778 """<p>This opens a dialog to install or update plugins.</p>"""
2779 )) 2779 ))
2780 self.pluginInstallAct.triggered.connect(self.__installPlugins) 2780 self.pluginInstallAct.triggered.connect(self.__installPlugins)
2781 self.actions.append(self.pluginInstallAct) 2781 self.actions.append(self.pluginInstallAct)
2782 2782
2783 self.pluginDeinstallAct = E5Action( 2783 self.pluginDeinstallAct = EricAction(
2784 self.tr('Uninstall Plugin'), 2784 self.tr('Uninstall Plugin'),
2785 UI.PixmapCache.getIcon("pluginUninstall"), 2785 UI.PixmapCache.getIcon("pluginUninstall"),
2786 self.tr('&Uninstall Plugin...'), 2786 self.tr('&Uninstall Plugin...'),
2787 0, 0, self, 'plugin_deinstall') 2787 0, 0, self, 'plugin_deinstall')
2788 self.pluginDeinstallAct.setStatusTip(self.tr('Uninstall Plugin')) 2788 self.pluginDeinstallAct.setStatusTip(self.tr('Uninstall Plugin'))
2791 """<p>This opens a dialog to uninstall a plugin.</p>""" 2791 """<p>This opens a dialog to uninstall a plugin.</p>"""
2792 )) 2792 ))
2793 self.pluginDeinstallAct.triggered.connect(self.__deinstallPlugin) 2793 self.pluginDeinstallAct.triggered.connect(self.__deinstallPlugin)
2794 self.actions.append(self.pluginDeinstallAct) 2794 self.actions.append(self.pluginDeinstallAct)
2795 2795
2796 self.pluginRepoAct = E5Action( 2796 self.pluginRepoAct = EricAction(
2797 self.tr('Plugin Repository'), 2797 self.tr('Plugin Repository'),
2798 UI.PixmapCache.getIcon("pluginRepository"), 2798 UI.PixmapCache.getIcon("pluginRepository"),
2799 self.tr('Plugin &Repository...'), 2799 self.tr('Plugin &Repository...'),
2800 0, 0, self, 'plugin_repository') 2800 0, 0, self, 'plugin_repository')
2801 self.pluginRepoAct.setStatusTip(self.tr( 2801 self.pluginRepoAct.setStatusTip(self.tr(
2806 """available on the Internet.</p>""" 2806 """available on the Internet.</p>"""
2807 )) 2807 ))
2808 self.pluginRepoAct.triggered.connect(self.showPluginsAvailable) 2808 self.pluginRepoAct.triggered.connect(self.showPluginsAvailable)
2809 self.actions.append(self.pluginRepoAct) 2809 self.actions.append(self.pluginRepoAct)
2810 2810
2811 self.virtualenvManagerAct = E5Action( 2811 self.virtualenvManagerAct = EricAction(
2812 self.tr('Virtualenv Manager'), 2812 self.tr('Virtualenv Manager'),
2813 UI.PixmapCache.getIcon("virtualenv"), 2813 UI.PixmapCache.getIcon("virtualenv"),
2814 self.tr('&Virtualenv Manager...'), 2814 self.tr('&Virtualenv Manager...'),
2815 0, 0, self, 2815 0, 0, self,
2816 'virtualenv_manager') 2816 'virtualenv_manager')
2823 )) 2823 ))
2824 self.virtualenvManagerAct.triggered.connect( 2824 self.virtualenvManagerAct.triggered.connect(
2825 self.virtualenvManager.showVirtualenvManagerDialog) 2825 self.virtualenvManager.showVirtualenvManagerDialog)
2826 self.actions.append(self.virtualenvManagerAct) 2826 self.actions.append(self.virtualenvManagerAct)
2827 2827
2828 self.virtualenvConfigAct = E5Action( 2828 self.virtualenvConfigAct = EricAction(
2829 self.tr('Virtualenv Configurator'), 2829 self.tr('Virtualenv Configurator'),
2830 UI.PixmapCache.getIcon("virtualenvConfig"), 2830 UI.PixmapCache.getIcon("virtualenvConfig"),
2831 self.tr('Virtualenv &Configurator...'), 2831 self.tr('Virtualenv &Configurator...'),
2832 0, 0, self, 2832 0, 0, self,
2833 'virtualenv_configurator') 2833 'virtualenv_configurator')
2857 2857
2858 def __initQtDocActions(self): 2858 def __initQtDocActions(self):
2859 """ 2859 """
2860 Private slot to initialize the action to show the Qt documentation. 2860 Private slot to initialize the action to show the Qt documentation.
2861 """ 2861 """
2862 self.qt5DocAct = E5Action( 2862 self.qt5DocAct = EricAction(
2863 self.tr('Qt5 Documentation'), 2863 self.tr('Qt5 Documentation'),
2864 self.tr('Qt5 Documentation'), 2864 self.tr('Qt5 Documentation'),
2865 0, 0, self, 'qt5_documentation') 2865 0, 0, self, 'qt5_documentation')
2866 self.qt5DocAct.setStatusTip(self.tr('Open Qt5 Documentation')) 2866 self.qt5DocAct.setStatusTip(self.tr('Open Qt5 Documentation'))
2867 self.qt5DocAct.setWhatsThis(self.tr( 2867 self.qt5DocAct.setWhatsThis(self.tr(
2872 """ Assistant. </p>""" 2872 """ Assistant. </p>"""
2873 )) 2873 ))
2874 self.qt5DocAct.triggered.connect(lambda: self.__showQtDoc(5)) 2874 self.qt5DocAct.triggered.connect(lambda: self.__showQtDoc(5))
2875 self.actions.append(self.qt5DocAct) 2875 self.actions.append(self.qt5DocAct)
2876 2876
2877 self.qt6DocAct = E5Action( 2877 self.qt6DocAct = EricAction(
2878 self.tr('Qt6 Documentation'), 2878 self.tr('Qt6 Documentation'),
2879 self.tr('Qt6 Documentation'), 2879 self.tr('Qt6 Documentation'),
2880 0, 0, self, 'qt6_documentation') 2880 0, 0, self, 'qt6_documentation')
2881 self.qt6DocAct.setStatusTip(self.tr('Open Qt6 Documentation')) 2881 self.qt6DocAct.setStatusTip(self.tr('Open Qt6 Documentation'))
2882 self.qt6DocAct.setWhatsThis(self.tr( 2882 self.qt6DocAct.setWhatsThis(self.tr(
2887 """ Assistant. </p>""" 2887 """ Assistant. </p>"""
2888 )) 2888 ))
2889 self.qt6DocAct.triggered.connect(lambda: self.__showQtDoc(6)) 2889 self.qt6DocAct.triggered.connect(lambda: self.__showQtDoc(6))
2890 self.actions.append(self.qt6DocAct) 2890 self.actions.append(self.qt6DocAct)
2891 2891
2892 self.pyqt5DocAct = E5Action( 2892 self.pyqt5DocAct = EricAction(
2893 self.tr('PyQt5 Documentation'), 2893 self.tr('PyQt5 Documentation'),
2894 self.tr('PyQt5 Documentation'), 2894 self.tr('PyQt5 Documentation'),
2895 0, 0, self, 'pyqt5_documentation') 2895 0, 0, self, 'pyqt5_documentation')
2896 self.pyqt5DocAct.setStatusTip(self.tr( 2896 self.pyqt5DocAct.setStatusTip(self.tr(
2897 'Open PyQt5 Documentation')) 2897 'Open PyQt5 Documentation'))
2904 )) 2904 ))
2905 self.pyqt5DocAct.triggered.connect( 2905 self.pyqt5DocAct.triggered.connect(
2906 lambda: self.__showPyQtDoc(variant=5)) 2906 lambda: self.__showPyQtDoc(variant=5))
2907 self.actions.append(self.pyqt5DocAct) 2907 self.actions.append(self.pyqt5DocAct)
2908 2908
2909 self.pyqt6DocAct = E5Action( 2909 self.pyqt6DocAct = EricAction(
2910 self.tr('PyQt6 Documentation'), 2910 self.tr('PyQt6 Documentation'),
2911 self.tr('PyQt6 Documentation'), 2911 self.tr('PyQt6 Documentation'),
2912 0, 0, self, 'pyqt6_documentation') 2912 0, 0, self, 'pyqt6_documentation')
2913 self.pyqt6DocAct.setStatusTip(self.tr( 2913 self.pyqt6DocAct.setStatusTip(self.tr(
2914 'Open PyQt6 Documentation')) 2914 'Open PyQt6 Documentation'))
2926 def __initPythonDocActions(self): 2926 def __initPythonDocActions(self):
2927 """ 2927 """
2928 Private slot to initialize the actions to show the Python 2928 Private slot to initialize the actions to show the Python
2929 documentation. 2929 documentation.
2930 """ 2930 """
2931 self.pythonDocAct = E5Action( 2931 self.pythonDocAct = EricAction(
2932 self.tr('Python 3 Documentation'), 2932 self.tr('Python 3 Documentation'),
2933 self.tr('Python 3 Documentation'), 2933 self.tr('Python 3 Documentation'),
2934 0, 0, self, 'python3_documentation') 2934 0, 0, self, 'python3_documentation')
2935 self.pythonDocAct.setStatusTip(self.tr( 2935 self.pythonDocAct.setStatusTip(self.tr(
2936 'Open Python 3 Documentation')) 2936 'Open Python 3 Documentation'))
2948 2948
2949 def __initEricDocAction(self): 2949 def __initEricDocAction(self):
2950 """ 2950 """
2951 Private slot to initialize the action to show the eric documentation. 2951 Private slot to initialize the action to show the eric documentation.
2952 """ 2952 """
2953 self.ericDocAct = E5Action( 2953 self.ericDocAct = EricAction(
2954 self.tr("Eric API Documentation"), 2954 self.tr("Eric API Documentation"),
2955 self.tr('Eric API Documentation'), 2955 self.tr('Eric API Documentation'),
2956 0, 0, self, 'eric_documentation') 2956 0, 0, self, 'eric_documentation')
2957 self.ericDocAct.setStatusTip(self.tr( 2957 self.ericDocAct.setStatusTip(self.tr(
2958 "Open Eric API Documentation")) 2958 "Open Eric API Documentation"))
2969 """ 2969 """
2970 Private slot to initialize the actions to show the PySide 2970 Private slot to initialize the actions to show the PySide
2971 documentation. 2971 documentation.
2972 """ 2972 """
2973 if Utilities.checkPyside(variant=2): 2973 if Utilities.checkPyside(variant=2):
2974 self.pyside2DocAct = E5Action( 2974 self.pyside2DocAct = EricAction(
2975 self.tr('PySide2 Documentation'), 2975 self.tr('PySide2 Documentation'),
2976 self.tr('PySide2 Documentation'), 2976 self.tr('PySide2 Documentation'),
2977 0, 0, self, 'pyside2_documentation') 2977 0, 0, self, 'pyside2_documentation')
2978 self.pyside2DocAct.setStatusTip(self.tr( 2978 self.pyside2DocAct.setStatusTip(self.tr(
2979 'Open PySide2 Documentation')) 2979 'Open PySide2 Documentation'))
2989 self.actions.append(self.pyside2DocAct) 2989 self.actions.append(self.pyside2DocAct)
2990 else: 2990 else:
2991 self.pyside2DocAct = None 2991 self.pyside2DocAct = None
2992 2992
2993 if Utilities.checkPyside(variant=6): 2993 if Utilities.checkPyside(variant=6):
2994 self.pyside6DocAct = E5Action( 2994 self.pyside6DocAct = EricAction(
2995 self.tr('PySide6 Documentation'), 2995 self.tr('PySide6 Documentation'),
2996 self.tr('PySide6 Documentation'), 2996 self.tr('PySide6 Documentation'),
2997 0, 0, self, 'pyside6_documentation') 2997 0, 0, self, 'pyside6_documentation')
2998 self.pyside6DocAct.setStatusTip(self.tr( 2998 self.pyside6DocAct.setStatusTip(self.tr(
2999 'Open PySide6 Documentation')) 2999 'Open PySide6 Documentation'))
3527 Private slot to set up the status bar. 3527 Private slot to set up the status bar.
3528 """ 3528 """
3529 self.__statusBar = self.statusBar() 3529 self.__statusBar = self.statusBar()
3530 self.__statusBar.setSizeGripEnabled(True) 3530 self.__statusBar.setSizeGripEnabled(True)
3531 3531
3532 self.sbLanguage = E5ClickableLabel(self.__statusBar) 3532 self.sbLanguage = EricClickableLabel(self.__statusBar)
3533 self.__statusBar.addPermanentWidget(self.sbLanguage) 3533 self.__statusBar.addPermanentWidget(self.sbLanguage)
3534 self.sbLanguage.setWhatsThis(self.tr( 3534 self.sbLanguage.setWhatsThis(self.tr(
3535 """<p>This part of the status bar displays the""" 3535 """<p>This part of the status bar displays the"""
3536 """ current editors language.</p>""" 3536 """ current editors language.</p>"""
3537 )) 3537 ))
3538 3538
3539 self.sbEncoding = E5ClickableLabel(self.__statusBar) 3539 self.sbEncoding = EricClickableLabel(self.__statusBar)
3540 self.__statusBar.addPermanentWidget(self.sbEncoding) 3540 self.__statusBar.addPermanentWidget(self.sbEncoding)
3541 self.sbEncoding.setWhatsThis(self.tr( 3541 self.sbEncoding.setWhatsThis(self.tr(
3542 """<p>This part of the status bar displays the""" 3542 """<p>This part of the status bar displays the"""
3543 """ current editors encoding.</p>""" 3543 """ current editors encoding.</p>"""
3544 )) 3544 ))
3545 3545
3546 self.sbEol = E5ClickableLabel(self.__statusBar) 3546 self.sbEol = EricClickableLabel(self.__statusBar)
3547 self.__statusBar.addPermanentWidget(self.sbEol) 3547 self.__statusBar.addPermanentWidget(self.sbEol)
3548 self.sbEol.setWhatsThis(self.tr( 3548 self.sbEol.setWhatsThis(self.tr(
3549 """<p>This part of the status bar displays the""" 3549 """<p>This part of the status bar displays the"""
3550 """ current editors eol setting.</p>""" 3550 """ current editors eol setting.</p>"""
3551 )) 3551 ))
3569 self.sbPos.setWhatsThis(self.tr( 3569 self.sbPos.setWhatsThis(self.tr(
3570 """<p>This part of the status bar displays the cursor position""" 3570 """<p>This part of the status bar displays the cursor position"""
3571 """ of the current editor.</p>""" 3571 """ of the current editor.</p>"""
3572 )) 3572 ))
3573 3573
3574 self.sbZoom = E5ZoomWidget( 3574 self.sbZoom = EricZoomWidget(
3575 UI.PixmapCache.getPixmap("zoomOut"), 3575 UI.PixmapCache.getPixmap("zoomOut"),
3576 UI.PixmapCache.getPixmap("zoomIn"), 3576 UI.PixmapCache.getPixmap("zoomIn"),
3577 UI.PixmapCache.getPixmap("zoomReset"), 3577 UI.PixmapCache.getPixmap("zoomReset"),
3578 self.__statusBar) 3578 self.__statusBar)
3579 self.__statusBar.addPermanentWidget(self.sbZoom) 3579 self.__statusBar.addPermanentWidget(self.sbZoom)
3685 def __showSettingsMenu(self): 3685 def __showSettingsMenu(self):
3686 """ 3686 """
3687 Private slot to show the Settings menu. 3687 Private slot to show the Settings menu.
3688 """ 3688 """
3689 self.editMessageFilterAct.setEnabled( 3689 self.editMessageFilterAct.setEnabled(
3690 E5ErrorMessage.messageHandlerInstalled()) 3690 EricErrorMessage.messageHandlerInstalled())
3691 3691
3692 self.showMenu.emit("Settings", self.__menus["settings"]) 3692 self.showMenu.emit("Settings", self.__menus["settings"])
3693 3693
3694 def __showNext(self): 3694 def __showNext(self):
3695 """ 3695 """
3779 ).format(chromeVersion) 3779 ).format(chromeVersion)
3780 versionText += ("""<tr><td><b>{0}</b></td><td>{1}</td></tr>""" 3780 versionText += ("""<tr><td><b>{0}</b></td><td>{1}</td></tr>"""
3781 ).format(Program, Version) 3781 ).format(Program, Version)
3782 versionText += self.tr("""</table>""") 3782 versionText += self.tr("""</table>""")
3783 3783
3784 E5MessageBox.about(self, Program, versionText) 3784 EricMessageBox.about(self, Program, versionText)
3785 3785
3786 def __reportBug(self): 3786 def __reportBug(self):
3787 """ 3787 """
3788 Private slot to handle the Report Bug dialog. 3788 Private slot to handle the Report Bug dialog.
3789 """ 3789 """
3808 self.__showSystemEmailClient(mode, attachFile, deleteAttachFile) 3808 self.__showSystemEmailClient(mode, attachFile, deleteAttachFile)
3809 else: 3809 else:
3810 if not Preferences.getUser("UseGoogleMailOAuth2") and ( 3810 if not Preferences.getUser("UseGoogleMailOAuth2") and (
3811 Preferences.getUser("Email") == "" or 3811 Preferences.getUser("Email") == "" or
3812 Preferences.getUser("MailServer") == ""): 3812 Preferences.getUser("MailServer") == ""):
3813 E5MessageBox.critical( 3813 EricMessageBox.critical(
3814 self, 3814 self,
3815 self.tr("Report Bug"), 3815 self.tr("Report Bug"),
3816 self.tr( 3816 self.tr(
3817 """Email address or mail server address is empty.""" 3817 """Email address or mail server address is empty."""
3818 """ Please configure your Email settings in the""" 3818 """ Please configure your Email settings in the"""
3929 """ 3929 """
3930 from QScintilla.MiniEditor import MiniEditor 3930 from QScintilla.MiniEditor import MiniEditor
3931 editor = MiniEditor(parent=self) 3931 editor = MiniEditor(parent=self)
3932 editor.show() 3932 editor.show()
3933 3933
3934 def addE5Actions(self, actions, actionType): 3934 def addEricActions(self, actions, actionType):
3935 """ 3935 """
3936 Public method to add actions to the list of actions. 3936 Public method to add actions to the list of actions.
3937 3937
3938 @param actions list of actions to be added (list of E5Action) 3938 @param actions list of actions to be added (list of EricAction)
3939 @param actionType string denoting the action set to add to. 3939 @param actionType string denoting the action set to add to.
3940 It must be one of "ui" or "wizards". 3940 It must be one of "ui" or "wizards".
3941 """ 3941 """
3942 if actionType == 'ui': 3942 if actionType == 'ui':
3943 self.actions.extend(actions) 3943 self.actions.extend(actions)
3944 elif actionType == 'wizards': 3944 elif actionType == 'wizards':
3945 self.wizardsActions.extend(actions) 3945 self.wizardsActions.extend(actions)
3946 3946
3947 def removeE5Actions(self, actions, actionType='ui'): 3947 def removeEricActions(self, actions, actionType='ui'):
3948 """ 3948 """
3949 Public method to remove actions from the list of actions. 3949 Public method to remove actions from the list of actions.
3950 3950
3951 @param actions list of actions (list of E5Action) 3951 @param actions list of actions (list of EricAction)
3952 @param actionType string denoting the action set to remove from. 3952 @param actionType string denoting the action set to remove from.
3953 It must be one of "ui" or "wizards". 3953 It must be one of "ui" or "wizards".
3954 """ 3954 """
3955 for act in actions: 3955 for act in actions:
3956 with contextlib.suppress(ValueError): 3956 with contextlib.suppress(ValueError):
3963 """ 3963 """
3964 Public method to get a list of all actions. 3964 Public method to get a list of all actions.
3965 3965
3966 @param actionType string denoting the action set to get. 3966 @param actionType string denoting the action set to get.
3967 It must be one of "ui" or "wizards". 3967 It must be one of "ui" or "wizards".
3968 @return list of all actions (list of E5Action) 3968 @return list of all actions (list of EricAction)
3969 """ 3969 """
3970 if actionType == 'ui': 3970 if actionType == 'ui':
3971 return self.actions[:] 3971 return self.actions[:]
3972 elif actionType == 'wizards': 3972 elif actionType == 'wizards':
3973 return self.wizardsActions[:] 3973 return self.wizardsActions[:]
4109 def __quit(self): 4109 def __quit(self):
4110 """ 4110 """
4111 Private method to quit the application. 4111 Private method to quit the application.
4112 """ 4112 """
4113 if self.__shutdown(): 4113 if self.__shutdown():
4114 e5App().closeAllWindows() 4114 ericApp().closeAllWindows()
4115 4115
4116 @pyqtSlot() 4116 @pyqtSlot()
4117 def __restart(self, ask=False): 4117 def __restart(self, ask=False):
4118 """ 4118 """
4119 Private method to restart the application. 4119 Private method to restart the application.
4120 4120
4121 @param ask flag indicating to ask the user for permission 4121 @param ask flag indicating to ask the user for permission
4122 @type bool 4122 @type bool
4123 """ 4123 """
4124 res = ( 4124 res = (
4125 E5MessageBox.yesNo( 4125 EricMessageBox.yesNo(
4126 self, 4126 self,
4127 self.tr("Restart application"), 4127 self.tr("Restart application"),
4128 self.tr( 4128 self.tr(
4129 """The application needs to be restarted. Do it now?"""), 4129 """The application needs to be restarted. Do it now?"""),
4130 yesDefault=True) 4130 yesDefault=True)
4131 if ask else 4131 if ask else
4132 True 4132 True
4133 ) 4133 )
4134 4134
4135 if res and self.__shutdown(): 4135 if res and self.__shutdown():
4136 e5App().closeAllWindows() 4136 ericApp().closeAllWindows()
4137 program = sys.executable 4137 program = sys.executable
4138 eric7 = os.path.join(getConfig("ericDir"), "eric7.py") 4138 eric7 = os.path.join(getConfig("ericDir"), "eric7.py")
4139 args = [eric7] 4139 args = [eric7]
4140 args.append("--start-session") 4140 args.append("--start-session")
4141 args.extend(self.__restartArgs) 4141 args.extend(self.__restartArgs)
5033 if fn is not None: 5033 if fn is not None:
5034 try: 5034 try:
5035 if os.path.isfile(fn) and os.path.getsize(fn): 5035 if os.path.isfile(fn) and os.path.getsize(fn):
5036 args.append(fn) 5036 args.append(fn)
5037 else: 5037 else:
5038 E5MessageBox.critical( 5038 EricMessageBox.critical(
5039 self, 5039 self,
5040 self.tr('Problem'), 5040 self.tr('Problem'),
5041 self.tr( 5041 self.tr(
5042 '<p>The file <b>{0}</b> does not exist or' 5042 '<p>The file <b>{0}</b> does not exist or'
5043 ' is zero length.</p>') 5043 ' is zero length.</p>')
5044 .format(fn)) 5044 .format(fn))
5045 return 5045 return
5046 except OSError: 5046 except OSError:
5047 E5MessageBox.critical( 5047 EricMessageBox.critical(
5048 self, 5048 self,
5049 self.tr('Problem'), 5049 self.tr('Problem'),
5050 self.tr( 5050 self.tr(
5051 '<p>The file <b>{0}</b> does not exist or' 5051 '<p>The file <b>{0}</b> does not exist or'
5052 ' is zero length.</p>') 5052 ' is zero length.</p>')
5064 designer += '.exe' 5064 designer += '.exe'
5065 5065
5066 if designer: 5066 if designer:
5067 proc = QProcess() 5067 proc = QProcess()
5068 if not proc.startDetached(designer, args): 5068 if not proc.startDetached(designer, args):
5069 E5MessageBox.critical( 5069 EricMessageBox.critical(
5070 self, 5070 self,
5071 self.tr('Process Generation Error'), 5071 self.tr('Process Generation Error'),
5072 self.tr( 5072 self.tr(
5073 '<p>Could not start Qt-Designer.<br>' 5073 '<p>Could not start Qt-Designer.<br>'
5074 'Ensure that it is available as <b>{0}</b>.</p>' 5074 'Ensure that it is available as <b>{0}</b>.</p>'
5075 ).format(designer) 5075 ).format(designer)
5076 ) 5076 )
5077 else: 5077 else:
5078 E5MessageBox.critical( 5078 EricMessageBox.critical(
5079 self, 5079 self,
5080 self.tr('Process Generation Error'), 5080 self.tr('Process Generation Error'),
5081 self.tr( 5081 self.tr(
5082 '<p>Could not find the Qt-Designer executable.<br>' 5082 '<p>Could not find the Qt-Designer executable.<br>'
5083 'Ensure that it is installed and optionally configured on' 5083 'Ensure that it is installed and optionally configured on'
5103 os.path.getsize(fn) and 5103 os.path.getsize(fn) and
5104 fn not in args 5104 fn not in args
5105 ): 5105 ):
5106 args.append(fn) 5106 args.append(fn)
5107 else: 5107 else:
5108 E5MessageBox.critical( 5108 EricMessageBox.critical(
5109 self, 5109 self,
5110 self.tr('Problem'), 5110 self.tr('Problem'),
5111 self.tr( 5111 self.tr(
5112 '<p>The file <b>{0}</b> does not exist or' 5112 '<p>The file <b>{0}</b> does not exist or'
5113 ' is zero length.</p>') 5113 ' is zero length.</p>')
5114 .format(fn)) 5114 .format(fn))
5115 return 5115 return
5116 except OSError: 5116 except OSError:
5117 E5MessageBox.critical( 5117 EricMessageBox.critical(
5118 self, 5118 self,
5119 self.tr('Problem'), 5119 self.tr('Problem'),
5120 self.tr( 5120 self.tr(
5121 '<p>The file <b>{0}</b> does not exist or' 5121 '<p>The file <b>{0}</b> does not exist or'
5122 ' is zero length.</p>') 5122 ' is zero length.</p>')
5134 linguist += '.exe' 5134 linguist += '.exe'
5135 5135
5136 if linguist: 5136 if linguist:
5137 proc = QProcess() 5137 proc = QProcess()
5138 if not proc.startDetached(linguist, args): 5138 if not proc.startDetached(linguist, args):
5139 E5MessageBox.critical( 5139 EricMessageBox.critical(
5140 self, 5140 self,
5141 self.tr('Process Generation Error'), 5141 self.tr('Process Generation Error'),
5142 self.tr( 5142 self.tr(
5143 '<p>Could not start Qt-Linguist.<br>' 5143 '<p>Could not start Qt-Linguist.<br>'
5144 'Ensure that it is available as <b>{0}</b>.</p>' 5144 'Ensure that it is available as <b>{0}</b>.</p>'
5145 ).format(linguist) 5145 ).format(linguist)
5146 ) 5146 )
5147 else: 5147 else:
5148 E5MessageBox.critical( 5148 EricMessageBox.critical(
5149 self, 5149 self,
5150 self.tr('Process Generation Error'), 5150 self.tr('Process Generation Error'),
5151 self.tr( 5151 self.tr(
5152 '<p>Could not find the Qt-Linguist executable.<br>' 5152 '<p>Could not find the Qt-Linguist executable.<br>'
5153 'Ensure that it is installed and optionally configured on' 5153 'Ensure that it is installed and optionally configured on'
5178 assistant += '.exe' 5178 assistant += '.exe'
5179 5179
5180 if assistant: 5180 if assistant:
5181 proc = QProcess() 5181 proc = QProcess()
5182 if not proc.startDetached(assistant, args): 5182 if not proc.startDetached(assistant, args):
5183 E5MessageBox.critical( 5183 EricMessageBox.critical(
5184 self, 5184 self,
5185 self.tr('Process Generation Error'), 5185 self.tr('Process Generation Error'),
5186 self.tr( 5186 self.tr(
5187 '<p>Could not start Qt-Assistant.<br>' 5187 '<p>Could not start Qt-Assistant.<br>'
5188 'Ensure that it is available as <b>{0}</b>.</p>' 5188 'Ensure that it is available as <b>{0}</b>.</p>'
5189 ).format(assistant) 5189 ).format(assistant)
5190 ) 5190 )
5191 else: 5191 else:
5192 E5MessageBox.critical( 5192 EricMessageBox.critical(
5193 self, 5193 self,
5194 self.tr('Process Generation Error'), 5194 self.tr('Process Generation Error'),
5195 self.tr( 5195 self.tr(
5196 '<p>Could not find the Qt-Assistant executable.<br>' 5196 '<p>Could not find the Qt-Assistant executable.<br>'
5197 'Ensure that it is installed and optionally configured on' 5197 'Ensure that it is installed and optionally configured on'
5211 5211
5212 @param home full pathname of a file to display (string) 5212 @param home full pathname of a file to display (string)
5213 """ 5213 """
5214 customViewer = Preferences.getHelp("CustomViewer") 5214 customViewer = Preferences.getHelp("CustomViewer")
5215 if not customViewer: 5215 if not customViewer:
5216 E5MessageBox.information( 5216 EricMessageBox.information(
5217 self, 5217 self,
5218 self.tr("Help"), 5218 self.tr("Help"),
5219 self.tr( 5219 self.tr(
5220 """Currently no custom viewer is selected.""" 5220 """Currently no custom viewer is selected."""
5221 """ Please use the preferences dialog to specify one.""")) 5221 """ Please use the preferences dialog to specify one."""))
5225 args = [] 5225 args = []
5226 if home: 5226 if home:
5227 args.append(home) 5227 args.append(home)
5228 5228
5229 if not proc.startDetached(customViewer, args): 5229 if not proc.startDetached(customViewer, args):
5230 E5MessageBox.critical( 5230 EricMessageBox.critical(
5231 self, 5231 self,
5232 self.tr('Process Generation Error'), 5232 self.tr('Process Generation Error'),
5233 self.tr( 5233 self.tr(
5234 '<p>Could not start custom viewer.<br>' 5234 '<p>Could not start custom viewer.<br>'
5235 'Ensure that it is available as <b>{0}</b>.</p>' 5235 'Ensure that it is available as <b>{0}</b>.</p>'
5245 proc = QProcess() 5245 proc = QProcess()
5246 args = [] 5246 args = []
5247 args.append(home) 5247 args.append(home)
5248 5248
5249 if not proc.startDetached("hh", args): 5249 if not proc.startDetached("hh", args):
5250 E5MessageBox.critical( 5250 EricMessageBox.critical(
5251 self, 5251 self,
5252 self.tr('Process Generation Error'), 5252 self.tr('Process Generation Error'),
5253 self.tr( 5253 self.tr(
5254 '<p>Could not start the help viewer.<br>' 5254 '<p>Could not start the help viewer.<br>'
5255 'Ensure that it is available as <b>hh</b>.</p>' 5255 'Ensure that it is available as <b>hh</b>.</p>'
5273 if fn is not None: 5273 if fn is not None:
5274 try: 5274 try:
5275 if os.path.isfile(fn) and os.path.getsize(fn): 5275 if os.path.isfile(fn) and os.path.getsize(fn):
5276 args.append(fn) 5276 args.append(fn)
5277 else: 5277 else:
5278 E5MessageBox.critical( 5278 EricMessageBox.critical(
5279 self, 5279 self,
5280 self.tr('Problem'), 5280 self.tr('Problem'),
5281 self.tr( 5281 self.tr(
5282 '<p>The file <b>{0}</b> does not exist or' 5282 '<p>The file <b>{0}</b> does not exist or'
5283 ' is zero length.</p>') 5283 ' is zero length.</p>')
5284 .format(fn)) 5284 .format(fn))
5285 return 5285 return
5286 except OSError: 5286 except OSError:
5287 E5MessageBox.critical( 5287 EricMessageBox.critical(
5288 self, 5288 self,
5289 self.tr('Problem'), 5289 self.tr('Problem'),
5290 self.tr( 5290 self.tr(
5291 '<p>The file <b>{0}</b> does not exist or' 5291 '<p>The file <b>{0}</b> does not exist or'
5292 ' is zero length.</p>') 5292 ' is zero length.</p>')
5295 5295
5296 if ( 5296 if (
5297 not os.path.isfile(viewer) or 5297 not os.path.isfile(viewer) or
5298 not proc.startDetached(sys.executable, args) 5298 not proc.startDetached(sys.executable, args)
5299 ): 5299 ):
5300 E5MessageBox.critical( 5300 EricMessageBox.critical(
5301 self, 5301 self,
5302 self.tr('Process Generation Error'), 5302 self.tr('Process Generation Error'),
5303 self.tr( 5303 self.tr(
5304 '<p>Could not start UI Previewer.<br>' 5304 '<p>Could not start UI Previewer.<br>'
5305 'Ensure that it is available as <b>{0}</b>.</p>' 5305 'Ensure that it is available as <b>{0}</b>.</p>'
5329 try: 5329 try:
5330 if os.path.isfile(fn) and os.path.getsize(fn): 5330 if os.path.isfile(fn) and os.path.getsize(fn):
5331 args.append(fn) 5331 args.append(fn)
5332 else: 5332 else:
5333 if not ignore: 5333 if not ignore:
5334 E5MessageBox.critical( 5334 EricMessageBox.critical(
5335 self, 5335 self,
5336 self.tr('Problem'), 5336 self.tr('Problem'),
5337 self.tr( 5337 self.tr(
5338 '<p>The file <b>{0}</b> does not exist or' 5338 '<p>The file <b>{0}</b> does not exist or'
5339 ' is zero length.</p>') 5339 ' is zero length.</p>')
5340 .format(fn)) 5340 .format(fn))
5341 return 5341 return
5342 except OSError: 5342 except OSError:
5343 if not ignore: 5343 if not ignore:
5344 E5MessageBox.critical( 5344 EricMessageBox.critical(
5345 self, 5345 self,
5346 self.tr('Problem'), 5346 self.tr('Problem'),
5347 self.tr( 5347 self.tr(
5348 '<p>The file <b>{0}</b> does not exist or' 5348 '<p>The file <b>{0}</b> does not exist or'
5349 ' is zero length.</p>') 5349 ' is zero length.</p>')
5352 5352
5353 if ( 5353 if (
5354 not os.path.isfile(viewer) or 5354 not os.path.isfile(viewer) or
5355 not proc.startDetached(sys.executable, args) 5355 not proc.startDetached(sys.executable, args)
5356 ): 5356 ):
5357 E5MessageBox.critical( 5357 EricMessageBox.critical(
5358 self, 5358 self,
5359 self.tr('Process Generation Error'), 5359 self.tr('Process Generation Error'),
5360 self.tr( 5360 self.tr(
5361 '<p>Could not start Translation Previewer.<br>' 5361 '<p>Could not start Translation Previewer.<br>'
5362 'Ensure that it is available as <b>{0}</b>.</p>' 5362 'Ensure that it is available as <b>{0}</b>.</p>'
5375 5375
5376 if ( 5376 if (
5377 not os.path.isfile(browser) or 5377 not os.path.isfile(browser) or
5378 not proc.startDetached(sys.executable, args) 5378 not proc.startDetached(sys.executable, args)
5379 ): 5379 ):
5380 E5MessageBox.critical( 5380 EricMessageBox.critical(
5381 self, 5381 self,
5382 self.tr('Process Generation Error'), 5382 self.tr('Process Generation Error'),
5383 self.tr( 5383 self.tr(
5384 '<p>Could not start SQL Browser.<br>' 5384 '<p>Could not start SQL Browser.<br>'
5385 'Ensure that it is available as <b>{0}</b>.</p>' 5385 'Ensure that it is available as <b>{0}</b>.</p>'
5460 5460
5461 if ( 5461 if (
5462 not os.path.isfile(snap) or 5462 not os.path.isfile(snap) or
5463 not proc.startDetached(sys.executable, args) 5463 not proc.startDetached(sys.executable, args)
5464 ): 5464 ):
5465 E5MessageBox.critical( 5465 EricMessageBox.critical(
5466 self, 5466 self,
5467 self.tr('Process Generation Error'), 5467 self.tr('Process Generation Error'),
5468 self.tr( 5468 self.tr(
5469 '<p>Could not start Snapshot tool.<br>' 5469 '<p>Could not start Snapshot tool.<br>'
5470 'Ensure that it is available as <b>{0}</b>.</p>' 5470 'Ensure that it is available as <b>{0}</b>.</p>'
5483 for tool in toolGroup[1]: 5483 for tool in toolGroup[1]:
5484 if tool['menutext'] == toolMenuText: 5484 if tool['menutext'] == toolMenuText:
5485 self.__startToolProcess(tool) 5485 self.__startToolProcess(tool)
5486 return 5486 return
5487 5487
5488 E5MessageBox.information( 5488 EricMessageBox.information(
5489 self, 5489 self,
5490 self.tr("External Tools"), 5490 self.tr("External Tools"),
5491 self.tr( 5491 self.tr(
5492 """No tool entry found for external tool '{0}' """ 5492 """No tool entry found for external tool '{0}' """
5493 """in tool group '{1}'.""") 5493 """in tool group '{1}'.""")
5494 .format(toolMenuText, toolGroupName)) 5494 .format(toolMenuText, toolGroupName))
5495 return 5495 return
5496 5496
5497 E5MessageBox.information( 5497 EricMessageBox.information(
5498 self, 5498 self,
5499 self.tr("External Tools"), 5499 self.tr("External Tools"),
5500 self.tr("""No toolgroup entry '{0}' found.""") 5500 self.tr("""No toolgroup entry '{0}' found.""")
5501 .format(toolGroupName) 5501 .format(toolGroupName)
5502 ) 5502 )
5547 if aw is not None: 5547 if aw is not None:
5548 aw.beginUndoAction() 5548 aw.beginUndoAction()
5549 5549
5550 proc.start(program, args) 5550 proc.start(program, args)
5551 if not proc.waitForStarted(): 5551 if not proc.waitForStarted():
5552 E5MessageBox.critical( 5552 EricMessageBox.critical(
5553 self, 5553 self,
5554 self.tr('Process Generation Error'), 5554 self.tr('Process Generation Error'),
5555 self.tr( 5555 self.tr(
5556 '<p>Could not start the tool entry <b>{0}</b>.<br>' 5556 '<p>Could not start the tool entry <b>{0}</b>.<br>'
5557 'Ensure that it is available as <b>{1}</b>.</p>') 5557 'Ensure that it is available as <b>{1}</b>.</p>')
5637 pythonDocDir = Preferences.getHelp("PythonDocDir") 5637 pythonDocDir = Preferences.getHelp("PythonDocDir")
5638 if not pythonDocDir: 5638 if not pythonDocDir:
5639 if Utilities.isWindowsPlatform(): 5639 if Utilities.isWindowsPlatform():
5640 venvName = Preferences.getDebugger("Python3VirtualEnv") 5640 venvName = Preferences.getDebugger("Python3VirtualEnv")
5641 interpreter = ( 5641 interpreter = (
5642 e5App().getObject("VirtualEnvManager") 5642 ericApp().getObject("VirtualEnvManager")
5643 .getVirtualenvInterpreter(venvName) 5643 .getVirtualenvInterpreter(venvName)
5644 ) 5644 )
5645 if interpreter: 5645 if interpreter:
5646 default = os.path.join(os.path.dirname(interpreter), "doc") 5646 default = os.path.join(os.path.dirname(interpreter), "doc")
5647 else: 5647 else:
5666 pythonDocDir, "python{0}.chm".format(vers)) 5666 pythonDocDir, "python{0}.chm".format(vers))
5667 else: 5667 else:
5668 home = pythonDocDir 5668 home = pythonDocDir
5669 5669
5670 if not os.path.exists(home): 5670 if not os.path.exists(home):
5671 E5MessageBox.warning( 5671 EricMessageBox.warning(
5672 self, 5672 self,
5673 self.tr("Documentation Missing"), 5673 self.tr("Documentation Missing"),
5674 self.tr("""<p>The documentation starting point""" 5674 self.tr("""<p>The documentation starting point"""
5675 """ "<b>{0}</b>" could not be found.</p>""") 5675 """ "<b>{0}</b>" could not be found.</p>""")
5676 .format(home)) 5676 .format(home))
5726 home = Utilities.normjoinpath(qtDocDir, 'index.html') 5726 home = Utilities.normjoinpath(qtDocDir, 'index.html')
5727 else: 5727 else:
5728 home = qtDocDir 5728 home = qtDocDir
5729 5729
5730 if not os.path.exists(home): 5730 if not os.path.exists(home):
5731 E5MessageBox.warning( 5731 EricMessageBox.warning(
5732 self, 5732 self,
5733 self.tr("Documentation Missing"), 5733 self.tr("Documentation Missing"),
5734 self.tr("""<p>The documentation starting point""" 5734 self.tr("""<p>The documentation starting point"""
5735 """ "<b>{0}</b>" could not be found.</p>""") 5735 """ "<b>{0}</b>" could not be found.</p>""")
5736 .format(home)) 5736 .format(home))
5765 if not pyqtDocDir: 5765 if not pyqtDocDir:
5766 pyqtDocDir = Utilities.getEnvironmentEntry( 5766 pyqtDocDir = Utilities.getEnvironmentEntry(
5767 "PYQT{0}DOCDIR".format(variant), None) 5767 "PYQT{0}DOCDIR".format(variant), None)
5768 5768
5769 if not pyqtDocDir: 5769 if not pyqtDocDir:
5770 E5MessageBox.warning( 5770 EricMessageBox.warning(
5771 self, 5771 self,
5772 self.tr("Documentation"), 5772 self.tr("Documentation"),
5773 self.tr("""<p>The PyQt{0} documentation starting point""" 5773 self.tr("""<p>The PyQt{0} documentation starting point"""
5774 """ has not been configured.</p>""").format(variant)) 5774 """ has not been configured.</p>""").format(variant))
5775 return 5775 return
5792 break 5792 break
5793 else: 5793 else:
5794 home = pyqtDocDir 5794 home = pyqtDocDir
5795 5795
5796 if not home or not os.path.exists(home): 5796 if not home or not os.path.exists(home):
5797 E5MessageBox.warning( 5797 EricMessageBox.warning(
5798 self, 5798 self,
5799 self.tr("Documentation Missing"), 5799 self.tr("Documentation Missing"),
5800 self.tr("""<p>The documentation starting point""" 5800 self.tr("""<p>The documentation starting point"""
5801 """ "<b>{0}</b>" could not be found.</p>""") 5801 """ "<b>{0}</b>" could not be found.</p>""")
5802 .format(home)) 5802 .format(home))
5831 home = Utilities.normjoinpath( 5831 home = Utilities.normjoinpath(
5832 getConfig('ericDocDir'), "Source", "index.html") 5832 getConfig('ericDocDir'), "Source", "index.html")
5833 5833
5834 if not home.startswith(("http://", "https://", "qthelp://")): 5834 if not home.startswith(("http://", "https://", "qthelp://")):
5835 if not os.path.exists(home): 5835 if not os.path.exists(home):
5836 E5MessageBox.warning( 5836 EricMessageBox.warning(
5837 self, 5837 self,
5838 self.tr("Documentation Missing"), 5838 self.tr("Documentation Missing"),
5839 self.tr("""<p>The documentation starting point""" 5839 self.tr("""<p>The documentation starting point"""
5840 """ "<b>{0}</b>" could not be found.</p>""") 5840 """ "<b>{0}</b>" could not be found.</p>""")
5841 .format(home)) 5841 .format(home))
5870 if not pysideDocDir: 5870 if not pysideDocDir:
5871 pysideDocDir = Utilities.getEnvironmentEntry( 5871 pysideDocDir = Utilities.getEnvironmentEntry(
5872 "PYSIDE{0}DOCDIR".format(variant), None) 5872 "PYSIDE{0}DOCDIR".format(variant), None)
5873 5873
5874 if not pysideDocDir: 5874 if not pysideDocDir:
5875 E5MessageBox.warning( 5875 EricMessageBox.warning(
5876 self, 5876 self,
5877 self.tr("Documentation"), 5877 self.tr("Documentation"),
5878 self.tr("""<p>The PySide{0} documentation starting point""" 5878 self.tr("""<p>The PySide{0} documentation starting point"""
5879 """ has not been configured.</p>""").format( 5879 """ has not been configured.</p>""").format(
5880 variant) 5880 variant)
5887 if not os.path.splitext(pysideDocDir)[1]: 5887 if not os.path.splitext(pysideDocDir)[1]:
5888 home = Utilities.normjoinpath(pysideDocDir, 'index.html') 5888 home = Utilities.normjoinpath(pysideDocDir, 'index.html')
5889 else: 5889 else:
5890 home = pysideDocDir 5890 home = pysideDocDir
5891 if not os.path.exists(home): 5891 if not os.path.exists(home):
5892 E5MessageBox.warning( 5892 EricMessageBox.warning(
5893 self, 5893 self,
5894 self.tr("Documentation Missing"), 5894 self.tr("Documentation Missing"),
5895 self.tr("""<p>The documentation starting point""" 5895 self.tr("""<p>The documentation starting point"""
5896 """ "<b>{0}</b>" could not be found.</p>""") 5896 """ "<b>{0}</b>" could not be found.</p>""")
5897 .format(home)) 5897 .format(home))
5983 "--name={0}".format(self.__webBrowserSAName), 5983 "--name={0}".format(self.__webBrowserSAName),
5984 home 5984 home
5985 ] 5985 ]
5986 process.start(sys.executable, args) 5986 process.start(sys.executable, args)
5987 if not process.waitForStarted(): 5987 if not process.waitForStarted():
5988 E5MessageBox.warning( 5988 EricMessageBox.warning(
5989 self, 5989 self,
5990 self.tr("Start Web Browser"), 5990 self.tr("Start Web Browser"),
5991 self.tr("""The eric web browser could not be""" 5991 self.tr("""The eric web browser could not be"""
5992 """ started.""")) 5992 """ started."""))
5993 return False 5993 return False
6047 process.exitCode() == 100 6047 process.exitCode() == 100
6048 ): 6048 ):
6049 # Process exited prematurely due to missing pre-requisites 6049 # Process exited prematurely due to missing pre-requisites
6050 return -1 6050 return -1
6051 if res <= 0: 6051 if res <= 0:
6052 E5MessageBox.warning( 6052 EricMessageBox.warning(
6053 self, 6053 self,
6054 self.tr("Start Web Browser"), 6054 self.tr("Start Web Browser"),
6055 self.tr("""<p>The eric web browser is not started.</p>""" 6055 self.tr("""<p>The eric web browser is not started.</p>"""
6056 """<p>Reason: {0}</p>""").format( 6056 """<p>Reason: {0}</p>""").format(
6057 webBrowserClient.errstr()) 6057 webBrowserClient.errstr())
6090 6090
6091 @param home full pathname of a file to display (string) 6091 @param home full pathname of a file to display (string)
6092 """ 6092 """
6093 started = QDesktopServices.openUrl(QUrl(home)) 6093 started = QDesktopServices.openUrl(QUrl(home))
6094 if not started: 6094 if not started:
6095 E5MessageBox.critical( 6095 EricMessageBox.critical(
6096 self, 6096 self,
6097 self.tr('Open Browser'), 6097 self.tr('Open Browser'),
6098 self.tr('Could not start a web browser')) 6098 self.tr('Could not start a web browser'))
6099 6099
6100 @pyqtSlot() 6100 @pyqtSlot()
6164 self.setStyle(Preferences.getUI("Style"), 6164 self.setStyle(Preferences.getUI("Style"),
6165 Preferences.getUI("StyleSheet")) 6165 Preferences.getUI("StyleSheet"))
6166 6166
6167 if Preferences.getUI("SingleApplicationMode"): 6167 if Preferences.getUI("SingleApplicationMode"):
6168 if self.SAServer is None: 6168 if self.SAServer is None:
6169 self.SAServer = E5SingleApplicationServer() 6169 self.SAServer = EricSingleApplicationServer()
6170 else: 6170 else:
6171 if self.SAServer is not None: 6171 if self.SAServer is not None:
6172 self.SAServer.shutdown() 6172 self.SAServer.shutdown()
6173 self.SAServer = None 6173 self.SAServer = None
6174 self.newWindowAct.setEnabled( 6174 self.newWindowAct.setEnabled(
6281 6281
6282 def __configToolBars(self): 6282 def __configToolBars(self):
6283 """ 6283 """
6284 Private slot to configure the various toolbars. 6284 Private slot to configure the various toolbars.
6285 """ 6285 """
6286 from E5Gui.E5ToolBarDialog import E5ToolBarDialog 6286 from E5Gui.EricToolBarDialog import EricToolBarDialog
6287 dlg = E5ToolBarDialog(self.toolbarManager) 6287 dlg = EricToolBarDialog(self.toolbarManager)
6288 if dlg.exec() == QDialog.DialogCode.Accepted: 6288 if dlg.exec() == QDialog.DialogCode.Accepted:
6289 Preferences.setUI( 6289 Preferences.setUI(
6290 "ToolbarManagerState", self.toolbarManager.saveState()) 6290 "ToolbarManagerState", self.toolbarManager.saveState())
6291 6291
6292 def __configShortcuts(self): 6292 def __configShortcuts(self):
6301 6301
6302 def __exportShortcuts(self): 6302 def __exportShortcuts(self):
6303 """ 6303 """
6304 Private slot to export the keyboard shortcuts. 6304 Private slot to export the keyboard shortcuts.
6305 """ 6305 """
6306 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( 6306 fn, selectedFilter = EricFileDialog.getSaveFileNameAndFilter(
6307 None, 6307 None,
6308 self.tr("Export Keyboard Shortcuts"), 6308 self.tr("Export Keyboard Shortcuts"),
6309 "", 6309 "",
6310 self.tr("Keyboard Shortcuts File (*.ekj)"), 6310 self.tr("Keyboard Shortcuts File (*.ekj)"),
6311 "", 6311 "",
6312 E5FileDialog.DontConfirmOverwrite) 6312 EricFileDialog.DontConfirmOverwrite)
6313 6313
6314 if not fn: 6314 if not fn:
6315 return 6315 return
6316 6316
6317 ext = QFileInfo(fn).suffix() 6317 ext = QFileInfo(fn).suffix()
6319 ex = selectedFilter.split("(*")[1].split(")")[0] 6319 ex = selectedFilter.split("(*")[1].split(")")[0]
6320 if ex: 6320 if ex:
6321 fn += ex 6321 fn += ex
6322 6322
6323 ok = ( 6323 ok = (
6324 E5MessageBox.yesNo( 6324 EricMessageBox.yesNo(
6325 self, 6325 self,
6326 self.tr("Export Keyboard Shortcuts"), 6326 self.tr("Export Keyboard Shortcuts"),
6327 self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists""" 6327 self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists"""
6328 """ already. Overwrite it?</p>""").format(fn)) 6328 """ already. Overwrite it?</p>""").format(fn))
6329 if os.path.exists(fn) else 6329 if os.path.exists(fn) else
6336 6336
6337 def __importShortcuts(self): 6337 def __importShortcuts(self):
6338 """ 6338 """
6339 Private slot to import the keyboard shortcuts. 6339 Private slot to import the keyboard shortcuts.
6340 """ 6340 """
6341 fn = E5FileDialog.getOpenFileName( 6341 fn = EricFileDialog.getOpenFileName(
6342 None, 6342 None,
6343 self.tr("Import Keyboard Shortcuts"), 6343 self.tr("Import Keyboard Shortcuts"),
6344 "", 6344 "",
6345 self.tr("Keyboard Shortcuts File (*.ekj);;" 6345 self.tr("Keyboard Shortcuts File (*.ekj);;"
6346 "XML Keyboard shortcut file (*.e4k)")) 6346 "XML Keyboard shortcut file (*.e4k)"))
6404 """ 6404 """
6405 Private slot to handle the projectOpened signal. 6405 Private slot to handle the projectOpened signal.
6406 """ 6406 """
6407 from Debugger.DebugClientCapabilities import HasUnittest 6407 from Debugger.DebugClientCapabilities import HasUnittest
6408 self.__setWindowCaption(project=self.project.name) 6408 self.__setWindowCaption(project=self.project.name)
6409 cap = e5App().getObject("DebugServer").getClientCapabilities( 6409 cap = ericApp().getObject("DebugServer").getClientCapabilities(
6410 self.project.getProjectLanguage()) 6410 self.project.getProjectLanguage())
6411 self.utProjectAct.setEnabled(cap & HasUnittest) 6411 self.utProjectAct.setEnabled(cap & HasUnittest)
6412 self.utProjectOpen = cap & HasUnittest 6412 self.utProjectOpen = cap & HasUnittest
6413 6413
6414 def __projectClosed(self): 6414 def __projectClosed(self):
6456 """ 6456 """
6457 self.wizardsMenuAct.setEnabled( 6457 self.wizardsMenuAct.setEnabled(
6458 len(self.__menus["wizards"].actions()) > 0) 6458 len(self.__menus["wizards"].actions()) > 0)
6459 6459
6460 if fn and str(fn) != "None": 6460 if fn and str(fn) != "None":
6461 dbs = e5App().getObject("DebugServer") 6461 dbs = ericApp().getObject("DebugServer")
6462 for language in dbs.getSupportedLanguages(): 6462 for language in dbs.getSupportedLanguages():
6463 exts = dbs.getExtensions(language) 6463 exts = dbs.getExtensions(language)
6464 if fn.endswith(exts): 6464 if fn.endswith(exts):
6465 from Debugger.DebugClientCapabilities import HasUnittest 6465 from Debugger.DebugClientCapabilities import HasUnittest
6466 cap = dbs.getClientCapabilities(language) 6466 cap = dbs.getClientCapabilities(language)
6479 @param editor editor window 6479 @param editor editor window
6480 """ 6480 """
6481 fn = editor.getFileName() if editor else None 6481 fn = editor.getFileName() if editor else None
6482 6482
6483 if fn: 6483 if fn:
6484 dbs = e5App().getObject("DebugServer") 6484 dbs = ericApp().getObject("DebugServer")
6485 for language in dbs.getSupportedLanguages(): 6485 for language in dbs.getSupportedLanguages():
6486 exts = dbs.getExtensions(language) 6486 exts = dbs.getExtensions(language)
6487 if fn.endswith(exts): 6487 if fn.endswith(exts):
6488 from Debugger.DebugClientCapabilities import HasUnittest 6488 from Debugger.DebugClientCapabilities import HasUnittest
6489 cap = dbs.getClientCapabilities(language) 6489 cap = dbs.getClientCapabilities(language)
6522 from EricXML.TasksReader import TasksReader 6522 from EricXML.TasksReader import TasksReader
6523 reader = TasksReader(f, viewer=self.taskViewer) 6523 reader = TasksReader(f, viewer=self.taskViewer)
6524 reader.readXML() 6524 reader.readXML()
6525 f.close() 6525 f.close()
6526 else: 6526 else:
6527 E5MessageBox.critical( 6527 EricMessageBox.critical(
6528 self, 6528 self,
6529 self.tr("Read Tasks"), 6529 self.tr("Read Tasks"),
6530 self.tr( 6530 self.tr(
6531 "<p>The tasks file <b>{0}</b> could not be" 6531 "<p>The tasks file <b>{0}</b> could not be"
6532 " read.</p>") 6532 " read.</p>")
6570 "eric7session.esj") 6570 "eric7session.esj")
6571 if not os.path.exists(fn): 6571 if not os.path.exists(fn):
6572 fn = os.path.join(Utilities.getConfigDir(), 6572 fn = os.path.join(Utilities.getConfigDir(),
6573 "eric7session.e5s") 6573 "eric7session.e5s")
6574 if not os.path.exists(fn): 6574 if not os.path.exists(fn):
6575 E5MessageBox.critical( 6575 EricMessageBox.critical(
6576 self, 6576 self,
6577 self.tr("Read Session"), 6577 self.tr("Read Session"),
6578 self.tr("<p>The session file <b>{0}</b> could not" 6578 self.tr("<p>The session file <b>{0}</b> could not"
6579 " be read.</p>") 6579 " be read.</p>")
6580 .format(fn)) 6580 .format(fn))
6597 reader.readXML() 6597 reader.readXML()
6598 self.__readingSession = False 6598 self.__readingSession = False
6599 f.close() 6599 f.close()
6600 res = True 6600 res = True
6601 else: 6601 else:
6602 E5MessageBox.critical( 6602 EricMessageBox.critical(
6603 self, 6603 self,
6604 self.tr("Read session"), 6604 self.tr("Read session"),
6605 self.tr("<p>The session file <b>{0}</b> could not be" 6605 self.tr("<p>The session file <b>{0}</b> could not be"
6606 " read.</p>") 6606 " read.</p>")
6607 .format(fn)) 6607 .format(fn))
6613 6613
6614 def __saveSessionToFile(self): 6614 def __saveSessionToFile(self):
6615 """ 6615 """
6616 Private slot to save a session to disk. 6616 Private slot to save a session to disk.
6617 """ 6617 """
6618 sessionFile, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( 6618 sessionFile, selectedFilter = EricFileDialog.getSaveFileNameAndFilter(
6619 self, 6619 self,
6620 self.tr("Save Session"), 6620 self.tr("Save Session"),
6621 Utilities.getHomeDir(), 6621 Utilities.getHomeDir(),
6622 self.tr("eric Session Files (*.esj)"), 6622 self.tr("eric Session Files (*.esj)"),
6623 "") 6623 "")
6635 6635
6636 def __loadSessionFromFile(self): 6636 def __loadSessionFromFile(self):
6637 """ 6637 """
6638 Private slot to load a session from disk. 6638 Private slot to load a session from disk.
6639 """ 6639 """
6640 sessionFile = E5FileDialog.getOpenFileName( 6640 sessionFile = EricFileDialog.getOpenFileName(
6641 self, 6641 self,
6642 self.tr("Load session"), 6642 self.tr("Load session"),
6643 Utilities.getHomeDir(), 6643 Utilities.getHomeDir(),
6644 self.tr("eric Session Files (*.esj);;" 6644 self.tr("eric Session Files (*.esj);;"
6645 "eric XML Session Files (*.e5s)")) 6645 "eric XML Session Files (*.e5s)"))
6685 Preferences.getUI("OpenCrashSessionOnStartup") 6685 Preferences.getUI("OpenCrashSessionOnStartup")
6686 ): 6686 ):
6687 fn = os.path.join(Utilities.getConfigDir(), 6687 fn = os.path.join(Utilities.getConfigDir(),
6688 "eric7_crash_session.esj") 6688 "eric7_crash_session.esj")
6689 if os.path.exists(fn): 6689 if os.path.exists(fn):
6690 yes = E5MessageBox.yesNo( 6690 yes = EricMessageBox.yesNo(
6691 self, 6691 self,
6692 self.tr("Crash Session found!"), 6692 self.tr("Crash Session found!"),
6693 self.tr("""A session file of a crashed session was""" 6693 self.tr("""A session file of a crashed session was"""
6694 """ found. Shall this session be restored?""")) 6694 """ found. Shall this session be restored?"""))
6695 if yes: 6695 if yes:
6890 fname = url.toLocalFile() 6890 fname = url.toLocalFile()
6891 if fname: 6891 if fname:
6892 if QFileInfo(fname).isFile(): 6892 if QFileInfo(fname).isFile():
6893 self.viewmanager.openSourceFile(fname) 6893 self.viewmanager.openSourceFile(fname)
6894 else: 6894 else:
6895 E5MessageBox.information( 6895 EricMessageBox.information(
6896 self, 6896 self,
6897 self.tr("Drop Error"), 6897 self.tr("Drop Error"),
6898 self.tr("""<p><b>{0}</b> is not a file.</p>""") 6898 self.tr("""<p><b>{0}</b> is not a file.</p>""")
6899 .format(fname)) 6899 .format(fname))
6900 6900
6914 """ 6914 """
6915 if self.__shutdown(): 6915 if self.__shutdown():
6916 event.accept() 6916 event.accept()
6917 if not self.inCloseEvent: 6917 if not self.inCloseEvent:
6918 self.inCloseEvent = True 6918 self.inCloseEvent = True
6919 QTimer.singleShot(0, e5App().closeAllWindows) 6919 QTimer.singleShot(0, ericApp().closeAllWindows)
6920 else: 6920 else:
6921 event.ignore() 6921 event.ignore()
6922 6922
6923 def __shutdown(self): 6923 def __shutdown(self):
6924 """ 6924 """
7052 self.httpAlternative = alternative 7052 self.httpAlternative = alternative
7053 url = QUrl(self.__httpAlternatives[alternative]) 7053 url = QUrl(self.__httpAlternatives[alternative])
7054 self.__versionCheckCanceled = False 7054 self.__versionCheckCanceled = False
7055 if manual: 7055 if manual:
7056 if self.__versionCheckProgress is None: 7056 if self.__versionCheckProgress is None:
7057 self.__versionCheckProgress = E5ProgressDialog( 7057 self.__versionCheckProgress = EricProgressDialog(
7058 "", self.tr("&Cancel"), 7058 "", self.tr("&Cancel"),
7059 0, len(self.__httpAlternatives), 7059 0, len(self.__httpAlternatives),
7060 self.tr("%v/%m"), self) 7060 self.tr("%v/%m"), self)
7061 self.__versionCheckProgress.setWindowTitle( 7061 self.__versionCheckProgress.setWindowTitle(
7062 self.tr("Version Check")) 7062 self.tr("Version Check"))
7113 "Updates/FirstFailedCheckDate", QDate.currentDate()) 7113 "Updates/FirstFailedCheckDate", QDate.currentDate())
7114 failedDuration = firstFailure.daysTo(QDate.currentDate()) 7114 failedDuration = firstFailure.daysTo(QDate.currentDate())
7115 Preferences.Prefs.settings.setValue( 7115 Preferences.Prefs.settings.setValue(
7116 "Updates/FirstFailedCheckDate", firstFailure) 7116 "Updates/FirstFailedCheckDate", firstFailure)
7117 if self.manualUpdatesCheck: 7117 if self.manualUpdatesCheck:
7118 E5MessageBox.warning( 7118 EricMessageBox.warning(
7119 self, 7119 self,
7120 self.tr("Error getting versions information"), 7120 self.tr("Error getting versions information"),
7121 self.tr("""The versions information could not be""" 7121 self.tr("""The versions information could not be"""
7122 """ downloaded.""" 7122 """ downloaded."""
7123 """ Please go online and try again.""")) 7123 """ Please go online and try again."""))
7124 elif failedDuration > 7: 7124 elif failedDuration > 7:
7125 E5MessageBox.warning( 7125 EricMessageBox.warning(
7126 self, 7126 self,
7127 self.tr("Error getting versions information"), 7127 self.tr("Error getting versions information"),
7128 self.tr("""The versions information could not be""" 7128 self.tr("""The versions information could not be"""
7129 """ downloaded for the last 7 days.""" 7129 """ downloaded for the last 7 days."""
7130 """ Please go online and try again.""")) 7130 """ Please go online and try again."""))
7178 # check snapshot version like snapshot-20170810 7178 # check snapshot version like snapshot-20170810
7179 if "snapshot-" in versions[2]: 7179 if "snapshot-" in versions[2]:
7180 installedSnapshotDate = VersionOnly.rsplit("-", 1)[-1] 7180 installedSnapshotDate = VersionOnly.rsplit("-", 1)[-1]
7181 availableSnapshotDate = versions[2].rsplit("-", 1)[-1] 7181 availableSnapshotDate = versions[2].rsplit("-", 1)[-1]
7182 if availableSnapshotDate > installedSnapshotDate: 7182 if availableSnapshotDate > installedSnapshotDate:
7183 res = E5MessageBox.yesNo( 7183 res = EricMessageBox.yesNo(
7184 self, 7184 self,
7185 self.tr("Update available"), 7185 self.tr("Update available"),
7186 self.tr( 7186 self.tr(
7187 """The update to <b>{0}</b> of eric is""" 7187 """The update to <b>{0}</b> of eric is"""
7188 """ available at <b>{1}</b>. Would you like""" 7188 """ available at <b>{1}</b>. Would you like"""
7190 .format(versions[2], versions[3]), 7190 .format(versions[2], versions[3]),
7191 yesDefault=True) 7191 yesDefault=True)
7192 url = res and versions[3] or '' 7192 url = res and versions[3] or ''
7193 else: 7193 else:
7194 if self.manualUpdatesCheck: 7194 if self.manualUpdatesCheck:
7195 E5MessageBox.information( 7195 EricMessageBox.information(
7196 self, 7196 self,
7197 self.tr("Update Check"), 7197 self.tr("Update Check"),
7198 self.tr( 7198 self.tr(
7199 """You are using a snapshot release of""" 7199 """You are using a snapshot release of"""
7200 """ eric. A more up-to-date stable release""" 7200 """ eric. A more up-to-date stable release"""
7201 """ might be available.""")) 7201 """ might be available."""))
7202 elif VersionOnly.startswith(("rev_", "@@")): 7202 elif VersionOnly.startswith(("rev_", "@@")):
7203 # check installation from source 7203 # check installation from source
7204 if self.manualUpdatesCheck: 7204 if self.manualUpdatesCheck:
7205 E5MessageBox.information( 7205 EricMessageBox.information(
7206 self, 7206 self,
7207 self.tr("Update Check"), 7207 self.tr("Update Check"),
7208 self.tr( 7208 self.tr(
7209 """You installed eric directly from the source""" 7209 """You installed eric directly from the source"""
7210 """ code. There is no possibility to check""" 7210 """ code. There is no possibility to check"""
7212 else: 7212 else:
7213 # check release version 7213 # check release version
7214 installedVersionTuple = self.__versionToTuple(VersionOnly) 7214 installedVersionTuple = self.__versionToTuple(VersionOnly)
7215 availableVersionTuple = self.__versionToTuple(versions[0]) 7215 availableVersionTuple = self.__versionToTuple(versions[0])
7216 if availableVersionTuple > installedVersionTuple: 7216 if availableVersionTuple > installedVersionTuple:
7217 res = E5MessageBox.yesNo( 7217 res = EricMessageBox.yesNo(
7218 self, 7218 self,
7219 self.tr("Update available"), 7219 self.tr("Update available"),
7220 self.tr( 7220 self.tr(
7221 """The update to <b>{0}</b> of eric is""" 7221 """The update to <b>{0}</b> of eric is"""
7222 """ available at <b>{1}</b>. Would you like""" 7222 """ available at <b>{1}</b>. Would you like"""
7224 .format(versions[0], versions[1]), 7224 .format(versions[0], versions[1]),
7225 yesDefault=True) 7225 yesDefault=True)
7226 url = res and versions[1] or '' 7226 url = res and versions[1] or ''
7227 else: 7227 else:
7228 if self.manualUpdatesCheck: 7228 if self.manualUpdatesCheck:
7229 E5MessageBox.information( 7229 EricMessageBox.information(
7230 self, 7230 self,
7231 self.tr("eric is up to date"), 7231 self.tr("eric is up to date"),
7232 self.tr( 7232 self.tr(
7233 """You are using the latest version of""" 7233 """You are using the latest version of"""
7234 """ eric""")) 7234 """ eric"""))
7235 except (IndexError, TypeError): 7235 except (IndexError, TypeError):
7236 E5MessageBox.warning( 7236 EricMessageBox.warning(
7237 self, 7237 self,
7238 self.tr("Error during updates check"), 7238 self.tr("Error during updates check"),
7239 self.tr("""Could not perform updates check.""")) 7239 self.tr("""Could not perform updates check."""))
7240 7240
7241 if url: 7241 if url:
7272 'sourceforge' in versions[line + 1] and 7272 'sourceforge' in versions[line + 1] and
7273 "SourceForge" or versions[line + 1]) 7273 "SourceForge" or versions[line + 1])
7274 line += 2 7274 line += 2
7275 versionText += self.tr("""</table>""") 7275 versionText += self.tr("""</table>""")
7276 7276
7277 self.__versionsDialog = E5MessageBox.E5MessageBox( 7277 self.__versionsDialog = EricMessageBox.EricMessageBox(
7278 E5MessageBox.NoIcon, 7278 EricMessageBox.NoIcon,
7279 Program, 7279 Program,
7280 versionText, 7280 versionText,
7281 modal=False, 7281 modal=False,
7282 buttons=E5MessageBox.Ok, 7282 buttons=EricMessageBox.Ok,
7283 parent=self 7283 parent=self
7284 ) 7284 )
7285 self.__versionsDialog.setIconPixmap( 7285 self.__versionsDialog.setIconPixmap(
7286 UI.PixmapCache.getPixmap("eric").scaled(64, 64)) 7286 UI.PixmapCache.getPixmap("eric").scaled(64, 64))
7287 self.__versionsDialog.show() 7287 self.__versionsDialog.show()
7307 the configuration dialog is shown. 7307 the configuration dialog is shown.
7308 """ 7308 """
7309 if not Preferences.isConfigured(): 7309 if not Preferences.isConfigured():
7310 self.__initDebugToolbarsLayout() 7310 self.__initDebugToolbarsLayout()
7311 7311
7312 E5MessageBox.information( 7312 EricMessageBox.information(
7313 self, 7313 self,
7314 self.tr("First time usage"), 7314 self.tr("First time usage"),
7315 self.tr("""eric has not been configured yet. """ 7315 self.tr("""eric has not been configured yet. """
7316 """The configuration dialog will be started.""")) 7316 """The configuration dialog will be started."""))
7317 self.showPreferences() 7317 self.showPreferences()
7326 self.checkConfigurationStatus() 7326 self.checkConfigurationStatus()
7327 7327
7328 workspace = Preferences.getMultiProject("Workspace") 7328 workspace = Preferences.getMultiProject("Workspace")
7329 if workspace == "": 7329 if workspace == "":
7330 default = Utilities.getHomeDir() 7330 default = Utilities.getHomeDir()
7331 workspace = E5FileDialog.getExistingDirectory( 7331 workspace = EricFileDialog.getExistingDirectory(
7332 None, 7332 None,
7333 self.tr("Select Workspace Directory"), 7333 self.tr("Select Workspace Directory"),
7334 default, 7334 default,
7335 E5FileDialog.Option(0)) 7335 EricFileDialog.Option(0))
7336 Preferences.setMultiProject("Workspace", workspace) 7336 Preferences.setMultiProject("Workspace", workspace)
7337 7337
7338 def versionIsNewer(self, required, snapshot=None): 7338 def versionIsNewer(self, required, snapshot=None):
7339 """ 7339 """
7340 Public method to check, if the eric version is good compared to 7340 Public method to check, if the eric version is good compared to

eric ide

mercurial