eric6/Plugins/WizardPlugins/EricPluginWizard/PluginWizardDialog.py

Tue, 10 Sep 2019 19:30:07 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Sep 2019 19:30:07 +0200
changeset 7229
53054eb5b15a
parent 7199
c71bd6f21748
child 7258
aff39db4dacc
permissions
-rw-r--r--

Removed obsolete "from __future__ import ..." statements.

6016
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
6645
ad476851d7e0 Updated copyright for 2019.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6479
diff changeset
3 # Copyright (c) 2014 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
6016
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the eric plug-in wizard dialog.
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 from PyQt5.QtCore import pyqtSlot, QDate
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from E5Gui.E5Application import e5App
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 from .Ui_PluginWizardDialog import Ui_PluginWizardDialog
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 from .Templates import mainTemplate, configTemplate0, configTemplate1, \
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 configTemplate2, configTemplate3, onDemandTemplate, \
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 previewPixmapTemplate, moduleSetupTemplate, exeDisplayDataTemplate, \
6479
2ae32c9f9792 PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
21 exeDisplayDataInfoTemplate, exeDisplayDataListTemplate, apiFilesTemplate
6016
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 class PluginWizardDialog(QDialog, Ui_PluginWizardDialog):
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Class implementing the eric plug-in wizard dialog.
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 def __init__(self, parent=None):
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 Constructor
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 @param parent reference to the parent widget (QWidget)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 super(PluginWizardDialog, self).__init__(parent)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 self.setupUi(self)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.dataTabWidget.setCurrentIndex(0)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.__okButton.setEnabled(False)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 projectOpen = e5App().getObject("Project").isOpen()
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.projectButton.setEnabled(projectOpen)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 self.nameEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.versionEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.authorEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.authorEmailEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.classNameEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.packageNameEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.shortDescriptionEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.longDescriptionEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.preferencesKeyEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.configurationGroup.toggled.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 self.autoActivateCheckBox.toggled.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 self.pluginTypeCombo.currentIndexChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.pluginTypeNameEdit.textChanged.connect(self.__enableOkButton)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 self.pluginTypeCombo.addItems(["", "viewmanager", "version_control"])
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 def __enableOkButton(self):
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 Private slot to set the state of the OK button.
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 enable = (
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 bool(self.nameEdit.text()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 bool(self.versionEdit.text()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 bool(self.authorEdit.text()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 bool(self.authorEmailEdit.text()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 bool(self.classNameEdit.text()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 bool(self.packageNameEdit.text()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 bool(self.shortDescriptionEdit.text()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 bool(self.longDescriptionEdit.toPlainText())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 )
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 if self.configurationGroup.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 enable = enable and bool(self.preferencesKeyEdit.text())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 if not self.autoActivateCheckBox.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 enable = (enable and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 bool(self.pluginTypeCombo.currentText()) and
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 bool(self.pluginTypeNameEdit.text())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 )
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.__okButton.setEnabled(enable)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 @pyqtSlot()
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 def on_projectButton_clicked(self):
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 Private slot to populate some fields with data retrieved from the
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 current project.
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 project = e5App().getObject("Project")
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 try:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.versionEdit.setText(project.getProjectVersion())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.authorEdit.setText(project.getProjectAuthor())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.authorEmailEdit.setText(project.getProjectAuthorEmail())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 description = project.getProjectDescription()
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 except AttributeError:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 self.versionEdit.setText(project.pdata["VERSION"][0])
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 self.authorEdit.setText(project.pdata["AUTHOR"][0])
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.authorEmailEdit.setText(project.pdata["EMAIL"][0])
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 description = project.pdata["DESCRIPTION"][0]
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 # summary is max. 55 characters long
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 summary = (description.split(".", 1)[0]
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 .replace("\r", "").replace("\n", "") + ".")[:55]
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.shortDescriptionEdit.setText(summary)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 self.longDescriptionEdit.setPlainText(description)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 # prevent overwriting of entries by disabling the button
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 self.projectButton.setEnabled(False)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 def getCode(self):
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 Public method to get the source code.
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 @return generated code (string)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 templateData = {
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 "year": QDate.currentDate().year(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 "author": self.authorEdit.text(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 "email": self.authorEmailEdit.text(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 "name": self.nameEdit.text(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 "autoactivate": self.autoActivateCheckBox.isChecked(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 "deactivateable": self.deactivateableCheckBox.isChecked(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 "version": self.versionEdit.text(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 "className": self.classNameEdit.text(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 "packageName": self.packageNameEdit.text(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 "shortDescription": self.shortDescriptionEdit.text(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 "longDescription": self.longDescriptionEdit.toPlainText(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 "needsRestart": self.restartCheckBox.isChecked(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 }
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 if self.configurationGroup.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 templateData["config0"] = configTemplate0
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 templateData["config1"] = configTemplate1.format(
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 className=self.classNameEdit.text())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 templateData["config2"] = configTemplate2.format(
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 preferencesKey=self.preferencesKeyEdit.text())
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 templateData["config3"] = configTemplate3
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 else:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 templateData["config0"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 templateData["config1"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 templateData["config2"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 templateData["config3"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 if self.autoActivateCheckBox.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 templateData["onDemand"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 else:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 templateData["onDemand"] = onDemandTemplate.format(
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 pluginType=self.pluginTypeCombo.currentText(),
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 pluginTypename=self.pluginTypeNameEdit.text()
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 )
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 if self.pixmapCheckBox.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 templateData["preview"] = previewPixmapTemplate
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 else:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 templateData["preview"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 if self.moduleSetupCheckBox.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 templateData["modulesetup"] = moduleSetupTemplate
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 else:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 templateData["modulesetup"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 templateData["exeData"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 if self.exeGroup.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 if self.exeRadioButton.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 templateData["exeData"] = exeDisplayDataTemplate
6479
2ae32c9f9792 PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
169 elif self.exeInfoRadioButton.isChecked():
2ae32c9f9792 PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
170 templateData["exeData"] = exeDisplayDataInfoTemplate
6016
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 elif self.exeListRadioButton.isChecked():
6479
2ae32c9f9792 PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
172 templateData["exeData"] = exeDisplayDataListTemplate
6016
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 if self.apiFilesCheckBox.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 templateData["apiFiles"] = apiFilesTemplate
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 else:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 templateData["apiFiles"] = ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 return mainTemplate.format(**templateData)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 def packageName(self):
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 Public method to retrieve the plug-in package name.
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 @return plug-in package name (string)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 if self.createPackageCheckBox.isChecked():
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 return self.packageNameEdit.text()
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 else:
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 return ""
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 @pyqtSlot(str)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 def on_pluginTypeCombo_currentTextChanged(self, txt):
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 Private slot to react upon the selection of a plug-in type.
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 @param txt selected plug-in type (string)
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 """
3d594f66a7f7 Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 self.pixmapCheckBox.setChecked(txt == "viewmanager")

eric ide

mercurial