make NetworkManager optional

NetworkManager is only available on Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=669495
This commit is contained in:
Michael Biebl
2014-02-11 17:20:15 -05:00
committed by Ryan Lortie
parent ccec7732a7
commit 9f3499a7c3
6 changed files with 78 additions and 10 deletions

View File

@ -812,7 +812,11 @@ const AggregateMenu = new Lang.Class({
this._indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box' });
this.actor.add_child(this._indicators);
this._network = new imports.ui.status.network.NMApplet();
if (Config.HAVE_NETWORKMANAGER) {
this._network = new imports.ui.status.network.NMApplet();
} else {
this._network = null;
}
if (Config.HAVE_BLUETOOTH) {
this._bluetooth = new imports.ui.status.bluetooth.Indicator();
} else {
@ -829,7 +833,9 @@ const AggregateMenu = new Lang.Class({
this._indicators.add_child(this._screencast.indicators);
this._indicators.add_child(this._location.indicators);
this._indicators.add_child(this._network.indicators);
if (this._network) {
this._indicators.add_child(this._network.indicators);
}
if (this._bluetooth) {
this._indicators.add_child(this._bluetooth.indicators);
}
@ -841,7 +847,9 @@ const AggregateMenu = new Lang.Class({
this.menu.addMenuItem(this._volume.menu);
this.menu.addMenuItem(this._brightness.menu);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addMenuItem(this._network.menu);
if (this._network) {
this.menu.addMenuItem(this._network.menu);
}
if (this._bluetooth) {
this.menu.addMenuItem(this._bluetooth.menu);
}