mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
extensionSystem: Add 'extension-status-changed' signal
https://bugzilla.gnome.org/show_bug.cgi?id=654770
This commit is contained in:
parent
d8a98e5467
commit
a56cd3c3d6
2 changed files with 20 additions and 2 deletions
|
|
@ -182,6 +182,7 @@ function disableExtension(uuid) {
|
|||
}
|
||||
|
||||
meta.state = ExtensionState.DISABLED;
|
||||
_signals.emit('extension-state-changed', meta);
|
||||
}
|
||||
|
||||
function enableExtension(uuid) {
|
||||
|
|
@ -202,12 +203,16 @@ function enableExtension(uuid) {
|
|||
}
|
||||
|
||||
meta.state = ExtensionState.ENABLED;
|
||||
_signals.emit('extension-state-changed', meta);
|
||||
}
|
||||
|
||||
function logExtensionError(uuid, message) {
|
||||
if (!errors[uuid]) errors[uuid] = [];
|
||||
errors[uuid].push(message);
|
||||
global.logError('Extension "%s" had error: %s'.format(uuid, message));
|
||||
_signals.emit('extension-state-changed', { uuid: uuid,
|
||||
error: message,
|
||||
state: ExtensionState.ERROR });
|
||||
}
|
||||
|
||||
function loadExtension(dir, enabled, type) {
|
||||
|
|
@ -268,6 +273,7 @@ function loadExtension(dir, enabled, type) {
|
|||
extensionMeta[uuid] = meta;
|
||||
meta.type = type;
|
||||
meta.path = dir.get_path();
|
||||
meta.error = '';
|
||||
|
||||
// Default to error, we set success as the last step
|
||||
meta.state = ExtensionState.ERROR;
|
||||
|
|
@ -335,6 +341,7 @@ function loadExtension(dir, enabled, type) {
|
|||
enableExtension(uuid);
|
||||
|
||||
_signals.emit('extension-loaded', meta.uuid);
|
||||
_signals.emit('extension-state-changed', meta);
|
||||
global.log('Loaded extension ' + meta.uuid);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue