2012-05-16 18:26:44 -04:00
|
|
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
|
|
|
const Lang = imports.lang;
|
|
|
|
const Shell = imports.gi.Shell;
|
|
|
|
|
|
|
|
const Params = imports.misc.params;
|
|
|
|
|
|
|
|
const DEFAULT_MODE = 'user';
|
|
|
|
|
|
|
|
const _modes = {
|
2012-05-16 18:59:02 -04:00
|
|
|
'gdm': { hasOverview: false,
|
2012-05-16 19:12:39 -04:00
|
|
|
hasAppMenu: false,
|
2012-05-17 18:32:04 -04:00
|
|
|
showCalendarEvents: false,
|
2012-05-16 19:43:59 -04:00
|
|
|
allowSettings: false,
|
2012-05-16 20:08:56 -04:00
|
|
|
allowExtensions: false,
|
2012-05-17 09:55:35 -04:00
|
|
|
allowKeybindingsWhenModal: true,
|
2012-05-16 18:59:02 -04:00
|
|
|
sessionType: Shell.SessionType.GDM },
|
2012-05-16 18:26:44 -04:00
|
|
|
|
2012-05-16 18:59:02 -04:00
|
|
|
'user': { hasOverview: true,
|
2012-05-16 19:12:39 -04:00
|
|
|
hasAppMenu: true,
|
2012-05-17 18:32:04 -04:00
|
|
|
showCalendarEvents: true,
|
2012-05-16 19:43:59 -04:00
|
|
|
allowSettings: true,
|
2012-05-16 20:08:56 -04:00
|
|
|
allowExtensions: true,
|
2012-05-17 09:55:35 -04:00
|
|
|
allowKeybindingsWhenModal: false,
|
2012-05-16 18:59:02 -04:00
|
|
|
sessionType: Shell.SessionType.USER }
|
2012-05-16 18:26:44 -04:00
|
|
|
};
|
|
|
|
|
2012-05-18 17:57:04 -04:00
|
|
|
function modeExists(mode) {
|
|
|
|
let modes = Object.getOwnPropertyNames(_modes);
|
|
|
|
return modes.indexOf(mode) != -1;
|
|
|
|
}
|
|
|
|
|
2012-05-16 18:26:44 -04:00
|
|
|
const SessionMode = new Lang.Class({
|
|
|
|
Name: 'SessionMode',
|
|
|
|
|
|
|
|
_init: function() {
|
|
|
|
let params = _modes[global.session_mode];
|
|
|
|
|
|
|
|
params = Params.parse(params, _modes[DEFAULT_MODE]);
|
|
|
|
Lang.copyProperties(params, this);
|
|
|
|
}
|
|
|
|
});
|