Delegate mode information to a dedicated object

Rather than accessing global.session_type / global.session_mode
all over the place, delegate mode information to a dedicated
sessionMode object. While not very useful for now, we will replace
checks for a particular mode with checks for particular properties
that sessionMode defines based on global.session_mode.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
This commit is contained in:
Florian Müllner
2012-05-17 00:26:44 +02:00
parent 940ddb104c
commit 3d26224180
6 changed files with 41 additions and 12 deletions

View File

@ -889,7 +889,7 @@ const PopupMenuBase = new Lang.Class({
addSettingsAction: function(title, desktopFile) {
// Don't allow user settings to get edited unless we're in a user session
if (global.session_type != Shell.SessionType.USER)
if (Main.sessionMode.sessionType != Shell.SessionType.USER)
return null;
let menuItem = this.addAction(title, function() {