DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
delete_object_screen.DeleteConfigObjectScreen Class Reference
Inheritance diagram for delete_object_screen.DeleteConfigObjectScreen:
[legend]
Collaboration diagram for delete_object_screen.DeleteConfigObjectScreen:
[legend]

Public Member Functions

ComposeResult compose (self)
 
 dismiss_and_update (self)
 
None on_button_pressed (self, Button.Pressed event)
 

Static Public Attributes

str css_file_path = f"{environ.get('DAQCONF_SHARE')}/config/textual_dbe/textual_css"
 
str CSS_PATH = f"{css_file_path}/delete_screen.tcss"
 

Protected Attributes

 _main_screen = self.app.get_screen("main")
 
ConfigurationController _config_controller = self._main_screen.query_one(ConfigurationController)
 

Detailed Description

Definition at line 9 of file delete_object_screen.py.

Member Function Documentation

◆ compose()

ComposeResult delete_object_screen.DeleteConfigObjectScreen.compose ( self)

Definition at line 16 of file delete_object_screen.py.

16 def compose(self) -> ComposeResult:
17 self._main_screen = self.app.get_screen("main")
18 self._config_controller: ConfigurationController = self._main_screen.query_one(ConfigurationController)
19
20 selected_obj = getattr(self._config_controller.current_dal, "id")
21
22 yield Grid(
23
24 Label(f"Are you sure you want to delete {selected_obj}?]", id="question"),
25 Button("Delete", variant="success", id="delete"),
26 Button("Cancel", variant="primary", id="cancel"),
27 id="dialog",
28 )
29

◆ dismiss_and_update()

delete_object_screen.DeleteConfigObjectScreen.dismiss_and_update ( self)

Definition at line 31 of file delete_object_screen.py.

31 def dismiss_and_update(self):
32 selection_menu = self._main_screen.query_exactly_one("SelectionPanel")
33 selection_menu.refresh(recompose=True)
34 selection_menu.restore_menu_state()
35 self.app.screen.dismiss()
36

◆ on_button_pressed()

None delete_object_screen.DeleteConfigObjectScreen.on_button_pressed ( self,
Button.Pressed event )

Definition at line 37 of file delete_object_screen.py.

37 def on_button_pressed(self, event: Button.Pressed) -> None:
38 if event.button.id == "delete":
39 try:
40 self._config_controller.destroy_current_object()
41 except Exception as e:
42 self._main_screen.query_one("RichLogWError").write_error(e)
43 self.dismiss_and_update()
44 else:
45 self.app.pop_screen()

Member Data Documentation

◆ _config_controller

ConfigurationController delete_object_screen.DeleteConfigObjectScreen._config_controller = self._main_screen.query_one(ConfigurationController)
protected

Definition at line 18 of file delete_object_screen.py.

◆ _main_screen

delete_object_screen.DeleteConfigObjectScreen._main_screen = self.app.get_screen("main")
protected

Definition at line 17 of file delete_object_screen.py.

◆ css_file_path

str delete_object_screen.DeleteConfigObjectScreen.css_file_path = f"{environ.get('DAQCONF_SHARE')}/config/textual_dbe/textual_css"
static

Definition at line 11 of file delete_object_screen.py.

◆ CSS_PATH

str delete_object_screen.DeleteConfigObjectScreen.CSS_PATH = f"{css_file_path}/delete_screen.tcss"
static

Definition at line 13 of file delete_object_screen.py.


The documentation for this class was generated from the following file: