131 self.makeCheckBox.setChecked( |
134 self.makeCheckBox.setChecked( |
132 self.project.pdata["MAKEPARAMS"]["MakeEnabled"]) |
135 self.project.pdata["MAKEPARAMS"]["MakeEnabled"]) |
133 cindex = self.docstringStyleComboBox.findData( |
136 cindex = self.docstringStyleComboBox.findData( |
134 self.project.pdata["DOCSTRING"]) |
137 self.project.pdata["DOCSTRING"]) |
135 self.docstringStyleComboBox.setCurrentIndex(cindex) |
138 self.docstringStyleComboBox.setCurrentIndex(cindex) |
|
139 with contextlib.suppress(KeyError): |
|
140 cindex = self.testingFrameworkComboBox.findData( |
|
141 self.project.pdata["TESTING_FRAMEWORK"]) |
|
142 self.testingFrameworkComboBox.setCurrentIndex(cindex) |
136 else: |
143 else: |
137 self.languageComboBox.setCurrentIndex( |
144 self.languageComboBox.setCurrentIndex( |
138 self.languageComboBox.findText("Python3")) |
145 self.languageComboBox.findText("Python3")) |
139 self.projectTypeComboBox.setCurrentIndex( |
146 self.projectTypeComboBox.setCurrentIndex( |
140 self.projectTypeComboBox.findData("PyQt6")) |
147 self.projectTypeComboBox.findData("PyQt6")) |
147 |
154 |
148 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
155 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
149 bool(self.dirPicker.text()) and |
156 bool(self.dirPicker.text()) and |
150 self.dirPicker.text() not in self.__initPaths) |
157 self.dirPicker.text() not in self.__initPaths) |
151 |
158 |
152 @pyqtSlot(int) |
159 @pyqtSlot(str) |
153 def on_languageComboBox_currentIndexChanged(self, index): |
160 def on_languageComboBox_currentTextChanged(self, language): |
154 """ |
161 """ |
155 Private slot handling the selection of a programming language. |
162 Private slot handling the selection of a programming language. |
156 |
163 |
157 @param index index of the current item |
164 @param language text of the current item |
158 @type int |
165 @type str |
159 """ |
166 """ |
160 language = self.languageComboBox.itemText(index) |
|
161 curProjectType = self.getProjectType() |
167 curProjectType = self.getProjectType() |
162 |
168 |
163 projectTypes = [] |
|
164 for projectTypeItem in self.project.getProjectTypes(language).items(): |
|
165 projectTypes.append((projectTypeItem[1], projectTypeItem[0])) |
|
166 self.projectTypeComboBox.clear() |
169 self.projectTypeComboBox.clear() |
167 for projectType in sorted(projectTypes): |
170 for projectType in sorted( |
|
171 self.project.getProjectTypes(language).items(), |
|
172 key=lambda k: k[1] |
|
173 ): |
168 self.projectTypeComboBox.addItem( |
174 self.projectTypeComboBox.addItem( |
169 projectType[0], projectType[1]) |
175 projectType[1], projectType[0]) |
170 |
176 |
171 index = self.projectTypeComboBox.findData(curProjectType) |
177 index = self.projectTypeComboBox.findData(curProjectType) |
172 if index == -1: |
178 if index == -1: |
173 index = 0 |
179 index = 0 |
174 self.projectTypeComboBox.setCurrentIndex(index) |
180 self.projectTypeComboBox.setCurrentIndex(index) |
|
181 |
|
182 curTestingFramework = self.testingFrameworkComboBox.currentText() |
|
183 self.testingFrameworkComboBox.clear() |
|
184 self.testingFrameworkComboBox.addItem(self.tr("None"), "") |
|
185 with contextlib.suppress(KeyError): |
|
186 for framework in sorted(FrameworkNames[language]): |
|
187 self.testingFrameworkComboBox.addItem(framework, framework) |
|
188 self.testingFrameworkComboBox.setCurrentText(curTestingFramework) |
175 |
189 |
176 @pyqtSlot(str) |
190 @pyqtSlot(str) |
177 def on_dirPicker_textChanged(self, txt): |
191 def on_dirPicker_textChanged(self, txt): |
178 """ |
192 """ |
179 Private slot to handle a change of the project directory. |
193 Private slot to handle a change of the project directory. |