fix remove round used in sector

This commit is contained in:
Maxime Réaux 2026-02-06 11:13:29 +01:00
parent 6cd3a060c7
commit 701f6b3292
7 changed files with 15 additions and 9 deletions

View file

@ -21,7 +21,7 @@ def format_campaign_label(camp: CampaignDTO) -> str:
return f"{camp.name} ({calendar.month_name[camp.month]})"
def format_round_label(index: int) -> str:
def format_round_label(index: int | None) -> str:
if index is None:
return ""
return f"Round {index}"

View file

@ -23,10 +23,11 @@ class SectorDialog(QDialog):
super().__init__(parent)
self.ui: Ui_sectorDialog = Ui_sectorDialog()
self.ui.setupUi(self) # type: ignore
self.ui.sectorName.setText(default_name)
self.ui.majorComboBox.addItem("(none)", None)
self.ui.minorComboBox.addItem("(none)", None)
self.ui.influenceComboBox.addItem("(none)", None)
self.ui.sectorName.setText(default_name)
self.ui.roundComboBox.addItem("(none)", None)
for index, rnd in enumerate(rounds, start=1):
self.ui.roundComboBox.addItem(format_round_label(index), rnd.id)
select_if_exists(self.ui.roundComboBox, default_round_id)

View file

@ -448,7 +448,7 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
if action == edit_action and self.on_edit_item:
self.on_edit_item(ItemType.BATTLE, battle_id)
def show_round_details(self, *, index: int) -> None:
def show_round_details(self, *, index: int | None) -> None:
self.roundNb.setText(f"Round {index}")
def display_round_choices(self, participants: List[ChoiceDTO]) -> None: