~charlesk/indicator-network/lp-1233679

« back to all changes in this revision

Viewing changes to network/device-wifi.vala

  • Committer: Tarmac
  • Author(s): Ted Gould
  • Date: 2013-08-26 22:00:02 UTC
  • mfrom: (269.2.7 settings-links)
  • Revision ID: tarmac-20130826220002-xqydt67d09xt5fzf
Adds settings items for cellular and Wifi.

Approved by Charles Kerr, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        {
27
27
                private  Menu        apsmenu;
28
28
                private  MenuItem    device_item;
 
29
                private  MenuItem    settings_item;
29
30
                public   DeviceWifi  device;
30
31
                private  SimpleActionGroup actions;
31
32
                private  NM.Client   client;
42
43
                        device_item = create_item_for_wifi_device ();
43
44
                        this.apsmenu.append_item(device_item);
44
45
 
 
46
                        settings_item = new MenuItem("Wi-Fi settings…", "indicator.global.settings::wifi");
 
47
                        this.apsmenu.append_item(settings_item);
 
48
 
45
49
                        device.access_point_added.connect   (access_point_added_cb);
46
50
                        device.access_point_removed.connect (access_point_removed_cb);
47
51
                        device.notify.connect               (active_access_point_changed);
174
178
                        //Find the right spot for the AP
175
179
                        var item = new MenuItem (null, null);
176
180
                        bind_ap_item (ap, item);
177
 
                        for (int i = 1; i < apsmenu.get_n_items(); i++)
 
181
                        /* We need to start at 1 and end at -1 to avoid the toggle and the settings */
 
182
                        for (int i = 1; i < apsmenu.get_n_items() - 1; i++)
178
183
                        {
179
184
                                string path;
180
185
 
198
203
                                        return;
199
204
                                }
200
205
                        }
201
 
                        //AP is last in the menu
202
 
                        apsmenu.append_item (item);
 
206
 
 
207
                        //AP is last in the menu (avoid the settings item)
 
208
                        apsmenu.insert_item (apsmenu.get_n_items() - 1, item);
203
209
                }
204
210
 
205
211
                private void set_active_ap (AccessPoint? ap)