[gnome-settings-daemon] power: Add sound notification on power plug/unplug
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Add sound notification on power plug/unplug
- Date: Fri, 16 May 2014 13:14:57 +0000 (UTC)
commit 16c7f3d5fc0f8d8b4b6974f1c0f0eaebb6e4c736
Author: Bastien Nocera <hadess hadess net>
Date: Thu May 15 17:43:03 2014 +0200
power: Add sound notification on power plug/unplug
https://bugzilla.gnome.org/show_bug.cgi?id=730202
plugins/power/gsd-power-manager.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 79cb58c..4966fa1 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -1741,6 +1741,19 @@ up_client_on_battery_cb (UpClient *client,
GParamSpec *pspec,
GsdPowerManager *manager)
{
+ if (up_client_get_on_battery (manager->priv->up_client)) {
+ ca_context_play (ca_gtk_context_get (), 0,
+ CA_PROP_EVENT_ID, "power-unplug",
+ /* TRANSLATORS: this is the sound description */
+ CA_PROP_EVENT_DESCRIPTION, _("On battery power"), NULL);
+ } else {
+ ca_context_play (ca_gtk_context_get (), 0,
+ CA_PROP_EVENT_ID, "power-plug",
+ /* TRANSLATORS: this is the sound description */
+ CA_PROP_EVENT_DESCRIPTION, _("On AC power"), NULL);
+
+ }
+
idle_configure (manager);
if (manager->priv->lid_is_closed)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]