virtual files: show option only when branding allows it
authorChristian Kamm <mail@ckamm.de>
Thu, 30 Aug 2018 15:55:24 +0000 (17:55 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:12 +0000 (10:58 +0100)
src/gui/folderwizard.cpp
src/gui/wizard/owncloudadvancedsetuppage.cpp
src/libsync/theme.cpp
src/libsync/theme.h

index a1efa3b097c7c162e4ff5f724b575afb764420d2..47603ed5021786eff8894c503c212d0b1778dcf9 100644 (file)
@@ -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) {
index 245b871460f70a4f982c197701ca0ca9208ab1a3..09e3928836081ee4cf5a313b341830a9497d4f4b 100644 (file)
@@ -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.
index 3941c9fce5445a641793fc2b00ed2137b8e63247..bb0dde9781961532bf33c0bbbd90f2f427fbc807 100644 (file)
@@ -16,6 +16,7 @@
 #include "config.h"
 #include "common/utility.h"
 #include "version.h"
+#include "configfile.h"
 
 #include <QtCore>
 #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
index cede363b68b3f0c883d49c610b3d56b3827f6a42..394cb89305378c57b98ed004305b2972c8a6e415 100644 (file)
@@ -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;