eric6/MicroPython/ConnectionSelectionDialog.py

changeset 8143
2c730d5fd177
parent 8139
418c2d9a767d
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
19 class ConnectionSelectionDialog(QDialog, Ui_ConnectionSelectionDialog): 19 class ConnectionSelectionDialog(QDialog, Ui_ConnectionSelectionDialog):
20 """ 20 """
21 Class implementing a dialog to select the port to connect to and the type 21 Class implementing a dialog to select the port to connect to and the type
22 of the attached device. 22 of the attached device.
23 """ 23 """
24 PortNameRole = Qt.UserRole 24 PortNameRole = Qt.ItemDataRole.UserRole
25 VidPidRole = Qt.UserRole + 1 25 VidPidRole = Qt.ItemDataRole.UserRole + 1
26 26
27 def __init__(self, ports, currentPort, currentType, parent=None): 27 def __init__(self, ports, currentPort, currentType, parent=None):
28 """ 28 """
29 Constructor 29 Constructor
30 30
77 77
78 def __updateOK(self): 78 def __updateOK(self):
79 """ 79 """
80 Private method to update the status of the OK button. 80 Private method to update the status of the OK button.
81 """ 81 """
82 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled( 82 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(
83 bool(self.portNameComboBox.currentData(self.PortNameRole)) and 83 bool(self.portNameComboBox.currentData(self.PortNameRole)) and
84 bool(self.deviceTypeComboBox.currentData()) 84 bool(self.deviceTypeComboBox.currentData())
85 ) 85 )
86 86
87 @pyqtSlot(str) 87 @pyqtSlot(str)

eric ide

mercurial