Rearchitect the Shell to have a components system

Components are pieces of the shell code that can be added/removed
at runtime, like extension, but are tied more directly to a session
mode. The session polkit agent, the network agent, autorun/automount,
are all components, keyring, recorder and telepathy client are all
now copmonents.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
This commit is contained in:
Jasper St. Pierre
2012-09-02 22:23:50 -03:00
parent ca2e09fe8b
commit 2a800e4ce0
13 changed files with 313 additions and 271 deletions

View File

@ -17,8 +17,8 @@ const _modes = {
hasRunDialog: false,
hasWorkspaces: false,
hasWindows: false,
createSession: Main.createGDMSession,
createUnlockDialog: Main.createGDMLoginDialog,
components: [],
panel: {
left: [],
center: ['dateMenu'],
@ -36,6 +36,7 @@ const _modes = {
hasRunDialog: false,
hasWorkspaces: false,
hasWindows: false,
components: ['networkAgent', 'polkitAgent', 'telepathyClient'],
panel: {
left: ['userMenu'],
center: [],
@ -50,7 +51,7 @@ const _modes = {
allowKeybindingsWhenModal: false,
hasRunDialog: false,
hasWorkspaces: false,
createSession: Main.createInitialSetupSession,
components: ['keyring'],
panel: {
left: [],
center: ['dateMenu'],
@ -66,8 +67,9 @@ const _modes = {
hasRunDialog: true,
hasWorkspaces: true,
hasWindows: true,
createSession: Main.createUserSession,
createUnlockDialog: Main.createSessionUnlockDialog,
components: ['networkAgent', 'polkitAgent', 'telepathyClient',
'keyring', 'recorder', 'autorunManager', 'automountManager'],
panel: {
left: ['activities', 'appMenu'],
center: ['dateMenu'],
@ -112,8 +114,6 @@ const SessionMode = new Lang.Class({
let params = _modes[this.currentMode];
params = Params.parse(params, _modes[DEFAULT_MODE]);
this._createSession = params.createSession;
delete params.createSession;
this._createUnlockDialog = params.createUnlockDialog;
delete params.createUnlockDialog;
@ -121,11 +121,6 @@ const SessionMode = new Lang.Class({
this.emit('updated');
},
createSession: function() {
if (this._createSession)
this._createSession();
},
createUnlockDialog: function() {
if (this._createUnlockDialog)
return this._createUnlockDialog.apply(this, arguments);