PluginPipxInterface.py

changeset 43
2ef4c1f1adea
parent 39
e660d95312bf
child 44
e5e923c6a6db
diff -r 507f7e834536 -r 2ef4c1f1adea PluginPipxInterface.py
--- a/PluginPipxInterface.py	Mon Jul 29 11:32:07 2024 +0200
+++ b/PluginPipxInterface.py	Mon Jul 29 11:37:20 2024 +0200
@@ -36,7 +36,7 @@
     "author": "Detlev Offenbach <detlev@die-offenbachs.de>",
     "autoactivate": True,
     "deactivateable": True,
-    "version": "10.2.2",
+    "version": "10.2.3",
     "className": "PluginPipxInterface",
     "packageName": "PipxInterface",
     "shortDescription": "Graphical interface to the 'pipx' command.",
@@ -263,6 +263,34 @@
             self.__widget.show()
         self.__widget.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
 
+    def setOutdatedIndicator(self, outdated):
+        """
+        Public method to set or clear the outdated indication of the pipx icon
+
+        @param outdated flag indicating outdated packages or dependencies
+        @type bool
+        """
+        uiLayoutType = self.__ui.getLayoutType()
+
+        if uiLayoutType == "Toolboxes":
+            iconName = "pipxOutdated22" if outdated else "pipx22"
+            index = self.__ui.rToolbox.indexOf(self.__widget)
+            self.__ui.rToolbox.setItemIcon(
+                index,
+                EricPixmapCache.getIcon(
+                    os.path.join("PipxInterface", "icons", iconName)
+                )
+            )
+        elif uiLayoutType == "Sidebars":
+            iconName = "pipxOutdated96" if outdated else "pipx96"
+            index = self.__ui.rightSidebar.indexOf(self.__widget)
+            self.__ui.rightSidebar.setTabIcon(
+                index,
+                EricPixmapCache.getIcon(
+                    os.path.join("PipxInterface", "icons", iconName)
+                )
+            )
+
     def getPreferences(self, key):
         """
         Public method to retrieve the various settings values.

eric ide

mercurial