Commit 1c3fb86e authored by Felipe Borges's avatar Felipe Borges 👣

wizard-downloads-page: Reset view to show recommended OSes

Whenever the user enters the "Download an OS" page, they should
see the recommended list, and perform a search if necessary.
parent e56d3a3f
// This file is part of GNOME Boxes. License: LGPLv2+
public enum WizardDownloadsPageView {
RECOMMENDED,
SEARCH_RESULTS,
}
[GtkTemplate (ui = "/org/gnome/Boxes/ui/wizard-downloads-page.ui")]
public class Boxes.WizardDownloadsPage : Gtk.Stack {
private OSDatabase os_db = new OSDatabase ();
......@@ -21,6 +26,24 @@
"http://fedoraproject.org/fedora/27",
};
private WizardDownloadsPageView _page;
public WizardDownloadsPageView page {
get { return _page; }
set {
_page = value;
switch (_page) {
case WizardDownloadsPageView.SEARCH_RESULTS:
visible_child_name = "search-results";
break;
case WizardDownloadsPageView.RECOMMENDED:
default:
visible_child_name = "recommended";
break;
}
}
}
construct {
os_db.load.begin ();
......
......@@ -122,6 +122,7 @@ public void show_downloads_page (OSDatabase os_db, owned DownloadChosenFunc down
topbar.downloads_search.grab_focus ();
downloads_page.download_chosen_func = download_chosen_func;
downloads_page.page = WizardDownloadsPageView.RECOMMENDED;
os_db.list_downloadable_oses.begin ((db, result) => {
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment