diff options
author | Fabian Müller <fmueller@owncloud.com> | 2022-03-22 17:06:35 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2022-03-24 13:32:50 +0300 |
commit | b22989d75109e6e1282bc42b70968ef3dee6f750 (patch) | |
tree | 6edbce4cb2d4e4837f094566c4f903559e67e398 /src/gui/application.cpp | |
parent | cf93da2e4de381ca9470fd3a2fb0db330129c7b2 (diff) |
Rewrite wizard from scratch
Diffstat (limited to 'src/gui/application.cpp')
-rw-r--r-- | src/gui/application.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 4909d2e1e..aebd0a12c 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -35,7 +35,6 @@ #include "folderman.h" #include "logbrowser.h" #include "logger.h" -#include "owncloudsetupwizard.h" #include "settingsdialog.h" #include "sharedialog.h" #include "socketapi/socketapi.h" @@ -497,32 +496,32 @@ void Application::slotShowGuiMessage(const QString &title, const QString &messag } -void Application::slotownCloudWizardDone(int res) +AccountStatePtr Application::addNewAccount(AccountPtr newAccount) { - AccountManager *accountMan = AccountManager::instance(); - FolderMan *folderMan = FolderMan::instance(); + auto *accountMan = AccountManager::instance(); - // During the wizard, scheduling of new syncs is disabled - folderMan->setSyncEnabled(true); + // first things first: we need to add the new account + auto accountStatePtr = accountMan->addAccount(newAccount); - if (res == QDialog::Accepted) { - // Check connectivity of the newly created account - _checkConnectionTimer.start(); - slotCheckConnection(); + // check connectivity of the newly created account + _checkConnectionTimer.start(); + slotCheckConnection(); - // If one account is configured: enable autostart - bool shouldSetAutoStart = (accountMan->accounts().size() == 1); + // if one account is configured: enable autostart + bool shouldSetAutoStart = (accountMan->accounts().size() == 1); #ifdef Q_OS_MAC - // Don't auto start when not being 'installed' - shouldSetAutoStart = shouldSetAutoStart - && QCoreApplication::applicationDirPath().startsWith("/Applications/"); + // Don't auto start when not being 'installed' + shouldSetAutoStart = shouldSetAutoStart + && QCoreApplication::applicationDirPath().startsWith("/Applications/"); #endif - if (shouldSetAutoStart) { - Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), true); - } - - _gui->slotShowSettings(); + if (shouldSetAutoStart) { + Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), true); } + + // showing the UI to show the user that the account has been added successfully + _gui->slotShowSettings(); + + return accountStatePtr; } void Application::setupLogging() |