@@ -88,7 +88,9 @@ def init_visuals(
8888OpenAndroidInstaller works with the [TWRP recovery project](https://twrp.me/about).""" ,
8989 ),
9090 actions = [
91- TextButton ("Close" , on_click = self .close_close_explain_images_dlg ),
91+ TextButton (
92+ "Close" , on_click = lambda _ : self .page .close (self .dlg_explain_images )
93+ ),
9294 ],
9395 actions_alignment = "end" ,
9496 shape = ContinuousRectangleBorder (radius = 0 ),
@@ -172,7 +174,7 @@ def build(self):
172174 # create help/info button to show the help dialog for the image and recovery selection
173175 explain_images_button = OutlinedButton (
174176 "What is this?" ,
175- on_click = self .open_explain_images_dlg ,
177+ on_click = lambda _ : self .page . open ( self . dlg_explain_images ) ,
176178 expand = True ,
177179 icon = Icons .HELP_OUTLINE_OUTLINED ,
178180 icon_color = Colors .DEEP_ORANGE_500 ,
@@ -374,7 +376,10 @@ def toggle_additional_image_selection(self):
374376 ),
375377 actions = [
376378 TextButton (
377- "Close" , on_click = self .close_close_explain_additional_images_dlg
379+ "Close" ,
380+ on_click = lambda _ : self .page .close (
381+ self .dlg_explain_additional_images
382+ ),
378383 ),
379384 ],
380385 actions_alignment = "end" ,
@@ -384,7 +389,7 @@ def toggle_additional_image_selection(self):
384389 # create help/info button to show the help dialog for the image and recovery selection
385390 explain_additional_images_button = OutlinedButton (
386391 "Why do I need this and where do I get it?" ,
387- on_click = self .open_explain_additional_images_dlg ,
392+ on_click = lambda _ : self .page . open ( self . dlg_explain_additional_images ) ,
388393 expand = True ,
389394 icon = Icons .HELP_OUTLINE_OUTLINED ,
390395 icon_color = Colors .DEEP_ORANGE_500 ,
@@ -500,28 +505,6 @@ def toggle_additional_image_selection(self):
500505 self .additional_image_selection .controls = additional_image_selection
501506 self .additional_image_selection .update ()
502507
503- def open_explain_images_dlg (self , e ):
504- """Open the dialog to explain OS and recovery image."""
505- self .page .dialog = self .dlg_explain_images
506- self .dlg_explain_images .open = True
507- self .page .update ()
508-
509- def close_close_explain_images_dlg (self , e ):
510- """Close the dialog to explain OS and recovery image."""
511- self .dlg_explain_images .open = False
512- self .page .update ()
513-
514- def open_explain_additional_images_dlg (self , e ):
515- """Open the dialog to explain additional images."""
516- self .page .dialog = self .dlg_explain_additional_images
517- self .dlg_explain_additional_images .open = True
518- self .page .update ()
519-
520- def close_close_explain_additional_images_dlg (self , e ):
521- """Close the dialog to explain additional images."""
522- self .dlg_explain_additional_images .open = False
523- self .page .update ()
524-
525508 def pick_image_result (self , e : FilePickerResultEvent ):
526509 logger .info (f"Selected image: { e .files } " )
527510 path = ", " .join (map (lambda f : f .name , e .files )) if e .files else "Cancelled!"
0 commit comments