gnome-shell/js/ui/sessionMode.js
Florian Müllner ed17418101 sessionMode: Add hasWorkspaces property
Add a sessionMode.hasWorkspaces property, which determines whether
the concept of workspaces should be exposed in the interface or not.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
2012-05-22 19:42:28 +02:00

47 lines
1.2 KiB
JavaScript

// -*- 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 = {
'gdm': { hasOverview: false,
hasAppMenu: false,
showCalendarEvents: false,
allowSettings: false,
allowExtensions: false,
allowKeybindingsWhenModal: true,
hasRunDialog: false,
hasWorkspaces: false,
sessionType: Shell.SessionType.GDM },
'user': { hasOverview: true,
hasAppMenu: true,
showCalendarEvents: true,
allowSettings: true,
allowExtensions: true,
allowKeybindingsWhenModal: false,
hasRunDialog: true,
hasWorkspaces: true,
sessionType: Shell.SessionType.USER }
};
function modeExists(mode) {
let modes = Object.getOwnPropertyNames(_modes);
return modes.indexOf(mode) != -1;
}
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);
}
});