~rsalveti/indicator-power/update-powerd-api

« back to all changes in this revision

Viewing changes to src/service.c

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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
378
378
    label = indicator_power_device_get_label (device);
379
379
    item = g_menu_item_new (label, "indicator.activate-statistics");
380
380
    g_free (label);
 
381
    g_menu_item_set_action_and_target(item, "indicator.activate-statistics", "s",
 
382
                                      indicator_power_device_get_object_path (device));
381
383
 
382
384
    if ((icon = indicator_power_device_get_gicon (device)))
383
385
      {
695
697
 
696
698
static void
697
699
on_statistics_activated (GSimpleAction * a      G_GNUC_UNUSED,
698
 
                         GVariant      * param  G_GNUC_UNUSED,
 
700
                         GVariant      * param,
699
701
                         gpointer        gself  G_GNUC_UNUSED)
700
702
{
701
 
  execute_command ("gnome-power-statistics");
 
703
  char *cmd = g_strconcat ("gnome-power-statistics", " --device ",
 
704
                           g_variant_get_string (param, NULL), NULL);
 
705
  execute_command (cmd);
 
706
  g_free (cmd);
702
707
}
703
708
 
704
709
static void
724
729
  GActionEntry entries[] = {
725
730
    { "activate-settings", on_settings_activated },
726
731
    { "activate-phone-settings", on_phone_settings_activated },
727
 
    { "activate-statistics", on_statistics_activated }
 
732
    { "activate-statistics", on_statistics_activated, "s" }
728
733
  };
729
734
 
730
735
  p->actions = g_simple_action_group_new ();