From: Christian Kamm Date: Thu, 30 Aug 2018 15:55:24 +0000 (+0200) Subject: virtual files: show option only when branding allows it X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~469 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=60de1c9720fd281ed9e47421d23662671267a752;p=nextcloud-desktop.git virtual files: show option only when branding allows it --- diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index a1efa3b09..47603ed50 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -494,7 +494,7 @@ FolderWizardSelectiveSync::FolderWizardSelectiveSync(const AccountPtr &account) _selectiveSync = new SelectiveSyncWidget(account, this); layout->addWidget(_selectiveSync); - if (ConfigFile().showExperimentalOptions()) { + if (Theme::instance()->showVirtualFilesOption()) { _virtualFilesCheckBox = new QCheckBox(tr("Use virtual files instead of downloading content immediately (experimental)")); connect(_virtualFilesCheckBox, &QCheckBox::clicked, this, &FolderWizardSelectiveSync::virtualFilesCheckboxClicked); connect(_virtualFilesCheckBox, &QCheckBox::stateChanged, this, [this](int state) { diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp index 245b87146..09e392883 100644 --- a/src/gui/wizard/owncloudadvancedsetuppage.cpp +++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp @@ -102,7 +102,7 @@ void OwncloudAdvancedSetupPage::initializePage() { WizardCommon::initErrorLabel(_ui.errorLabel); - if (!ConfigFile().showExperimentalOptions()) { + if (!Theme::instance()->showVirtualFilesOption()) { // If the layout were wrapped in a widget, the auto-grouping of the // radio buttons no longer works and there are surprising margins. // Just manually hide the button and remove the layout. diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 3941c9fce..bb0dde978 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -16,6 +16,7 @@ #include "config.h" #include "common/utility.h" #include "version.h" +#include "configfile.h" #include #ifndef TOKEN_AUTH_ONLY @@ -731,4 +732,9 @@ QPixmap Theme::createColorAwarePixmap(const QString &name) return createColorAwarePixmap(name, QGuiApplication::palette()); } +bool Theme::showVirtualFilesOption() const +{ + return ConfigFile().showExperimentalOptions(); +} + } // end namespace client diff --git a/src/libsync/theme.h b/src/libsync/theme.h index cede363b6..394cb8930 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -501,6 +501,15 @@ public: */ static QPixmap createColorAwarePixmap(const QString &name); + + /** + * @brief Whether to show the option to create folders using "virtual files". + * + * By default, the options are not shown unless experimental options are + * manually enabled in the configuration file. + */ + virtual bool showVirtualFilesOption() const; + protected: #ifndef TOKEN_AUTH_ONLY QIcon themeIcon(const QString &name, bool sysTray = false) const;