eric6/Plugins/WizardPlugins/DotDesktopWizard/DotDesktopWizardDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
32 @param parent reference to the parent widget (QWidget) 32 @param parent reference to the parent widget (QWidget)
33 """ 33 """
34 super(DotDesktopWizardDialog, self).__init__(parent) 34 super(DotDesktopWizardDialog, self).__init__(parent)
35 self.setupUi(self) 35 self.setupUi(self)
36 36
37 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 37 self.buttonBox.button(
38 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
38 39
39 self.__mainCategories = [ 40 self.__mainCategories = [
40 'AudioVideo', 'Audio', 'Video', 'Development', 'Education', 41 'AudioVideo', 'Audio', 'Video', 'Development', 'Education',
41 'Game', 'Graphics', 'Network', 'Office', 'Science', 'Settings', 42 'Game', 'Graphics', 'Network', 'Office', 'Science', 'Settings',
42 'System', 'Utility', 43 'System', 'Utility',
213 Private slot to check, if the OK button should be enabled. 214 Private slot to check, if the OK button should be enabled.
214 """ 215 """
215 enable = bool(self.nameEdit.text()) and bool(self.typeEdit.text()) 216 enable = bool(self.nameEdit.text()) and bool(self.typeEdit.text())
216 if bool(self.onlyShowEdit.text()) and bool(self.notShowEdit.text()): 217 if bool(self.onlyShowEdit.text()) and bool(self.notShowEdit.text()):
217 enable = False 218 enable = False
218 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) 219 self.buttonBox.button(
220 QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
219 221
220 @pyqtSlot(int) 222 @pyqtSlot(int)
221 def on_typeComboBox_currentIndexChanged(self, index): 223 def on_typeComboBox_currentIndexChanged(self, index):
222 """ 224 """
223 Private slot to handle a change of the .desktop type. 225 Private slot to handle a change of the .desktop type.
266 dlg = DotDesktopListSelectionDialog( 268 dlg = DotDesktopListSelectionDialog(
267 self.__mainCategories, 269 self.__mainCategories,
268 self.categoriesEdit.text(), ";", 270 self.categoriesEdit.text(), ";",
269 subEntries=self.__subCategories, 271 subEntries=self.__subCategories,
270 allowMultiMain=False) 272 allowMultiMain=False)
271 if dlg.exec() == QDialog.Accepted: 273 if dlg.exec() == QDialog.DialogCode.Accepted:
272 categories = dlg.getData(";", True) 274 categories = dlg.getData(";", True)
273 self.categoriesEdit.setText(categories) 275 self.categoriesEdit.setText(categories)
274 276
275 @pyqtSlot(str) 277 @pyqtSlot(str)
276 def on_onlyShowEdit_textChanged(self, txt): 278 def on_onlyShowEdit_textChanged(self, txt):
296 DotDesktopListSelectionDialog 298 DotDesktopListSelectionDialog
297 ) 299 )
298 dlg = DotDesktopListSelectionDialog( 300 dlg = DotDesktopListSelectionDialog(
299 self.__showinEnvironments, 301 self.__showinEnvironments,
300 self.onlyShowEdit.text(), ";") 302 self.onlyShowEdit.text(), ";")
301 if dlg.exec() == QDialog.Accepted: 303 if dlg.exec() == QDialog.DialogCode.Accepted:
302 environments = dlg.getData(";", True) 304 environments = dlg.getData(";", True)
303 self.onlyShowEdit.setText(environments) 305 self.onlyShowEdit.setText(environments)
304 306
305 @pyqtSlot(str) 307 @pyqtSlot(str)
306 def on_notShowEdit_textChanged(self, txt): 308 def on_notShowEdit_textChanged(self, txt):
326 DotDesktopListSelectionDialog 328 DotDesktopListSelectionDialog
327 ) 329 )
328 dlg = DotDesktopListSelectionDialog( 330 dlg = DotDesktopListSelectionDialog(
329 self.__showinEnvironments, 331 self.__showinEnvironments,
330 self.notShowEdit.text(), ";") 332 self.notShowEdit.text(), ";")
331 if dlg.exec() == QDialog.Accepted: 333 if dlg.exec() == QDialog.DialogCode.Accepted:
332 environments = dlg.getData(";", True) 334 environments = dlg.getData(";", True)
333 self.notShowEdit.setText(environments) 335 self.notShowEdit.setText(environments)
334 336
335 @pyqtSlot(str) 337 @pyqtSlot(str)
336 def on_typeEdit_textChanged(self, txt): 338 def on_typeEdit_textChanged(self, txt):

eric ide

mercurial