diff --git a/taskwhisperer-extension@infinicode.de/components/cards/taskCard.js b/taskwhisperer-extension@infinicode.de/components/cards/taskCard.js index 9826368..0e80c5f 100644 --- a/taskwhisperer-extension@infinicode.de/components/cards/taskCard.js +++ b/taskwhisperer-extension@infinicode.de/components/cards/taskCard.js @@ -5,20 +5,20 @@ const Me = ExtensionUtils.getCurrentExtension() const { isNullOrEmpty } = Me.imports.helpers.data const { IconButton } = Me.imports.components.buttons.iconButton -const { EventHandler } = Me.imports.helpers.eventHandler const { TaskPriority } = Me.imports.services.meta.taskWarrior const { setTaskDone, setTaskUndone, startTask, stopTask } = Me.imports.services.taskService var TaskCard = GObject.registerClass({ GTypeName: 'TaskWhisperer_TaskCard' }, class TaskCard extends St.Button { - _init (quoteSummary) { + _init (quoteSummary, mainEventHandler) { super._init({ style_class: 'card message task-card', can_focus: true, x_expand: true }) + this._mainEventHandler = mainEventHandler this.cardItem = quoteSummary const vContentBox = new St.BoxLayout({ @@ -204,26 +204,26 @@ var TaskCard = GObject.registerClass({ async _startTask () { await startTask(this.cardItem.ID) - EventHandler.emit('refresh-tasks') + this._mainEventHandler.emit('refresh-tasks') } async _stopTask () { await stopTask(this.cardItem.ID) - EventHandler.emit('refresh-tasks') + this._mainEventHandler.emit('refresh-tasks') } async _setTaskDone () { await setTaskDone(this.cardItem.ID) - EventHandler.emit('refresh-tasks') + this._mainEventHandler.emit('refresh-tasks') } async _setTaskUnDone () { await setTaskUndone(this.cardItem.UUID) - EventHandler.emit('refresh-tasks') + this._mainEventHandler.emit('refresh-tasks') } _editTask () { - EventHandler.emit('show-screen', { + this._mainEventHandler.emit('show-screen', { screen: 'edit-task', additionalData: { item: this.cardItem diff --git a/taskwhisperer-extension@infinicode.de/components/panel/menuItem.js b/taskwhisperer-extension@infinicode.de/components/panel/menuItem.js index 183afcf..a26935e 100644 --- a/taskwhisperer-extension@infinicode.de/components/panel/menuItem.js +++ b/taskwhisperer-extension@infinicode.de/components/panel/menuItem.js @@ -3,8 +3,7 @@ const { Clutter, GObject, St } = imports.gi const ExtensionUtils = imports.misc.extensionUtils const Me = ExtensionUtils.getCurrentExtension() -const { EventHandler } = Me.imports.helpers.eventHandler -const { Settings, TASKWHISPERER_SHOW_PANEL_ICON, TASKWHISPERER_SHOW_TEXT_IN_PANEL } = Me.imports.helpers.settings +const { SettingsHandler, TASKWHISPERER_SHOW_PANEL_ICON, TASKWHISPERER_SHOW_TEXT_IN_PANEL } = Me.imports.helpers.settings const { Translations } = Me.imports.helpers.translations const ComponentsHelper = Me.imports.helpers.components @@ -16,7 +15,7 @@ const SETTING_KEYS_TO_REFRESH = [ var MenuItem = GObject.registerClass({ GTypeName: 'TaskWhisperer_MenuItem' }, class MenuItem extends St.BoxLayout { - _init () { + _init (mainEventHandler) { super._init({ style_class: 'menu-item', x_expand: true, @@ -25,15 +24,18 @@ var MenuItem = GObject.registerClass({ y_expand: true, }) + this._mainEventHandler = mainEventHandler + this._settings = new SettingsHandler() + this._taskCount = 0 - this._settingsChangedId = Settings.connect('changed', (value, key) => { + this._settingsChangedId = this._settings.connect('changed', (value, key) => { if (SETTING_KEYS_TO_REFRESH.includes(key)) { this._sync() } }) - this._refreshMenuTaskCountId = EventHandler.connect('refresh-menu-task-count', (_, { taskCount }) => { + this._refreshMenuTaskCountId = this._mainEventHandler.connect('refresh-menu-task-count', (_, { taskCount }) => { this._taskCount = taskCount this._sync() }) @@ -58,7 +60,7 @@ var MenuItem = GObject.registerClass({ y_align: Clutter.ActorAlign.CENTER }) - if (Settings.show_taskwarrior_icon) { + if (this._settings.show_taskwarrior_icon) { const icon = new St.Icon({ y_align: Clutter.ActorAlign.CENTER, y_expand: true, @@ -71,10 +73,10 @@ var MenuItem = GObject.registerClass({ let additionalTaskAmountInformationText - if (Settings.show_task_text_in_panel) { + if (this._settings.show_task_text_in_panel) { additionalTaskAmountInformationText = Translations.PANEL_TASK_INFO(this._taskCount) } else { - additionalTaskAmountInformationText = Settings.show_taskwarrior_icon ? `${this._taskCount}` : `${this._taskCount} T` + additionalTaskAmountInformationText = this._settings.show_taskwarrior_icon ? `${this._taskCount}` : `${this._taskCount} T` } const label = new St.Label({ @@ -91,11 +93,11 @@ var MenuItem = GObject.registerClass({ _onDestroy () { if (this._settingsChangedId) { - Settings.disconnect(this._settingsChangedId) + this._settings.disconnect(this._settingsChangedId) } if (this._refreshMenuTaskCountId) { - EventHandler.disconnect(this._refreshMenuTaskCountId) + this._mainEventHandler.disconnect(this._refreshMenuTaskCountId) } } }) diff --git a/taskwhisperer-extension@infinicode.de/components/screenWrapper/screenWrapper.js b/taskwhisperer-extension@infinicode.de/components/screenWrapper/screenWrapper.js index 382d7c4..7ff9e3a 100644 --- a/taskwhisperer-extension@infinicode.de/components/screenWrapper/screenWrapper.js +++ b/taskwhisperer-extension@infinicode.de/components/screenWrapper/screenWrapper.js @@ -4,18 +4,18 @@ const ExtensionUtils = imports.misc.extensionUtils const Me = ExtensionUtils.getCurrentExtension() const { TaskOverviewScreen } = Me.imports.components.screens.taskOverviewScreen.taskOverviewScreen const { EditTaskScreen } = Me.imports.components.screens.editTaskScreen.editTaskScreen -const { EventHandler } = Me.imports.helpers.eventHandler var ScreenWrapper = GObject.registerClass({ GTypeName: 'TaskWhisperer_ScreenWrapper' }, class ScreenWrapper extends St.Widget { - _init () { + _init (mainEventHandler) { super._init({ style_class: 'screen-wrapper' }) - this._showScreenConnectId = EventHandler.connect('show-screen', (sender, { screen, additionalData }) => this.showScreen(screen, additionalData)) + this._mainEventHandler = mainEventHandler + this._showScreenConnectId = this._mainEventHandler.connect('show-screen', (sender, { screen, additionalData }) => this.showScreen(screen, additionalData)) this.connect('destroy', this._onDestroy.bind(this)) @@ -28,12 +28,12 @@ var ScreenWrapper = GObject.registerClass({ switch (screenName) { case 'edit-task': - screen = new EditTaskScreen(additionalData.item) + screen = new EditTaskScreen(additionalData.item, this._mainEventHandler) break case 'overview': default: - screen = new TaskOverviewScreen() + screen = new TaskOverviewScreen(this._mainEventHandler) break } @@ -43,7 +43,7 @@ var ScreenWrapper = GObject.registerClass({ _onDestroy () { if (this._showScreenConnectId) { - EventHandler.disconnect(this._showScreenConnectId) + this._mainEventHandler.disconnect(this._showScreenConnectId) } } } diff --git a/taskwhisperer-extension@infinicode.de/components/screens/editTaskScreen/editTaskScreen.js b/taskwhisperer-extension@infinicode.de/components/screens/editTaskScreen/editTaskScreen.js index 2f65801..b924ae1 100644 --- a/taskwhisperer-extension@infinicode.de/components/screens/editTaskScreen/editTaskScreen.js +++ b/taskwhisperer-extension@infinicode.de/components/screens/editTaskScreen/editTaskScreen.js @@ -3,7 +3,6 @@ const { Clutter, GObject, St } = imports.gi const ExtensionUtils = imports.misc.extensionUtils const Me = ExtensionUtils.getCurrentExtension() -const { EventHandler } = Me.imports.helpers.eventHandler const { ButtonGroup } = Me.imports.components.buttons.buttonGroup const { SearchBar } = Me.imports.components.searchBar.searchBar const { Translations } = Me.imports.helpers.translations @@ -11,12 +10,13 @@ const { TaskPriority } = Me.imports.services.meta.taskWarrior const { createTask, modifyTask } = Me.imports.services.taskService var EditTaskScreen = GObject.registerClass({}, class EditTaskScreen extends St.BoxLayout { - _init (taskItem) { + _init (taskItem, mainEventHandler) { super._init({ style_class: 'screen edit-task-screen', vertical: true }) + this._mainEventHandler = mainEventHandler this.task = taskItem || {} this.newTask = {} @@ -25,7 +25,8 @@ var EditTaskScreen = GObject.registerClass({}, class EditTaskScreen extends St.B const searchBar = new SearchBar({ back_screen_name: 'overview', showFilterInputBox: false, - showRefreshIcon: false + showRefreshIcon: false, + mainEventHandler: this._mainEventHandler }) this.add_child(searchBar) @@ -161,7 +162,7 @@ var EditTaskScreen = GObject.registerClass({}, class EditTaskScreen extends St.B if (result.error) { this._errorPlaceHolder.text = result.error } else { - EventHandler.emit('show-screen', { + this._mainEventHandler.emit('show-screen', { screen: 'overview' }) } diff --git a/taskwhisperer-extension@infinicode.de/components/screens/taskOverviewScreen/taskOverviewScreen.js b/taskwhisperer-extension@infinicode.de/components/screens/taskOverviewScreen/taskOverviewScreen.js index f6cc31d..828584e 100644 --- a/taskwhisperer-extension@infinicode.de/components/screens/taskOverviewScreen/taskOverviewScreen.js +++ b/taskwhisperer-extension@infinicode.de/components/screens/taskOverviewScreen/taskOverviewScreen.js @@ -5,7 +5,6 @@ const Mainloop = imports.mainloop const ExtensionUtils = imports.misc.extensionUtils const Me = ExtensionUtils.getCurrentExtension() -const { EventHandler } = Me.imports.helpers.eventHandler const { ButtonGroup } = Me.imports.components.buttons.buttonGroup const { IconButton } = Me.imports.components.buttons.iconButton const { FlatList } = Me.imports.components.flatList.flatList @@ -13,7 +12,7 @@ const { TaskCard } = Me.imports.components.cards.taskCard const { SearchBar } = Me.imports.components.searchBar.searchBar const { setTimeout, clearTimeout } = Me.imports.helpers.components const { clearCache } = Me.imports.helpers.data -const { Settings, TASKWHISPERER_PROJECT, TASKWHISPERER_TASK_ORDER, TASKWHISPERER_TASK_STATUS } = Me.imports.helpers.settings +const { SettingsHandler, TASKWHISPERER_PROJECT, TASKWHISPERER_TASK_ORDER, TASKWHISPERER_TASK_STATUS } = Me.imports.helpers.settings const { Translations } = Me.imports.helpers.translations const { TaskOrder, TaskStatus } = Me.imports.services.meta.taskWarrior const { loadProjectsData, loadTaskData } = Me.imports.services.taskService @@ -25,17 +24,21 @@ const SETTING_KEYS_TO_REFRESH = [ ] var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen extends St.BoxLayout { - _init () { + _init (mainEventHandler) { super._init({ style_class: 'screen task-overview-screen', vertical: true }) + this._mainEventHandler = mainEventHandler + this._settings = new SettingsHandler() + this._isRendering = false this._showLoadingInfoTimeoutId = null this._autoRefreshTimeoutId = null const searchBar = new SearchBar({ + mainEventHandler: this._mainEventHandler, additionalIcons: [ new IconButton({ isCustomIcon: true, @@ -43,7 +46,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte icon_name: 'create-symbolic', icon_size: 18, onClick: () => { - EventHandler.emit('show-screen', { + this._mainEventHandler.emit('show-screen', { screen: 'edit-task' }) } @@ -64,7 +67,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte this.connect('destroy', this._onDestroy.bind(this)) - EventHandler.connect('refresh-tasks', () => this._loadData()) + this._mainEventHandler.connect('refresh-tasks', () => this._loadData()) searchBar.connect('refresh', () => { clearCache() this._loadData() @@ -72,7 +75,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte searchBar.connect('text-change', (sender, searchText) => this._filter_results(searchText)) - this._settingsChangedId = Settings.connect('changed', (_, key) => { + this._settingsChangedId = this._settings.connect('changed', (_, key) => { if (SETTING_KEYS_TO_REFRESH.includes(key)) { this._loadData() } @@ -105,7 +108,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte Mainloop.source_remove(this._autoRefreshTimeoutId) } - this._autoRefreshTimeoutId = Mainloop.timeout_add_seconds(Settings.ticker_interval || 30, () => { + this._autoRefreshTimeoutId = Mainloop.timeout_add_seconds(this._settings.ticker_interval || 30, () => { this._loadData() return true @@ -119,12 +122,12 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte try { const { tasks, error } = await loadTaskData({ - project: Settings.project, - taskStatus: Settings.task_status, - taskOrder: Settings.task_order + project: this._settings.project, + taskStatus: this._settings.task_status, + taskOrder: this._settings.task_order }) - EventHandler.emit('refresh-menu-task-count', { + this._mainEventHandler.emit('refresh-menu-task-count', { taskCount: tasks ? tasks.length : '-' }) @@ -142,7 +145,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte this._list.clear_list_items() tasks.forEach(quoteSummary => { - this._list.addItem(new TaskCard(quoteSummary)) + this._list.addItem(new TaskCard(quoteSummary, this._mainEventHandler)) }) } catch (e) { logError(e) @@ -155,10 +158,10 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte } async _createProjectsButtonGroup () { - const projects = await loadProjectsData(Settings.task_status) + const projects = await loadProjectsData(this._settings.task_status) - if (!['all', 'unassigned', ...projects].includes(Settings.project)) { - Settings.project = 'all' + if (!['all', 'unassigned', ...projects].includes(this._settings.project)) { + this._settings.project = 'all' } let buttons = [] @@ -168,17 +171,17 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte { label: Translations.ALL_PROJECT, value: 'all', - selected: Settings.project === 'all' + selected: this._settings.project === 'all' }, ...projects.map(item => ({ label: item, value: item, - selected: Settings.project === item + selected: this._settings.project === item })), { label: Translations.UNASSIGNED_PROJECT, value: 'unassigned', - selected: Settings.project === 'unassigned' + selected: this._settings.project === 'unassigned' } ] } @@ -215,7 +218,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte const buttons = Object.keys(TaskStatus).map(key => ({ label: Translations.TASKS[`SHOW_${key}`], value: TaskStatus[key], - selected: TaskStatus[key] === Settings.task_status + selected: TaskStatus[key] === this._settings.task_status })) const taskStatusButtonGroup = new ButtonGroup({ @@ -240,7 +243,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte const buttons = Object.keys(TaskOrder).map(key => ({ label: Translations.TASKS[`ORDER_BY_${key}`], value: TaskOrder[key], - selected: TaskOrder[key] === Settings.task_order + selected: TaskOrder[key] === this._settings.task_order })) const taskOrderButtonGroup = new ButtonGroup({ @@ -256,15 +259,15 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte } _selectProject (project) { - Settings.project = project + this._settings.project = project } _selectOrder (order) { - Settings.task_order = order + this._settings.task_order = order } _selectStatus (status) { - Settings.task_status = status + this._settings.task_status = status } _onDestroy () { @@ -273,7 +276,7 @@ var TaskOverviewScreen = GObject.registerClass({}, class TaskOverviewScreen exte } if (this._settingsChangedId) { - Settings.disconnect(this._settingsChangedId) + this._settings.disconnect(this._settingsChangedId) } } }) diff --git a/taskwhisperer-extension@infinicode.de/components/searchBar/searchBar.js b/taskwhisperer-extension@infinicode.de/components/searchBar/searchBar.js index d6a08a5..6353ab2 100644 --- a/taskwhisperer-extension@infinicode.de/components/searchBar/searchBar.js +++ b/taskwhisperer-extension@infinicode.de/components/searchBar/searchBar.js @@ -5,7 +5,6 @@ const Util = imports.misc.util const Me = ExtensionUtils.getCurrentExtension() -const { EventHandler } = Me.imports.helpers.eventHandler const { IconButton } = Me.imports.components.buttons.iconButton const { Translations } = Me.imports.helpers.translations @@ -18,12 +17,13 @@ var SearchBar = GObject.registerClass({ 'refresh': {} } }, class SearchBar extends St.BoxLayout { - _init ({ back_screen_name, showFilterInputBox = true, showRefreshIcon = true, additionalIcons } = {}) { + _init ({ back_screen_name, showFilterInputBox = true, showRefreshIcon = true, additionalIcons, mainEventHandler } = {}) { super._init({ style_class: 'search-bar', x_expand: true }) + this._mainEventHandler = mainEventHandler this.back_screen_name = back_screen_name this.additionalIcons = additionalIcons this._showRefreshIcon = showRefreshIcon @@ -48,7 +48,7 @@ var SearchBar = GObject.registerClass({ style_class: 'button navigate-back-icon-button', icon_name: 'go-previous-symbolic', text: Translations.BACK, - onClick: () => EventHandler.emit('show-screen', { screen: this.back_screen_name }) + onClick: () => this._mainEventHandler.emit('show-screen', { screen: this.back_screen_name }) }) searchInputBox.add_child(backIconButton) @@ -107,7 +107,7 @@ var SearchBar = GObject.registerClass({ icon_name: 'emblem-system-symbolic', icon_size: 18, onClick: () => { - EventHandler.emit('hide-panel') + this._mainEventHandler.emit('hide-panel') Util.spawn(['gnome-shell-extension-prefs', 'taskwhisperer-extension@infinicode.de']) } }) diff --git a/taskwhisperer-extension@infinicode.de/extension.js b/taskwhisperer-extension@infinicode.de/extension.js index 6cbc536..239f971 100644 --- a/taskwhisperer-extension@infinicode.de/extension.js +++ b/taskwhisperer-extension@infinicode.de/extension.js @@ -31,10 +31,9 @@ const Me = ExtensionUtils.getCurrentExtension() const { MenuItem } = Me.imports.components.panel.menuItem const { ScreenWrapper } = Me.imports.components.screenWrapper.screenWrapper const { EventHandler } = Me.imports.helpers.eventHandler -const { initTranslations } = Me.imports.helpers.translations -const { Settings } = Me.imports.helpers.settings +const { SettingsHandler } = Me.imports.helpers.settings -const Gettext = imports.gettext.domain('taskwhisperer@infinicode.de') +const Gettext = imports.gettext const _ = Gettext.gettext const Main = imports.ui.main @@ -51,6 +50,9 @@ let TaskWhispererMenuButton = GObject.registerClass(class TaskWhispererMenuButto this._previousPanelPosition = null this._settingsChangedId = null + this._mainEventHandler = new EventHandler() + this._settings = new SettingsHandler() + // Panel menu item - the current class let menuAlignment = 0.25 @@ -61,22 +63,22 @@ let TaskWhispererMenuButton = GObject.registerClass(class TaskWhispererMenuButto super._init(menuAlignment, _('taskwarrior')) this.add_style_class_name('taskwhisperer-extension') - this.add_child(new MenuItem()) + this.add_child(new MenuItem(this._mainEventHandler)) const bin = new St.Widget({ style_class: 'taskwhisperer-extension' }) bin._delegate = this this.menu.box.add_child(bin) - this._screenWrapper = new ScreenWrapper() + this._screenWrapper = new ScreenWrapper(this._mainEventHandler) bin.add_child(this._screenWrapper) // Bind events - EventHandler.connect('hide-panel', () => this.menu.close()) - this._settingsChangedId = Settings.connect('changed', this._sync.bind(this)) + this._mainEventHandler.connect('hide-panel', () => this.menu.close()) + this._settingsChangedId = this._settings.connect('changed', this._sync.bind(this)) this.menu.connect('destroy', this._destroyExtension.bind(this)) this.menu.connect('open-state-changed', (menu, isOpen) => { - EventHandler.emit('open-state-changed', { isOpen }) + this._mainEventHandler.emit('open-state-changed', { isOpen }) }) this._sync() @@ -90,7 +92,7 @@ let TaskWhispererMenuButton = GObject.registerClass(class TaskWhispererMenuButto const container = this.container const parent = container.get_parent() - if (!parent || this._previousPanelPosition === Settings.position_in_panel) { + if (!parent || this._previousPanelPosition === this._settings.position_in_panel) { return } @@ -98,7 +100,7 @@ let TaskWhispererMenuButton = GObject.registerClass(class TaskWhispererMenuButto let children = null - switch (Settings.position_in_panel) { + switch (this._settings.position_in_panel) { case MenuPosition.LEFT: children = Main.panel._leftBox.get_children() Main.panel._leftBox.insert_child_at_index(container, children.length) @@ -113,12 +115,12 @@ let TaskWhispererMenuButton = GObject.registerClass(class TaskWhispererMenuButto break } - this._previousPanelPosition = Settings.position_in_panel + this._previousPanelPosition = this._settings.position_in_panel } _destroyExtension () { if (this._settingsChangedId) { - Settings.disconnect(this._settingsChangedId) + this._settings.disconnect(this._settingsChangedId) } } }) @@ -126,7 +128,7 @@ let TaskWhispererMenuButton = GObject.registerClass(class TaskWhispererMenuButto var taskWhispererMenu function init (extensionMeta) { - initTranslations() + ExtensionUtils.initTranslations() } function enable () { @@ -136,5 +138,7 @@ function enable () { } function disable () { - taskWhispererMenu.destroy() + if (taskWhispererMenu) { + taskWhispererMenu.destroy() + } } diff --git a/taskwhisperer-extension@infinicode.de/helpers/eventHandler.js b/taskwhisperer-extension@infinicode.de/helpers/eventHandler.js index 0d45938..237cd04 100644 --- a/taskwhisperer-extension@infinicode.de/helpers/eventHandler.js +++ b/taskwhisperer-extension@infinicode.de/helpers/eventHandler.js @@ -1,8 +1,6 @@ const { GObject } = imports.gi const Signals = imports.signals -const Handler = class {} +var EventHandler = class EventHandler {} -Signals.addSignalMethods(Handler.prototype) - -var EventHandler = new Handler() +Signals.addSignalMethods(EventHandler.prototype) diff --git a/taskwhisperer-extension@infinicode.de/helpers/settings.js b/taskwhisperer-extension@infinicode.de/helpers/settings.js index 7dc17d7..b57039b 100644 --- a/taskwhisperer-extension@infinicode.de/helpers/settings.js +++ b/taskwhisperer-extension@infinicode.de/helpers/settings.js @@ -1,10 +1,6 @@ -const { Gio, GLib } = imports.gi - const ExtensionUtils = imports.misc.extensionUtils const Me = ExtensionUtils.getCurrentExtension() -const { decodeBase64JsonOrDefault, isNullOrEmpty } = Me.imports.helpers.data - var POSITION_IN_PANEL_KEY = 'position-in-panel' var TASKWHISPERER_ENABLE_TASKD_SYNC = 'enable-taskd-sync' var TASKWHISPERER_SHOW_NO_DATES_AT_END = 'show-no-dates-at-end' @@ -16,52 +12,9 @@ var TASKWHISPERER_PROJECT = 'project' var SETTINGS_SCHEMA_DOMAIN = 'org.gnome.shell.extensions.taskwhisperer' -/** - * getSettings: - * @schemaName: (optional): the GSettings schema id - * - * Builds and return a GSettings schema for @schema, using schema files - * in extensionsdir/schemas. If @schema is not provided, it is taken from - * metadata['settings-schema']. - */ -var getSettings = () => { - const extension = ExtensionUtils.getCurrentExtension() - - const schemaName = SETTINGS_SCHEMA_DOMAIN || extension.metadata['settings-schema'] - - const GioSSS = Gio.SettingsSchemaSource - - // check if this extension was built with "make zip-file", and thus - // has the schema files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell (and therefore schemas are available - // in the standard folders) - const schemaDir = extension.dir.get_child('schemas') - - let schemaSource - - if (schemaDir.query_exists(null)) { - schemaSource = GioSSS.new_from_directory(schemaDir.get_path(), - GioSSS.get_default(), - false) - } else { - schemaSource = GioSSS.get_default() - } - - const schemaObj = schemaSource.lookup(schemaName, true) - - if (!schemaObj) { - throw new Error('Schema ' + schemaName + ' could not be found for extension ' + extension.metadata.uuid + '. Please check your installation.') - } - - return new Gio.Settings({ - settings_schema: schemaObj - }) -} - -const Handler = class { +var SettingsHandler = class SettingsHandler { constructor () { - this._settings = getSettings(SETTINGS_SCHEMA_DOMAIN) + this._settings = ExtensionUtils.getSettings() } get position_in_panel () { @@ -116,5 +69,3 @@ const Handler = class { this._settings.disconnect(connectId) } } - -var Settings = new Handler() diff --git a/taskwhisperer-extension@infinicode.de/helpers/translations.js b/taskwhisperer-extension@infinicode.de/helpers/translations.js index e9b6e96..c92c4c6 100644 --- a/taskwhisperer-extension@infinicode.de/helpers/translations.js +++ b/taskwhisperer-extension@infinicode.de/helpers/translations.js @@ -2,12 +2,6 @@ const Gettext = imports.gettext const _ = Gettext.gettext const ngettext = Gettext.ngettext -const Config = imports.misc.config -const ExtensionUtils = imports.misc.extensionUtils -const Me = ExtensionUtils.getCurrentExtension() - -const { SETTINGS_SCHEMA_DOMAIN } = Me.imports.helpers.settings - var Translations = { BACK: _('back'), FILTER_PLACEHOLDER: _('Filter Tasks'), @@ -40,31 +34,3 @@ var Translations = { DEFAULT_DATE_TIME: _('%H:%M:%S %d.%m.%Y') } } - -/** - * initTranslations: - * @domain: (optional): the gettext domain to use - * - * Initialize Gettext to load translations from extensionsdir/locale. - * If @domain is not provided, it will be taken from metadata['gettext-domain'] - */ -var initTranslations = domain => { - if (Config.PACKAGE_VERSION.startsWith('3.32')) { - ExtensionUtils.initTranslations(domain) - } else { - const extension = ExtensionUtils.getCurrentExtension() - - domain = domain || SETTINGS_SCHEMA_DOMAIN || extension.metadata['gettext-domain'] - - // check if this extension was built with "make zip-file", and thus - // has the locale files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell - const localeDir = extension.dir.get_child('locale') - if (localeDir.query_exists(null)) { - Gettext.bindtextdomain(domain, localeDir.get_path()) - } else { - Gettext.bindtextdomain(domain, Config.LOCALEDIR) - } - } -} diff --git a/taskwhisperer-extension@infinicode.de/metadata.json b/taskwhisperer-extension@infinicode.de/metadata.json index 860165b..366bc41 100644 --- a/taskwhisperer-extension@infinicode.de/metadata.json +++ b/taskwhisperer-extension@infinicode.de/metadata.json @@ -2,6 +2,8 @@ "description": "Taskwhisperer is a extension for TaskWarrior Application https://taskwarrior.org. It is to display upcoming tasks and task details as well as to create and modify them.\n", "localedir": "/usr/local/share/locale", "name": "TaskWhisperer", + "settings-schema": "org.gnome.shell.extensions.taskwhisperer", + "gettext-domain": "gnome-shell-extension-taskwhisperer", "shell-version": [ "40", "41", @@ -9,5 +11,5 @@ ], "url": "https://github.com/cinatic/taskwhisperer", "uuid": "taskwhisperer-extension@infinicode.de", - "version": 21 + "version": 22 } diff --git a/taskwhisperer-extension@infinicode.de/po/de.po b/taskwhisperer-extension@infinicode.de/po/de.po index 12ac95e..3740d25 100644 --- a/taskwhisperer-extension@infinicode.de/po/de.po +++ b/taskwhisperer-extension@infinicode.de/po/de.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: fh@infinicode.de\n" -"POT-Creation-Date: 2022-03-04 14:13+0100\n" +"POT-Creation-Date: 2022-04-16 11:21+0200\n" "PO-Revision-Date: 2016-04-16 23:40+0200\n" "Last-Translator: Florijan Hamzic \n" "Language-Team: German\n" @@ -13,7 +13,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.8.7.1\n" -#: taskwhisperer-extension@infinicode.de/extension.js:61 +#: taskwhisperer-extension@infinicode.de/extension.js:63 msgid "taskwarrior" msgstr "" @@ -119,102 +119,102 @@ msgstr "" msgid "About" msgstr "Über" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:6 msgid "back" msgstr "zurück" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:13 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:7 msgid "Filter Tasks" msgstr "Aufgaben Filtern" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:8 msgid "Loading Data" msgstr "Lade Daten" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:9 msgid "UNKNOWN" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:10 #, javascript-format msgid "%d Task" msgid_plural "%d Tasks" msgstr[0] "%d Aufgabe" msgstr[1] "%d Aufgaben" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:11 msgid "All" msgstr "Alle" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:18 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 msgid "Unassigned" msgstr "Projektlos" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 msgid "↕ Due" msgstr "↕ Fälligkeit" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 #, fuzzy msgid "↕ Urgency" msgstr "↕ Dringlichkeit" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:22 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 msgid "Pending" msgstr "Laufende" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:23 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 msgid "Completed" msgstr "Erledigte" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:19 msgid "High" msgstr "Hoch" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 msgid "Medium" msgstr "Mittel" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 msgid "Low" msgstr "Niedrig" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:24 #, fuzzy msgid "Project" msgstr "Projekt" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:31 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 #, fuzzy msgid "Description" msgstr "Beschreibung" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:32 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 #, fuzzy msgid "Due" msgstr "Fälligkeit" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:33 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 #, fuzzy msgid "Tags" msgstr "Tags" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:28 #, fuzzy msgid "Priority" msgstr "Priorität" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:35 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:29 #, fuzzy msgid "Additional" msgstr "Weitere Parameter" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:36 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 #, fuzzy msgid "Save Task" msgstr "Aufgabe speichern" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:40 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 msgid "%H:%M:%S %d.%m.%Y" msgstr "" diff --git a/taskwhisperer-extension@infinicode.de/po/es.po b/taskwhisperer-extension@infinicode.de/po/es.po index 4640f14..50c34b6 100644 --- a/taskwhisperer-extension@infinicode.de/po/es.po +++ b/taskwhisperer-extension@infinicode.de/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: TaskWhisperer\n" "Report-Msgid-Bugs-To: fh@infinicode.de\n" -"POT-Creation-Date: 2022-03-04 14:13+0100\n" +"POT-Creation-Date: 2022-04-16 11:21+0200\n" "PO-Revision-Date: 2017-03-31 13:38+0200\n" "Last-Translator: Francisco José Rodríguez Bogado \n" "Language-Team: \n" @@ -19,7 +19,7 @@ msgstr "" "X-Generator: Poedit 1.8.11\n" "X-Poedit-SourceCharset: UTF-8\n" -#: taskwhisperer-extension@infinicode.de/extension.js:61 +#: taskwhisperer-extension@infinicode.de/extension.js:63 msgid "taskwarrior" msgstr "" @@ -118,99 +118,99 @@ msgstr "" msgid "About" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:6 msgid "back" msgstr "espalda" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:13 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:7 msgid "Filter Tasks" msgstr "Filtrar tareas" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:8 msgid "Loading Data" msgstr "Cargando datos" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:9 msgid "UNKNOWN" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:10 #, javascript-format msgid "%d Task" msgid_plural "%d Tasks" msgstr[0] "%d tarea" msgstr[1] "%d tareas" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:11 msgid "All" msgstr "Todos" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:18 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 msgid "Unassigned" msgstr "Sin asignar" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 msgid "↕ Due" msgstr "↕ Vencimiento" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 #, fuzzy msgid "↕ Urgency" msgstr "↕ Urgencia" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:22 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 msgid "Pending" msgstr "Pendiente" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:23 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 msgid "Completed" msgstr "Terminada" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:19 msgid "High" msgstr "Alto" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 msgid "Medium" msgstr "Medio" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 msgid "Low" msgstr "Bajo" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:24 msgid "Project" msgstr "Proyecto" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:31 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 #, fuzzy msgid "Description" msgstr "Descripción" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:32 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 #, fuzzy msgid "Due" msgstr "Vencimiento" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:33 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 #, fuzzy msgid "Tags" msgstr "Etiquetas" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:28 #, fuzzy msgid "Priority" msgstr "Prioridad" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:35 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:29 msgid "Additional" msgstr "Adicional" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:36 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 #, fuzzy msgid "Save Task" msgstr "Guardar Tarea" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:40 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 msgid "%H:%M:%S %d.%m.%Y" msgstr "" diff --git a/taskwhisperer-extension@infinicode.de/po/fr.po b/taskwhisperer-extension@infinicode.de/po/fr.po index 69388e3..c2f7eb5 100644 --- a/taskwhisperer-extension@infinicode.de/po/fr.po +++ b/taskwhisperer-extension@infinicode.de/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: fh@infinicode.de\n" -"POT-Creation-Date: 2022-03-04 14:13+0100\n" +"POT-Creation-Date: 2022-04-16 11:21+0200\n" "PO-Revision-Date: 2016-04-16 23:37+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -18,7 +18,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 1.8.7.1\n" -#: taskwhisperer-extension@infinicode.de/extension.js:61 +#: taskwhisperer-extension@infinicode.de/extension.js:63 msgid "taskwarrior" msgstr "" @@ -119,99 +119,99 @@ msgstr "" msgid "About" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:6 msgid "back" msgstr "retour" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:13 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:7 msgid "Filter Tasks" msgstr "Filtrer les tâches" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:8 msgid "Loading Data" msgstr "Chargement des données" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:9 msgid "UNKNOWN" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:10 #, javascript-format msgid "%d Task" msgid_plural "%d Tasks" msgstr[0] "%d Tâche" msgstr[1] "%d Tâches" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:11 msgid "All" msgstr "Toute" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:18 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 msgid "Unassigned" msgstr "Non attribué" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 msgid "↕ Due" msgstr "↕ Payable" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 msgid "↕ Urgency" msgstr "↕ Urgence" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:22 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 msgid "Pending" msgstr "En attente" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:23 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 msgid "Completed" msgstr "Complété" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:19 msgid "High" msgstr "Haut" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 msgid "Medium" msgstr "Moyen" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 msgid "Low" msgstr "Faible" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:24 msgid "Project" msgstr "Projet" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:31 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 #, fuzzy msgid "Description" msgstr "Description" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:32 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 #, fuzzy msgid "Due" msgstr "Échéance" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:33 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 #, fuzzy msgid "Tags" msgstr "Tags" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:28 msgid "Priority" msgstr "Priorité" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:35 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:29 #, fuzzy msgid "Additional" msgstr "Arguments additionnels" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:36 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 #, fuzzy msgid "Save Task" msgstr "Enregistrer la tâche" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:40 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 #, fuzzy msgid "%H:%M:%S %d.%m.%Y" msgstr "%H:%M %A %d. %b. %Y" diff --git a/taskwhisperer-extension@infinicode.de/po/nl.po b/taskwhisperer-extension@infinicode.de/po/nl.po index 3b5e550..9338399 100644 --- a/taskwhisperer-extension@infinicode.de/po/nl.po +++ b/taskwhisperer-extension@infinicode.de/po/nl.po @@ -7,18 +7,18 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extension-taskwhisperer-extension\n" "Report-Msgid-Bugs-To: fh@infinicode.de\n" -"POT-Creation-Date: 2021-04-17 22:13+0200\n" +"POT-Creation-Date: 2022-04-16 11:21+0200\n" "PO-Revision-Date: 2021-07-14 18:18+0200\n" +"Last-Translator: Heimen Stoffels \n" "Language-Team: \n" +"Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 3.0\n" -"Last-Translator: Heimen Stoffels \n" -"Language: nl\n" -#: taskwhisperer-extension@infinicode.de/extension.js:60 +#: taskwhisperer-extension@infinicode.de/extension.js:63 msgid "taskwarrior" msgstr "taskwarrior" @@ -123,93 +123,93 @@ msgstr "" msgid "About" msgstr "Over" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:6 msgid "back" msgstr "Terug" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:13 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:7 msgid "Filter Tasks" msgstr "Taken filteren" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:8 msgid "Loading Data" msgstr "Bezig met laden van gegevens…" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:9 msgid "UNKNOWN" msgstr "ONBEKEND" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:10 #, javascript-format msgid "%d Task" msgid_plural "%d Tasks" msgstr[0] "%d taak" msgstr[1] "%d taken" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:11 msgid "All" msgstr "Alle" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:18 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 msgid "Unassigned" msgstr "Niet-toegewezen" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 msgid "↕ Due" msgstr "↕ Einddatum" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 msgid "↕ Urgency" msgstr "↕ Urgentie" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:22 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 msgid "Pending" msgstr "In uitvoering" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:23 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 msgid "Completed" msgstr "Afgerond" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:19 msgid "High" msgstr "Hoog" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 msgid "Medium" msgstr "Gemiddeld" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 msgid "Low" msgstr "Laag" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:24 msgid "Project" msgstr "Project" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:31 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 msgid "Description" msgstr "Omschrijving" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:32 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 msgid "Due" msgstr "Einddatum" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:33 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 msgid "Tags" msgstr "Labels" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:28 msgid "Priority" msgstr "Prioriteit" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:35 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:29 msgid "Additional" msgstr "Aanvullend" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:36 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 msgid "Save Task" msgstr "Taak opslaan" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:40 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 msgid "%H:%M:%S %d.%m.%Y" msgstr "%H:%M:%S %d %m %Y" diff --git a/taskwhisperer-extension@infinicode.de/po/taskwhisperer-extension@infinicode.de.pot b/taskwhisperer-extension@infinicode.de/po/taskwhisperer-extension@infinicode.de.pot index 854782a..77d4aca 100644 --- a/taskwhisperer-extension@infinicode.de/po/taskwhisperer-extension@infinicode.de.pot +++ b/taskwhisperer-extension@infinicode.de/po/taskwhisperer-extension@infinicode.de.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extension-taskwhisperer-extension\n" "Report-Msgid-Bugs-To: fh@infinicode.de\n" -"POT-Creation-Date: 2022-03-04 14:13+0100\n" +"POT-Creation-Date: 2022-04-16 11:23+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: taskwhisperer-extension@infinicode.de/extension.js:61 +#: taskwhisperer-extension@infinicode.de/extension.js:63 msgid "taskwarrior" msgstr "" @@ -115,93 +115,93 @@ msgstr "" msgid "About" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:6 msgid "back" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:13 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:7 msgid "Filter Tasks" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:8 msgid "Loading Data" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:9 msgid "UNKNOWN" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:10 #, javascript-format msgid "%d Task" msgid_plural "%d Tasks" msgstr[0] "" msgstr[1] "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:11 msgid "All" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:18 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:12 msgid "Unassigned" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:14 msgid "↕ Due" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:15 msgid "↕ Urgency" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:22 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:16 msgid "Pending" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:23 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:17 msgid "Completed" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:19 msgid "High" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:20 msgid "Medium" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:21 msgid "Low" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:24 msgid "Project" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:31 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:25 msgid "Description" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:32 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:26 msgid "Due" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:33 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:27 msgid "Tags" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:28 msgid "Priority" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:35 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:29 msgid "Additional" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:36 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:30 msgid "Save Task" msgstr "" -#: taskwhisperer-extension@infinicode.de/helpers/translations.js:40 +#: taskwhisperer-extension@infinicode.de/helpers/translations.js:34 msgid "%H:%M:%S %d.%m.%Y" msgstr "" diff --git a/taskwhisperer-extension@infinicode.de/prefs.js b/taskwhisperer-extension@infinicode.de/prefs.js index 22202fa..459e348 100644 --- a/taskwhisperer-extension@infinicode.de/prefs.js +++ b/taskwhisperer-extension@infinicode.de/prefs.js @@ -4,9 +4,7 @@ const Config = imports.misc.config const ExtensionUtils = imports.misc.extensionUtils const Me = ExtensionUtils.getCurrentExtension() -const Settings = Me.imports.helpers.settings - -const { initTranslations } = Me.imports.helpers.translations +const { SETTINGS_SCHEMA_DOMAIN } = Me.imports.helpers.settings const EXTENSIONDIR = Me.dir.get_path() @@ -73,7 +71,7 @@ var PrefsWidget = GObject.registerClass({ } loadConfig () { - this.Settings = Settings.getSettings() + this.Settings = ExtensionUtils.getSettings() } }) @@ -103,7 +101,7 @@ const isGnome4 = () => Config.PACKAGE_VERSION.startsWith('4') // this is called when settings has been opened var init = () => { - initTranslations(Settings.SETTINGS_SCHEMA_DOMAIN) + ExtensionUtils.initTranslations() } function buildPrefsWidget () { diff --git a/taskwhisperer-extension@infinicode.de/services/taskService.js b/taskwhisperer-extension@infinicode.de/services/taskService.js index df09cdf..391b7e5 100644 --- a/taskwhisperer-extension@infinicode.de/services/taskService.js +++ b/taskwhisperer-extension@infinicode.de/services/taskService.js @@ -33,7 +33,7 @@ const { run } = Me.imports.helpers.subprocess const { Task } = Me.imports.services.dto.task const { TaskStatus, TaskOrder } = Me.imports.services.meta.taskWarrior -const { Settings } = Me.imports.helpers.settings +const { SettingsHandler } = Me.imports.helpers.settings var loadTaskData = async ({ taskStatus, project, taskOrder }) => { let statusFilter = 'status:Pending' @@ -223,7 +223,8 @@ var modifyTask = async (taskUUID, task) => { } var syncTasks = async () => { - if (!Settings.enable_taskd_sync) { + const settings = new SettingsHandler() + if (!settings.enable_taskd_sync) { return } @@ -276,10 +277,12 @@ const _convertTaskToParams = task => { } const _sortByDue = (a, b) => { + const settings = new SettingsHandler() + let dueA let dueB - if (Settings.show_no_dates_at_end) { + if (settings.show_no_dates_at_end) { dueA = a.Due || '999999999999999' dueB = b.Due || '999999999999999' } else {