eric6/Project/PropertiesDialog.py

changeset 7266
d001bc703c29
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7265:0665c4d509c9 7266:d001bc703c29
54 54
55 patterns = [] 55 patterns = []
56 for pattern, filetype in self.project.pdata["FILETYPES"].items(): 56 for pattern, filetype in self.project.pdata["FILETYPES"].items():
57 if filetype == "SOURCES": 57 if filetype == "SOURCES":
58 patterns.append(pattern) 58 patterns.append(pattern)
59 filters = self.tr("Source Files ({0});;All Files (*)")\ 59 filters = self.tr("Source Files ({0});;All Files (*)"
60 .format(" ".join(sorted(patterns))) 60 ).format(" ".join(sorted(patterns)))
61 self.mainscriptPicker.setFilters(filters) 61 self.mainscriptPicker.setFilters(filters)
62 62
63 self.languageComboBox.addItems(project.getProgrammingLanguages()) 63 self.languageComboBox.addItems(project.getProgrammingLanguages())
64 64
65 projectTypes = [] 65 projectTypes = []
68 self.projectTypeComboBox.clear() 68 self.projectTypeComboBox.clear()
69 for projectType in sorted(projectTypes): 69 for projectType in sorted(projectTypes):
70 self.projectTypeComboBox.addItem( 70 self.projectTypeComboBox.addItem(
71 projectType[0], projectType[1]) 71 projectType[0], projectType[1])
72 72
73 ipath = Preferences.getMultiProject("Workspace") or \ 73 ipath = (
74 Preferences.getMultiProject("Workspace") or
74 Utilities.getHomeDir() 75 Utilities.getHomeDir()
76 )
75 self.__initPaths = [ 77 self.__initPaths = [
76 Utilities.fromNativeSeparators(ipath), 78 Utilities.fromNativeSeparators(ipath),
77 Utilities.fromNativeSeparators(ipath) + "/", 79 Utilities.fromNativeSeparators(ipath) + "/",
78 ] 80 ]
79 81
98 self.descriptionEdit.setPlainText( 100 self.descriptionEdit.setPlainText(
99 self.project.pdata["DESCRIPTION"]) 101 self.project.pdata["DESCRIPTION"])
100 self.eolComboBox.setCurrentIndex(self.project.pdata["EOL"]) 102 self.eolComboBox.setCurrentIndex(self.project.pdata["EOL"])
101 self.vcsLabel.show() 103 self.vcsLabel.show()
102 if self.project.vcs is not None: 104 if self.project.vcs is not None:
103 vcsSystemsDict = e5App().getObject("PluginManager")\ 105 vcsSystemsDict = (
106 e5App().getObject("PluginManager")
104 .getPluginDisplayStrings("version_control") 107 .getPluginDisplayStrings("version_control")
108 )
105 try: 109 try:
106 vcsSystemDisplay = \ 110 vcsSystemDisplay = vcsSystemsDict[
107 vcsSystemsDict[self.project.pdata["VCS"]] 111 self.project.pdata["VCS"]]
108 except KeyError: 112 except KeyError:
109 vcsSystemDisplay = "None" 113 vcsSystemDisplay = "None"
110 self.vcsLabel.setText( 114 self.vcsLabel.setText(
111 self.tr( 115 self.tr(
112 "The project is version controlled by <b>{0}</b>.") 116 "The project is version controlled by <b>{0}</b>.")
173 """ 177 """
174 Private slot to display the spelling properties dialog. 178 Private slot to display the spelling properties dialog.
175 """ 179 """
176 if self.spellPropertiesDlg is None: 180 if self.spellPropertiesDlg is None:
177 from .SpellingPropertiesDialog import SpellingPropertiesDialog 181 from .SpellingPropertiesDialog import SpellingPropertiesDialog
178 self.spellPropertiesDlg = \ 182 self.spellPropertiesDlg = SpellingPropertiesDialog(
179 SpellingPropertiesDialog(self.project, self.newProject, self) 183 self.project, self.newProject, self)
180 res = self.spellPropertiesDlg.exec_() 184 res = self.spellPropertiesDlg.exec_()
181 if res == QDialog.Rejected: 185 if res == QDialog.Rejected:
182 self.spellPropertiesDlg.initDialog() # reset the dialogs contents 186 self.spellPropertiesDlg.initDialog() # reset the dialogs contents
183 187
184 @pyqtSlot() 188 @pyqtSlot()
185 def on_transPropertiesButton_clicked(self): 189 def on_transPropertiesButton_clicked(self):
186 """ 190 """
187 Private slot to display the translations properties dialog. 191 Private slot to display the translations properties dialog.
188 """ 192 """
189 if self.transPropertiesDlg is None: 193 if self.transPropertiesDlg is None:
190 from .TranslationPropertiesDialog import \ 194 from .TranslationPropertiesDialog import (
191 TranslationPropertiesDialog 195 TranslationPropertiesDialog
192 self.transPropertiesDlg = \ 196 )
193 TranslationPropertiesDialog(self.project, self.newProject, 197 self.transPropertiesDlg = TranslationPropertiesDialog(
194 self) 198 self.project, self.newProject, self)
195 else: 199 else:
196 self.transPropertiesDlg.initFilters() 200 self.transPropertiesDlg.initFilters()
197 res = self.transPropertiesDlg.exec_() 201 res = self.transPropertiesDlg.exec_()
198 if res == QDialog.Rejected: 202 if res == QDialog.Rejected:
199 self.transPropertiesDlg.initDialog() # reset the dialogs contents 203 self.transPropertiesDlg.initDialog() # reset the dialogs contents
203 """ 207 """
204 Private slot to display the make properties dialog. 208 Private slot to display the make properties dialog.
205 """ 209 """
206 if self.makePropertiesDlg is None: 210 if self.makePropertiesDlg is None:
207 from .MakePropertiesDialog import MakePropertiesDialog 211 from .MakePropertiesDialog import MakePropertiesDialog
208 self.makePropertiesDlg = \ 212 self.makePropertiesDlg = MakePropertiesDialog(
209 MakePropertiesDialog(self.project, self.newProject, self) 213 self.project, self.newProject, self)
210 res = self.makePropertiesDlg.exec_() 214 res = self.makePropertiesDlg.exec_()
211 if res == QDialog.Rejected: 215 if res == QDialog.Rejected:
212 self.makePropertiesDlg.initDialog() 216 self.makePropertiesDlg.initDialog()
213 217
214 @pyqtSlot(str) 218 @pyqtSlot(str)
289 self.project.pdata["MAINSCRIPT"] = "" 293 self.project.pdata["MAINSCRIPT"] = ""
290 self.project.translationsRoot = "" 294 self.project.translationsRoot = ""
291 self.project.pdata["AUTHOR"] = self.authorEdit.text() 295 self.project.pdata["AUTHOR"] = self.authorEdit.text()
292 self.project.pdata["EMAIL"] = self.emailEdit.text() 296 self.project.pdata["EMAIL"] = self.emailEdit.text()
293 self.project.pdata["DESCRIPTION"] = self.descriptionEdit.toPlainText() 297 self.project.pdata["DESCRIPTION"] = self.descriptionEdit.toPlainText()
294 self.project.pdata["PROGLANGUAGE"] = \ 298 self.project.pdata["PROGLANGUAGE"] = (
295 self.languageComboBox.currentText() 299 self.languageComboBox.currentText()
296 self.project.pdata["MIXEDLANGUAGE"] = \ 300 )
301 self.project.pdata["MIXEDLANGUAGE"] = (
297 self.mixedLanguageCheckBox.isChecked() 302 self.mixedLanguageCheckBox.isChecked()
303 )
298 projectType = self.getProjectType() 304 projectType = self.getProjectType()
299 if projectType is not None: 305 if projectType is not None:
300 self.project.pdata["PROJECTTYPE"] = projectType 306 self.project.pdata["PROJECTTYPE"] = projectType
301 self.project.pdata["EOL"] = self.eolComboBox.currentIndex() 307 self.project.pdata["EOL"] = self.eolComboBox.currentIndex()
302 308
306 self.spellPropertiesDlg.storeData() 312 self.spellPropertiesDlg.storeData()
307 313
308 if self.transPropertiesDlg is not None: 314 if self.transPropertiesDlg is not None:
309 self.transPropertiesDlg.storeData() 315 self.transPropertiesDlg.storeData()
310 316
311 self.project.pdata["MAKEPARAMS"]["MakeEnabled"] = \ 317 self.project.pdata["MAKEPARAMS"]["MakeEnabled"] = (
312 self.makeCheckBox.isChecked() 318 self.makeCheckBox.isChecked()
319 )
313 if self.makePropertiesDlg is not None: 320 if self.makePropertiesDlg is not None:
314 self.makePropertiesDlg.storeData() 321 self.makePropertiesDlg.storeData()

eric ide

mercurial