49 if name: |
49 if name: |
50 self.setObjectName(name) |
50 self.setObjectName(name) |
51 self.setupUi(self) |
51 self.setupUi(self) |
52 |
52 |
53 self.dirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
53 self.dirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
|
54 self.srcDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
54 self.mainscriptPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
55 self.mainscriptPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
55 |
56 |
56 self.makeButton.setIcon(EricPixmapCache.getIcon("makefile")) |
57 self.makeButton.setIcon(EricPixmapCache.getIcon("makefile")) |
57 |
58 |
58 self.docstringStyleComboBox.addItem(self.tr("None"), "") |
59 self.docstringStyleComboBox.addItem(self.tr("None"), "") |
111 ) |
112 ) |
112 if curIndex == -1: |
113 if curIndex == -1: |
113 curIndex = self.projectTypeComboBox.findData("PyQt6") |
114 curIndex = self.projectTypeComboBox.findData("PyQt6") |
114 self.projectTypeComboBox.setCurrentIndex(curIndex) |
115 self.projectTypeComboBox.setCurrentIndex(curIndex) |
115 self.dirPicker.setText(self.project.ppath) |
116 self.dirPicker.setText(self.project.ppath) |
|
117 self.srcDirPicker.setText(self.project.getProjectData(dataKey="SOURCESDIR")) |
116 self.versionEdit.setText(self.project.getProjectData(dataKey="VERSION")) |
118 self.versionEdit.setText(self.project.getProjectData(dataKey="VERSION")) |
117 self.mainscriptPicker.setText( |
119 self.mainscriptPicker.setText( |
118 self.project.getProjectData(dataKey="MAINSCRIPT") |
120 self.project.getProjectData(dataKey="MAINSCRIPT") |
119 ) |
121 ) |
120 self.authorEdit.setText(self.project.getProjectData(dataKey="AUTHOR")) |
122 self.authorEdit.setText(self.project.getProjectData(dataKey="AUTHOR")) |
243 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
245 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
244 bool(txt) |
246 bool(txt) |
245 and FileSystemUtilities.fromNativeSeparators(txt) not in self.__initPaths |
247 and FileSystemUtilities.fromNativeSeparators(txt) not in self.__initPaths |
246 ) |
248 ) |
247 |
249 |
|
250 @pyqtSlot(str) |
|
251 def on_srcDirPicker_pathSelected(self, srcDir): |
|
252 """ |
|
253 Private slot to check the selected sources sub-directory name. |
|
254 |
|
255 @param srcDir name of the sources directory name |
|
256 @type str |
|
257 """ |
|
258 if srcDir: |
|
259 ppath = self.dirPicker.text() |
|
260 if ppath: |
|
261 ppath = QDir(ppath).absolutePath() + QDir.separator() |
|
262 srcDir = srcDir.replace(ppath, "") |
|
263 self.srcDirPicker.setText(srcDir) |
|
264 |
|
265 @pyqtSlot() |
|
266 def on_srcDirPicker_aboutToShowPathPickerDialog(self): |
|
267 """ |
|
268 Private slot to perform actions before the sources sub-directory selection |
|
269 dialog is shown. |
|
270 """ |
|
271 ppath = self.dirPicker.text() |
|
272 if not ppath: |
|
273 ppath = QDir.currentPath() |
|
274 self.srcDirPicker.setDefaultDirectory(ppath) |
|
275 |
248 @pyqtSlot() |
276 @pyqtSlot() |
249 def on_spellPropertiesButton_clicked(self): |
277 def on_spellPropertiesButton_clicked(self): |
250 """ |
278 """ |
251 Private slot to display the spelling properties dialog. |
279 Private slot to display the spelling properties dialog. |
252 """ |
280 """ |
311 def on_mainscriptPicker_aboutToShowPathPickerDialog(self): |
339 def on_mainscriptPicker_aboutToShowPathPickerDialog(self): |
312 """ |
340 """ |
313 Private slot to perform actions before the main script selection dialog |
341 Private slot to perform actions before the main script selection dialog |
314 is shown. |
342 is shown. |
315 """ |
343 """ |
316 path = self.dirPicker.text() |
344 ppath = self.dirPicker.text() |
317 if not path: |
345 if not ppath: |
318 path = QDir.currentPath() |
346 ppath = QDir.currentPath() |
319 self.mainscriptPicker.setDefaultDirectory(path) |
347 self.mainscriptPicker.setDefaultDirectory(ppath) |
320 |
348 |
321 @pyqtSlot() |
349 @pyqtSlot() |
322 def on_vcsInfoButton_clicked(self): |
350 def on_vcsInfoButton_clicked(self): |
323 """ |
351 """ |
324 Private slot to display a vcs information dialog. |
352 Private slot to display a vcs information dialog. |
408 fn = "{0}.epj".format(fn) |
436 fn = "{0}.epj".format(fn) |
409 self.project.pfile = os.path.join(self.project.ppath, fn) |
437 self.project.pfile = os.path.join(self.project.ppath, fn) |
410 else: |
438 else: |
411 self.project.pfile = "" |
439 self.project.pfile = "" |
412 self.project.setProjectData(self.versionEdit.text(), dataKey="VERSION") |
440 self.project.setProjectData(self.versionEdit.text(), dataKey="VERSION") |
|
441 srcDir = self.srcDirPicker.text() |
|
442 if srcDir: |
|
443 srcDir = self.project.getRelativePath(srcDir) |
|
444 self.project.setProjectData(srcDir, dataKey="SOURCESDIR") |
|
445 else: |
|
446 self.project.setProjectData("", dataKey="SOURCESDIR") |
413 fn = self.mainscriptPicker.text() |
447 fn = self.mainscriptPicker.text() |
414 if fn: |
448 if fn: |
415 fn = self.project.getRelativePath(fn) |
449 fn = self.project.getRelativePath(fn) |
416 self.project.setProjectData(fn, dataKey="MAINSCRIPT") |
450 self.project.setProjectData(fn, dataKey="MAINSCRIPT") |
417 self.project.translationsRoot = os.path.splitext(fn)[0] |
451 self.project.translationsRoot = os.path.splitext(fn)[0] |