[gnome-shell/wip/rstrode/login-screen-extensions: 35/134] extensionUtils: Move ExtensionState definition here
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/login-screen-extensions: 35/134] extensionUtils: Move ExtensionState definition here
- Date: Thu, 26 Aug 2021 19:30:58 +0000 (UTC)
commit ff68b07eb870bb6bf87c047996a7dfe7f7bc71d5
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jul 6 15:31:57 2019 +0200
extensionUtils: Move ExtensionState definition here
It makes sense to keep extension-related enums in the same module instead
of spreading them between ExtensionSystem and ExtensionUtils.
More importantly, this will make the type available to the extensions-prefs
tool (which runs in a different process and therefore only has access to
a limited set of modules).
https://bugzilla.gnome.org/show_bug.cgi?id=789852
js/misc/extensionUtils.js | 13 +++++++++++++
js/ui/extensionSystem.js | 13 +------------
js/ui/lookingGlass.js | 14 ++++++++------
3 files changed, 22 insertions(+), 18 deletions(-)
---
diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js
index fb1e2b506c..dc6e74cf80 100644
--- a/js/misc/extensionUtils.js
+++ b/js/misc/extensionUtils.js
@@ -17,6 +17,19 @@ var ExtensionType = {
SESSION_MODE: 3
};
+var ExtensionState = {
+ ENABLED: 1,
+ DISABLED: 2,
+ ERROR: 3,
+ OUT_OF_DATE: 4,
+ DOWNLOADING: 5,
+ INITIALIZED: 6,
+
+ // Used as an error state for operations on unknown extensions,
+ // should never be in a real extensionMeta object.
+ UNINSTALLED: 99
+};
+
// Maps uuid -> metadata object
var extensions = {};
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 9ffdb4f3de..3091af2baf 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -6,18 +6,7 @@ const Signals = imports.signals;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
-var ExtensionState = {
- ENABLED: 1,
- DISABLED: 2,
- ERROR: 3,
- OUT_OF_DATE: 4,
- DOWNLOADING: 5,
- INITIALIZED: 6,
-
- // Used as an error state for operations on unknown extensions,
- // should never be in a real extensionMeta object.
- UNINSTALLED: 99
-};
+const { ExtensionState } = ExtensionUtils;
// Arrays of uuids
var enabledExtensions;
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 958211df06..fefb3f7314 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -14,6 +14,8 @@ const Tweener = imports.ui.tweener;
const Main = imports.ui.main;
const JsParse = imports.misc.jsParse;
+const { ExtensionState } = ExtensionUtils;
+
const CHEVRON = '>>> ';
/* Imports...feel free to add here as needed */
@@ -684,16 +686,16 @@ var Extensions = class Extensions {
_stateToString(extensionState) {
switch (extensionState) {
- case ExtensionSystem.ExtensionState.ENABLED:
+ case ExtensionState.ENABLED:
return _("Enabled");
- case ExtensionSystem.ExtensionState.DISABLED:
- case ExtensionSystem.ExtensionState.INITIALIZED:
+ case ExtensionState.DISABLED:
+ case ExtensionState.INITIALIZED:
return _("Disabled");
- case ExtensionSystem.ExtensionState.ERROR:
+ case ExtensionState.ERROR:
return _("Error");
- case ExtensionSystem.ExtensionState.OUT_OF_DATE:
+ case ExtensionState.OUT_OF_DATE:
return _("Out of date");
- case ExtensionSystem.ExtensionState.DOWNLOADING:
+ case ExtensionState.DOWNLOADING:
return _("Downloading");
}
return 'Unknown'; // Not translated, shouldn't appear
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]