Move No Remotes to new list

This commit is contained in:
heliguy
2023-12-09 16:24:31 -05:00
parent a62f63b4d1
commit e62e51e973
2 changed files with 5 additions and 11 deletions

View File

@@ -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");
}
}
};
}

View File

@@ -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)