PipxInterface/ConfigurationPage/PipxPage.py

changeset 16
c06fb4cb120e
child 32
b7a3ae7519ba
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PipxInterface/ConfigurationPage/PipxPage.py	Fri Jun 28 17:19:26 2024 +0200
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2024 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing the pipx configuration page.
+"""
+
+from eric7 import Preferences
+from eric7.Preferences.ConfigurationPages.ConfigurationPageBase import (
+    ConfigurationPageBase,
+)
+
+from .Ui_PipxPage import Ui_PipxPage
+
+
+class PipxPage(ConfigurationPageBase, Ui_PipxPage):
+    """
+    Class implementing the pipx configuration page.
+    """
+
+    def __init__(self, plugin):
+        """
+        Constructor
+
+        @param plugin reference to the plugin object
+        @type PluginPipxInterface
+        """
+        super().__init__()
+        self.setupUi(self)
+        self.setObjectName("PipxPage")
+
+        self.__plugin = plugin
+
+        # set the pip index URL for information only
+        self.indexEdit.setText(Preferences.getPip("PipSearchIndex"))
+
+        # set initial values
+        self.recentWorkdirsSpinBox.setValue(
+            self.__plugin.getPreferences("MaxRecentAppWorkdirs")
+        )
+
+    def save(self):
+        """
+        Public slot to save the MQTT Monitor configuration.
+        """
+        self.__plugin.setPreferences(
+            "MaxRecentAppWorkdirs", self.recentWorkdirsSpinBox.value()
+        )

eric ide

mercurial