mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
extensionSystem: Add hasUpdate state
The current support for extension updates is half-baked at best. We are about to change that, and implement offline updates similar to gnome-software. As a first step, add a hasUpdate property to the extension state which will communicate available updates. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/945
This commit is contained in:
parent
2dae3f5656
commit
375d1892bf
2 changed files with 19 additions and 1 deletions
|
|
@ -31,7 +31,15 @@ var ExtensionState = {
|
|||
UNINSTALLED: 99,
|
||||
};
|
||||
|
||||
const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs', 'canChange'];
|
||||
const SERIALIZED_PROPERTIES = [
|
||||
'type',
|
||||
'state',
|
||||
'path',
|
||||
'error',
|
||||
'hasPrefs',
|
||||
'hasUpdate',
|
||||
'canChange',
|
||||
];
|
||||
|
||||
/**
|
||||
* getCurrentExtension:
|
||||
|
|
|
|||
|
|
@ -198,6 +198,15 @@ var ExtensionManager = class {
|
|||
return true;
|
||||
}
|
||||
|
||||
notifyExtensionUpdate(uuid) {
|
||||
let extension = this.lookup(uuid);
|
||||
if (!extension)
|
||||
return;
|
||||
|
||||
extension.hasUpdate = true;
|
||||
this.emit('extension-state-changed', extension);
|
||||
}
|
||||
|
||||
logExtensionError(uuid, error) {
|
||||
let extension = this.lookup(uuid);
|
||||
if (!extension)
|
||||
|
|
@ -253,6 +262,7 @@ var ExtensionManager = class {
|
|||
path: dir.get_path(),
|
||||
error: '',
|
||||
hasPrefs: dir.get_child('prefs.js').query_exists(null),
|
||||
hasUpdate: false,
|
||||
canChange: false,
|
||||
};
|
||||
this._extensions.set(uuid, extension);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue