src/eric7/MicroPython/ConnectionSelectionDialog.py

branch
eric7
changeset 9759
4543b7876047
parent 9653
e67609152c5e
child 9765
6378da868bb0
equal deleted inserted replaced
9758:6d24ab9c0404 9759:4543b7876047
9 """ 9 """
10 10
11 from PyQt6.QtCore import Qt, pyqtSlot 11 from PyQt6.QtCore import Qt, pyqtSlot
12 from PyQt6.QtWidgets import QDialog, QDialogButtonBox 12 from PyQt6.QtWidgets import QDialog, QDialogButtonBox
13 13
14 from . import MicroPythonDevices 14 from .Devices import getSupportedDevices
15 from .Ui_ConnectionSelectionDialog import Ui_ConnectionSelectionDialog 15 from .Ui_ConnectionSelectionDialog import Ui_ConnectionSelectionDialog
16 16
17 17
18 class ConnectionSelectionDialog(QDialog, Ui_ConnectionSelectionDialog): 18 class ConnectionSelectionDialog(QDialog, Ui_ConnectionSelectionDialog):
19 """ 19 """
51 self.portNameComboBox.setItemData(index, portName, self.PortNameRole) 51 self.portNameComboBox.setItemData(index, portName, self.PortNameRole)
52 self.portNameComboBox.setItemData(index, (vid, pid), self.VidPidRole) 52 self.portNameComboBox.setItemData(index, (vid, pid), self.VidPidRole)
53 53
54 self.deviceTypeComboBox.addItem("", "") 54 self.deviceTypeComboBox.addItem("", "")
55 for board, description in sorted( 55 for board, description in sorted(
56 MicroPythonDevices.getSupportedDevices(), key=lambda x: x[1] 56 getSupportedDevices(), key=lambda x: x[1]
57 ): 57 ):
58 self.deviceTypeComboBox.addItem(description, board) 58 self.deviceTypeComboBox.addItem(description, board)
59 59
60 if self.portNameComboBox.currentText(): 60 if self.portNameComboBox.currentText():
61 # some ports were found; use the previously selected type as 61 # some ports were found; use the previously selected type as

eric ide

mercurial