[gnome-software] updates page: Don't hide the refresh button in failure state



commit 267961d1ce76c07d0e71c0c8d59856d462ef04c0
Author: Kalev Lember <klember redhat com>
Date:   Wed Oct 24 14:05:19 2018 +0200

    updates page: Don't hide the refresh button in failure state
    
    If something goes wrong while checking updates, it's good to give the
    user a way to retry in case it was a transient error.

 src/gs-updates-page.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 7e3c9974..ace0493b 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -376,7 +376,7 @@ gs_updates_page_update_ui_state (GsUpdatesPage *self)
        case GS_UPDATES_PAGE_STATE_MANAGED:
                gtk_widget_hide (self->button_refresh);
                break;
-       default:
+       case GS_UPDATES_PAGE_STATE_IDLE:
                gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON 
(self->button_refresh))),
                                              "view-refresh-symbolic", GTK_ICON_SIZE_MENU);
                if (self->result_flags != GS_UPDATES_PAGE_FLAG_NONE) {
@@ -388,6 +388,14 @@ gs_updates_page_update_ui_state (GsUpdatesPage *self)
                        gtk_widget_set_visible (self->button_refresh, allow_mobile_refresh);
                }
                break;
+       case GS_UPDATES_PAGE_STATE_FAILED:
+               gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON 
(self->button_refresh))),
+                                             "view-refresh-symbolic", GTK_ICON_SIZE_MENU);
+               gtk_widget_show (self->button_refresh);
+               break;
+       default:
+               g_assert_not_reached ();
+               break;
        }
        gtk_widget_set_sensitive (self->button_refresh,
                                  gs_plugin_loader_get_network_available (self->plugin_loader));


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