[gnome-software/wip/iainl/ubuntu-xenial] More notification fixes under Unity
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/iainl/ubuntu-xenial] More notification fixes under Unity
- Date: Wed, 13 Apr 2016 16:30:10 +0000 (UTC)
commit da85b78363a2e23aef8702337092500141e8e12f
Author: William Hua <william hua canonical com>
Date: Wed Apr 13 12:29:43 2016 -0400
More notification fixes under Unity
src/gs-shell-updates.c | 18 +++++++++++++-----
src/gs-update-monitor.c | 3 +--
2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index cddf933..9b9a8b8 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -938,6 +938,12 @@ gs_shell_updates_reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer
self);
}
+static gboolean
+is_unity (void)
+{
+ return g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0;
+}
+
/**
* gs_shell_updates_perform_update_cb:
**/
@@ -976,11 +982,13 @@ gs_shell_updates_perform_update_cb (GsPluginLoader *plugin_loader,
n = g_notification_new (_("Updates have been installed"));
/* TRANSLATORS: the new apps will not be run until we restart */
g_notification_set_body (n, _("A restart is required for them to take effect."));
- /* TRANSLATORS: button text */
- g_notification_add_button (n, _("Not Now"), "app.nop");
- /* TRANSLATORS: button text */
- g_notification_add_button_with_target (n, _("Restart"), "app.reboot", NULL);
- g_notification_set_default_action_and_target (n, "app.set-mode", "s", "updates");
+ if (!is_unity ()) {
+ /* TRANSLATORS: button text */
+ g_notification_add_button (n, _("Not Now"), "app.nop");
+ /* TRANSLATORS: button text */
+ g_notification_add_button_with_target (n, _("Restart"), "app.reboot", NULL);
+ g_notification_set_default_action_and_target (n, "app.set-mode", "s", "updates");
+ }
g_application_send_notification (g_application_get_default (), "restart-required", n);
}
}
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index cd472a5..13ff002 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -439,12 +439,11 @@ get_updates_historical_cb (GObject *object, GAsyncResult *res, gpointer data)
notification = g_notification_new (_("Software Updates Failed"));
/* TRANSLATORS: message when we offline updates have failed */
g_notification_set_body (notification, _("An important OS update failed to be
installed."));
- g_application_send_notification (monitor->application, "offline-updates",
notification);
if (!is_unity ()) {
g_notification_add_button (notification, _("Show Details"),
"app.show-offline-update-error");
g_notification_set_default_action (notification,
"app.show-offline-update-error");
- g_application_send_notification (monitor->application, "offline-updates",
notification);
}
+ g_application_send_notification (monitor->application, "offline-updates",
notification);
}
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]