gnome-shell/js/extensions/prefs.js
Florian Müllner abdd1346da extensionBase: Stop injecting extensionManager
All extension lookups now happen through the dedicated
Extension/ExtensionPreferences classes, so the shared
code no longer has to access the extensionManager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>
2023-07-30 10:29:44 +03:00

29 lines
830 B
JavaScript

import GObject from 'gi://GObject';
import {ExtensionBase, GettextWrapper} from './sharedInternals.js';
import {extensionManager} from '../extensionsService.js';
export class ExtensionPreferences extends ExtensionBase {
static lookupByUUID(uuid) {
return extensionManager.lookup(uuid)?.stateObj ?? null;
}
static defineTranslationFunctions(url) {
const wrapper = new GettextWrapper(this, url);
return wrapper.defineTranslationFunctions();
}
/**
* Fill the preferences window with preferences.
*
* @param {Adw.PreferencesWindow} _window - the preferences window
*/
fillPreferencesWindow(_window) {
throw new GObject.NotImplementedError();
}
}
export const {
gettext, ngettext, pgettext,
} = ExtensionPreferences.defineTranslationFunctions();