userMenu: Make the user menu insensitive in the lock screen

And show a lock icon as well.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
This commit is contained in:
Jasper St. Pierre
2012-09-01 18:44:46 -03:00
parent 2a800e4ce0
commit ec01f5d5ee
3 changed files with 16 additions and 1 deletions

View File

@ -505,6 +505,8 @@ const UserMenuButton = new Lang.Class({
style_class: 'popup-menu-icon' });
this._pendingIcon = new St.Icon({ icon_name: 'user-status-pending-symbolic',
style_class: 'popup-menu-icon' });
this._lockedIcon = new St.Icon({ icon_name: 'changes-prevent-symbolic',
style_class: 'popup-menu-icon' });
this._accountMgr.connect('most-available-presence-changed',
Lang.bind(this, this._updatePresenceIcon));
@ -578,6 +580,9 @@ const UserMenuButton = new Lang.Class({
let allowSettings = Main.sessionMode.allowSettings;
this._statusChooser.setSensitive(allowSettings);
this._systemSettings.visible = allowSettings;
this.setSensitive(!Main.sessionMode.isLocked);
this._updatePresenceIcon();
},
_onDestroy: function() {
@ -661,7 +666,9 @@ const UserMenuButton = new Lang.Class({
},
_updatePresenceIcon: function(accountMgr, presence, status, message) {
if (presence == Tp.ConnectionPresenceType.AVAILABLE)
if (Main.sessionMode.isLocked)
this._iconBox.child = this._lockedIcon;
else if (presence == Tp.ConnectionPresenceType.AVAILABLE)
this._iconBox.child = this._availableIcon;
else if (presence == Tp.ConnectionPresenceType.BUSY)
this._iconBox.child = this._busyIcon;