[gnome-boxes/fix-logo-for-rhel: 13/13] wizard: Resolve logo for custom downloadable OSes (RHEL)



commit bb89e051e220a37f76ad855196efc56eb4eb7db7
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Mar 12 16:19:19 2018 +0100

    wizard: Resolve logo for custom downloadable OSes (RHEL)
    
    The logos hashtable introduced in de46e6e doesn't handle the
    downloadable OSes which don't come from libosinfo but are manually
    added.
    
    This patch is a hotfix so we don't ship the regression in 3.28.
    
    Fixes #185

 src/wizard-source.vala | 7 +++++--
 src/wizard-window.vala | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 69d9537f..44155533 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -310,6 +310,7 @@ private void on_notify_estimated_load_progress () {
 
     private Gtk.ListBox media_vbox;
     private Gtk.ListBox downloads_vbox;
+    private Osinfo.Os rhel_os;
 
     private Cancellable? rhel_cancellable;
 
@@ -394,9 +395,9 @@ private void on_notify_estimated_load_progress () {
         var rhel_id = "http://redhat.com/rhel/7.4";;
         os_db.get_os_by_id.begin (rhel_id, (obj, res) => {
             try {
-                var os = os_db.get_os_by_id.end (res);
+                rhel_os = os_db.get_os_by_id.end (res);
 
-                var rhel_row = new WizardDownloadableEntry.from_os (os);
+                var rhel_row = new WizardDownloadableEntry.from_os (rhel_os);
                 rhel_row.title = "Red Hat Enterprise Linux";
                 rhel_row.details = _("Available with a free Red Hat developer account");
 
@@ -644,6 +645,8 @@ private bool on_rhel_web_view_decide_policy (WebKit.WebView web_view,
 
         debug ("RHEL ISO download URI: %s", download_uri);
 
+        window.wizard_window.logos_table.insert (download_uri, rhel_os);
+
         var soup_download_uri = new Soup.URI (download_uri);
         var download_path = soup_download_uri.get_path ();
 
diff --git a/src/wizard-window.vala b/src/wizard-window.vala
index ecd4706e..c31f1ce8 100644
--- a/src/wizard-window.vala
+++ b/src/wizard-window.vala
@@ -15,7 +15,7 @@
     public delegate void FileChosenFunc (string uri);
     public delegate void DownloadChosenFunc (WizardDownloadableEntry entry);
 
-    private HashTable<string,Osinfo.Os> logos_table;
+    public HashTable<string,Osinfo.Os> logos_table;
 
     public UIState previous_ui_state { get; protected set; }
     public UIState ui_state { get; protected set; }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]