Merge lp:~binli/ubuntu/trusty/unity-control-center/unity-control-center.lp1248720-block-power-callback-unless-its-triggered-by-user into lp:unity-control-center/14.04

Proposed by Bin Li on 2015-09-14
Status: Merged
Approved by: Sebastien Bacher on 2015-09-16
Approved revision: 12783
Merged at revision: 12783
Proposed branch: lp:~binli/ubuntu/trusty/unity-control-center/unity-control-center.lp1248720-block-power-callback-unless-its-triggered-by-user
Merge into: lp:unity-control-center/14.04
Diff against target: 87 lines (+26/-0)
2 files modified
debian/changelog (+7/-0)
panels/bluetooth/cc-bluetooth-panel.c (+19/-0)
To merge this branch: bzr merge lp:~binli/ubuntu/trusty/unity-control-center/unity-control-center.lp1248720-block-power-callback-unless-its-triggered-by-user
Reviewer Review Type Date Requested Status
Sebastien Bacher 2015-09-14 Approve on 2015-09-16
Review via email: mp+270924@code.launchpad.net

Description of the change

Cheery pick from lp:unity-control-center.

To post a comment you must log in.
Bin Li (binli) wrote :

revno: 12815 [merge]
author: Yu Ning <email address hidden>
committer: CI Train Bot <email address hidden>
branch nick: unity-control-center
timestamp: Fri 2015-04-10 14:09:34 +0000
message:
  Block power callback unless it's triggered by the user. Fixes: #1248720
  Approved by: Sebastien Bacher, Lars Uebernickel

Sebastien Bacher (seb128) wrote :

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-07-27 16:23:21 +0000
3+++ debian/changelog 2015-09-14 05:56:00 +0000
4@@ -1,3 +1,10 @@
5+unity-control-center (14.04.3+14.04.20140922-0ubuntu1.2) UNRELEASED; urgency=medium
6+
7+ [ Ning Yu ]
8+ * Block power callback unless it's triggered by the user.(LP: #1248720)
9+
10+ -- Bin Li <bin.li@canonical.com> Mon, 14 Sep 2015 12:13:16 +0800
11+
12 unity-control-center (14.04.3+14.04.20140922-0ubuntu1.1) trusty; urgency=medium
13
14 [ Jian-Ding Chen (timchen119) ]
15
16=== modified file 'panels/bluetooth/cc-bluetooth-panel.c'
17--- panels/bluetooth/cc-bluetooth-panel.c 2014-02-20 22:57:03 +0000
18+++ panels/bluetooth/cc-bluetooth-panel.c 2015-09-14 05:56:00 +0000
19@@ -58,6 +58,8 @@
20 GHashTable *connecting_devices;
21 GCancellable *cancellable;
22 GSettings *indicator_settings;
23+
24+ gulong power_callback_handler_id;
25 };
26
27 static void cc_bluetooth_panel_finalize (GObject *object);
28@@ -420,8 +422,12 @@
29
30 state = gtk_switch_get_active (GTK_SWITCH (WID ("switch_bluetooth")));
31 g_debug ("Power switched to %s", state ? "on" : "off");
32+ g_signal_handler_block (G_OBJECT (WID ("switch_bluetooth")),
33+ self->priv->power_callback_handler_id);
34 bluetooth_killswitch_set_state (self->priv->killswitch,
35 state ? BLUETOOTH_KILLSWITCH_STATE_UNBLOCKED : BLUETOOTH_KILLSWITCH_STATE_SOFT_BLOCKED);
36+ g_signal_handler_unblock (G_OBJECT (WID ("switch_bluetooth")),
37+ self->priv->power_callback_handler_id);
38 }
39
40 static void
41@@ -776,7 +782,11 @@
42 CcBluetoothPanel *self)
43 {
44 g_debug ("Default adapter power changed");
45+ g_signal_handler_block (G_OBJECT (WID ("switch_bluetooth")),
46+ self->priv->power_callback_handler_id);
47 cc_bluetooth_panel_update_powered_state (self);
48+ g_signal_handler_unblock (G_OBJECT (WID ("switch_bluetooth")),
49+ self->priv->power_callback_handler_id);
50 }
51
52 static void
53@@ -785,9 +795,13 @@
54 CcBluetoothPanel *self)
55 {
56 g_debug ("Default adapter changed");
57+ g_signal_handler_block (G_OBJECT (WID ("switch_bluetooth")),
58+ self->priv->power_callback_handler_id);
59 cc_bluetooth_panel_update_state (self);
60 cc_bluetooth_panel_update_power (self);
61 cc_bluetooth_panel_update_powered_state (self);
62+ g_signal_handler_unblock (G_OBJECT (WID ("switch_bluetooth")),
63+ self->priv->power_callback_handler_id);
64 }
65
66 static void
67@@ -796,8 +810,12 @@
68 CcBluetoothPanel *self)
69 {
70 g_debug ("Killswitch changed to state '%s' (%d)", bluetooth_killswitch_state_to_string (state) , state);
71+ g_signal_handler_block (G_OBJECT (WID ("switch_bluetooth")),
72+ self->priv->power_callback_handler_id);
73 cc_bluetooth_panel_update_state (self);
74 cc_bluetooth_panel_update_power (self);
75+ g_signal_handler_unblock (G_OBJECT (WID ("switch_bluetooth")),
76+ self->priv->power_callback_handler_id);
77 }
78
79 static void
80@@ -904,6 +922,7 @@
81 G_CALLBACK (switch_connected_active_changed), self);
82
83 /* Set the initial state of power */
84+ self->priv->power_callback_handler_id =
85 g_signal_connect (G_OBJECT (WID ("switch_bluetooth")), "notify::active",
86 G_CALLBACK (power_callback), self);
87 g_signal_connect (G_OBJECT (self->priv->killswitch), "state-changed",

Subscribers

People subscribed via source and target branches