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

Method choose_file

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

Source from the content-addressed store, hash-verified

93 self.setCurrentIndex(0)
94
95 def choose_file(self, parent=None):
96 path, _ = QFileDialog.getOpenFileName(parent, 'Select File to Bundle', '.', 'All Files (*)')
97 if path:
98 # Ensure absolute path
99 path = os.path.abspath(path)
100 display_name = os.path.basename(path)
101 bundle_icon = QIcon(os.path.join('gui', 'icons', 'bundle.ico')) if os.path.exists(os.path.join('gui', 'icons', 'bundle.ico')) else QIcon()
102 for i in range(self.count()):
103 if self.itemData(i) == path:
104 self.setCurrentIndex(i)
105 return
106 self.addItem(bundle_icon, display_name, path)
107 self.setCurrentIndex(self.count() - 1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected