extensionSystem: Add a DOWNLOADING state

https://bugzilla.gnome.org/show_bug.cgi?id=654770
This commit is contained in:
Jasper St. Pierre 2011-06-27 22:27:56 -04:00
parent a56cd3c3d6
commit 465d03ab2c
2 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,7 @@ const ExtensionState = {
DISABLED: 2, DISABLED: 2,
ERROR: 3, ERROR: 3,
OUT_OF_DATE: 4, OUT_OF_DATE: 4,
DOWNLOADING: 5,
// Used as an error state for operations on unknown extensions, // Used as an error state for operations on unknown extensions,
// should never be in a real extensionMeta object. // should never be in a real extensionMeta object.
@ -113,6 +114,12 @@ function installExtensionFromManifestURL(uuid, url) {
return; return;
} }
let meta = extensionMeta[uuid] = { uuid: uuid,
state: ExtensionState.DOWNLOADING,
error: '' };
_signals.emit('extension-state-changed', meta);
installExtensionFromManifest(manifest, meta); installExtensionFromManifest(manifest, meta);
}); });
} }

View File

@ -690,6 +690,8 @@ Extensions.prototype = {
return _("Error"); return _("Error");
case ExtensionSystem.ExtensionState.OUT_OF_DATE: case ExtensionSystem.ExtensionState.OUT_OF_DATE:
return _("Out of date"); return _("Out of date");
case ExtensionSystem.ExtensionState.DOWNLOADING:
return _("Downloading");
} }
return 'Unknown'; // Not translated, shouldn't appear return 'Unknown'; // Not translated, shouldn't appear
}, },