From b57266be0c5d91ed7b8cec29c4f045c1e42329a0 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 17 Aug 2020 15:31:21 +0200 Subject: [PATCH] Windows VFS: Enable Windows VFS by default --- changelog/unreleased/8019 | 5 +++++ src/gui/accountsettings.cpp | 2 +- src/gui/folderwizard.cpp | 3 +-- src/gui/wizard/owncloudadvancedsetuppage.cpp | 19 ++++++++++++++----- src/gui/wizard/owncloudwizard.cpp | 16 ++-------------- 5 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 changelog/unreleased/8019 diff --git a/changelog/unreleased/8019 b/changelog/unreleased/8019 new file mode 100644 index 00000000000..2e32c72d3c6 --- /dev/null +++ b/changelog/unreleased/8019 @@ -0,0 +1,5 @@ +Change: Enable Windows Virtual files by default + +We now enable the Windows Virtual file support by default. + +https://github.com/owncloud/client/pull/8019 diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 3628afceae6..ee608bcc07d 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -353,7 +353,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); } diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index f8a9e180eec..58995192be1 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -485,8 +485,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); diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp index 4bfb73bb726..90cb6987a9a 100644 --- a/src/gui/wizard/owncloudadvancedsetuppage.cpp +++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp @@ -61,6 +61,12 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage() connect(_ui.rSyncEverything, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSyncEverythingClicked); 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); connect(_ui.rManualFolder, &QAbstractButton::clicked, this, [this] { setRadioChecked(_ui.rManualFolder); }); @@ -82,8 +88,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(_ui.wSyncStrategy->layout())->insertItem(0, _ui.lVirtualFileSync); + setRadioChecked(_ui.rVirtualFileSync); + } +#endif } void OwncloudAdvancedSetupPage::setupCustomization() @@ -365,9 +377,6 @@ void OwncloudAdvancedSetupPage::slotVirtualFileSyncClicked() OwncloudWizard::askExperimentalVirtualFilesFeature(this, [this](bool enable) { if (!enable) return; - - _ui.lSelectiveSyncSizeLabel->setText(QString()); - _selectiveSyncBlacklist.clear(); setRadioChecked(_ui.rVirtualFileSync); }); } diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp index 4c75ad52cbe..5d23664ff00 100644 --- a/src/gui/wizard/owncloudwizard.cpp +++ b/src/gui/wizard/owncloudwizard.cpp @@ -246,20 +246,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,