diff -r 06e7d2941ead -r 331ac8f99cf8 UI/UserInterface.py --- a/UI/UserInterface.py Thu Nov 01 11:48:02 2018 +0100 +++ b/UI/UserInterface.py Sat Dec 01 11:44:34 2018 +0100 @@ -166,7 +166,7 @@ def __init__(self, app, locale, splash, plugin, disabledPlugins, noOpenAtStartup, noCrashOpenAtStartup, disableCrashSession, - restartArguments): + restartArguments, originalPathString): """ Constructor @@ -194,6 +194,8 @@ @param restartArguments list of command line parameters to be used for a restart @type list of str + @param originalPathString original PATH environment variable + @type str """ super(UserInterface, self).__init__() @@ -209,6 +211,8 @@ self.__disableCrashSession = disableCrashSession self.__disabledPlugins = disabledPlugins[:] + self.__originalPathString = originalPathString + self.__layoutType = Preferences.getUI("LayoutType") self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled") @@ -248,7 +252,7 @@ # Generate the debug server object from Debugger.DebugServer import DebugServer - debugServer = DebugServer() + debugServer = DebugServer(self.__originalPathString) # Create the background service object from Utilities.BackgroundService import BackgroundService @@ -697,9 +701,15 @@ splash.showMessage(self.tr("Reading Templates...")) self.templateViewer.readTemplates() - # now start the debug client + # now start the debug client with the most recently used virtual + # environment splash.showMessage(self.tr("Starting Debugger...")) - debugServer.startClient(False) + if Preferences.getShell("StartWithMostRecentlyUsedEnvironment"): + debugServer.startClient( + False, venvName=Preferences.getShell("LastVirtualEnvironment") + ) + else: + debugServer.startClient(False) # attributes for the network objects self.__networkManager = QNetworkAccessManager(self) @@ -889,7 +899,7 @@ logging.debug("Creating Shell...") from QScintilla.Shell import ShellAssembly self.shellAssembly = \ - ShellAssembly(debugServer, self.viewmanager, True) + ShellAssembly(debugServer, self.viewmanager, self.project, True) self.shell = self.shellAssembly.shell() self.hToolbox.insertItem(0, self.shellAssembly, UI.PixmapCache.getIcon("shell.png"), @@ -1030,7 +1040,7 @@ logging.debug("Creating Shell...") from QScintilla.Shell import ShellAssembly self.shellAssembly = \ - ShellAssembly(debugServer, self.viewmanager, True) + ShellAssembly(debugServer, self.viewmanager, self.project, True) self.shell = self.shellAssembly.shell() self.bottomSidebar.insertTab(0, self.shellAssembly, UI.PixmapCache.getIcon("shell.png"), @@ -4557,7 +4567,9 @@ Private slot to start the Qt-Designer executable. @param fn filename of the form to be opened - @param version indication for the requested version (Qt 4) (integer) + @type str + @param version indication for the requested version (4 = Qt 4/5) + @type int """ if fn is not None and version == 0: # determine version from file, if not specified @@ -4633,7 +4645,7 @@ def __designer4(self): """ - Private slot to start the Qt-Designer 4 executable. + Private slot to start the Qt-Designer 4/5 executable. """ self.__designer(version=4) @@ -4642,7 +4654,9 @@ Private slot to start the Qt-Linguist executable. @param fn filename of the translation file to be opened - @param version indication for the requested version (Qt 4) (integer) + @type str + @param version indication for the requested version (4 = Qt 4/5) + @type int """ if version < 4: E5MessageBox.information( @@ -4702,7 +4716,7 @@ @pyqtSlot(str) def __linguist4(self, fn=None): """ - Private slot to start the Qt-Linguist 4 executable. + Private slot to start the Qt-Linguist 4/5 executable. @param fn filename of the translation file to be opened """ @@ -4712,8 +4726,10 @@ """ Private slot to start the Qt-Assistant executable. - @param home full pathname of a file to display (string) - @param version indication for the requested version (Qt 4) (integer) + @param home full pathname of a file to display + @type str + @param version indication for the requested version (4 = Qt 4/5) + @type int """ if version < 4: E5MessageBox.information( @@ -4751,7 +4767,7 @@ def __assistant4(self): """ - Private slot to start the Qt-Assistant 4 executable. + Private slot to start the Qt-Assistant 4/5 executable. """ self.__assistant(version=4) @@ -5859,9 +5875,16 @@ self.masterPasswordChanged.emit(oldPassword, newPassword) Preferences.convertPasswords(oldPassword, newPassword) if self.helpWindow is None: - from Helpviewer.Passwords.PasswordManager import PasswordManager - pwManager = PasswordManager() - pwManager.masterPasswordChanged(oldPassword, newPassword) + if WEBENGINE_AVAILABLE: + from WebBrowser.Passwords.PasswordManager import \ + PasswordManager + pwManager = PasswordManager() + pwManager.masterPasswordChanged(oldPassword, newPassword) + elif WEBKIT_AVAILABLE: + from Helpviewer.Passwords.PasswordManager import \ + PasswordManager + pwManager = PasswordManager() + pwManager.masterPasswordChanged(oldPassword, newPassword) Utilities.crypto.changeRememberedMaster(newPassword) def __reloadAPIs(self): @@ -6439,7 +6462,7 @@ Public slot to show the plugins available for download. """ from PluginManager.PluginRepositoryDialog import PluginRepositoryDialog - dlg = PluginRepositoryDialog(self) + dlg = PluginRepositoryDialog(self.pluginManager, self) res = dlg.exec_() if res == (QDialog.Accepted + 1): self.__installPlugins(dlg.getDownloadedPlugins()) @@ -7039,6 +7062,16 @@ p = w.pos() return [p.x(), p.y(), s.width(), s.height(), not w.isHidden()] + def getOriginalPathString(self): + """ + Public method to get the original PATH environment variable + (i.e. before modifications by eric6 and PyQt5). + + @return original PATH environment variable + @rtype str + """ + return self.__originalPathString + ############################ ## some event handlers below ############################