mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
gui/wizard: Present virtual files checkbox if using macOS File Provider module
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
bad94dbf10
commit
c1b39fdab1
@ -35,7 +35,12 @@
|
||||
#include "networkjobs.h"
|
||||
#include "wizard/owncloudwizard.h"
|
||||
|
||||
namespace OCC {
|
||||
#ifdef BUILD_FILE_PROVIDER_MODULE
|
||||
#include "gui/macOS/fileprovider.h"
|
||||
#endif
|
||||
|
||||
namespace OCC
|
||||
{
|
||||
|
||||
OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard)
|
||||
: QWizardPage()
|
||||
@ -101,14 +106,22 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard)
|
||||
_ui.confTraillingSizeLabel->hide();
|
||||
}
|
||||
|
||||
_ui.rVirtualFileSync->setText(tr("Use &virtual files instead of downloading content immediately %1").arg(bestAvailableVfsMode() == Vfs::WindowsCfApi ? QString() : tr("(experimental)")));
|
||||
QString vfsExperimentalText = tr("(experimental)");
|
||||
|
||||
if (
|
||||
#ifdef Q_OS_WIN
|
||||
if (bestAvailableVfsMode() == Vfs::WindowsCfApi) {
|
||||
bestAvailableVfsMode() == Vfs::WindowsCfApi
|
||||
#elif defined(BUILD_FILE_PROVIDER_MODULE)
|
||||
Mac::FileProvider::fileProviderAvailable()
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
) {
|
||||
_ui.wSyncStrategy->addLayout(_ui.lVirtualFileSync);
|
||||
setRadioChecked(_ui.rVirtualFileSync);
|
||||
vfsExperimentalText = "";
|
||||
}
|
||||
#endif
|
||||
_ui.rVirtualFileSync->setText(tr("Use &virtual files instead of downloading content immediately %1").arg(vfsExperimentalText));
|
||||
}
|
||||
|
||||
void OwncloudAdvancedSetupPage::setupCustomization()
|
||||
@ -142,7 +155,11 @@ void OwncloudAdvancedSetupPage::initializePage()
|
||||
{
|
||||
WizardCommon::initErrorLabel(_ui.errorLabel);
|
||||
|
||||
if (!Theme::instance()->showVirtualFilesOption() || bestAvailableVfsMode() == Vfs::Off) {
|
||||
if (!Theme::instance()->showVirtualFilesOption()
|
||||
#ifndef BUILD_FILE_PROVIDER_MODULE
|
||||
|| bestAvailableVfsMode() == Vfs::Off
|
||||
#endif
|
||||
) {
|
||||
// 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.
|
||||
@ -179,7 +196,6 @@ void OwncloudAdvancedSetupPage::initializePage()
|
||||
connect(quotaJob, &PropfindJob::finishedWithError, this, &OwncloudAdvancedSetupPage::slotQuotaRetrievedWithError);
|
||||
quotaJob->start();
|
||||
|
||||
|
||||
if (Theme::instance()->wizardSelectiveSyncDefaultNothing()) {
|
||||
_selectiveSyncBlacklist = QStringList("/");
|
||||
setRadioChecked(_ui.rSelectiveSync);
|
||||
@ -260,7 +276,11 @@ void OwncloudAdvancedSetupPage::refreshVirtualFilesAvailibility(const QString &p
|
||||
setRadioChecked(_ui.rSyncEverything);
|
||||
_ui.rVirtualFileSync->setEnabled(false);
|
||||
} else {
|
||||
_ui.rVirtualFileSync->setText(tr("Use &virtual files instead of downloading content immediately %1").arg(bestAvailableVfsMode() == Vfs::WindowsCfApi ? QString() : tr("(experimental)")));
|
||||
QString textArg;
|
||||
#ifndef BUILD_FILE_PROVIDER_MODULE
|
||||
textArg = bestAvailableVfsMode() == Vfs::WindowsCfApi ? QString() : tr("(experimental)");
|
||||
#endif
|
||||
_ui.rVirtualFileSync->setText(tr("Use &virtual files instead of downloading content immediately %1").arg(textArg));
|
||||
_ui.rVirtualFileSync->setEnabled(true);
|
||||
}
|
||||
//
|
||||
|
||||
Loading…
Reference in New Issue
Block a user