Modified the 'eric Plug-in' wizard slightly and corrected a typo in one of its code templates. eric7

Sat, 10 May 2025 10:45:03 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 May 2025 10:45:03 +0200
branch
eric7
changeset 11277
002e62035d8e
parent 11276
0c252a7d814f
child 11278
aaf85a74ea45

Modified the 'eric Plug-in' wizard slightly and corrected a typo in one of its code templates.

src/eric7/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
src/eric7/Documentation/Source/eric7.Plugins.WizardPlugins.EricPluginWizard.Templates.html file | annotate | diff | comparison | revisions
src/eric7/Plugins/WizardPlugins/EricPluginWizard/PluginWizardDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py file | annotate | diff | comparison | revisions
Binary file src/eric7/Documentation/Help/source.qch has changed
--- a/src/eric7/Documentation/Source/eric7.Plugins.WizardPlugins.EricPluginWizard.Templates.html	Sat May 10 10:26:27 2025 +0200
+++ b/src/eric7/Documentation/Source/eric7.Plugins.WizardPlugins.EricPluginWizard.Templates.html	Sat May 10 10:45:03 2025 +0200
@@ -35,7 +35,7 @@
 </tr>
 <tr>
 <td><a href="#deactivate">deactivate</a></td>
-<td>Function to create the Translator configuration page.</td>
+<td>Function to create the plug-in configuration page.</td>
 </tr>
 <tr>
 <td><a href="#getConfigData">getConfigData</a></td>
@@ -104,7 +104,7 @@
 <h2>deactivate</h2>
 <b>deactivate</b>(<i>self</i>)
 <p>
-    Function to create the Translator configuration page.
+    Function to create the plug-in configuration page.
 </p>
 
 <dl>
--- a/src/eric7/Plugins/WizardPlugins/EricPluginWizard/PluginWizardDialog.py	Sat May 10 10:26:27 2025 +0200
+++ b/src/eric7/Plugins/WizardPlugins/EricPluginWizard/PluginWizardDialog.py	Sat May 10 10:45:03 2025 +0200
@@ -26,8 +26,8 @@
     installDependenciesTemplate,
     mainTemplate,
     moduleSetupTemplate,
-    onDemandTemplate,
     pluginTypeTemplate,
+    pluginTypeNameTemplate,
     previewPixmapTemplate,
 )
 from .Ui_PluginWizardDialog import Ui_PluginWizardDialog
@@ -186,21 +186,20 @@
             templateData["config2"] = ""
             templateData["config3"] = ""
 
+        templateData["pluginType"] = (
+            pluginTypeTemplate.format(
+                pluginType=self.pluginTypeCombo.currentText()
+            )
+            if bool(self.pluginTypeCombo.currentText())
+            else ""
+        )
+
         if self.autoActivateCheckBox.isChecked():
-            templateData["onDemand"] = ""
-            templateData["pluginType"] = (
-                pluginTypeTemplate.format(
-                    pluginType=self.pluginTypeCombo.currentText()
-                )
-                if bool(self.pluginTypeCombo.currentText())
-                else ""
-            )
+            templateData["pluginTypeName"] = ""
         else:
-            templateData["onDemand"] = onDemandTemplate.format(
-                pluginType=self.pluginTypeCombo.currentText(),
+            templateData["pluginTypeName"] = pluginTypeNameTemplate.format(
                 pluginTypename=self.pluginTypeNameEdit.text(),
             )
-            templateData["pluginType"] = ""
 
         if self.pixmapCheckBox.isChecked():
             templateData["preview"] = previewPixmapTemplate
--- a/src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py	Sat May 10 10:26:27 2025 +0200
+++ b/src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py	Sat May 10 10:45:03 2025 +0200
@@ -28,7 +28,7 @@
     "deactivateable": {deactivateable},
     "version": "{version}",
 {pluginType}\
-{onDemand}\
+{pluginTypeName}\
     "className": "{className}",
     "packageName": "{packageName}",
     "shortDescription": "{shortDescription}",
@@ -92,7 +92,7 @@
 
 configTemplate1 = '''def pageCreationFunction(configDlg):
     """
-    Function to create the Translator configuration page.
+    Function to create the plug-in configuration page.
 
     @param configDlg reference to the configuration dialog
     @type ConfigurationWidget
@@ -158,11 +158,10 @@
         pass
 '''
 
-onDemandTemplate = """    "pluginType": "{pluginType}",
-    "pluginTypename": "{pluginTypename}",
+pluginTypeTemplate = """    "pluginType": "{pluginType}",
 """
 
-pluginTypeTemplate = """    "pluginType": "{pluginType}",
+pluginTypeNameTemplate = """    "pluginTypename": "{pluginTypename}",
 """
 
 previewPixmapTemplate = '''def previewPix():

eric ide

mercurial