mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #8657 from nextcloud/feature/noid/vfs-by-default
feat(wizard): automatically set up macOS-VFS when available
This commit is contained in:
commit
c52f3d71c1
@ -703,7 +703,7 @@ void OwncloudSetupWizard::slotAssistantFinished(int result)
|
||||
auto account = applyAccountChanges();
|
||||
|
||||
#ifdef BUILD_FILE_PROVIDER_MODULE
|
||||
if (Mac::FileProvider::fileProviderAvailable() && _ocWizard->useVirtualFileSync()) {
|
||||
if (_ocWizard->useVirtualFileSyncByDefault()) {
|
||||
Mac::FileProvider::instance()->domainManager()->addFileProviderDomainForAccount(account);
|
||||
auto const accountId = account->account()->userIdAtHostWithPort();
|
||||
// let the user settings know that VFS is enabled
|
||||
|
||||
@ -26,4 +26,21 @@ void AbstractCredentialsWizardPage::cleanupPage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int AbstractCredentialsWizardPage::nextId() const
|
||||
{
|
||||
const auto ocWizard = qobject_cast<OwncloudWizard *>(wizard());
|
||||
Q_ASSERT(ocWizard);
|
||||
|
||||
if (ocWizard->needsToAcceptTermsOfService()) {
|
||||
return WizardCommon::Page_TermsOfService;
|
||||
}
|
||||
|
||||
if (ocWizard->useVirtualFileSyncByDefault()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return WizardCommon::Page_AdvancedSetup;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ class AbstractCredentialsWizardPage : public QWizardPage
|
||||
{
|
||||
public:
|
||||
void cleanupPage() override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
[[nodiscard]] virtual AbstractCredentials *getCredentials() const = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -92,17 +92,6 @@ void Flow2AuthCredsPage::slotFlow2AuthResult(Flow2Auth::Result r, const QString
|
||||
}
|
||||
}
|
||||
|
||||
int Flow2AuthCredsPage::nextId() const
|
||||
{
|
||||
const auto ocWizard = qobject_cast<OwncloudWizard *>(wizard());
|
||||
Q_ASSERT(ocWizard);
|
||||
if (ocWizard->needsToAcceptTermsOfService()) {
|
||||
return WizardCommon::Page_TermsOfService;
|
||||
}
|
||||
|
||||
return WizardCommon::Page_AdvancedSetup;
|
||||
}
|
||||
|
||||
void Flow2AuthCredsPage::setConnected()
|
||||
{
|
||||
auto *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
|
||||
|
||||
@ -32,7 +32,6 @@ public:
|
||||
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
void setConnected();
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
|
||||
|
||||
@ -142,17 +142,6 @@ bool OwncloudHttpCredsPage::validatePage()
|
||||
return true;
|
||||
}
|
||||
|
||||
int OwncloudHttpCredsPage::nextId() const
|
||||
{
|
||||
const auto ocWizard = qobject_cast<OwncloudWizard *>(wizard());
|
||||
Q_ASSERT(ocWizard);
|
||||
if (ocWizard->needsToAcceptTermsOfService()) {
|
||||
return WizardCommon::Page_TermsOfService;
|
||||
}
|
||||
|
||||
return WizardCommon::Page_AdvancedSetup;
|
||||
}
|
||||
|
||||
void OwncloudHttpCredsPage::setConnected()
|
||||
{
|
||||
_connected = true;
|
||||
|
||||
@ -30,7 +30,6 @@ public:
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
bool validatePage() override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
void setConnected();
|
||||
void setErrorString(const QString &err);
|
||||
|
||||
|
||||
@ -34,6 +34,10 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#ifdef BUILD_FILE_PROVIDER_MODULE
|
||||
#include "gui/macOS/fileprovider.h"
|
||||
#endif
|
||||
|
||||
namespace OCC {
|
||||
|
||||
Q_LOGGING_CATEGORY(lcWizard, "nextcloud.gui.wizard", QtInfoMsg)
|
||||
@ -226,6 +230,15 @@ bool OwncloudWizard::needsToAcceptTermsOfService() const
|
||||
return _needsToAcceptTermsOfService;
|
||||
}
|
||||
|
||||
bool OwncloudWizard::useVirtualFileSyncByDefault() const
|
||||
{
|
||||
#ifdef BUILD_FILE_PROVIDER_MODULE
|
||||
return Mac::FileProvider::fileProviderAvailable();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
QString OwncloudWizard::ocUrl() const
|
||||
{
|
||||
QString url = field("OCUrl").toString().simplified();
|
||||
|
||||
@ -62,6 +62,7 @@ public:
|
||||
[[nodiscard]] bool useVirtualFileSync() const;
|
||||
[[nodiscard]] bool isConfirmBigFolderChecked() const;
|
||||
[[nodiscard]] bool needsToAcceptTermsOfService() const;
|
||||
[[nodiscard]] bool useVirtualFileSyncByDefault() const;
|
||||
|
||||
void displayError(const QString &, bool retryHTTPonly);
|
||||
[[nodiscard]] AbstractCredentials *getCredentials() const;
|
||||
|
||||
@ -54,6 +54,13 @@ void OCC::TermsOfServiceWizardPage::cleanupPage()
|
||||
|
||||
int OCC::TermsOfServiceWizardPage::nextId() const
|
||||
{
|
||||
const auto ocWizard = qobject_cast<OwncloudWizard *>(wizard());
|
||||
Q_ASSERT(ocWizard);
|
||||
|
||||
if (ocWizard->useVirtualFileSyncByDefault()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return WizardCommon::Page_AdvancedSetup;
|
||||
}
|
||||
|
||||
|
||||
@ -96,16 +96,6 @@ void WebViewPage::cleanupPage()
|
||||
_ocWizard->centerWindow();
|
||||
}
|
||||
|
||||
int WebViewPage::nextId() const {
|
||||
const auto ocWizard = qobject_cast<OwncloudWizard *>(wizard());
|
||||
Q_ASSERT(ocWizard);
|
||||
if (ocWizard->needsToAcceptTermsOfService()) {
|
||||
return WizardCommon::Page_TermsOfService;
|
||||
}
|
||||
|
||||
return WizardCommon::Page_AdvancedSetup;
|
||||
}
|
||||
|
||||
bool WebViewPage::isComplete() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -23,7 +23,6 @@ public:
|
||||
|
||||
void initializePage() override;
|
||||
void cleanupPage() override;
|
||||
[[nodiscard]] int nextId() const override;
|
||||
[[nodiscard]] bool isComplete() const override;
|
||||
|
||||
[[nodiscard]] AbstractCredentials* getCredentials() const override;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user