~donadigo/switchboard-plug-networking/connect-to-hidden

« back to all changes in this revision

Viewing changes to src/Widgets/WifiInterface.vala

  • Committer: RabbitBot
  • Author(s): Adam Bieńkowski, xapantu
  • Date: 2015-08-04 20:11:18 UTC
  • mfrom: (123.3.9 switchboard-plug-networking)
  • Revision ID: rabbitbot-20150804201118-uy4nfvvqhewzjwr6
Added new placeholders that will adapt to the situation of wifi list:
* When there are no available access points
* When wireless is disabled
* When scanning for access points
* Put the advanced settings button back again to the bottom of the box

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
namespace Network {
26
26
    public class WifiInterface : AbstractWifiInterface {
27
27
        
28
 
                public WifiInterface (NM.Client client, NM.RemoteSettings settings, NM.Device device_) {
 
28
        public WifiInterface (NM.Client client, NM.RemoteSettings settings, NM.Device device_) {
29
29
            info_box = new InfoBox.from_device (device_);
30
30
            info_box.no_show_all = true;
31
31
            this.init (device_, info_box);
89
89
            this.show_all ();   
90
90
        }
91
91
 
 
92
        protected override void update_switch () {
 
93
            control_switch.active = !software_locked;
 
94
        }
 
95
 
 
96
        protected override void control_switch_activated () {
 
97
            var active = control_switch.active;
 
98
            if (active != !software_locked) {
 
99
                rfkill.set_software_lock (RFKillDeviceType.WLAN, !active);
 
100
                nm_client.wireless_set_enabled (active);
 
101
            }
 
102
        }
 
103
 
92
104
        protected override void wifi_activate_cb (WifiMenuItem row) {
93
105
            if (device != null) {  
94
106
                /* Do not activate connection if it is already activated */