diff options
author | Daniel Molkentin <danimo@owncloud.com> | 2014-07-11 02:31:24 +0400 |
---|---|---|
committer | Daniel Molkentin <danimo@owncloud.com> | 2014-07-11 13:07:31 +0400 |
commit | df3c3bca025a7cdb5f20e55fc2ecc37618e7cc8d (patch) | |
tree | 22fa58b5a09ec9f93ad376dce2edd6272483fc1a /src/gui/owncloudsetupwizard.h | |
parent | d1b991e1984ef0c4ed803c5c5ead1ce3bfe00266 (diff) |
Split into three separate projects: library, gui and cmd
Diffstat (limited to 'src/gui/owncloudsetupwizard.h')
-rw-r--r-- | src/gui/owncloudsetupwizard.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/gui/owncloudsetupwizard.h b/src/gui/owncloudsetupwizard.h new file mode 100644 index 000000000..8a094aed9 --- /dev/null +++ b/src/gui/owncloudsetupwizard.h @@ -0,0 +1,103 @@ +/* + * Copyright (C) by Klaas Freitag <freitag@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#ifndef OWNCLOUDSETUPWIZARD_H +#define OWNCLOUDSETUPWIZARD_H + +#include <QObject> +#include <QWidget> +#include <QProcess> +#include <QNetworkReply> +#include <QPointer> + +#include "theme.h" +#include "networkjobs.h" + +#include "wizard/owncloudwizardcommon.h" + +namespace Mirall { + +class OwncloudWizard; +class Account; + +class ValidateDavAuthJob : public AbstractNetworkJob { + Q_OBJECT +public: + ValidateDavAuthJob(Account* account, QObject *parent = 0); + void start() Q_DECL_OVERRIDE; +signals: + void authResult(QNetworkReply*); +private slots: + bool finished() Q_DECL_OVERRIDE; +}; + +class DetermineAuthTypeJob : public AbstractNetworkJob { + Q_OBJECT +public: + explicit DetermineAuthTypeJob(Account *account, QObject *parent = 0); + void start() Q_DECL_OVERRIDE; +signals: + void authType(WizardCommon::AuthType); +private slots: + bool finished() Q_DECL_OVERRIDE; +private: + int _redirects; +}; + + +class OwncloudSetupWizard : public QObject +{ + Q_OBJECT +public: + /** Run the wizard */ + static void runWizard(QObject *obj, const char* amember, QWidget *parent = 0 ); + +signals: + // overall dialog close signal. + void ownCloudWizardDone( int ); + +private slots: + void slotDetermineAuthType(const QString&); + void slotOwnCloudFoundAuth(const QUrl&, const QVariantMap&); + void slotNoOwnCloudFoundAuth(QNetworkReply *reply); + void slotNoOwnCloudFoundAuthTimeout(const QUrl&url); + + void slotConnectToOCUrl(const QString&); + void slotConnectionCheck(QNetworkReply*); + + void slotCreateLocalAndRemoteFolders(const QString&, const QString&); + void slotAuthCheckReply(QNetworkReply*); + void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError); + void slotAssistantFinished( int ); + +private: + explicit OwncloudSetupWizard(QObject *parent = 0 ); + ~OwncloudSetupWizard(); + + void startWizard(); + void testOwnCloudConnect(); + void createRemoteFolder(); + void finalizeSetup( bool ); + bool ensureStartFromScratch(const QString &localFolder); + void replaceDefaultAccountWith(Account *newAccount); + + Account* _account; + OwncloudWizard* _ocWizard; + QString _remoteFolder; + +}; + +} + +#endif // OWNCLOUDSETUPWIZARD_H |