[gnome-settings-daemon] Add meaningful app names to notifications from plugins
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] Add meaningful app names to notifications from plugins
- Date: Tue, 3 May 2011 15:54:29 +0000 (UTC)
commit 8b8d2b682d34cce904e842380e8b983285fdb848
Author: Matthias Clasen <mclasen redhat com>
Date: Tue May 3 11:53:29 2011 -0400
Add meaningful app names to notifications from plugins
Also, bump the libnotify requirement to 0.7.3, since we use
api that will be introduced in that version.
https://bugzilla.gnome.org/show_bug.cgi?id=648911
configure.ac | 2 +-
plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c | 1 +
plugins/housekeeping/gsd-disk-space.c | 1 +
.../gsd-print-notifications-manager.c | 3 +-
plugins/print-notifications/gsd-printer.c | 1 +
plugins/updates/gsd-updates-firmware.c | 4 +++
plugins/updates/gsd-updates-manager.c | 22 +++++--------------
plugins/xrandr/gsd-xrandr-manager.c | 1 +
8 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 31bb527..cda15cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,7 @@ GTK_REQUIRED_VERSION=2.99.3
GCONF_REQUIRED_VERSION=2.6.1
GIO_REQUIRED_VERSION=2.26.0
GNOME_DESKTOP_REQUIRED_VERSION=2.91.5
-LIBNOTIFY_REQUIRED_VERSION=0.6.1
+LIBNOTIFY_REQUIRED_VERSION=0.7.3
EXTRA_COMPILE_WARNINGS(yes)
diff --git a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
index 3414033..07bb251 100644
--- a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
+++ b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
@@ -535,6 +535,7 @@ ax_slowkeys_warning_post_bubble (GsdA11yKeyboardManager *manager,
manager->priv->notification = notify_notification_new (title,
message,
"preferences-desktop-accessibility");
+ notify_notification_set_app_name (manager->priv->notification, _("Universal Access"));
notify_notification_set_timeout (manager->priv->notification, NOTIFICATION_TIMEOUT * 1000);
notify_notification_add_action (manager->priv->notification,
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index fa08d0b..bc2a375 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -360,6 +360,7 @@ ldsm_notify_for_mount (LdsmMountInfo *mount,
G_CALLBACK (on_notification_closed),
NULL);
+ notify_notification_set_app_name (notification, _("Disk space"));
notify_notification_set_hint (notification, "transient", g_variant_new_boolean (TRUE));
notify_notification_set_urgency (notification, NOTIFY_URGENCY_CRITICAL);
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c b/plugins/print-notifications/gsd-print-notifications-manager.c
index 17a64d9..56105b6 100644
--- a/plugins/print-notifications/gsd-print-notifications-manager.c
+++ b/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -452,6 +452,7 @@ on_cups_notification (GDBusConnection *connection,
notification = notify_notification_new (statuses_first[j],
second_row,
"printer-symbolic");
+ notify_notification_set_app_name (notification, _("Printers"));
notify_notification_set_hint (notification,
"transient",
g_variant_new_boolean (TRUE));
@@ -473,8 +474,8 @@ on_cups_notification (GDBusConnection *connection,
notification = notify_notification_new (primary_text,
secondary_text,
"printer-symbolic");
+ notify_notification_set_app_name (notification, _("Printers"));
notify_notification_set_hint (notification, "transient", g_variant_new_boolean (TRUE));
-
notify_notification_show (notification, NULL);
g_object_unref (notification);
g_free (primary_text);
diff --git a/plugins/print-notifications/gsd-printer.c b/plugins/print-notifications/gsd-printer.c
index c064566..90fa955 100644
--- a/plugins/print-notifications/gsd-printer.c
+++ b/plugins/print-notifications/gsd-printer.c
@@ -200,6 +200,7 @@ handle_method_call (GDBusConnection *connection,
notification = notify_notification_new (primary_text,
secondary_text,
"printer-symbolic");
+ notify_notification_set_app_name (notification, _("Printers"));
notify_notification_set_hint (notification, "transient", g_variant_new_boolean (TRUE));
notify_notification_show (notification, NULL);
diff --git a/plugins/updates/gsd-updates-firmware.c b/plugins/updates/gsd-updates-firmware.c
index fdddace..24f97bf 100644
--- a/plugins/updates/gsd-updates-firmware.c
+++ b/plugins/updates/gsd-updates-firmware.c
@@ -241,6 +241,7 @@ require_restart (GsdUpdatesFirmware *firmware)
/* TRANSLATORS: title of libnotify bubble */
notification = notify_notification_new (_("Additional software was installed"), message, NULL);
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
@@ -265,6 +266,7 @@ require_replug (GsdUpdatesFirmware *firmware)
/* TRANSLATORS: title of libnotify bubble */
notification = notify_notification_new (_("Additional software was installed"), message, NULL);
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
@@ -289,6 +291,7 @@ require_nothing (GsdUpdatesFirmware *firmware)
/* TRANSLATORS: title of libnotify bubble */
notification = notify_notification_new (_("Additional software was installed"), message, NULL);
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
@@ -578,6 +581,7 @@ delay_timeout_cb (gpointer data)
/* TRANSLATORS: title of libnotify bubble */
notification = notify_notification_new (_("Additional firmware required"), string->str, NULL);
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
notify_notification_add_action (notification, "install-firmware",
diff --git a/plugins/updates/gsd-updates-manager.c b/plugins/updates/gsd-updates-manager.c
index c59bd66..a81aa1f 100644
--- a/plugins/updates/gsd-updates-manager.c
+++ b/plugins/updates/gsd-updates-manager.c
@@ -193,10 +193,7 @@ get_distro_upgrades_finished_cb (GObject *object,
/* TRANSLATORS: a distro update is available, e.g. Fedora 8 to Fedora 9 */
title = _("Distribution upgrades available");
notification = notify_notification_new (title, string->str, NULL);
- if (notification == NULL) {
- g_warning ("failed to create notification");
- goto out;
- }
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
notify_notification_add_action (notification, "distro-upgrade-info",
@@ -319,10 +316,7 @@ notify_critical_updates (GsdUpdatesManager *manager, GPtrArray *array)
/* do the bubble */
g_debug ("title=%s, message=%s", title, message);
notification = notify_notification_new (title, message, NULL);
- if (notification == NULL) {
- g_warning ("failed to get bubble");
- return;
- }
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, 15000);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_CRITICAL);
notify_notification_add_action (notification, "show-update-viewer",
@@ -379,10 +373,7 @@ notify_normal_updates_maybe (GsdUpdatesManager *manager, GPtrArray *array)
/* do the bubble */
g_debug ("title=%s, message=%s", title, message);
notification = notify_notification_new (title, message, NULL);
- if (notification == NULL) {
- g_warning ("failed to get bubble");
- return;
- }
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, 15000);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
notify_notification_add_action (notification, "show-update-viewer",
@@ -437,6 +428,7 @@ update_check_on_battery (GsdUpdatesManager *manager)
/* TRANSLATORS: informs user will not install by default */
notification = notify_notification_new (_("Updates not installed"),
message, NULL);
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, 15000);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
notify_notification_add_action (notification, "update-all-packages",
@@ -567,6 +559,7 @@ notify_update_finished (GsdUpdatesManager *manager, PkResults *results)
/* TRANSLATORS: title: system update completed all okay */
notification = notify_notification_new (_("The system update has completed"),
message_text->str, NULL);
+ 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) {
@@ -653,10 +646,7 @@ notify_failed_get_updates_maybe (GsdUpdatesManager *manager)
button = _("Try again");
notification = notify_notification_new (title, message, NULL);
- if (notification == NULL) {
- g_warning ("failed to create notification");
- goto out;
- }
+ notify_notification_set_app_name (notification, _("Software Updates"));
notify_notification_set_timeout (notification, 120*1000);
notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
notify_notification_add_action (notification, "show-update-viewer",
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index 229a61a..85f9812 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -1119,6 +1119,7 @@ error_message (GsdXrandrManager *mgr, const char *primary_text, GError *error_to
error_to_display ? error_to_display->message : secondary_text,
GSD_XRANDR_ICON_NAME);
+ notify_notification_set_app_name (notification, _("Displays"));
notify_notification_show (notification, NULL); /* NULL-GError */
#else
GtkWidget *dialog;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]