DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
daqconf
python
daqconf
cider
widgets
popups
quit_screen.py
Go to the documentation of this file.
1
from
textual.widgets
import
Button, Label
2
from
textual.screen
import
Screen
3
from
textual.containers
import
Grid
4
from
textual.app
import
ComposeResult
5
from
os
import
environ
6
7
8
class
QuitScreen
(Screen):
9
"""Screen with a dialog to quit."""
10
css_file_path = f
"{environ.get('DAQCONF_SHARE')}/config/textual_dbe/textual_css"
11
12
CSS_PATH = f
"{css_file_path}/quit_screen.tcss"
13
14
def
compose
(self) -> ComposeResult:
15
yield
Grid(
16
Label(
"Are you sure you want to quit? [Any unsaved changes will be lost!]"
, id=
"question"
),
17
Button(
"Save and Quit"
, variant=
"success"
, id=
"save_quit"
),
18
Button(
"Quit"
, variant=
"error"
, id=
"quit"
),
19
Button(
"Cancel"
, variant=
"primary"
, id=
"cancel"
),
20
id=
"dialog"
,
21
)
22
23
def
on_button_pressed
(self, event: Button.Pressed) ->
None
:
24
if
event.button.id ==
"quit"
:
25
self.app.exit()
26
elif
event.button.id ==
"save_quit"
:
27
main_screen = self.app.get_screen(
"main"
)
28
config_controller = main_screen.query_one(
"ConfigurationController"
)
29
config_controller.commit_configuration(
"Update configuration"
)
30
self.app.exit()
31
else
:
32
self.app.pop_screen()
quit_screen.QuitScreen
Definition
quit_screen.py:8
quit_screen.QuitScreen.compose
ComposeResult compose(self)
Definition
quit_screen.py:14
quit_screen.QuitScreen.on_button_pressed
None on_button_pressed(self, Button.Pressed event)
Definition
quit_screen.py:23
Generated on
for DUNE-DAQ by
1.17.0