[gnome-settings-daemon] updates: Remove the notification when updating has completed
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] updates: Remove the notification when updating has completed
- Date: Fri, 29 Jun 2012 12:15:34 +0000 (UTC)
commit 7cd4aad5fcdf2beea30c62436c11dbb83ca97ccd
Author: Richard Hughes <richard hughsie com>
Date: Fri Jun 29 10:58:49 2012 +0100
updates: Remove the notification when updating has completed
We're not updating in the session now, we just download packages and leave the
offline updates feature to actually do the snapshot and install the updates.
...ttings-daemon.plugins.updates.gschema.xml.in.in | 5 -
plugins/updates/gsd-updates-common.h | 1 -
plugins/updates/gsd-updates-manager.c | 139 --------------------
3 files changed, 0 insertions(+), 145 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
index f0290c9..cf1b3e7 100644
--- a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
@@ -60,11 +60,6 @@
<_summary>Notify the user when distribution upgrades are available</_summary>
<_description>Notify the user when distribution upgrades are available.</_description>
</key>
- <key name="notify-update-complete-restart" type="b">
- <default>true</default>
- <_summary>Notify the user for completed updates where the user needs to restart</_summary>
- <_description>Notify the user for completed updates where the user needs to restart.</_description>
- </key>
<key name="enable-check-firmware" type="b">
<default>true</default>
<_summary>Ask the user if additional firmware should be installed</_summary>
diff --git a/plugins/updates/gsd-updates-common.h b/plugins/updates/gsd-updates-common.h
index acb6f68..998fc4a 100644
--- a/plugins/updates/gsd-updates-common.h
+++ b/plugins/updates/gsd-updates-common.h
@@ -36,7 +36,6 @@ G_BEGIN_DECLS
#define GSD_SETTINGS_LAST_UPDATES_NOTIFICATION "last-updates-notification"
#define GSD_SETTINGS_MEDIA_REPO_FILENAMES "media-repo-filenames"
#define GSD_SETTINGS_NOTIFY_DISTRO_UPGRADES "notify-distro-upgrades"
-#define GSD_SETTINGS_NOTIFY_UPDATE_COMPLETE "notify-update-complete"
#define GSD_SETTINGS_SCHEMA "org.gnome.settings-daemon.plugins.updates"
#define GSD_SETTINGS_UPDATE_BATTERY "update-battery"
#define GSD_SETTINGS_AUTO_DOWNLOAD_UPDATES "auto-download-updates"
diff --git a/plugins/updates/gsd-updates-manager.c b/plugins/updates/gsd-updates-manager.c
index 3dc1127..ef977f0 100644
--- a/plugins/updates/gsd-updates-manager.c
+++ b/plugins/updates/gsd-updates-manager.c
@@ -549,144 +549,6 @@ update_check_on_battery (GsdUpdatesManager *manager)
return FALSE;
}
-static const gchar *
-restart_enum_to_localised_text (PkRestartEnum restart)
-{
- const gchar *text = NULL;
- switch (restart) {
- case PK_RESTART_ENUM_NONE:
- text = _("No restart is required.");
- break;
- case PK_RESTART_ENUM_SYSTEM:
- text = _("A restart is required.");
- break;
- case PK_RESTART_ENUM_SESSION:
- text = _("You need to log out and log back in.");
- break;
- case PK_RESTART_ENUM_APPLICATION:
- text = _("You need to restart the application.");
- break;
- case PK_RESTART_ENUM_SECURITY_SESSION:
- text = _("You need to log out and log back in to remain secure.");
- break;
- case PK_RESTART_ENUM_SECURITY_SYSTEM:
- text = _("A restart is required to remain secure.");
- break;
- default:
- g_warning ("restart unrecognised: %i", restart);
- }
- return text;
-}
-
-static void
-notify_update_finished (GsdUpdatesManager *manager, PkResults *results)
-{
- const gchar *message;
- gboolean ret;
- gchar *package_id = NULL;
- gchar **split;
- gchar *summary = NULL;
- GError *error = NULL;
- GPtrArray *array;
- GString *message_text = NULL;
- guint i;
- guint skipped_number = 0;
- NotifyNotification *notification;
- PkInfoEnum info;
- PkPackage *item;
- PkRestartEnum restart;
-
- /* check we got some packages */
- array = pk_results_get_package_array (results);
- g_debug ("length=%i", array->len);
- if (array->len == 0) {
- g_debug ("no updates");
- goto out;
- }
-
- message_text = g_string_new ("");
-
- /* find any we skipped */
- for (i=0; i<array->len; i++) {
- item = g_ptr_array_index (array, i);
- g_object_get (item,
- "info", &info,
- "package-id", &package_id,
- "summary", &summary,
- NULL);
-
- split = pk_package_id_split (package_id);
- g_debug ("%s, %s, %s", pk_info_enum_to_string (info),
- split[PK_PACKAGE_ID_NAME], summary);
- if (info == PK_INFO_ENUM_BLOCKED) {
- skipped_number++;
- g_string_append_printf (message_text, "<b>%s</b> - %s\n",
- split[PK_PACKAGE_ID_NAME], summary);
- }
- g_free (package_id);
- g_free (summary);
- g_strfreev (split);
- }
-
- /* notify the user if there were skipped entries */
- if (skipped_number > 0) {
- /* TRANSLATORS: we did the update, but some updates were skipped and not applied */
- message = ngettext ("One package was skipped:",
- "Some packages were skipped:", skipped_number);
- g_string_prepend (message_text, message);
- g_string_append_c (message_text, '\n');
- }
-
- /* add a message that we need to restart */
- restart = pk_results_get_require_restart_worst (results);
- if (restart != PK_RESTART_ENUM_NONE) {
- message = restart_enum_to_localised_text (restart);
-
- /* add a gap if we are putting both */
- if (skipped_number > 0)
- g_string_append (message_text, "\n");
-
- g_string_append (message_text, message);
- g_string_append_c (message_text, '\n');
- }
-
- /* trim off extra newlines */
- if (message_text->len != 0)
- g_string_set_size (message_text, message_text->len-1);
-
- /* do we do the notification? */
- ret = g_settings_get_boolean (manager->priv->settings_gsd,
- GSD_SETTINGS_NOTIFY_UPDATE_COMPLETE);
- if (!ret) {
- g_debug ("ignoring due to GSettings");
- goto out;
- }
-
- /* TRANSLATORS: title: system update completed all okay */
- notification = notify_notification_new (_("The system update has completed"),
- message_text->str,
- GSD_UPDATES_ICON_NORMAL);
- notify_notification_set_app_name (notification, _("Software Updates"));
- notify_notification_set_timeout (notification, 15000);
- notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
- if (restart == PK_RESTART_ENUM_SYSTEM) {
- notify_notification_add_action (notification, "restart",
- /* TRANSLATORS: restart computer as system packages need update */
- _("Restart computer now"),
- libnotify_action_cb,
- manager, NULL);
- }
- ret = notify_notification_show (notification, &error);
- if (!ret) {
- g_warning ("error: %s", error->message);
- g_error_free (error);
- }
-out:
- if (message_text != NULL)
- g_string_free (message_text, TRUE);
- g_ptr_array_unref (array);
-}
-
static void
update_packages_finished_cb (PkTask *task,
GAsyncResult *res,
@@ -715,7 +577,6 @@ update_packages_finished_cb (PkTask *task,
}
/* notify */
- notify_update_finished (manager, results);
manager->priv->number_updates_critical_last_shown = 0;
out:
if (error_code != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]