fix propagate player update to participant views
This commit is contained in:
parent
7792a76f8e
commit
dd886802f4
6 changed files with 24 additions and 21 deletions
|
|
@ -157,22 +157,22 @@ class AppController:
|
|||
)
|
||||
elif item_type == ItemType.OBJECTIVE:
|
||||
self.wars.edit_objective(item_id)
|
||||
self.navigation.refresh(RefreshScope.WAR_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.WAR_PARTICIPANT:
|
||||
self.wars.edit_war_participant(item_id)
|
||||
self.navigation.refresh(RefreshScope.WAR_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.SECTOR:
|
||||
self.campaigns.edit_sector(item_id)
|
||||
self.navigation.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.CAMPAIGN_PARTICIPANT:
|
||||
self.campaigns.edit_campaign_participant(item_id)
|
||||
self.navigation.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.CHOICE:
|
||||
self.rounds.edit_round_choice(item_id)
|
||||
self.navigation.refresh(RefreshScope.ROUND_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.BATTLE:
|
||||
self.rounds.edit_round_battle(item_id)
|
||||
self.navigation.refresh(RefreshScope.ROUND_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
self.is_dirty = True
|
||||
except UpdateRequiresConfirmation as e:
|
||||
reply = QMessageBox.question(
|
||||
|
|
@ -183,7 +183,7 @@ class AppController:
|
|||
)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
e.apply_update()
|
||||
self.navigation.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
|
||||
def delete_item(self, item_type: str, item_id: str) -> None:
|
||||
reply = QMessageBox.question(
|
||||
|
|
@ -210,16 +210,16 @@ class AppController:
|
|||
)
|
||||
elif item_type == ItemType.OBJECTIVE:
|
||||
self.model.remove_objective(item_id)
|
||||
self.navigation.refresh(RefreshScope.WAR_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.WAR_PARTICIPANT:
|
||||
self.model.remove_war_participant(item_id)
|
||||
self.navigation.refresh(RefreshScope.WAR_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.SECTOR:
|
||||
self.model.remove_sector(item_id)
|
||||
self.navigation.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.CAMPAIGN_PARTICIPANT:
|
||||
self.model.remove_campaign_participant(item_id)
|
||||
self.navigation.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
elif item_type == ItemType.ROUND:
|
||||
camp = self.model.get_campaign_by_round(item_id)
|
||||
camp_id = camp.id
|
||||
|
|
@ -243,4 +243,4 @@ class AppController:
|
|||
)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
e.cleanup_action()
|
||||
self.navigation.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue