Merge lp:~ted/indicator-power/fix-settings3 into lp:indicator-power/13.10

Proposed by Ted Gould
Status: Merged
Approved by: Timo Jyrinki
Approved revision: 196
Merged at revision: 199
Proposed branch: lp:~ted/indicator-power/fix-settings3
Merge into: lp:indicator-power/13.10
Diff against target: 110 lines (+18/-15)
3 files modified
configure.ac (+2/-1)
debian/control (+1/-0)
src/service.c (+15/-14)
To merge this branch: bzr merge lp:~ted/indicator-power/fix-settings3
Reviewer Review Type Date Requested Status
Timo Jyrinki Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+185695@code.launchpad.net

Commit message

Use URL dispatcher to show settings on the phone

Description of the change

After a discussion with the release team this can be used as long as this merge lands:

https://code.launchpad.net/~ted/url-dispatcher/lib-suggests-service/+merge/185694

DO NOT top approve this until that merge lands. Please, please, please.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The url-dispatcher change is now merged to trunk. We're in manual publishing mode, so we won't publish a new indicator-power before a new url-dispatcher, therefore approving this to get the build into daily PPA to go with url-dispatcher.

review: Approve
Revision history for this message
Ted Gould (ted) wrote :

Thanks for reviewing this Timo!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2013-09-14 02:43:47 +0000
3+++ configure.ac 2013-09-16 01:54:49 +0000
4@@ -40,7 +40,8 @@
5 PKG_CHECK_MODULES([SERVICE_DEPS],[glib-2.0 >= $GLIB_REQUIRED_VERSION
6 gio-2.0 >= $GIO_REQUIRED_VERSION
7 gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
8- gudev-1.0 >= $GUDEV_REQUIRED_VERSION])
9+ gudev-1.0 >= $GUDEV_REQUIRED_VERSION
10+ url-dispatcher-1])
11
12 ###########################
13 # GSETTINGS
14
15=== modified file 'debian/control'
16--- debian/control 2013-09-14 02:43:47 +0000
17+++ debian/control 2013-09-16 01:54:49 +0000
18@@ -9,6 +9,7 @@
19 libgtest-dev,
20 libglib2.0-dev (>= 2.36),
21 libgudev-1.0-dev,
22+ liburl-dispatcher1-dev,
23 python,
24 Standards-Version: 3.9.2
25 Homepage: https://launchpad.net/indicator-power
26
27=== modified file 'src/service.c'
28--- src/service.c 2013-09-14 02:43:47 +0000
29+++ src/service.c 2013-09-16 01:54:49 +0000
30@@ -22,6 +22,7 @@
31
32 #include <glib/gi18n.h>
33 #include <gio/gio.h>
34+#include <url-dispatcher.h>
35
36 #include "device.h"
37 #include "device-provider.h"
38@@ -331,15 +332,13 @@
39
40 g_variant_builder_init (&b, G_VARIANT_TYPE("a{sv}"));
41
42+ g_variant_builder_add (&b, "{sv}", "title", g_variant_new_string (_("Battery")));
43+
44 g_variant_builder_add (&b, "{sv}", "visible",
45 g_variant_new_boolean (should_be_visible (self)));
46
47 if (label != NULL)
48- {
49- g_variant_builder_add (&b, "{sv}", "label", g_variant_new_string (label));
50-
51- g_free (label);
52- }
53+ g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (label));
54
55 if (icon != NULL)
56 {
57@@ -349,12 +348,7 @@
58 }
59
60 if (a11y != NULL)
61- {
62- g_variant_builder_add (&b, "{sv}", "accessible-desc",
63- g_variant_new_string (a11y));
64-
65- g_free (a11y);
66- }
67+ g_variant_builder_add (&b, "{sv}", "accessible-desc", g_variant_new_take_string (a11y));
68
69 return g_variant_builder_end (&b);
70 }
71@@ -532,7 +526,7 @@
72 update_brightness_action_state (self);
73 g_object_unref (item);
74
75- g_menu_append (section, _("Battery settingsā€¦"), "indicator.activate-settings");
76+ g_menu_append (section, _("Battery settingsā€¦"), "indicator.activate-phone-settings");
77
78 return G_MENU_MODEL (section);
79 }
80@@ -685,8 +679,6 @@
81 GVariant * param G_GNUC_UNUSED,
82 gpointer gself G_GNUC_UNUSED)
83 {
84- /* FIXME: unity8 settings */
85-
86 execute_command ("gnome-control-center power");
87 }
88
89@@ -698,6 +690,14 @@
90 execute_command ("gnome-power-statistics");
91 }
92
93+static void
94+on_phone_settings_activated (GSimpleAction * a G_GNUC_UNUSED,
95+ GVariant * param G_GNUC_UNUSED,
96+ gpointer gself G_GNUC_UNUSED)
97+{
98+ url_dispatch_send("settings://system/battery", NULL, NULL);
99+}
100+
101 /***
102 ****
103 ***/
104@@ -739,6 +739,7 @@
105
106 GActionEntry entries[] = {
107 { "activate-settings", on_settings_activated },
108+ { "activate-phone-settings", on_phone_settings_activated },
109 { "activate-statistics", on_statistics_activated }
110 };
111

Subscribers

People subscribed via source and target branches