~charlesk/indicator-network/lp-1233679

« back to all changes in this revision

Viewing changes to network/device-mobile.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:
24
24
{
25
25
        public class Mobile : Base {
26
26
                private GLib.MenuItem enabled_item;
 
27
                private GLib.MenuItem settings_item;
27
28
 
28
 
                public Mobile (NM.Client client, NM.DeviceModem device, GLibLocal.ActionMuxer muxer) {
 
29
                public Mobile (NM.Client client, NM.DeviceModem device, GLibLocal.ActionMuxer muxer, bool show_enable) {
29
30
                        GLib.Object(
30
31
                                client: client,
31
32
                                device: device,
33
34
                                muxer: muxer
34
35
                        );
35
36
 
36
 
                        enabled_item = new MenuItem("Mobile", "indicator." + device.get_iface() + ".device-enabled");
37
 
                        enabled_item.set_attribute ("x-canonical-type"  ,           "s", "com.canonical.indicator.switch");
38
 
                        _menu.append_item(enabled_item);
39
 
                        /* TODO: Need busy action */
 
37
                        if (show_enable) {
 
38
                                enabled_item = new MenuItem("Cellular", "indicator." + device.get_iface() + ".device-enabled");
 
39
                                enabled_item.set_attribute ("x-canonical-type"  ,           "s", "com.canonical.indicator.switch");
 
40
                                _menu.append_item(enabled_item);
 
41
                        }
 
42
 
 
43
                        settings_item = new MenuItem("Cellular settings…", "indicator.global.settings::cellular");
 
44
                        _menu.append_item(settings_item);
40
45
                }
41
46
 
42
47
                ~Mobile ()