extensionSytem: Rename ENABLED/DISABLED states

The ENABLED state means that an extension's `enable()` method
was called successfully.

This usually matches whether an extension *should* be enabled
according to the enabled-extensions/disabled-extensions settings,
but not necessarily: If an extension had an error or does not
support the currently active mode, its actual state is different.

We currently only expose the actual state to external tooling,
but whether an extension should be enabled is relevant as well,
for example to disable a lock-screen only extension from the
regular session.

For that purpose we will expose a separate `enabled` property.
To avoid confusion with the existing states, change the exposed
names to (IN)ACTIVE.

This does not affect the D-Bus API, as the numeric values of
the states remain unchanged.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7004

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3073>
This commit is contained in:
Florian Müllner
2023-12-21 18:59:33 +01:00
committed by Marge Bot
parent 32d4bc43ea
commit e6624f8ba1
5 changed files with 27 additions and 27 deletions

View File

@ -801,21 +801,21 @@ const Extensions = GObject.registerClass({
_stateToString(extensionState) {
switch (extensionState) {
case ExtensionState.ENABLED:
return _('Enabled');
case ExtensionState.DISABLED:
case ExtensionState.ACTIVE:
return _('Active');
case ExtensionState.INACTIVE:
case ExtensionState.INITIALIZED:
return _('Disabled');
return _('Inactive');
case ExtensionState.ERROR:
return _('Error');
case ExtensionState.OUT_OF_DATE:
return _('Out of date');
case ExtensionState.DOWNLOADING:
return _('Downloading');
case ExtensionState.DISABLING:
return _('Disabling');
case ExtensionState.ENABLING:
return _('Enabling');
case ExtensionState.DEACTIVATING:
return _('Deactivating');
case ExtensionState.ACTIVATING:
return _('Activating');
}
return 'Unknown'; // Not translated, shouldn't appear
}