mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 14:21:33 +03:00
Prevent multiple character selector dialogs from opening at once
This commit is contained in:
parent
74c4af1a5b
commit
61d1532552
3
paint.py
3
paint.py
@ -1305,10 +1305,13 @@ class PaintApp(App):
|
|||||||
|
|
||||||
def action_open_character_selector(self) -> None:
|
def action_open_character_selector(self) -> None:
|
||||||
"""Show dialog to select a character."""
|
"""Show dialog to select a character."""
|
||||||
|
for old_window in self.query("#character_selector_dialog").nodes:
|
||||||
|
old_window.close()
|
||||||
def handle_selected_character(character):
|
def handle_selected_character(character):
|
||||||
self.selected_char = character
|
self.selected_char = character
|
||||||
window.close()
|
window.close()
|
||||||
window = CharacterSelectorDialog(
|
window = CharacterSelectorDialog(
|
||||||
|
id="character_selector_dialog",
|
||||||
handle_selected_character=handle_selected_character,
|
handle_selected_character=handle_selected_character,
|
||||||
selected_character=self.selected_char,
|
selected_character=self.selected_char,
|
||||||
title=_("Choose Character"),
|
title=_("Choose Character"),
|
||||||
|
Loading…
Reference in New Issue
Block a user