fix(loadout): remove leftover code causing indentation error

- Removed old attachment selection dialog code
- Fixed _on_attach() method
This commit is contained in:
LemonNexus 2026-02-09 13:06:05 +00:00
parent 78234da448
commit ad9cd2cd4c
1 changed files with 0 additions and 34 deletions

View File

@ -1649,40 +1649,6 @@ class LoadoutManagerDialog(QDialog):
def _on_attach(self, attachment_type: str): def _on_attach(self, attachment_type: str):
"""Handle attachment selection (legacy - now uses API).""" """Handle attachment selection (legacy - now uses API)."""
self._on_select_attachment(attachment_type) self._on_select_attachment(attachment_type)
return
# Create simple selection dialog
dialog = QDialog(self)
dialog.setWindowTitle(f"Select {attachment_type.title()}")
dialog.setMinimumWidth(400)
layout = QVBoxLayout(dialog)
list_widget = QListWidget()
for att in attachments:
item = QListWidgetItem(f"📎 {att.name}")
item.setData(Qt.ItemDataRole.UserRole, att)
list_widget.addItem(item)
layout.addWidget(list_widget)
buttons = QDialogButtonBox(
QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel
)
buttons.accepted.connect(dialog.accept)
buttons.rejected.connect(dialog.reject)
layout.addWidget(buttons)
# Add None option
none_btn = QPushButton("Remove Attachment")
none_btn.clicked.connect(lambda: self._clear_attachment(attachment_type) or dialog.reject())
layout.addWidget(none_btn)
if dialog.exec() == QDialog.DialogCode.Accepted:
selected = list_widget.currentItem()
if selected:
att = selected.data(Qt.ItemDataRole.UserRole)
self._apply_attachment(attachment_type, att)
def _apply_attachment(self, attachment_type: str, att): def _apply_attachment(self, attachment_type: str, att):
"""Apply selected attachment.""" """Apply selected attachment."""