-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advanced account configuration for new wizard #9566
Conversation
Also missing:
|
Please check that those are supported:
|
Can we rename those options easily, or should we rather keep the names and adjust the comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few thoughts
@@ -1588,25 +1589,40 @@ Folder *FolderMan::addFolder(AccountStatePtr accountStatePtr, const QString &loc | |||
folderDefinition.navigationPaneClsid = QUuid::createUuid(); | |||
#endif | |||
|
|||
auto f = addFolder(accountStatePtr, folderDefinition); | |||
auto finalize = [this, accountStatePtr, syncMode, localFolder](const FolderDefinition &folderDefinition, const QStringList &blacklist = {}) { | |||
auto f = addFolder(accountStatePtr, folderDefinition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One char variable names, really?
@@ -1588,25 +1589,40 @@ Folder *FolderMan::addFolder(AccountStatePtr accountStatePtr, const QString &loc | |||
folderDefinition.navigationPaneClsid = QUuid::createUuid(); | |||
#endif | |||
|
|||
auto f = addFolder(accountStatePtr, folderDefinition); | |||
auto finalize = [this, accountStatePtr, syncMode, localFolder](const FolderDefinition &folderDefinition, const QStringList &blacklist = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know lambdas are cool.
But in this case (for example) it is just not needed imho. The reasons are:
- The encapsulated code is just used once.
- The code flow is cluttered because you just move code from the place where it is used to the beginning of the method. Why?
For me, this makes things just more confusing.
} | ||
|
||
connect(_ui->chooseLocalDirectoryButton, &QPushButton::clicked, this, [=]() { | ||
auto dialog = new QFileDialog(this, tr("Choose"), defaultSyncTargetDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that leaking? It is probably going to be removed with the parent class, but why not set Qt::WA_DeleteOnClose
?
// ensure we are connected and fetch the capabilities | ||
auto validator = new ConnectionValidator(account, account.data()); | ||
QObject::connect(validator, &ConnectionValidator::connectionResult, account.data(), [accountStatePtr](ConnectionValidator::Status status, const QStringList &errors) { | ||
|
||
QObject::connect(validator, &ConnectionValidator::connectionResult, account.data(), [accountStatePtr, localFolder, syncMode](ConnectionValidator::Status status, const QStringList &errors) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my book this should be a proper slot method. Too big for a lambda: When you read the surrounding method, you loose context over this huge lambda.
// reenable sync, which is disabled while the wizard is shown | ||
FolderMan::instance()->setSyncEnabled(true); | ||
connect(_wizardController, &Wizard::SetupWizardController::finished, ocApp(), | ||
[this](AccountPtr newAccount, const QString &localFolder, Wizard::SyncMode syncMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. Separate slots are not forbidden ;-)
I quickly finished this and pushed the changes. I'll squash this PR soon. |
Seems like I broke the automatic merge. Will rebase on master and squash the history. |
8daba56
to
d5f8d41
Compare
// this may be overwritten by a branding option (see below) | ||
_ui->useVfsRadioButton->setEnabled(vfsIsAvailable); | ||
|
||
_ui->useVfsRadioButton->setText(tr("Use &virtual files instead of downloading content immediately")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
namespace OCC { | ||
|
||
AskExperimentalVirtualFilesFeatureMessageBox::AskExperimentalVirtualFilesFeatureMessageBox(QWidget *parent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old confirmation dialog was located within the setup wizard, which did not make a lot of sense. Therefore, the old code was restored, but moved into a new dedicated class, which can be used from other places easily, too.
Kudos, SonarCloud Quality Gate passed! |
Contributes to #9249.
This PR implements the remaining configuration options missing in the new wizard. It adds an hidden-by-default advanced options group box to the final wizard page.
I think we can just squash this PR entirely before merging it.