PluginPipxInterface.py

changeset 7
9a98f7260372
parent 2
26430067aa09
child 15
2fb8d19c38ae
--- a/PluginPipxInterface.py	Tue Jun 25 17:58:25 2024 +0200
+++ b/PluginPipxInterface.py	Tue Jun 25 17:59:15 2024 +0200
@@ -13,7 +13,7 @@
 from PyQt6.QtCore import QCoreApplication, QObject, Qt, QTranslator
 from PyQt6.QtGui import QKeySequence
 
-from eric7 import Preferences
+from eric7 import Globals, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricAction import EricAction
 from eric7.EricWidgets.EricApplication import ericApp
@@ -148,6 +148,8 @@
 
         self.__defaults = {
             # TODO: fill this dictionary with preferences default values
+            "RecentAppWorkdirs": [],
+            "MaxRecentAppWorkdirs": 20,
         }
 
         self.__translator = None
@@ -266,6 +268,19 @@
         @return the requested setting value
         @rtype Any
         """
+        if key in ("RecentAppWorkdirs",):
+            return Globals.toList(
+                Preferences.Prefs.settings.value(
+                    self.PreferencesKey + "/" + key, self.__defaults[key]
+                )
+            )
+        elif key in ("MaxRecentAppWorkdirs",):
+            return int(
+                Preferences.Prefs.settings.value(
+                    self.PreferencesKey + "/" + key, self.__defaults[key]
+                )
+            )
+
         return None
 
     def setPreferences(self, key, value):
@@ -277,7 +292,7 @@
         @param value the value to be set
         @type Any
         """
-        pass
+        Preferences.Prefs.settings.setValue(self.PreferencesKey + "/" + key, value)
 
 
 def installDependencies(pipInstall):

eric ide

mercurial