Merge lp:~ted/indicator-network/auto-connect into lp:indicator-network/13.10

Proposed by Ted Gould
Status: Merged
Approved by: Ted Gould
Approved revision: 298
Merged at revision: 302
Proposed branch: lp:~ted/indicator-network/auto-connect
Merge into: lp:indicator-network/13.10
Diff against target: 35 lines (+10/-1)
1 file modified
network/device-wifi.vala (+10/-1)
To merge this branch: bzr merge lp:~ted/indicator-network/auto-connect
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Antti Kaijanmäki (community) Approve
Review via email: mp+190233@code.launchpad.net

Commit message

Listen to auto-reconnect setting

Description of the change

Never auto-join unless the user wants us to.

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
Antti Kaijanmäki (kaijanmaki) wrote :

approved.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
298. By Ted Gould

Merge trunk to resolve a conflict

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'network/device-wifi.vala'
2--- network/device-wifi.vala 2013-10-10 17:33:03 +0000
3+++ network/device-wifi.vala 2013-10-10 18:57:57 +0000
4@@ -535,6 +535,7 @@
5 public class Wifi : Base {
6 private WifiMenu wifimenu;
7 private WifiActionManager wifiactionmanager;
8+ private GLib.Settings settings;
9
10 public Wifi (NM.Client client, NM.DeviceWifi device, GLibLocal.ActionMuxer muxer, bool show_settings) {
11 GLib.Object(
12@@ -544,6 +545,14 @@
13 muxer: muxer
14 );
15
16+ settings = new GLib.Settings ("com.canonical.indicator.network");
17+ settings.changed["auto-join-previous"].connect((k) => {
18+ if (client.wireless_get_enabled()) {
19+ device.set_autoconnect(settings.get_boolean("auto-join-previous"));
20+ }
21+ });
22+ device.set_autoconnect(settings.get_boolean("auto-join-previous"));
23+
24 wifimenu = new WifiMenu(client, device, this._menu, "indicator." + this.namespace + ".", show_settings);
25 wifiactionmanager = new WifiActionManager(actions, client, device);
26 }
27@@ -557,7 +566,7 @@
28 protected override void enable_device ()
29 {
30 client.wireless_set_enabled(true);
31- device.set_autoconnect(true);
32+ device.set_autoconnect(settings.get_boolean("auto-join-previous"));
33 }
34 }
35 }

Subscribers

People subscribed via source and target branches