[gnome-software/wip/iainl/ubuntu-xenial] Show a 'Install All' button when all the updates can be installed live
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/iainl/ubuntu-xenial] Show a 'Install All' button when all the updates can be installed live
- Date: Tue, 12 Apr 2016 14:23:42 +0000 (UTC)
commit f24bc7fea00312b2470cad3d7148059fa2238612
Author: Richard Hughes <richard hughsie com>
Date: Fri Apr 8 09:23:12 2016 +0100
Show a 'Install All' button when all the updates can be installed live
src/gs-shell-updates.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index c96cc5a..1868e84 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -63,6 +63,7 @@ struct _GsShellUpdates
GSettings *desktop_settings;
gboolean cache_valid;
gboolean in_progress;
+ gboolean all_updates_are_live;
GsShell *shell;
GNetworkMonitor *network_monitor;
gulong network_changed_handler;
@@ -467,9 +468,24 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
/* get the results */
list = gs_plugin_loader_get_updates_finish (plugin_loader, res, &error);
+ self->all_updates_are_live = TRUE;
for (l = list; l != NULL; l = l->next) {
- gs_update_list_add_app (GS_UPDATE_LIST (self->list_box_updates),
- GS_APP (l->data));
+ GsApp *app = GS_APP (l->data);
+ if (gs_app_get_state (app) != AS_APP_STATE_UPDATABLE_LIVE)
+ self->all_updates_are_live = FALSE;
+ gs_update_list_add_app (GS_UPDATE_LIST (self->list_box_updates), app);
+ }
+
+ /* change the button as to whether a reboot is required to
+ * apply all the updates */
+ if (self->all_updates_are_live) {
+ gtk_button_set_label (GTK_BUTTON (self->button_update_all),
+ /* TRANSLATORS: all updates will be installed */
+ _("_Install All"));
+ } else {
+ gtk_button_set_label (GTK_BUTTON (self->button_update_all),
+ /* TRANSLATORS: this is an offline update */
+ _("Restart & _Install"));
}
widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "button_updates_counter"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]