fix inluence_token setting auto cleanup and fix is_dirty
This commit is contained in:
parent
789756d586
commit
3c54a8d4a7
5 changed files with 114 additions and 18 deletions
|
|
@ -215,13 +215,13 @@ class AppController:
|
|||
self.navigation.refresh_and_select(
|
||||
RefreshScope.WARS_TREE, item_type=ItemType.ROUND, item_id=rnd.id
|
||||
)
|
||||
self.is_dirty = True
|
||||
except DomainError as e:
|
||||
QMessageBox.warning(
|
||||
self.view,
|
||||
"Deletion forbidden",
|
||||
"Add forbidden",
|
||||
str(e),
|
||||
)
|
||||
return
|
||||
except RequiresConfirmation as e:
|
||||
reply = QMessageBox.question(
|
||||
self.view,
|
||||
|
|
@ -231,7 +231,10 @@ class AppController:
|
|||
)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
e.action()
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
else:
|
||||
return
|
||||
self.is_dirty = True
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
|
||||
def edit_item(self, item_type: str, item_id: str) -> None:
|
||||
try:
|
||||
|
|
@ -266,13 +269,13 @@ class AppController:
|
|||
elif item_type == ItemType.BATTLE:
|
||||
self.rounds.edit_round_battle(item_id)
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
self.is_dirty = True
|
||||
except DomainError as e:
|
||||
QMessageBox.warning(
|
||||
self.view,
|
||||
"Deletion forbidden",
|
||||
"Update forbidden",
|
||||
str(e),
|
||||
)
|
||||
return
|
||||
except RequiresConfirmation as e:
|
||||
reply = QMessageBox.question(
|
||||
self.view,
|
||||
|
|
@ -282,7 +285,10 @@ class AppController:
|
|||
)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
e.action()
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
else:
|
||||
return
|
||||
self.is_dirty = True
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
|
||||
def delete_item(self, item_type: str, item_id: str) -> None:
|
||||
reply = QMessageBox.question(
|
||||
|
|
@ -326,13 +332,13 @@ class AppController:
|
|||
self.navigation.refresh_and_select(
|
||||
RefreshScope.WARS_TREE, item_type=ItemType.CAMPAIGN, item_id=camp_id
|
||||
)
|
||||
self.is_dirty = True
|
||||
except DomainError as e:
|
||||
QMessageBox.warning(
|
||||
self.view,
|
||||
"Deletion forbidden",
|
||||
str(e),
|
||||
)
|
||||
return
|
||||
except RequiresConfirmation as e:
|
||||
reply = QMessageBox.question(
|
||||
self.view,
|
||||
|
|
@ -342,4 +348,7 @@ class AppController:
|
|||
)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
e.action()
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
else:
|
||||
return
|
||||
self.is_dirty = True
|
||||
self.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue