Ver código fonte

virtual files: show option only when branding allows it

Christian Kamm 7 anos atrás
pai
commit
60de1c9720

+ 1 - 1
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) {

+ 1 - 1
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.

+ 6 - 0
src/libsync/theme.cpp

@@ -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

+ 9 - 0
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;