95 self.projectTypeComboBox.clear() |
95 self.projectTypeComboBox.clear() |
96 for projectType in sorted(projectTypes): |
96 for projectType in sorted(projectTypes): |
97 self.projectTypeComboBox.addItem(projectType[0], projectType[1]) |
97 self.projectTypeComboBox.addItem(projectType[0], projectType[1]) |
98 |
98 |
99 if self.__remoteProject: |
99 if self.__remoteProject: |
100 self.__initPaths = [self.__remotefsInterface.getcwd()] |
100 ipath = self.__remotefsInterface.getcwd() |
|
101 self.__initPaths = [ipath, ipath + self.__remotefsInterface.separator()] |
101 else: |
102 else: |
102 ipath = Preferences.getMultiProject("Workspace") or OSUtilities.getHomeDir() |
103 ipath = Preferences.getMultiProject("Workspace") or OSUtilities.getHomeDir() |
103 self.__initPaths = [ |
104 self.__initPaths = [ |
104 FileSystemUtilities.fromNativeSeparators(ipath), |
105 FileSystemUtilities.fromNativeSeparators(ipath), |
105 FileSystemUtilities.fromNativeSeparators(ipath) + "/", |
106 FileSystemUtilities.fromNativeSeparators(ipath) + "/", |
106 ] |
107 ] |
|
108 self.dirInfoLabel.setText( |
|
109 self.tr("<p>The project directory must not be '<b>{0}</b>'.</p>").format( |
|
110 ipath |
|
111 ) |
|
112 ) |
107 |
113 |
108 self.licenseComboBox.lineEdit().setClearButtonEnabled(True) |
114 self.licenseComboBox.lineEdit().setClearButtonEnabled(True) |
109 self.__populateLicenseComboBox() |
115 self.__populateLicenseComboBox() |
110 |
116 |
111 if not new: |
117 if not new: |
220 |
226 |
221 self.languageComboBox.currentTextChanged.connect(self.__initFileTypesDict) |
227 self.languageComboBox.currentTextChanged.connect(self.__initFileTypesDict) |
222 self.mixedLanguageCheckBox.stateChanged.connect(self.__initFileTypesDict) |
228 self.mixedLanguageCheckBox.stateChanged.connect(self.__initFileTypesDict) |
223 self.projectTypeComboBox.currentIndexChanged.connect(self.__initFileTypesDict) |
229 self.projectTypeComboBox.currentIndexChanged.connect(self.__initFileTypesDict) |
224 |
230 |
225 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
231 self.__updateOk() |
226 bool(self.dirPicker.text()) |
232 |
227 and self.dirPicker.text() not in self.__initPaths |
233 def __updateOk(self): |
228 ) |
234 """ |
|
235 Private method to update the state of the OK button. |
|
236 """ |
|
237 projectDir = self.dirPicker.text() |
|
238 if self.__remoteProject: |
|
239 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
|
240 FileSystemUtilities.isRemoteFileName(projectDir) |
|
241 and not self.__remotefsInterface.isEmpty(projectDir) |
|
242 and projectDir not in self.__initPaths |
|
243 ) |
|
244 else: |
|
245 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
|
246 bool(projectDir) |
|
247 and not FileSystemUtilities.isRemoteFileName(projectDir) |
|
248 and FileSystemUtilities.fromNativeSeparators(projectDir) |
|
249 not in self.__initPaths |
|
250 ) |
229 |
251 |
230 def __setMainScriptPickerFilters(self): |
252 def __setMainScriptPickerFilters(self): |
231 """ |
253 """ |
232 Private method to set the filters for the main script file picker. |
254 Private method to set the filters for the main script file picker. |
233 """ |
255 """ |
293 Private slot to handle a change of the project directory. |
315 Private slot to handle a change of the project directory. |
294 |
316 |
295 @param txt name of the project directory |
317 @param txt name of the project directory |
296 @type str |
318 @type str |
297 """ |
319 """ |
298 if self.__remoteProject: |
320 self.__updateOk() |
299 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
|
300 FileSystemUtilities.isRemoteFileName(txt) |
|
301 and txt not in self.__initPaths |
|
302 ) |
|
303 else: |
|
304 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
|
305 bool(txt) |
|
306 and FileSystemUtilities.fromNativeSeparators(txt) |
|
307 not in self.__initPaths |
|
308 ) |
|
309 |
321 |
310 @pyqtSlot(str) |
322 @pyqtSlot(str) |
311 def on_srcDirPicker_pathSelected(self, srcDir): |
323 def on_srcDirPicker_pathSelected(self, srcDir): |
312 """ |
324 """ |
313 Private slot to check the selected sources sub-directory name. |
325 Private slot to check the selected sources sub-directory name. |