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

Function create_target_combobox

gui/ui_components.py:128–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126
127
128def create_target_combobox():
129 combo = QComboBox()
130 combo.setView(QListView())
131 combo.setItemDelegate(QStyledItemDelegate())
132
133 target_icon = get_icon('target')
134
135 targets = [
136 ('x86_64-pc-windows-msvc', 'Windows MSVC (x64)'),
137 ('i686-pc-windows-msvc', 'Windows MSVC (x86)'),
138 ('x86_64-pc-windows-gnu', 'Windows GNU (x64)'),
139 ('i686-pc-windows-gnu', 'Windows GNU (x86)'),
140 ('aarch64-pc-windows-msvc', 'Windows MSVC (ARM64)'),
141 ]
142
143 for target, label in targets:
144 combo.addItem(target_icon, label, target)
145
146 import platform
147 os_name = platform.system().lower()
148 if os_name == "windows":
149 default_target = "x86_64-pc-windows-msvc"
150 else:
151 default_target = "x86_64-pc-windows-gnu"
152
153 for i in range(combo.count()):
154 if combo.itemData(i) == default_target:
155 combo.setCurrentIndex(i)
156 break
157
158 return combo

Callers 1

_create_sign_groupMethod · 0.85

Calls 1

get_iconFunction · 0.85

Tested by

no test coverage detected