Windows VFS: Enable Windows VFS by default
authorHannah von Reth <hannah.vonreth@owncloud.com>
Mon, 17 Aug 2020 13:31:21 +0000 (15:31 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:18 +0000 (10:59 +0100)
src/gui/accountsettings.cpp
src/gui/folderwizard.cpp
src/gui/wizard/owncloudadvancedsetuppage.cpp
src/gui/wizard/owncloudwizard.cpp

index 79c44d2056a77b1fe2531448dbdc63171ea73ca0..7f3b019b750c13c4fe9e35bb7808482b3446cbf2 100644 (file)
@@ -471,7 +471,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
         && !folder->supportsVirtualFiles()
         && bestAvailableVfsMode() != Vfs::Off
         && !folder->isVfsOnOffSwitchPending()) {
-        ac = menu->addAction(tr("Enable virtual file support %1...").arg(bestAvailableVfsMode() == Vfs::WindowsCfApi ? tr("(tech preview)") : tr("(experimental)")));
+        ac = menu->addAction(tr("Enable virtual file support%1...").arg(bestAvailableVfsMode() == Vfs::WindowsCfApi ? QString() : tr(" (experimental)")));
         connect(ac, &QAction::triggered, this, &AccountSettings::slotEnableVfsCurrentFolder);
     }
 
index b329ce9592ac1b392cd2bb75e0e8f684525b477d..77f9b25d732976cacec89577d13f0ebcea82ab9a 100644 (file)
@@ -494,8 +494,7 @@ FolderWizardSelectiveSync::FolderWizardSelectiveSync(const AccountPtr &account)
     layout->addWidget(_selectiveSync);
 
     if (Theme::instance()->showVirtualFilesOption() && bestAvailableVfsMode() != Vfs::Off) {
-        _virtualFilesCheckBox = new QCheckBox(tr("Use virtual files instead of downloading content immediately %1").arg(
-                                                  bestAvailableVfsMode() == Vfs::WindowsCfApi ? tr("(tech preview)") : tr("(experimental)")));
+        _virtualFilesCheckBox = new QCheckBox(tr("Use virtual files instead of downloading content immediately%1").arg(bestAvailableVfsMode() == Vfs::WindowsCfApi ? QString() : tr(" (experimental)")));
         connect(_virtualFilesCheckBox, &QCheckBox::clicked, this, &FolderWizardSelectiveSync::virtualFilesCheckboxClicked);
         connect(_virtualFilesCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
             _selectiveSync->setEnabled(state == Qt::Unchecked);
index c780707f9f33feed6c785b7816769e8c2f4b82bc..66686f6f21cd5c095acb77d8217d127b6bee430d 100644 (file)
@@ -57,6 +57,12 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
     connect(_ui.rSyncEverything, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSyncEverythingClicked);
     connect(_ui.rSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
     connect(_ui.rVirtualFileSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotVirtualFileSyncClicked);
+    connect(_ui.rVirtualFileSync, &QRadioButton::toggled, this, [this](bool checked) {
+        if (checked) {
+            _ui.lSelectiveSyncSizeLabel->clear();
+            _selectiveSyncBlacklist.clear();
+        }
+    });
     connect(_ui.bSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
 
     QIcon appIcon = theme->applicationIcon();
@@ -76,8 +82,14 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
         _ui.confTraillingSizeLabel->hide();
     }
 
-    _ui.rVirtualFileSync->setText(tr("Use &virtual files instead of downloading content immediately %1").arg(
-                                      bestAvailableVfsMode() == Vfs::WindowsCfApi ? tr("(tech preview)") : tr("(experimental)")));
+    _ui.rVirtualFileSync->setText(tr("Use &virtual files instead of downloading content immediately").arg(bestAvailableVfsMode() == Vfs::WindowsCfApi ? QString() : tr(" (experimental)")));
+
+#ifdef Q_OS_WIN
+    if (bestAvailableVfsMode() == Vfs::WindowsCfApi) {
+        qobject_cast<QVBoxLayout *>(_ui.wSyncStrategy->layout())->insertItem(0, _ui.lVirtualFileSync);
+        setRadioChecked(_ui.rVirtualFileSync);
+    }
+#endif
 }
 
 void OwncloudAdvancedSetupPage::setupCustomization()
@@ -372,9 +384,6 @@ void OwncloudAdvancedSetupPage::slotVirtualFileSyncClicked()
         OwncloudWizard::askExperimentalVirtualFilesFeature(this, [this](bool enable) {
             if (!enable)
                 return;
-
-            _ui.lSelectiveSyncSizeLabel->setText(QString());
-            _selectiveSyncBlacklist.clear();
             setRadioChecked(_ui.rVirtualFileSync);
         });
     }
index 06a88fc744da8cd2f0ccc31977b78fd57e393dda..312fc1c0de611c8e8526a792376b394c95791890 100644 (file)
@@ -340,20 +340,8 @@ void OwncloudWizard::askExperimentalVirtualFilesFeature(QWidget *receiver, const
     switch (bestVfsMode)
     {
     case Vfs::WindowsCfApi:
-        msgBox = new QMessageBox(
-            QMessageBox::Warning,
-            tr("Enable technical preview feature?"),
-            tr("When the \"virtual files\" mode is enabled no files will be downloaded initially. "
-               "Instead a virtual file will be created for each file that exists on the server. "
-               "When a file is opened its contents will be downloaded automatically. "
-               "Alternatively, files can be downloaded manually by using their context menu."
-               "\n\n"
-               "The virtual files mode is mutually exclusive with selective sync. "
-               "Currently unselected folders will be translated to online-only folders "
-               "and your selective sync settings will be reset."), QMessageBox::NoButton, receiver);
-        acceptButton = msgBox->addButton(tr("Enable virtual files"), QMessageBox::AcceptRole);
-        msgBox->addButton(tr("Continue to use selective sync"), QMessageBox::RejectRole);
-        break;
+        callback(true);
+        return;
     case Vfs::WithSuffix:
         msgBox = new QMessageBox(
             QMessageBox::Warning,