diff --git a/src/remotes_page/remotes_page.blp b/src/remotes_page/remotes_page.blp index f989ed5..613fc17 100644 --- a/src/remotes_page/remotes_page.blp +++ b/src/remotes_page/remotes_page.blp @@ -31,7 +31,6 @@ template $RemotesPage : Adw.NavigationPage { Adw.ToastOverlay { Stack stack { Adw.StatusPage loading_remotes { - visible: false; title: _("Loading Remotes"); description: _("This should only take a moment"); child: @@ -46,7 +45,6 @@ template $RemotesPage : Adw.NavigationPage { icon-name: "system-search-symbolic"; } Adw.StatusPage no_remotes { - visible: false; title: _("No Remotes Found"); description: _("Warehouse cannot see the current remotes or your system has no remotes added"); icon-name: "error-symbolic"; diff --git a/src/remotes_page/remotes_page.py b/src/remotes_page/remotes_page.py index e359645..a4075c7 100644 --- a/src/remotes_page/remotes_page.py +++ b/src/remotes_page/remotes_page.py @@ -23,6 +23,12 @@ class RemotesPage(Adw.NavigationPage): # It is used to determine if a new page should be made or not # This must be set to the created object from within the class's __init__ method instance = None + + def start_loading(self): + self.stack.set_visible_child(self.loading_remotes) + + def end_loading(self): + self.stack.set_visible_child(self.content_page) def __init__(self, main_window, **kwargs): super().__init__(**kwargs) @@ -30,6 +36,7 @@ class RemotesPage(Adw.NavigationPage): # Extra Object Creation ms = main_window.main_split self.search_bar.set_key_capture_widget(main_window) + self.__class__.instance = self # Connections ms.connect("notify::show-sidebar", lambda *_: self.sidebar_button.set_active(ms.get_show_sidebar()))