[gnome-software/1684-download-or-restart-update-button-remains-visible-for-some-time-after-hitting-refresh] gs-updates-page: Immediately show 'Loading Updates' information on Refresh
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1684-download-or-restart-update-button-remains-visible-for-some-time-after-hitting-refresh] gs-updates-page: Immediately show 'Loading Updates' information on Refresh
- Date: Mon, 28 Mar 2022 15:37:22 +0000 (UTC)
commit 99e29f8cadcf4c0973c7d57dae9302091d0369b0
Author: Milan Crha <mcrha redhat com>
Date: Mon Mar 28 17:34:40 2022 +0200
gs-updates-page: Immediately show 'Loading Updates' information on Refresh
Rather than showing the previously found updates while refreshing
the page content, show the "Loading Updates' immediately, thus
the users cannot click the 'Download', 'Update', 'Restart & Update',...
buttons while it's getting the list of apps to be updated.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1684
src/gs-updates-page.c | 36 ++----------------------------------
1 file changed, 2 insertions(+), 34 deletions(-)
---
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 5d440ccff..04971dacf 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -57,7 +57,6 @@ struct _GsUpdatesPage
GsUpdatesPageFlags result_flags;
GtkWidget *button_refresh;
GtkWidget *header_spinner_start;
- GtkWidget *header_checking_label;
GtkWidget *header_start_box;
gboolean has_agreed_to_mobile_data;
gboolean ampm_available;
@@ -280,21 +279,12 @@ gs_updates_page_update_ui_state (GsUpdatesPage *self)
case GS_UPDATES_PAGE_STATE_STARTUP:
case GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES:
case GS_UPDATES_PAGE_STATE_ACTION_REFRESH:
- /* if we have updates, avoid clearing the page with a spinner */
- if (self->result_flags != GS_UPDATES_PAGE_FLAG_NONE) {
- gs_stop_spinner (GTK_SPINNER (self->spinner_updates));
- gtk_spinner_start (GTK_SPINNER (self->header_spinner_start));
- gtk_widget_show (self->header_spinner_start);
- gtk_widget_show (self->header_checking_label);
- } else {
- gs_start_spinner (GTK_SPINNER (self->spinner_updates));
- }
+ gs_start_spinner (GTK_SPINNER (self->spinner_updates));
break;
default:
gs_stop_spinner (GTK_SPINNER (self->spinner_updates));
gtk_spinner_stop (GTK_SPINNER (self->header_spinner_start));
gtk_widget_hide (self->header_spinner_start);
- gtk_widget_hide (self->header_checking_label);
break;
}
@@ -344,11 +334,7 @@ gs_updates_page_update_ui_state (GsUpdatesPage *self)
"spinner");
break;
case GS_UPDATES_PAGE_STATE_ACTION_REFRESH:
- if (self->result_flags != GS_UPDATES_PAGE_FLAG_NONE) {
- gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "view");
- } else {
- gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "spinner");
- }
+ gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "spinner");
break;
case GS_UPDATES_PAGE_STATE_STARTUP:
case GS_UPDATES_PAGE_STATE_IDLE:
@@ -1218,7 +1204,6 @@ gs_updates_page_setup (GsPage *page,
GError **error)
{
GsUpdatesPage *self = GS_UPDATES_PAGE (page);
- GtkWidget *widget;
g_return_val_if_fail (GS_IS_UPDATES_PAGE (self), TRUE);
@@ -1268,23 +1253,6 @@ gs_updates_page_setup (GsPage *page,
gtk_widget_set_visible (self->header_start_box, TRUE);
gs_page_set_header_start_widget (GS_PAGE (self), self->header_start_box);
- /* This label indicates that the update check is in progress */
- self->header_checking_label = adw_squeezer_new ();
- adw_squeezer_set_xalign (ADW_SQUEEZER (self->header_checking_label), 0);
- adw_squeezer_set_transition_type (ADW_SQUEEZER (self->header_checking_label),
ADW_SQUEEZER_TRANSITION_TYPE_CROSSFADE);
-
- widget = gtk_label_new (_("Checking…"));
- gtk_widget_show (widget);
- adw_squeezer_add (ADW_SQUEEZER (self->header_checking_label), widget);
-
- /* FIXME: This box is just a 0x0 widget the squeezer will show when it
- * hasn't enough space to show the label. In GTK 4, we will be able to
- * use AdwSqueezer:allow-none instead. */
- widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_widget_show (widget);
- adw_squeezer_add (ADW_SQUEEZER (self->header_checking_label), widget);
-
- gtk_box_prepend (GTK_BOX (self->header_start_box), self->header_checking_label);
self->header_spinner_start = gtk_spinner_new ();
gtk_box_prepend (GTK_BOX (self->header_start_box), self->header_spinner_start);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]