fix(loadout): remove leftover code causing indentation error
- Removed old attachment selection dialog code - Fixed _on_attach() method
This commit is contained in:
parent
78234da448
commit
ad9cd2cd4c
|
|
@ -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."""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue