(self, parent=None)
| 30 | self.setCurrentIndex(default_idx) |
| 31 | |
| 32 | def choose_file(self, parent=None): |
| 33 | path, _ = QFileDialog.getOpenFileName(parent, 'Select Bin File', '.', 'Bin Files (*.bin);;All Files (*)') |
| 34 | if path: |
| 35 | display_name = os.path.basename(path) |
| 36 | bin_icon = QIcon(os.path.join('icons', 'bin.ico')) if os.path.exists(os.path.join('icons', 'bin.ico')) else QIcon() |
| 37 | for i in range(self.count()): |
| 38 | if self.itemData(i) == path: |
| 39 | self.setCurrentIndex(i) |
| 40 | return |
| 41 | self.addItem(bin_icon, display_name, path) |
| 42 | self.setCurrentIndex(self.count() - 1) |
| 43 | |
| 44 | class IcoComboBox(QComboBox): |
| 45 | def __init__(self, parent=None): |
no outgoing calls
no test coverage detected