sessionMode: Allow changing the session mode at runtime
Since we eventually want to add a system for changing the top panel contents depending on the current state of the shell, let's use the "session mode" feature for this, and add a mechanism for updating the session mode at runtime. Add support for every key besides the two functional keys, and make all the components update automatically when the session mode is changed. Add a new lock-screen mode, and make the lock screen change to this when locked. https://bugzilla.gnome.org/show_bug.cgi?id=683156
This commit is contained in:
@ -1567,7 +1567,6 @@ const NMApplet = new Lang.Class({
|
||||
this.secondaryIcon = this.addIcon(new Gio.ThemedIcon({ name: 'network-vpn-symbolic' }));
|
||||
this.secondaryIcon.hide();
|
||||
|
||||
this._isLocked = false;
|
||||
this._client = NMClient.Client.new();
|
||||
|
||||
this._statusSection = new PopupMenu.PopupMenuSection();
|
||||
@ -1675,11 +1674,6 @@ const NMApplet = new Lang.Class({
|
||||
}));
|
||||
},
|
||||
|
||||
setLockedState: function(locked) {
|
||||
this._isLocked = locked;
|
||||
this._syncNMState();
|
||||
},
|
||||
|
||||
_ensureSource: function() {
|
||||
if (!this._source) {
|
||||
this._source = new MessageTray.Source(_("Network Manager"),
|
||||
@ -2063,7 +2057,7 @@ const NMApplet = new Lang.Class({
|
||||
|
||||
_syncNMState: function() {
|
||||
this.mainIcon.visible = this._client.manager_running;
|
||||
this.actor.visible = this.mainIcon.visible && !this._isLocked;
|
||||
this.actor.visible = this.mainIcon.visible;
|
||||
|
||||
if (!this._client.networking_enabled) {
|
||||
this.setIcon('network-offline-symbolic');
|
||||
|
Reference in New Issue
Block a user