@@ -76,7 +76,7 @@ def __init__(self, state: AppState):
7676 self .view = Column (expand = True , width = 1200 )
7777
7878 # create default starter views
79- welcome_view = WelcomeView (
79+ self . welcome_view = WelcomeView (
8080 on_confirm = self .to_next_view ,
8181 state = self .state ,
8282 )
@@ -103,7 +103,10 @@ def __init__(self, state: AppState):
103103 )
104104
105105 # create the final success view
106- self .final_view = SuccessView (state = self .state )
106+ self .success_view = SuccessView (
107+ on_confirm = self .restart ,
108+ state = self .state ,
109+ )
107110
108111 # initialize the addon view
109112 self .select_addon_view = AddonsView (
@@ -120,7 +123,7 @@ def __init__(self, state: AppState):
120123 select_files_view ,
121124 requirements_view ,
122125 start_view ,
123- welcome_view ,
126+ self . welcome_view ,
124127 ]
125128 )
126129 self .state .add_addon_views (
@@ -132,7 +135,7 @@ def __init__(self, state: AppState):
132135 # final default views, ordered to allow to pop
133136 self .state .add_final_default_views (
134137 views = [
135- self .final_view ,
138+ self .success_view ,
136139 self .install_view ,
137140 ]
138141 )
@@ -178,10 +181,19 @@ def to_next_view(self, e):
178181
179182 # else:
180183 # # display the final view
181- # self.view.controls.append(self.final_view )
184+ # self.view.controls.append(self.success_view )
182185 logger .info ("Confirmed and moved to next step." )
183186 self .view .update ()
184-
187+
188+ def restart (self , e ):
189+ """Method to display the first view."""
190+ self .welcome_view .init_visuals ()
191+ # clear the current view
192+ self .view .controls = []
193+ # retrieve the new view and update
194+ self .view .controls .append (self .welcome_view )
195+ logger .info ("Restart." )
196+ self .view .update ()
185197
186198def configure (page : Page ):
187199 """Configure the application."""
0 commit comments