From 097750f67db41cca905557ef34dad658bfd7a382 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Mon, 10 Mar 2025 17:30:37 -0400 Subject: [PATCH] Remove donation page and icon gh-2259 --- po/fr.po | 33 ---- po/pl.po | 33 ---- po/uk.po | 33 ---- ...shell.extensions.dash-to-panel.gschema.xml | 4 - src/appIcons.js | 5 +- src/extension.js | 5 - src/overview.js | 5 +- src/prefs.js | 33 ---- src/taskbar.js | 80 +------- ui/SettingsDonation.ui | 171 ------------------ 10 files changed, 4 insertions(+), 398 deletions(-) delete mode 100644 ui/SettingsDonation.ui diff --git a/po/fr.po b/po/fr.po index ce97532..c037329 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1278,39 +1278,6 @@ msgstr "Clic région vide pour fermer Activités" msgid "Disable show overview on startup" msgstr "Désactiver le démarrage en mode Activités" -#: ui/SettingsDonation.ui.h:1 -msgid "Donation" -msgstr "Don" - -#: ui/SettingsDonation.ui.h:2 -msgid "" -"Gnome is the best desktop environment. No question. But " -"if you're like me and would never use it without the enhanced workflow that " -"Dash to Panel provides, please support my work by making a donation." -msgstr "" -"Gnome est le meilleur environnement de bureau. Aucun " -"doute. Mais si vous êtes comme moi et que vous ne l'utiliseriez jamais sans " -"le flux de travail amélioré offert par Dash to Panel, s'il vous plaît, " -"soutenez mon travail en faisant un don." - -#: ui/SettingsDonation.ui.h:3 -msgid "" -"I know you're thinking \"I don't have time for this\", but consider that " -"I've poured countless volunteer hours into making Dash to Panel a quality " -"extension that is useful to YOU! :)" -msgstr "" -"Vous vous dites surement « pas le temps pour ça », mais considérez que j'ai " -"investi un nombre incalculable d'heures de bénévolat pour faire de Dash to " -"Panel une extension de qualité qui est utile pour VOUS! :)" - -#: ui/SettingsDonation.ui.h:4 -msgid "" -"Thanks for your time!\n" -"If you like, you can now hide the donate icon" -msgstr "" -"Merci pour votre temps!\n" -"Si vous voulez, vous pouvez cacher l'icône de don" - #: ui/SettingsFineTune.ui.h:1 msgid "Fine-Tune" msgstr "Personnalisation" diff --git a/po/pl.po b/po/pl.po index dfe9fa8..6e74f01 100644 --- a/po/pl.po +++ b/po/pl.po @@ -3041,39 +3041,6 @@ msgstr "Kliknij na pustą przestrzeń, aby zamknąć przegląd" msgid "Disable show overview on startup" msgstr "Wyłącz pokazywanie przeglądu przy uruchomieniu" -#: ui/SettingsDonation.ui:10 -msgid "Donation" -msgstr "Darowizna" - -#: ui/SettingsDonation.ui:36 -msgid "" -"Gnome is the best desktop environment. No question. But " -"if you're like me and would never use it without the enhanced workflow that " -"Dash to Panel provides, please support my work by making a donation." -msgstr "" -"Gnome to najlepsze środowisko graficzne. Bez dwóch " -"zdań. Ale jeśli jesteś taki jak ja i nigdy byś z niego nie korzystał bez " -"ulepszonego przepływu pracy, jaki zapewnia Dash to Panel, proszę, wesprzyj " -"moją pracę, dokonując darowizny." - -#: ui/SettingsDonation.ui:45 -msgid "" -"I know you're thinking \"I don't have time for this\", but consider that " -"I've poured countless volunteer hours into making Dash to Panel a quality " -"extension that is useful to YOU! :)" -msgstr "" -"Wiem, że myślisz \"Nie mam na to czasu\", ale weź pod uwagę, że poświęciłem " -"niezliczone godziny wolontariatu, aby Dash to Panel było wysokiej jakości " -"rozszerzeniem, które jest przydatne DLA CIEBIE! :)" - -#: ui/SettingsDonation.ui:151 -msgid "" -"Thanks for your time!\n" -"If you like, you can now hide the donate icon" -msgstr "" -"Dziękuję za Twój czas!\n" -"Jeśli chcesz, możesz teraz ukryć ikonę darowizny" - #: ui/SettingsFineTune.ui:38 msgid "Fine-Tune" msgstr "Dostrajanie" diff --git a/po/uk.po b/po/uk.po index 9f806d8..2577865 100644 --- a/po/uk.po +++ b/po/uk.po @@ -1265,39 +1265,6 @@ msgstr "Клацання на пустому місці закриває «Ог msgid "Disable show overview on startup" msgstr "Не показувати «Огляд» під час запуску" -#: ui/SettingsDonation.ui:10 -msgid "Donation" -msgstr "Підтримка" - -#: ui/SettingsDonation.ui:36 -msgid "" -"Gnome is the best desktop environment. No question. But " -"if you're like me and would never use it without the enhanced workflow that " -"Dash to Panel provides, please support my work by making a donation." -msgstr "" -"Gnome - це найкраще стільничне середовище. В цьому " -"немає сумнівів. Проте, якщо ви, як і як, ніколи б не використовували його " -"без покращень робочого процесу, що надає Dash to Panel, будь ласка, " -"підтримайте фінансово мою роботу." - -#: ui/SettingsDonation.ui:45 -msgid "" -"I know you're thinking \"I don't have time for this\", but consider that " -"I've poured countless volunteer hours into making Dash to Panel a quality " -"extension that is useful to YOU! :)" -msgstr "" -"Я знаю, що ви думаєте \"У мене немає часу на це\", проте зауважте, що я " -"витратив незліченну кількість волонтерських годин задля того, щоб розширення " -"Dash to Panel було якісним та корисним для ВАС! :)" - -#: ui/SettingsDonation.ui:170 -msgid "" -"Thanks for your time!\n" -"If you like, you can now hide the donate icon" -msgstr "" -"Дякую за ваш час!\n" -"Якщо бажаєте, ви можете приховати піктограму фінансової підтримки" - #: ui/SettingsFineTune.ui:38 msgid "Fine-Tune" msgstr "Доналаштування" diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index cb2bf40..9107517 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -1353,10 +1353,6 @@ false Track if the preferences window is opened - - '' - Unix time when the donate icon was hidden - 65 Installed extension version diff --git a/src/appIcons.js b/src/appIcons.js index 295f69a..ab0c3f6 100644 --- a/src/appIcons.js +++ b/src/appIcons.js @@ -1957,10 +1957,10 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu { super.setApp(app) // set "App Details" menu item visibility - this._setAppDetailsVisibility(app) + this._setAppDetailsVisibility() } - _setAppDetailsVisibility(app) { + _setAppDetailsVisibility() { // This next line sets the app details menu to visible if Gnome Software is // installed. If it isn't, no point of showing the menu anyway because // its only purpose is to open Gnome Software @@ -1970,7 +1970,6 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu { this._detailsItem.visible = gnomeSoftwareIsInstalled && - !app.hideDetails && SETTINGS.get_boolean('secondarymenu-contains-showdetails') } } diff --git a/src/extension.js b/src/extension.js index 4dba5f5..f6387e3 100644 --- a/src/extension.js +++ b/src/extension.js @@ -85,11 +85,6 @@ export default class DashToPanelExtension extends Extension { // To remove later, try to map settings using monitor indexes to monitor ids PanelSettings.adjustMonitorSettings(SETTINGS) - // show the donate icon every 360 days (31104000000 milliseconds) - let donateIconUnixtime = SETTINGS.get_string('hide-donate-icon-unixtime') - if (donateIconUnixtime && donateIconUnixtime < Date.now() - 31104000000) - SETTINGS.set_string('hide-donate-icon-unixtime', '') - // if new version, display a notification linking to release notes if (this.metadata.version != SETTINGS.get_int('extension-version')) { Utils.notify( diff --git a/src/overview.js b/src/overview.js index edfe7bf..de2abe9 100644 --- a/src/overview.js +++ b/src/overview.js @@ -213,10 +213,7 @@ export const Overview = class { let apps = [] this.taskbar._getAppIcons().forEach((appIcon) => { - if ( - (!appIcon.app.hideDetails && !seenApps[appIcon.app]) || - this.taskbar.allowSplitApps - ) { + if (!seenApps[appIcon.app] || this.taskbar.allowSplitApps) { apps.push(appIcon) } diff --git a/src/prefs.js b/src/prefs.js index 24f087e..e8dd2a4 100644 --- a/src/prefs.js +++ b/src/prefs.js @@ -213,10 +213,6 @@ const Preferences = class { let pageFineTune = this._builder.get_object('finetune') window.add(pageFineTune) - this._builder.add_from_file(this._path + '/ui/SettingsDonation.ui') - let pageDonation = this._builder.get_object('donation') - window.add(pageDonation) - this._builder.add_from_file(this._path + '/ui/SettingsAbout.ui') let pageAbout = this._builder.get_object('about') window.add(pageAbout) @@ -3645,35 +3641,6 @@ const Preferences = class { }, ) }) - - // Donation panel - - let donationIconSwitch = this._builder.get_object('donation_icon_switch') - let hiddenDonateIcon = !!this._settings.get_string( - 'hide-donate-icon-unixtime', - ) - - this._builder - .get_object('donation_logo') - .set_from_file(`${this._path}/img/dash-to-panel-logo-light.svg`) - this._builder - .get_object('paypal_logo') - .set_from_file(`${this._path}/img/paypal.png`) - this._builder - .get_object('stripe_logo') - .set_from_file(`${this._path}/img/stripe.png`) - this._builder - .get_object('kofi_logo') - .set_from_file(`${this._path}/img/kofi.png`) - - donationIconSwitch.set_active(hiddenDonateIcon) - - donationIconSwitch.connect('notify::active', (widget) => - this._settings.set_string( - 'hide-donate-icon-unixtime', - widget.get_active() ? Date.now().toString() : '', - ), - ) } _setPreviewTitlePosition() { diff --git a/src/taskbar.js b/src/taskbar.js index f54e8bc..d987582 100644 --- a/src/taskbar.js +++ b/src/taskbar.js @@ -34,7 +34,6 @@ import * as Dash from 'resource:///org/gnome/shell/ui/dash.js' import * as DND from 'resource:///org/gnome/shell/ui/dnd.js' import * as Main from 'resource:///org/gnome/shell/ui/main.js' import { EventEmitter } from 'resource:///org/gnome/shell/misc/signals.js' -import { gettext as _ } from 'resource:///org/gnome/shell/extensions/extension.js' import * as AppIcons from './appIcons.js' import * as PanelManager from './panelManager.js' @@ -42,7 +41,7 @@ import * as PanelSettings from './panelSettings.js' import * as Pos from './panelPositions.js' import * as Utils from './utils.js' import * as WindowPreview from './windowPreview.js' -import { DTP_EXTENSION, SETTINGS, tracker } from './extension.js' +import { SETTINGS, tracker } from './extension.js' const SearchController = Main.overview.searchController @@ -55,68 +54,6 @@ export const MIN_ICON_SIZE = 4 const T1 = 'ensureAppIconVisibilityTimeout' const T2 = 'showLabelTimeout' const T3 = 'resetHoverTimeout' -const T4 = 'donateAppTimeout' - -let donateDummyApp = { - hideDetails: true, - app_info: { - should_show: () => false, - list_actions: () => ['opts'], - get_action_name: (action) => - action == 'opts' ? _('Hide and donation options') : '', - }, - connect: () => [], - disconnect: () => false, - connectObject: () => [], - get_id: () => 'dtp_donate', - get_windows: () => [], - can_open_new_window: () => false, - is_window_backed: () => false, - launch_action: function (action) { - action == 'opts' ? this.activate() : null - }, - get_name: function () { - return this.isActive() ? _('Thank you!') : _('Please donate :)') - }, - create_icon_texture: function (size) { - let iconParams = { - icon_name: this.isActive() - ? 'face-smile-big-symbolic' - : 'emote-love-symbolic', - icon_size: size, - } - - if (SETTINGS.get_string('appicon-style') !== 'SYMBOLIC') - iconParams.style = `color: ${this.isActive() ? '#FFC730' : '#C71807'}` - - return new St.Icon(iconParams) - }, - activate: function () { - SETTINGS.set_string('target-prefs-page', 'donation') - DTP_EXTENSION.openPreferences() - - if (this.isActive()) return - - this._taskbar._timeoutsHandler.add([T4, 5000, this.forceRefresh.bind(this)]) - this.forceRefresh() - }, - forceRefresh: function () { - setDonateApp.call(this._taskbar) - this._taskbar._queueRedisplay() - }, - isActive: function () { - return !!this._taskbar._timeoutsHandler.getId(T4) - }, -} - -function setDonateApp() { - delete this._donateApp - - if (!SETTINGS.get_string('hide-donate-icon-unixtime')) { - this._donateApp = Object.create(donateDummyApp) - this._donateApp._taskbar = this - } -} /** * Extend DashItemContainer @@ -452,7 +389,6 @@ export const Taskbar = class extends EventEmitter { 'changed::show-favorites', 'changed::show-running-apps', 'changed::show-favorites-all-monitors', - 'changed::hide-donate-icon-unixtime', ], () => { setAttributes() @@ -497,8 +433,6 @@ export const Taskbar = class extends EventEmitter { this.showRunningApps = SETTINGS.get_boolean('show-running-apps') this.allowSplitApps = this.usingLaunchers || (!this.isGroupApps && !this.showFavorites) - - setDonateApp.call(this) } setAttributes() @@ -1097,16 +1031,6 @@ export const Taskbar = class extends EventEmitter { ) } - if (this._donateApp) - appInfos = [ - ...appInfos, - { - app: this._donateApp, - isLauncher: true, - windows: [], - }, - ] - return appInfos } @@ -1296,8 +1220,6 @@ export const Taskbar = class extends EventEmitter { if (this.dtpPanel.isPrimary) hotkeyAppNumbers = {} this._getAppIcons().forEach((icon) => { - if (icon.app == this._donateApp) return - if ( this.dtpPanel.isPrimary && (!hotkeyAppNumbers[icon.app] || this.allowSplitApps) diff --git a/ui/SettingsDonation.ui b/ui/SettingsDonation.ui deleted file mode 100644 index 48e01ab..0000000 --- a/ui/SettingsDonation.ui +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - True - emote-love-symbolic - donation - Donation - - - - - center - 50 - 50 - 16 - - - error - emote-love-symbolic - 48 - - - - - - - - - - center - <span size="large">Gnome is the best desktop environment. No question. But if you're like me and would never use it without the enhanced workflow that Dash to Panel provides, please support my work by making a donation.</span> - 40 - True - True - - - - - center - I know you're thinking "I don't have time for this", but consider that I've poured countless volunteer hours into making Dash to Panel a quality extension that is useful to YOU! :) - 60 - True - True - - - - - center - 60 - 40 - center - - - - - center - 6 - center - - - - - - Paypal - 6 - - - - - button - https://www.paypal.com/donate/?hosted_button_id=5DCVELP7BSAVQ - - - - - - - center - 6 - center - - - - - - Stripe - 6 - - - - - button - https://donate.stripe.com/9AQg1g8sA5EY1y07ss - - - - - - - center - 6 - center - - - - - - Ko-fi - 6 - - - - - button - https://ko-fi.com/charlesgagnon - - - - - - - center - 4 - - - center - start - - - start - <span size="9000">Thanks for your time! -If you like, you can now hide the donate icon</span> - 10 - True - center - - - - - end - center - - - - - - - - - -