diff options
author | Bastien Nocera <hadess@hadess.net> | 2015-11-23 11:42:06 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2015-11-25 10:40:58 +0100 |
commit | e1f0bc6c925e779b19fad70b40ae7ccde2fb4308 (patch) | |
tree | 98ac248623c89a0f7df35e51d41de7bc88832eeb | |
parent | bbbb3f4bfd528c95d9b52421c391a7ea7ec3240a (diff) | |
download | gnome-settings-daemon-e1f0bc6c925e779b19fad70b40ae7ccde2fb4308.tar.gz |
power: Simplify setting the notification app name
All of the notifications in the power plugin are "Power" notifications,
so do this in the helper function instead.
https://bugzilla.gnome.org/show_bug.cgi?id=758532
-rw-r--r-- | plugins/power/gsd-power-manager.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c index 1215f8b0..d3908f24 100644 --- a/plugins/power/gsd-power-manager.c +++ b/plugins/power/gsd-power-manager.c @@ -313,6 +313,8 @@ create_notification (const char *summary, NotifyNotification *notification; notification = notify_notification_new (summary, body, icon_name); + /* TRANSLATORS: this is the notification application name */ + notify_notification_set_app_name (notification, _("Power")); *weak_pointer_location = notification; g_object_add_weak_pointer (G_OBJECT (notification), (gpointer *) weak_pointer_location); @@ -365,8 +367,6 @@ engine_ups_discharging (GsdPowerManager *manager, UpDevice *device) GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG); notify_notification_set_urgency (manager->priv->notification_ups_discharging, NOTIFY_URGENCY_NORMAL); - /* TRANSLATORS: this is the notification application name */ - notify_notification_set_app_name (manager->priv->notification_ups_discharging, _("Power")); notify_notification_set_hint (manager->priv->notification_ups_discharging, "transient", g_variant_new_boolean (TRUE)); @@ -514,7 +514,6 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device) GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG); notify_notification_set_urgency (manager->priv->notification_low, NOTIFY_URGENCY_NORMAL); - notify_notification_set_app_name (manager->priv->notification_low, _("Power")); notify_notification_set_hint (manager->priv->notification_low, "transient", g_variant_new_boolean (TRUE)); @@ -665,7 +664,6 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device) NOTIFY_EXPIRES_NEVER); notify_notification_set_urgency (manager->priv->notification_low, NOTIFY_URGENCY_CRITICAL); - notify_notification_set_app_name (manager->priv->notification_low, _("Power")); notify_notification_show (manager->priv->notification_low, NULL); @@ -773,7 +771,6 @@ engine_charge_action (GsdPowerManager *manager, UpDevice *device) NOTIFY_EXPIRES_NEVER); notify_notification_set_urgency (manager->priv->notification_low, NOTIFY_URGENCY_CRITICAL); - notify_notification_set_app_name (manager->priv->notification_low, _("Power")); /* try to show */ notify_notification_show (manager->priv->notification_low, NULL); @@ -2060,7 +2057,6 @@ show_sleep_warning (GsdPowerManager *manager) NOTIFY_EXPIRES_NEVER); notify_notification_set_urgency (manager->priv->notification_sleep_warning, NOTIFY_URGENCY_CRITICAL); - notify_notification_set_app_name (manager->priv->notification_sleep_warning, _("Power")); notify_notification_show (manager->priv->notification_sleep_warning, NULL); } |