From 6df08af61a555e269f21468004ed8817557a3a13 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 25 Jan 2023 12:27:42 +0100 Subject: [PATCH 1/4] Remove 'Use monochrome icons' checkbox from settings UI Signed-off-by: Claudio Cambra --- src/gui/generalsettings.ui | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/gui/generalsettings.ui b/src/gui/generalsettings.ui index 00cbeb14953b2..2e61fc0c9d833 100644 --- a/src/gui/generalsettings.ui +++ b/src/gui/generalsettings.ui @@ -7,7 +7,7 @@ 0 0 556 - 563 + 573 @@ -66,16 +66,6 @@ General Settings - - - - For System Tray - - - Use &Monochrome Icons - - - @@ -343,7 +333,6 @@ autostartCheckBox serverNotificationsCheckBox - monoIconsCheckBox ignoredFilesButton newFolderLimitCheckBox newFolderLimitSpinBox From 688126c003d01c233d2cb321e323ade54fb44fea Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 25 Jan 2023 12:32:06 +0100 Subject: [PATCH 2/4] Remove mono icons setting from generalsettings Signed-off-by: Claudio Cambra --- src/gui/generalsettings.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 6a5164a265382..429c759272f79 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -182,7 +182,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) //slotUpdateInfo(); // misc - connect(_ui->monoIconsCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings); connect(_ui->crashreporterCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings); connect(_ui->newFolderLimitCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings); connect(_ui->newFolderLimitSpinBox, static_cast(&QSpinBox::valueChanged), this, &GeneralSettings::saveMiscSettings); @@ -216,10 +215,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) _ui->horizontalLayout_3->getContentsMargins(&m0, &m1, &m2, &m3); _ui->horizontalLayout_3->setContentsMargins(0, m1, m2, m3); - // OEM themes are not obliged to ship mono icons, so there - // is no point in offering an option - _ui->monoIconsCheckBox->setVisible(Theme::instance()->monoIconsAvailable()); - connect(_ui->ignoredFilesButton, &QAbstractButton::clicked, this, &GeneralSettings::slotIgnoreFilesEditor); connect(_ui->debugArchiveButton, &QAbstractButton::clicked, this, &GeneralSettings::slotCreateDebugArchive); @@ -246,7 +241,6 @@ void GeneralSettings::loadMiscSettings() { QScopedValueRollback scope(_currentlyLoading, true); ConfigFile cfgFile; - _ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons()); _ui->serverNotificationsCheckBox->setChecked(cfgFile.optionalServerNotifications()); _ui->callNotificationsCheckBox->setEnabled(_ui->serverNotificationsCheckBox->isEnabled()); _ui->callNotificationsCheckBox->setChecked(cfgFile.showCallNotifications()); @@ -256,7 +250,6 @@ void GeneralSettings::loadMiscSettings() _ui->newFolderLimitCheckBox->setChecked(newFolderLimit.first); _ui->newFolderLimitSpinBox->setValue(newFolderLimit.second); _ui->newExternalStorage->setChecked(cfgFile.confirmExternalStorage()); - _ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons()); } #if defined(BUILD_UPDATER) @@ -420,9 +413,6 @@ void GeneralSettings::saveMiscSettings() if (_currentlyLoading) return; ConfigFile cfgFile; - bool isChecked = _ui->monoIconsCheckBox->isChecked(); - cfgFile.setMonoIcons(isChecked); - Theme::instance()->setSystrayUseMonoIcons(isChecked); cfgFile.setCrashReporter(_ui->crashreporterCheckBox->isChecked()); cfgFile.setNewBigFolderSizeLimit(_ui->newFolderLimitCheckBox->isChecked(), From 0aee2bc2eb656a863988af9ca5608db8803d867e Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 25 Jan 2023 12:42:47 +0100 Subject: [PATCH 3/4] Remove monoIcons-related functionality from theme Signed-off-by: Claudio Cambra --- src/gui/application.cpp | 8 -------- src/gui/application.h | 1 - src/libsync/theme.cpp | 17 ----------------- src/libsync/theme.h | 16 ---------------- 4 files changed, 42 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 3a262a305b671..907d87facd2a0 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -360,9 +360,6 @@ Application::Application(int &argc, char **argv) setQuitOnLastWindowClosed(false); - _theme->setSystrayUseMonoIcons(cfg.monoIcons()); - connect(_theme, &Theme::systrayUseMonoIconsChanged, this, &Application::slotUseMonoIconsChanged); - // Setting up the gui class will allow tray notifications for the // setup that follows, like folder setup _gui = new ownCloudGui(this); @@ -571,11 +568,6 @@ void Application::setupLogging() qCInfo(lcApplication) << "Arguments:" << qApp->arguments(); } -void Application::slotUseMonoIconsChanged(bool) -{ - _gui->slotComputeOverallSyncStatus(); -} - void Application::slotParseMessage(const QString &msg, QObject *) { if (msg.startsWith(QLatin1String("MSG_PARSEOPTIONS:"))) { diff --git a/src/gui/application.h b/src/gui/application.h index 5bd412077eda4..67fd836e9471a 100644 --- a/src/gui/application.h +++ b/src/gui/application.h @@ -100,7 +100,6 @@ public slots: protected slots: void slotParseMessage(const QString &, QObject *); void slotCheckConnection(); - void slotUseMonoIconsChanged(bool); void slotCleanup(); void slotAccountStateAdded(OCC::AccountState *accountState); void slotAccountStateRemoved(OCC::AccountState *accountState); diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index caee23bc361e6..732bd0948682f 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -480,23 +480,6 @@ QString Theme::systrayIconFlavor(bool mono) const return flavor; } -void Theme::setSystrayUseMonoIcons(bool mono) -{ - _mono = mono; - emit systrayUseMonoIconsChanged(mono); -} - -bool Theme::systrayUseMonoIcons() const -{ - return _mono; -} - -bool Theme::monoIconsAvailable() const -{ - QString themeDir = QString(Theme::themePrefix) + QString::fromLatin1("%1/").arg(Theme::instance()->systrayIconFlavor(true)); - return QDir(themeDir).exists(); -} - QString Theme::updateCheckUrl() const { return APPLICATION_UPDATE_URL; diff --git a/src/libsync/theme.h b/src/libsync/theme.h index de721f71c273a..7c6e42ba37a1b 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -340,21 +340,6 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject */ virtual QString aboutDetails() const; - /** - * Define if the systray icons should be using mono design - */ - void setSystrayUseMonoIcons(bool mono); - - /** - * Retrieve wether to use mono icons for systray - */ - bool systrayUseMonoIcons() const; - - /** - * Check if mono icons are available - */ - bool monoIconsAvailable() const; - /** * @brief Where to check for new Updates. */ @@ -612,7 +597,6 @@ public slots: Theme(); signals: - void systrayUseMonoIconsChanged(bool); void systemPaletteChanged(const QPalette &palette); void darkModeChanged(); void overrideServerUrlChanged(); From 8f2dcf4ca3122cd8f4b7d5072337e0a90890ac4f Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 25 Jan 2023 12:56:26 +0100 Subject: [PATCH 4/4] Remove monoIcons related things from configfile Signed-off-by: Claudio Cambra --- src/libsync/configfile.cpp | 18 ------------------ src/libsync/configfile.h | 3 --- 2 files changed, 21 deletions(-) diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 08064026f4058..16cb45576a396 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -56,7 +56,6 @@ static constexpr char remotePollIntervalC[] = "remotePollInterval"; static constexpr char forceSyncIntervalC[] = "forceSyncInterval"; static constexpr char fullLocalDiscoveryIntervalC[] = "fullLocalDiscoveryInterval"; static constexpr char notificationRefreshIntervalC[] = "notificationRefreshInterval"; -static constexpr char monoIconsC[] = "monoIcons"; static constexpr char promptDeleteC[] = "promptDeleteAllFiles"; static constexpr char crashReporterC[] = "crashReporter"; static constexpr char optionalServerNotificationsC[] = "optionalServerNotifications"; @@ -947,23 +946,6 @@ void ConfigFile::setPromptDeleteFiles(bool promptDeleteFiles) settings.setValue(QLatin1String(promptDeleteC), promptDeleteFiles); } -bool ConfigFile::monoIcons() const -{ - QSettings settings(configFile(), QSettings::IniFormat); - bool monoDefault = false; // On Mac we want bw by default -#ifdef Q_OS_MAC - // OEM themes are not obliged to ship mono icons - monoDefault = QByteArrayLiteral("Nextcloud") == QByteArrayLiteral(APPLICATION_NAME); -#endif - return settings.value(QLatin1String(monoIconsC), monoDefault).toBool(); -} - -void ConfigFile::setMonoIcons(bool useMonoIcons) -{ - QSettings settings(configFile(), QSettings::IniFormat); - settings.setValue(QLatin1String(monoIconsC), useMonoIcons); -} - bool ConfigFile::crashReporter() const { QSettings settings(configFile(), QSettings::IniFormat); diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h index 719cce0835ada..d7d6f4ebeabb2 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -83,9 +83,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile */ [[nodiscard]] std::chrono::milliseconds fullLocalDiscoveryInterval() const; - [[nodiscard]] bool monoIcons() const; - void setMonoIcons(bool); - [[nodiscard]] bool promptDeleteFiles() const; void setPromptDeleteFiles(bool promptDeleteFiles);