@@ -155,7 +155,7 @@ def __init__(self, window, arg_bottle=None, **kwargs):
155
155
156
156
# backend signals
157
157
SignalManager .connect (
158
- Signals .ManagerLocalBottlesLoaded , self .backend_local_bottle_loaded
158
+ Signals .ManagerLocalBottlesLoaded , self .update_bottles_list
159
159
)
160
160
161
161
self .bottle_status .set_icon_name (APP_ID )
@@ -176,7 +176,7 @@ def __filter_bottles(row, terms=None):
176
176
text = row .get_title ().lower ()
177
177
return terms .lower () in text
178
178
179
- def idle_update_bottles_list (self , show = False ) :
179
+ def update_bottles_list (self , * args ) -> None :
180
180
self .__bottles = {}
181
181
while self .list_bottles .get_first_child ():
182
182
self .list_bottles .remove (self .list_bottles .get_first_child ())
@@ -206,26 +206,9 @@ def idle_update_bottles_list(self, show=False):
206
206
self .group_steam .set_visible (True )
207
207
self .group_bottles .set_title (_ ("Your Bottles" ))
208
208
209
- if (
210
- self .arg_bottle is not None and self .arg_bottle in local_bottles .keys ()
211
- ) or (show is not None and show in local_bottles .keys ()):
212
- _config = None
213
- if self .arg_bottle :
214
- _config = local_bottles [self .arg_bottle ]
215
- if show :
216
- _config = local_bottles [show ]
217
- if not _config :
218
- raise NotImplementedError ("neither 'arg_bottle' nor 'show' are set" )
219
-
220
- self .window .page_details .view_preferences .update_combo_components ()
221
- self .window .show_details_view (config = _config )
222
- self .arg_bottle = None
223
-
224
- def backend_local_bottle_loaded (self , _ : Result ):
225
- self .update_bottles_list ()
226
-
227
- def update_bottles_list (self , show = False ):
228
- GLib .idle_add (self .idle_update_bottles_list , show )
209
+ def show_page (self , page : str ) -> None :
210
+ if config := self .window .manager .local_bottles .get (page ):
211
+ self .window .show_details_view (config = config )
229
212
230
213
def disable_bottle (self , config ):
231
214
self .__bottles [config .Path ].disable ()
0 commit comments