--- a/src/eric7/PipInterface/PipPackagesWidget.py Sun Oct 02 11:44:07 2022 +0200 +++ b/src/eric7/PipInterface/PipPackagesWidget.py Sat Oct 29 15:24:59 2022 +0200 @@ -28,16 +28,15 @@ QAbstractItemView, ) -from EricWidgets.EricApplication import ericApp -from EricWidgets import EricMessageBox -from EricGui.EricOverrideCursor import EricOverrideCursor +from eric7.EricWidgets.EricApplication import ericApp +from eric7.EricWidgets import EricMessageBox +from eric7.EricGui.EricOverrideCursor import EricOverrideCursor from .PipVulnerabilityChecker import Package, VulnerabilityCheckError from .Ui_PipPackagesWidget import Ui_PipPackagesWidget -import UI.PixmapCache -import Globals -import Preferences +from eric7.EricGui import EricPixmapCache +from eric7 import Globals, Preferences class PypiSearchResultsParser(html.parser.HTMLParser): @@ -188,10 +187,10 @@ self.layout().setContentsMargins(0, 3, 0, 0) - self.viewToggleButton.setIcon(UI.PixmapCache.getIcon("viewListTree")) + self.viewToggleButton.setIcon(EricPixmapCache.getIcon("viewListTree")) self.pipMenuButton.setObjectName("pip_supermenu_button") - self.pipMenuButton.setIcon(UI.PixmapCache.getIcon("superMenu")) + self.pipMenuButton.setIcon(EricPixmapCache.getIcon("superMenu")) self.pipMenuButton.setToolTip(self.tr("pip Menu")) self.pipMenuButton.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup) self.pipMenuButton.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly) @@ -199,21 +198,21 @@ self.pipMenuButton.setAutoRaise(True) self.pipMenuButton.setShowMenuInside(True) - self.refreshButton.setIcon(UI.PixmapCache.getIcon("reload")) - self.upgradeButton.setIcon(UI.PixmapCache.getIcon("1uparrow")) - self.upgradeAllButton.setIcon(UI.PixmapCache.getIcon("2uparrow")) - self.uninstallButton.setIcon(UI.PixmapCache.getIcon("minus")) - self.showPackageDetailsButton.setIcon(UI.PixmapCache.getIcon("info")) - self.searchToggleButton.setIcon(UI.PixmapCache.getIcon("find")) - self.searchButton.setIcon(UI.PixmapCache.getIcon("findNext")) - self.searchMoreButton.setIcon(UI.PixmapCache.getIcon("plus")) - self.installButton.setIcon(UI.PixmapCache.getIcon("plus")) - self.installUserSiteButton.setIcon(UI.PixmapCache.getIcon("addUser")) - self.showDetailsButton.setIcon(UI.PixmapCache.getIcon("info")) + self.refreshButton.setIcon(EricPixmapCache.getIcon("reload")) + self.upgradeButton.setIcon(EricPixmapCache.getIcon("1uparrow")) + self.upgradeAllButton.setIcon(EricPixmapCache.getIcon("2uparrow")) + self.uninstallButton.setIcon(EricPixmapCache.getIcon("minus")) + self.showPackageDetailsButton.setIcon(EricPixmapCache.getIcon("info")) + self.searchToggleButton.setIcon(EricPixmapCache.getIcon("find")) + self.searchButton.setIcon(EricPixmapCache.getIcon("findNext")) + self.searchMoreButton.setIcon(EricPixmapCache.getIcon("plus")) + self.installButton.setIcon(EricPixmapCache.getIcon("plus")) + self.installUserSiteButton.setIcon(EricPixmapCache.getIcon("addUser")) + self.showDetailsButton.setIcon(EricPixmapCache.getIcon("info")) - self.refreshDependenciesButton.setIcon(UI.PixmapCache.getIcon("reload")) - self.showDepPackageDetailsButton.setIcon(UI.PixmapCache.getIcon("info")) - self.dependencyRepairButton.setIcon(UI.PixmapCache.getIcon("repair")) + self.refreshDependenciesButton.setIcon(EricPixmapCache.getIcon("reload")) + self.showDepPackageDetailsButton.setIcon(EricPixmapCache.getIcon("info")) + self.dependencyRepairButton.setIcon(EricPixmapCache.getIcon("repair")) self.__pip = pip @@ -288,6 +287,9 @@ @type bool """ if not shutdown: + if self.environmentsComboBox.currentIndex() == 1: + self.environmentsComboBox.setCurrentIndex(0) + # the project entry is always at index 1 self.environmentsComboBox.removeItem(1) @@ -480,6 +482,13 @@ @type str """ if name != self.__selectedEnvironment: + if not name: + self.environmentPathLabel.setPath("") + else: + self.environmentPathLabel.setPath( + self.__pip.getVirtualenvInterpreter(name) + ) + if self.viewToggleButton.isChecked(): self.__refreshDependencyTree() else: @@ -1436,7 +1445,7 @@ @param venvName name of the environment to act upon @type str """ - from QScintilla.MiniEditor import MiniEditor + from eric7.QScintilla.MiniEditor import MiniEditor if venvName: cfgFile = self.__pip.getVirtualenvConfig(venvName) @@ -1598,7 +1607,7 @@ ) itm.setIcon( PipPackagesWidget.VulnerabilityColumn, - UI.PixmapCache.getIcon("securityLow"), + EricPixmapCache.getIcon("securityLow"), ) elif error in ( @@ -1774,7 +1783,7 @@ if not specifierSet.contains(dependency["installed_version"]): itm.setIcon( PipPackagesWidget.DepRequiredVersionColumn, - UI.PixmapCache.getIcon("warning"), + EricPixmapCache.getIcon("warning"), ) elif dependency["required_version"].lower() == "any":