Extended the eric Plugin code generation. eric7

Sat, 10 May 2025 12:52:44 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 May 2025 12:52:44 +0200
branch
eric7
changeset 11278
aaf85a74ea45
parent 11277
002e62035d8e
child 11279
590767a91391

Extended the eric Plugin code generation.

src/eric7/Plugins/WizardPlugins/EricPluginWizard/PluginWizardDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py file | annotate | diff | comparison | revisions
--- a/src/eric7/Plugins/WizardPlugins/EricPluginWizard/PluginWizardDialog.py	Sat May 10 10:45:03 2025 +0200
+++ b/src/eric7/Plugins/WizardPlugins/EricPluginWizard/PluginWizardDialog.py	Sat May 10 12:52:44 2025 +0200
@@ -20,6 +20,7 @@
     configTemplate1,
     configTemplate2,
     configTemplate3,
+    configTemplate4,
     exeDisplayDataInfoTemplate,
     exeDisplayDataListTemplate,
     exeDisplayDataTemplate,
@@ -180,11 +181,13 @@
                 preferencesKey=self.preferencesKeyEdit.text()
             )
             templateData["config3"] = configTemplate3
+            templateData["config4"] = configTemplate4
         else:
             templateData["config0"] = ""
             templateData["config1"] = ""
             templateData["config2"] = ""
             templateData["config3"] = ""
+            templateData["config4"] = ""
 
         templateData["pluginType"] = (
             pluginTypeTemplate.format(
--- a/src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py	Sat May 10 10:45:03 2025 +0200
+++ b/src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py	Sat May 10 12:52:44 2025 +0200
@@ -65,6 +65,7 @@
         """
         super().__init__(ui)
         self.__ui = ui
+{config4}\
 
     def activate(self):
         """
@@ -144,7 +145,9 @@
         @return the requested setting value
         @rtype Any
         """
-        return None
+        return Preferences.getSettings().value(
+            self.PreferencesKey + "/" + key, self.__defaults[key]
+        )
 
     def setPreferences(self, key, value):
         """
@@ -155,9 +158,14 @@
         @param value the value to be set
         @type Any
         """
-        pass
+        Preferences.getSettings().setValue(self.PreferencesKey + "/" + key, value)
 '''
 
+configTemplate4 = """
+        self.__defaults = {
+        }
+"""
+
 pluginTypeTemplate = """    "pluginType": "{pluginType}",
 """
 

eric ide

mercurial