diff options
-rw-r--r-- | src/service.c | 11 |
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 (); |