abdd1346da
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>
29 lines
830 B
JavaScript
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();
|