Placeholders: Add an checkbox in the FolderWizard to enable the placeholder feature

This commit is contained in:
Olivier Goffart 2018-01-15 17:30:33 +01:00 committed by Kevin Ottens
parent 1049fb74d9
commit 7eeb99ba24
No known key found for this signature in database
GPG Key ID: 074BBBCB8DECC9E2
3 changed files with 8 additions and 0 deletions

View File

@ -497,6 +497,7 @@ void AccountSettings::slotFolderWizardAccepted()
folderWizard->field(QLatin1String("sourceFolder")).toString());
definition.targetPath = FolderDefinition::prepareTargetPath(
folderWizard->property("targetPath").toString());
definition.usePlaceholders = folderWizard->property("usePlaceholders").toBool();
{
QDir dir(definition.localPath);

View File

@ -36,6 +36,7 @@
#include <QTreeWidget>
#include <QVBoxLayout>
#include <QEvent>
#include <QCheckBox>
#include <cstdlib>
@ -492,6 +493,8 @@ FolderWizardSelectiveSync::FolderWizardSelectiveSync(const AccountPtr &account)
auto *layout = new QVBoxLayout(this);
_selectiveSync = new SelectiveSyncWidget(account, this);
layout->addWidget(_selectiveSync);
_placeholderCheckBox = new QCheckBox(tr("Download placeholders instead of downloading the files (Experimental)"));
layout->addWidget(_placeholderCheckBox);
}
FolderWizardSelectiveSync::~FolderWizardSelectiveSync() = default;
@ -517,6 +520,7 @@ void FolderWizardSelectiveSync::initializePage()
bool FolderWizardSelectiveSync::validatePage()
{
wizard()->setProperty("selectiveSyncBlackList", QVariant(_selectiveSync->createBlackList()));
wizard()->setProperty("usePlaceholders", QVariant(_placeholderCheckBox->isChecked()));
return true;
}

View File

@ -25,6 +25,8 @@
#include "ui_folderwizardsourcepage.h"
#include "ui_folderwizardtargetpage.h"
class QCheckBox;
namespace OCC {
class SelectiveSyncWidget;
@ -130,6 +132,7 @@ public:
private:
SelectiveSyncWidget *_selectiveSync;
QCheckBox *_placeholderCheckBox;
};
/**