diff --git a/data/ui/remotes.blp b/data/ui/remotes.blp index be8a056..927aba3 100644 --- a/data/ui/remotes.blp +++ b/data/ui/remotes.blp @@ -24,6 +24,9 @@ template RemotesWindow: Adw.Window { } styles["flat"] }; + Adw.ActionRow no_remotes { + title: _("No remotes on the system, add some from below"); + } } Adw.PreferencesGroup popular_remotes_list { title: _("Add a Popular Remote"); @@ -73,12 +76,6 @@ template RemotesWindow: Adw.Window { styles ["description", "body"] } } - - Adw.StatusPage no_remotes { - icon-name: "error-symbolic"; - title: _("No Remotes"); - description: _("Warehouse cannot see the list of remotes or the system has no remotes added"); - } } }; } diff --git a/src/remotes_window.py b/src/remotes_window.py index 32a2bf2..3dd1288 100644 --- a/src/remotes_window.py +++ b/src/remotes_window.py @@ -87,11 +87,7 @@ class RemotesWindow(Adw.Window): self.app_window.clipboard.set(to_copy) self.make_toast(_("Copied {}").format(to_copy)) - if self.host_remotes[0][0] == '': - self.stack.set_visible_child(self.no_remotes) - return - else: - self.stack.set_visible_child(self.main_group) + self.no_remotes.set_visible(True) for i in range(len(self.host_remotes)): try: @@ -120,6 +116,7 @@ class RemotesWindow(Adw.Window): remote_row.add_suffix(copy_button) remote_row.add_suffix(remove_button) self.rows_in_list.append(remote_row) + self.no_remotes.set_visible(False) except Exception as e: print("error in remotes_window.generate_list: could not add remote. error:", e)