2023-07-10 06:04:07 +02:00
|
|
|
import {ExtensionBase, GettextWrapper} from './sharedInternals.js';
|
2023-07-01 02:11:37 +02:00
|
|
|
|
2023-07-10 05:12:30 +02:00
|
|
|
const {extensionManager} = imports.ui.main;
|
|
|
|
|
2023-07-01 02:11:37 +02:00
|
|
|
export class Extension extends ExtensionBase {
|
2023-07-10 10:33:31 +02:00
|
|
|
static lookupByUUID(uuid) {
|
|
|
|
return extensionManager.lookup(uuid)?.stateObj ?? null;
|
|
|
|
}
|
|
|
|
|
2023-07-10 07:06:17 +02:00
|
|
|
static defineTranslationFunctions(url) {
|
|
|
|
const wrapper = new GettextWrapper(this, url);
|
|
|
|
return wrapper.defineTranslationFunctions();
|
|
|
|
}
|
|
|
|
|
2023-07-01 02:11:37 +02:00
|
|
|
enable() {
|
|
|
|
}
|
2023-07-01 02:11:37 +02:00
|
|
|
|
2023-07-01 02:11:37 +02:00
|
|
|
disable() {
|
|
|
|
}
|
2023-07-01 02:11:37 +02:00
|
|
|
|
2023-07-01 02:11:37 +02:00
|
|
|
/**
|
|
|
|
* Open the extension's preferences window
|
|
|
|
*/
|
|
|
|
openPreferences() {
|
|
|
|
extensionManager.openExtensionPrefs(this.uuid, '', {});
|
|
|
|
}
|
2023-07-01 02:11:37 +02:00
|
|
|
}
|
2023-07-17 01:13:06 +02:00
|
|
|
|
|
|
|
export const {
|
|
|
|
gettext, ngettext, pgettext,
|
|
|
|
} = Extension.defineTranslationFunctions();
|