diff --git a/NEXTCLOUD.cmake b/NEXTCLOUD.cmake index 6c4e146d504a..a3c2150ca570 100644 --- a/NEXTCLOUD.cmake +++ b/NEXTCLOUD.cmake @@ -50,11 +50,11 @@ option( DO_NOT_USE_PROXY "Do not use system wide proxy, instead always do a dire ## Theming options set(NEXTCLOUD_BACKGROUND_COLOR "#0082c9" CACHE STRING "Default Nextcloud background color") +set( NEXTCLOUD_SETTINGS_WIDGET_VISIBLE ON ) set( APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR ${NEXTCLOUD_BACKGROUND_COLOR} CACHE STRING "Hex color of the wizard header background") set( APPLICATION_WIZARD_HEADER_TITLE_COLOR "#ffffff" CACHE STRING "Hex color of the text in the wizard header") option( APPLICATION_WIZARD_USE_CUSTOM_LOGO "Use the logo from ':/client/theme/colored/wizard_logo.(png|svg)' else the default application icon is used" ON ) - # ## Windows Shell Extensions & MSI - IMPORTANT: Generate new GUIDs for custom builds with "guidgen" or "uuidgen" # diff --git a/config.h.in b/config.h.in index ca9907c52f29..055678bd9afa 100644 --- a/config.h.in +++ b/config.h.in @@ -28,6 +28,7 @@ #cmakedefine LINUX_APPLICATION_ID "@LINUX_APPLICATION_ID@" #cmakedefine APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR "@APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR@" #cmakedefine NEXTCLOUD_BACKGROUND_COLOR "@NEXTCLOUD_BACKGROUND_COLOR@" +#cmakedefine NEXTCLOUD_SETTINGS_WIDGET_VISIBLE "@NEXTCLOUD_SETTINGS_WIDGET_VISIBLE@" #cmakedefine APPLICATION_WIZARD_HEADER_TITLE_COLOR "@APPLICATION_WIZARD_HEADER_TITLE_COLOR@" #cmakedefine APPLICATION_WIZARD_USE_CUSTOM_LOGO "@APPLICATION_WIZARD_USE_CUSTOM_LOGO@" #cmakedefine APPLICATION_VIRTUALFILE_SUFFIX "@APPLICATION_VIRTUALFILE_SUFFIX@" diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 9a562fc17a25..59070e0bee68 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -139,7 +139,7 @@ GeneralSettings::GeneralSettings(QWidget *parent) { _ui->setupUi(this); - const auto settingsWidgetVisible = ConfigFile().isNcSettingsWidgetsVisible(); + const auto settingsWidgetVisible = OCC::Theme::instance()->isSettingsWidgetsVisible(); _ui->callNotificationsCheckBox->setVisible(settingsWidgetVisible); _ui->newExternalStorage->setVisible(settingsWidgetVisible); _ui->showInExplorerNavigationPaneCheckBox->setVisible(settingsWidgetVisible); @@ -279,7 +279,7 @@ void GeneralSettings::slotUpdateInfo() if (ConfigFile().skipUpdateCheck() || !updater) { // updater disabled on compile _ui->updatesGroupBox->setVisible(false); - const auto settingsWidgetVisible = ConfigFile().isNcSettingsWidgetsVisible(); + const auto settingsWidgetVisible = OCC::Theme::instance()->isSettingsWidgetsVisible(); _ui->restartButton->setVisible(settingsWidgetVisible); _ui->updateButton->setVisible(settingsWidgetVisible); return; @@ -509,9 +509,9 @@ void GeneralSettings::customizeStyle() slotUpdateInfo(); #else _ui->updatesGroupBox->setVisible(false); - const auto widgetVisible = ConfigFile().isWidgetVisible(); - _ui->restartButton->setVisible(widgetVisible); - _ui->updateButton->setVisible(widgetVisible); + const auto settingsWidgetVisible = OCC::Theme::instance()->isSettingsWidgetsVisible(); + _ui->restartButton->setVisible(settingsWidgetVisible); + _ui->updateButton->setVisible(settingsWidgetVisible); #endif } diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 37af0712207d..fd8d938d643f 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -1185,8 +1185,4 @@ void ConfigFile::setMacFileProviderModuleEnabled(const bool moduleEnabled) settings.setValue(QLatin1String(macFileProviderModuleEnabledC), moduleEnabled); } -bool ConfigFile::isNcSettingsWidgetsVisible() const -{ - return _isNcSettingWidgetsVisible; -} } diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h index 9431a8c48133..5d0ee5460fce 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -60,7 +60,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile [[nodiscard]] bool showConfigBackupWarning() const; bool exists(); - bool isNcSettingsWidgetsVisible() const; [[nodiscard]] QString defaultConnection() const; @@ -245,7 +244,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile static QString _confDir; static QString _discoveredLegacyConfigPath; - bool _isNcSettingWidgetsVisible = true; }; } #endif // CONFIGFILE_H diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index a8bcd127365b..cb699817371d 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -917,6 +917,11 @@ bool Theme::enforceVirtualFilesSyncFolder() const return ENFORCE_VIRTUAL_FILES_SYNC_FOLDER && vfsMode != OCC::Vfs::Off; } +bool Theme::isSettingsWidgetsVisible() const +{ + return NEXTCLOUD_SETTINGS_WIDGET_VISIBLE; +} + QColor Theme::defaultColor() { return QColor{NEXTCLOUD_BACKGROUND_COLOR}; diff --git a/src/libsync/theme.h b/src/libsync/theme.h index 55120652f01b..822f55725155 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -591,6 +591,13 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject [[nodiscard]] bool enforceVirtualFilesSyncFolder() const; + /** + * @brief Whether to show certain widgets in the settings dialog. + * + * By default, the widgets are shown unless set otherwise via NEXTCLOUD_SETTINGS_WIDGET_VISIBLE + */ + bool isSettingsWidgetsVisible() const; + static QColor defaultColor(); static constexpr const char *themePrefix = ":/client/theme/"; @@ -644,6 +651,7 @@ public slots: bool _forceOverrideServerUrl = false; bool _isVfsEnabled = false; bool _startLoginFlowAutomatically = false; + bool _isSettingWidgetsVisible = true; #ifndef TOKEN_AUTH_ONLY mutable QHash _iconCache;