Merge lp:~seb128/unity-settings-daemon/battery-info-key into lp:unity-settings-daemon

Proposed by Sebastien Bacher on 2015-03-18
Status: Merged
Approved by: Iain Lane on 2015-03-18
Approved revision: 4073
Merged at revision: 4075
Proposed branch: lp:~seb128/unity-settings-daemon/battery-info-key
Merge into: lp:unity-settings-daemon
Diff against target: 38 lines (+1/-20)
1 file modified
plugins/media-keys/gsd-media-keys-manager.c (+1/-20)
To merge this branch: bzr merge lp:~seb128/unity-settings-daemon/battery-info-key
Reviewer Review Type Date Requested Status
Iain Lane 2015-03-18 Approve on 2015-03-18
Review via email: mp+253336@code.launchpad.net

Commit message

Open the battery info dialog when using the corresponding hotkey.
The current code was trying to display a notification with the info
but we don't have design on how that should look like with notify-osd
so go back to what we were doing before

Description of the change

Open the battery info dialog when using the corresponding hotkey.
The current code was trying to display a notification with the info
but we don't have design on how that should look like with notify-osd
so go back to what we were doing before

To post a comment you must log in.
Iain Lane (laney) wrote :

wfm, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
2--- plugins/media-keys/gsd-media-keys-manager.c 2015-02-12 15:37:32 +0000
3+++ plugins/media-keys/gsd-media-keys-manager.c 2015-03-18 11:36:07 +0000
4@@ -2424,25 +2424,6 @@
5 }
6
7 static void
8-do_battery_action (GsdMediaKeysManager *manager)
9-{
10- GVariant *icon_var, *percentage;
11- char *label = NULL;
12-
13- if (manager->priv->power_proxy == NULL)
14- return;
15-
16- icon_var = g_dbus_proxy_get_cached_property (manager->priv->power_proxy, "Icon");
17- percentage = g_dbus_proxy_get_cached_property (manager->priv->power_proxy, "Percentage");
18-
19- if (g_variant_get_double (percentage) >= 0.0)
20- label = g_strdup_printf ("%d %%", (int) g_variant_get_double (percentage));
21-
22- show_osd (manager, g_variant_get_string (icon_var, NULL),
23- label, g_variant_get_double (percentage));
24- g_free (label);
25-}
26-static void
27 do_screenshot_action (GsdMediaKeysManager *manager,
28 MediaKeyType type)
29 {
30@@ -2632,7 +2613,7 @@
31 do_keyboard_brightness_action (manager, type);
32 break;
33 case BATTERY_KEY:
34- do_battery_action (manager);
35+ do_execute_desktop_or_desktop (manager, "gnome-power-statistics.desktop", "", timestamp);
36 break;
37 case SWITCH_INPUT_SOURCE_KEY:
38 case SWITCH_INPUT_SOURCE_BACKWARD_KEY:

Subscribers

People subscribed via source and target branches