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

Proposed by Sebastien Bacher
Status: Merged
Approved by: Iain Lane
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 Approve
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.
Revision history for this message
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
=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
--- plugins/media-keys/gsd-media-keys-manager.c 2015-02-12 15:37:32 +0000
+++ plugins/media-keys/gsd-media-keys-manager.c 2015-03-18 11:36:07 +0000
@@ -2424,25 +2424,6 @@
2424}2424}
24252425
2426static void2426static void
2427do_battery_action (GsdMediaKeysManager *manager)
2428{
2429 GVariant *icon_var, *percentage;
2430 char *label = NULL;
2431
2432 if (manager->priv->power_proxy == NULL)
2433 return;
2434
2435 icon_var = g_dbus_proxy_get_cached_property (manager->priv->power_proxy, "Icon");
2436 percentage = g_dbus_proxy_get_cached_property (manager->priv->power_proxy, "Percentage");
2437
2438 if (g_variant_get_double (percentage) >= 0.0)
2439 label = g_strdup_printf ("%d %%", (int) g_variant_get_double (percentage));
2440
2441 show_osd (manager, g_variant_get_string (icon_var, NULL),
2442 label, g_variant_get_double (percentage));
2443 g_free (label);
2444}
2445static void
2446do_screenshot_action (GsdMediaKeysManager *manager,2427do_screenshot_action (GsdMediaKeysManager *manager,
2447 MediaKeyType type)2428 MediaKeyType type)
2448{2429{
@@ -2632,7 +2613,7 @@
2632 do_keyboard_brightness_action (manager, type);2613 do_keyboard_brightness_action (manager, type);
2633 break;2614 break;
2634 case BATTERY_KEY:2615 case BATTERY_KEY:
2635 do_battery_action (manager);2616 do_execute_desktop_or_desktop (manager, "gnome-power-statistics.desktop", "", timestamp);
2636 break;2617 break;
2637 case SWITCH_INPUT_SOURCE_KEY:2618 case SWITCH_INPUT_SOURCE_KEY:
2638 case SWITCH_INPUT_SOURCE_BACKWARD_KEY:2619 case SWITCH_INPUT_SOURCE_BACKWARD_KEY:

Subscribers

People subscribed via source and target branches