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