aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorCalum Lind <calumlind@gmail.com>2013-12-05 17:51:35 +0000
committerTarmac <Unknown>2013-12-05 17:51:35 +0000
commita253b42d083bc9eefa5b089b02568be40d235171 (patch)
treee24670752b6ff324308229ee1cf866264a03953a /src/service.c
parentb2c58f69426313c8ffe007d5fb3db29425cd4300 (diff)
parent5a957ffb2a7ae764de652423995d9120e803a4b6 (diff)
downloadayatana-indicator-power-a253b42d083bc9eefa5b089b02568be40d235171.tar.gz
ayatana-indicator-power-a253b42d083bc9eefa5b089b02568be40d235171.tar.bz2
ayatana-indicator-power-a253b42d083bc9eefa5b089b02568be40d235171.zip
From bug 1255655: "focus[es] the correct tab upon opening gnome-power-statistics when clicking the indicator battery.". Fixes: https://bugs.launchpad.net/bugs/1255655.
Approved by Charles Kerr, PS Jenkins bot.
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c
index 424e489..2670a67 100644
--- a/src/service.c
+++ b/src/service.c
@@ -378,6 +378,8 @@ append_device_to_menu (GMenu * menu, const IndicatorPowerDevice * device)
label = indicator_power_device_get_label (device);
item = g_menu_item_new (label, "indicator.activate-statistics");
g_free (label);
+ g_menu_item_set_action_and_target(item, "indicator.activate-statistics", "s",
+ indicator_power_device_get_object_path (device));
if ((icon = indicator_power_device_get_gicon (device)))
{
@@ -695,10 +697,13 @@ on_settings_activated (GSimpleAction * a G_GNUC_UNUSED,
static void
on_statistics_activated (GSimpleAction * a G_GNUC_UNUSED,
- GVariant * param G_GNUC_UNUSED,
+ GVariant * param,
gpointer gself G_GNUC_UNUSED)
{
- execute_command ("gnome-power-statistics");
+ char *cmd = g_strconcat ("gnome-power-statistics", " --device ",
+ g_variant_get_string (param, NULL), NULL);
+ execute_command (cmd);
+ g_free (cmd);
}
static void
@@ -724,7 +729,7 @@ init_gactions (IndicatorPowerService * self)
GActionEntry entries[] = {
{ "activate-settings", on_settings_activated },
{ "activate-phone-settings", on_phone_settings_activated },
- { "activate-statistics", on_statistics_activated }
+ { "activate-statistics", on_statistics_activated, "s" }
};
p->actions = g_simple_action_group_new ();