Merge lp:~calumlind/indicator-power/open_in_batt_stats_tab into lp:indicator-power/14.04

Proposed by Matthew Paul Thomas
Status: Merged
Approved by: Lars Karlitski
Approved revision: 220
Merged at revision: 220
Proposed branch: lp:~calumlind/indicator-power/open_in_batt_stats_tab
Merge into: lp:indicator-power/14.04
Diff against target: 37 lines (+8/-3)
1 file modified
src/service.c (+8/-3)
To merge this branch: bzr merge lp:~calumlind/indicator-power/open_in_batt_stats_tab
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+197329@code.launchpad.net

Description of the change

From bug 1255655: "focus[es] the correct tab upon opening gnome-power-statistics when clicking the indicator battery."

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

Hey, thanks for the patch.

Can you please use

  g_menu_item_set_action_and_target (item, "indicator.activate-statistics", "s",
                                     indicator_power_device_get_object_path (device));

It reads a bit nicer without the string allocation.

The issue Jenkins reports happens because lcov 1.10 isn't in the list of supported versions in gcov.m4. I've put up a merge request for that[1]. Let's just wait until that landed before merging this commit.

[1] https://code.launchpad.net/~larsu/indicator-power/allow-lcov-1.10/+merge/197525

219. By Cas

Focus to battery tab when opening in gnome-power-statistics

220. By Cas

merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

Since lars had requests I'll leave it for him to top-approve, but this looks fine and is working for me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/service.c'
2--- src/service.c 2013-11-29 15:37:22 +0000
3+++ src/service.c 2013-12-04 12:44:51 +0000
4@@ -378,6 +378,8 @@
5 label = indicator_power_device_get_label (device);
6 item = g_menu_item_new (label, "indicator.activate-statistics");
7 g_free (label);
8+ g_menu_item_set_action_and_target(item, "indicator.activate-statistics", "s",
9+ indicator_power_device_get_object_path (device));
10
11 if ((icon = indicator_power_device_get_gicon (device)))
12 {
13@@ -695,10 +697,13 @@
14
15 static void
16 on_statistics_activated (GSimpleAction * a G_GNUC_UNUSED,
17- GVariant * param G_GNUC_UNUSED,
18+ GVariant * param,
19 gpointer gself G_GNUC_UNUSED)
20 {
21- execute_command ("gnome-power-statistics");
22+ char *cmd = g_strconcat ("gnome-power-statistics", " --device ",
23+ g_variant_get_string (param, NULL), NULL);
24+ execute_command (cmd);
25+ g_free (cmd);
26 }
27
28 static void
29@@ -724,7 +729,7 @@
30 GActionEntry entries[] = {
31 { "activate-settings", on_settings_activated },
32 { "activate-phone-settings", on_phone_settings_activated },
33- { "activate-statistics", on_statistics_activated }
34+ { "activate-statistics", on_statistics_activated, "s" }
35 };
36
37 p->actions = g_simple_action_group_new ();

Subscribers

People subscribed via source and target branches