MCPcopy Create free account
hub / github.com/echQoQ/RustSL / choose_file

Method choose_file

gui/widgets.py:32–42  ·  view source on GitHub ↗
(self, parent=None)

Source from the content-addressed store, hash-verified

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
44class IcoComboBox(QComboBox):
45 def __init__(self, parent=None):

Callers 4

_create_bin_groupMethod · 0.45
_create_icon_groupMethod · 0.45
_create_sign_groupMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected