mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-14 10:38:22 +00:00
Added a way to quit application with 'q' more or less properly
This commit is contained in:
parent
0254c51164
commit
b272b1b07b
1 changed files with 8 additions and 2 deletions
|
@ -2,8 +2,7 @@
|
||||||
# -*-coding:UTF-8 -*
|
# -*-coding:UTF-8 -*
|
||||||
|
|
||||||
from asciimatics.widgets import Frame, ListBox, Layout, Divider, Text, \
|
from asciimatics.widgets import Frame, ListBox, Layout, Divider, Text, \
|
||||||
Button, TextBox, Widget, Label
|
Button, Label
|
||||||
from asciimatics.effects import Cycle, Print, Stars
|
|
||||||
from asciimatics.scene import Scene
|
from asciimatics.scene import Scene
|
||||||
from asciimatics.screen import Screen
|
from asciimatics.screen import Screen
|
||||||
from asciimatics.exceptions import ResizeScreenError, NextScene, StopApplication
|
from asciimatics.exceptions import ResizeScreenError, NextScene, StopApplication
|
||||||
|
@ -117,6 +116,11 @@ class CListBox(ListBox):
|
||||||
current_selected_queue = self.queue_name
|
current_selected_queue = self.queue_name
|
||||||
self._frame.save()
|
self._frame.save()
|
||||||
raise NextScene("action_choice")
|
raise NextScene("action_choice")
|
||||||
|
|
||||||
|
# Quit if press q
|
||||||
|
elif event.key_code == ord('q'):
|
||||||
|
ListView._quit()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Ignore any other key press.
|
# Ignore any other key press.
|
||||||
return event
|
return event
|
||||||
|
@ -785,3 +789,5 @@ if __name__ == "__main__":
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
except ResizeScreenError as e:
|
except ResizeScreenError as e:
|
||||||
pass
|
pass
|
||||||
|
except StopApplication:
|
||||||
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in a new issue