235 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
235 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
236 self.__setWindowCaption() |
236 self.__setWindowCaption() |
237 |
237 |
238 # load the view profiles |
238 # load the view profiles |
239 self.profiles = Preferences.getUI("ViewProfiles2") |
239 self.profiles = Preferences.getUI("ViewProfiles2") |
|
240 |
|
241 # Generate the virtual environment manager |
|
242 from VirtualEnv.VirtualenvManager import VirtualenvManager |
|
243 self.virtualenvManager = VirtualenvManager(self) |
|
244 # register it early because it is needed very soon |
|
245 e5App().registerObject("VirtualEnvManager", self.virtualenvManager) |
240 |
246 |
241 # Generate the debug server object |
247 # Generate the debug server object |
242 from Debugger.DebugServer import DebugServer |
248 from Debugger.DebugServer import DebugServer |
243 debugServer = DebugServer() |
249 debugServer = DebugServer() |
244 |
250 |
2411 """available on the Internet.</p>""" |
2417 """available on the Internet.</p>""" |
2412 )) |
2418 )) |
2413 self.pluginRepoAct.triggered.connect(self.showPluginsAvailable) |
2419 self.pluginRepoAct.triggered.connect(self.showPluginsAvailable) |
2414 self.actions.append(self.pluginRepoAct) |
2420 self.actions.append(self.pluginRepoAct) |
2415 |
2421 |
|
2422 self.virtualenvManagerAct = E5Action( |
|
2423 self.tr('Virtualenv Manager'), |
|
2424 UI.PixmapCache.getIcon("virtualenv.png"), |
|
2425 self.tr('&Virtualenv Manager...'), |
|
2426 0, 0, self, |
|
2427 'virtualenv_manager') |
|
2428 self.virtualenvManagerAct.setStatusTip(self.tr( |
|
2429 'Virtualenv Manager')) |
|
2430 self.virtualenvManagerAct.setWhatsThis(self.tr( |
|
2431 """<b>Virtualenv Manager</b>""" |
|
2432 """<p>This opens a dialog to manage the defined Python virtual""" |
|
2433 """ environments.</p>""" |
|
2434 )) |
|
2435 self.virtualenvManagerAct.triggered.connect( |
|
2436 self.virtualenvManager.showVirtualenvManagerDialog) |
|
2437 self.actions.append(self.virtualenvManagerAct) |
|
2438 |
|
2439 self.virtualenvConfigAct = E5Action( |
|
2440 self.tr('Virtualenv Configurator'), |
|
2441 UI.PixmapCache.getIcon("virtualenvConfig.png"), |
|
2442 self.tr('Virtualenv &Configurator...'), |
|
2443 0, 0, self, |
|
2444 'virtualenv_configurator') |
|
2445 self.virtualenvConfigAct.setStatusTip(self.tr( |
|
2446 'Virtualenv Configurator')) |
|
2447 self.virtualenvConfigAct.setWhatsThis(self.tr( |
|
2448 """<b>Virtualenv Configurator</b>""" |
|
2449 """<p>This opens a dialog for entering all the parameters""" |
|
2450 """ needed to create a Python virtual environment using""" |
|
2451 """ virtualenv or pyvenv.</p>""" |
|
2452 )) |
|
2453 self.virtualenvConfigAct.triggered.connect( |
|
2454 self.virtualenvManager.createVirtualEnv) |
|
2455 self.actions.append(self.virtualenvConfigAct) |
|
2456 |
2416 # initialize viewmanager actions |
2457 # initialize viewmanager actions |
2417 self.viewmanager.initActions() |
2458 self.viewmanager.initActions() |
2418 |
2459 |
2419 # initialize debugger actions |
2460 # initialize debugger actions |
2420 self.debuggerUI.initActions() |
2461 self.debuggerUI.initActions() |
2668 self.wizardsMenuAct = self.__menus["extras"].addMenu( |
2709 self.wizardsMenuAct = self.__menus["extras"].addMenu( |
2669 self.__menus["wizards"]) |
2710 self.__menus["wizards"]) |
2670 self.wizardsMenuAct.setEnabled(False) |
2711 self.wizardsMenuAct.setEnabled(False) |
2671 self.__menus["macros"] = self.viewmanager.initMacroMenu() |
2712 self.__menus["macros"] = self.viewmanager.initMacroMenu() |
2672 self.__menus["extras"].addMenu(self.__menus["macros"]) |
2713 self.__menus["extras"].addMenu(self.__menus["macros"]) |
|
2714 self.__menus["extras"].addSeparator() |
|
2715 self.__menus["extras"].addAction(self.virtualenvManagerAct) |
|
2716 self.__menus["extras"].addAction(self.virtualenvConfigAct) |
2673 self.toolGroupsMenu = QMenu(self.tr("Select Tool Group"), self) |
2717 self.toolGroupsMenu = QMenu(self.tr("Select Tool Group"), self) |
2674 self.toolGroupsMenu.aboutToShow.connect(self.__showToolGroupsMenu) |
2718 self.toolGroupsMenu.aboutToShow.connect(self.__showToolGroupsMenu) |
2675 self.toolGroupsMenu.triggered.connect(self.__toolGroupSelected) |
2719 self.toolGroupsMenu.triggered.connect(self.__toolGroupSelected) |
2676 self.toolGroupsMenuTriggered = False |
2720 self.toolGroupsMenuTriggered = False |
2677 self.__menus["extras"].addSeparator() |
2721 self.__menus["extras"].addSeparator() |
2867 toolstb.addSeparator() |
2911 toolstb.addSeparator() |
2868 toolstb.addAction(self.miniEditorAct) |
2912 toolstb.addAction(self.miniEditorAct) |
2869 toolstb.addAction(self.hexEditorAct) |
2913 toolstb.addAction(self.hexEditorAct) |
2870 toolstb.addAction(self.iconEditorAct) |
2914 toolstb.addAction(self.iconEditorAct) |
2871 toolstb.addAction(self.snapshotAct) |
2915 toolstb.addAction(self.snapshotAct) |
|
2916 toolstb.addSeparator() |
|
2917 toolstb.addAction(self.virtualenvManagerAct) |
|
2918 toolstb.addAction(self.virtualenvConfigAct) |
2872 if self.webBrowserAct: |
2919 if self.webBrowserAct: |
2873 toolstb.addSeparator() |
2920 toolstb.addSeparator() |
2874 toolstb.addAction(self.webBrowserAct) |
2921 toolstb.addAction(self.webBrowserAct) |
2875 self.toolbarManager.addToolBar(toolstb, toolstb.windowTitle()) |
2922 self.toolbarManager.addToolBar(toolstb, toolstb.windowTitle()) |
2876 |
2923 |
3195 def __showVersions(self): |
3242 def __showVersions(self): |
3196 """ |
3243 """ |
3197 Private slot to handle the Versions dialog. |
3244 Private slot to handle the Versions dialog. |
3198 """ |
3245 """ |
3199 try: |
3246 try: |
3200 import sip |
3247 try: |
|
3248 from PyQt5 import sip |
|
3249 except ImportError: |
|
3250 import sip |
3201 sip_version_str = sip.SIP_VERSION_STR |
3251 sip_version_str = sip.SIP_VERSION_STR |
3202 except (ImportError, AttributeError): |
3252 except (ImportError, AttributeError): |
3203 sip_version_str = "sip version not available" |
3253 sip_version_str = "sip version not available" |
3204 |
3254 |
3205 versionText = self.tr( |
3255 versionText = self.tr( |
5036 Private slot to show the Python 3 documentation. |
5086 Private slot to show the Python 3 documentation. |
5037 """ |
5087 """ |
5038 pythonDocDir = Preferences.getHelp("PythonDocDir") |
5088 pythonDocDir = Preferences.getHelp("PythonDocDir") |
5039 if not pythonDocDir: |
5089 if not pythonDocDir: |
5040 if Utilities.isWindowsPlatform(): |
5090 if Utilities.isWindowsPlatform(): |
5041 pythonDocDir = Utilities.getEnvironmentEntry( |
5091 venvName = Preferences.getDebugger("Python3VirtualEnv") |
5042 "PYTHON3DOCDIR", |
5092 interpreter = e5App().getObject("VirtualEnvManager")\ |
5043 os.path.join(os.path.dirname(sys.executable), "doc")) |
5093 .getVirtualenvInterpreter(venvName) |
|
5094 if interpreter: |
|
5095 default = os.path.join(os.path.dirname(interpreter), "doc") |
|
5096 else: |
|
5097 default = "" |
|
5098 pythonDocDir = \ |
|
5099 Utilities.getEnvironmentEntry("PYTHON3DOCDIR", default) |
5044 else: |
5100 else: |
5045 pythonDocDir = Utilities.getEnvironmentEntry( |
5101 pythonDocDir = Utilities.getEnvironmentEntry( |
5046 "PYTHON3DOCDIR", |
5102 "PYTHON3DOCDIR", |
5047 '/usr/share/doc/packages/python3/html') |
5103 '/usr/share/doc/packages/python3/html') |
5048 if not pythonDocDir.startswith(("http://", "https://", "qthelp://")): |
5104 if not pythonDocDir.startswith(("http://", "https://", "qthelp://")): |
5099 def __showPython2Doc(self): |
5155 def __showPython2Doc(self): |
5100 """ |
5156 """ |
5101 Private slot to show the Python 2 documentation. |
5157 Private slot to show the Python 2 documentation. |
5102 """ |
5158 """ |
5103 pythonDocDir = Preferences.getHelp("Python2DocDir") |
5159 pythonDocDir = Preferences.getHelp("Python2DocDir") |
5104 executable = Preferences.getDebugger("PythonInterpreter") |
|
5105 if not pythonDocDir: |
5160 if not pythonDocDir: |
5106 if Utilities.isWindowsPlatform(): |
5161 if Utilities.isWindowsPlatform(): |
5107 if executable: |
5162 venvName = Preferences.getDebugger("Python2VirtualEnv") |
5108 default = os.path.join(os.path.dirname(executable), "doc") |
5163 interpreter = e5App().getObject("VirtualEnvManager")\ |
|
5164 .getVirtualenvInterpreter(venvName) |
|
5165 if interpreter: |
|
5166 default = os.path.join(os.path.dirname(interpreter), "doc") |
5109 else: |
5167 else: |
5110 default = "" |
5168 default = "" |
5111 pythonDocDir = \ |
5169 pythonDocDir = \ |
5112 Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default) |
5170 Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default) |
5113 else: |
5171 else: |
6433 self.backgroundService.shutdown() |
6491 self.backgroundService.shutdown() |
6434 |
6492 |
6435 self.cooperation.shutdown() |
6493 self.cooperation.shutdown() |
6436 |
6494 |
6437 self.pluginManager.doShutdown() |
6495 self.pluginManager.doShutdown() |
|
6496 |
|
6497 self.virtualenvManager.shutdown() |
6438 |
6498 |
6439 if self.layoutType == "Sidebars": |
6499 if self.layoutType == "Sidebars": |
6440 self.leftSidebar.shutdown() |
6500 self.leftSidebar.shutdown() |
6441 self.bottomSidebar.shutdown() |
6501 self.bottomSidebar.shutdown() |
6442 self.rightSidebar.shutdown() |
6502 self.rightSidebar.shutdown() |