2011-09-30 19:42:28 +04:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2012-02-17 14:11:18 +04:00
|
|
|
#ifndef OWNCLOUDSETUPWIZARD_H
|
|
|
|
#define OWNCLOUDSETUPWIZARD_H
|
2011-09-28 20:14:48 +04:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QProcess>
|
2012-02-17 18:54:39 +04:00
|
|
|
#include <QNetworkReply>
|
2013-02-10 17:03:09 +04:00
|
|
|
#include <QPointer>
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2014-12-18 14:09:48 +03:00
|
|
|
#include "accountfwd.h"
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "theme.h"
|
|
|
|
#include "networkjobs.h"
|
2013-10-28 23:01:59 +04:00
|
|
|
|
|
|
|
#include "wizard/owncloudwizardcommon.h"
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
namespace OCC {
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2015-04-27 18:43:07 +03:00
|
|
|
class AccountState;
|
|
|
|
|
2013-07-30 13:19:22 +04:00
|
|
|
class OwncloudWizard;
|
2013-10-28 23:01:59 +04:00
|
|
|
|
2015-06-29 19:56:09 +03:00
|
|
|
/**
|
|
|
|
* @brief The DetermineAuthTypeJob class
|
|
|
|
* @ingroup gui
|
2015-06-26 18:07:47 +03:00
|
|
|
*/
|
2013-10-28 23:01:59 +04:00
|
|
|
class DetermineAuthTypeJob : public AbstractNetworkJob {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-12-18 14:09:48 +03:00
|
|
|
explicit DetermineAuthTypeJob(AccountPtr account, QObject *parent = 0);
|
2014-07-10 01:22:28 +04:00
|
|
|
void start() Q_DECL_OVERRIDE;
|
2013-10-28 23:01:59 +04:00
|
|
|
signals:
|
|
|
|
void authType(WizardCommon::AuthType);
|
|
|
|
private slots:
|
2014-07-10 01:22:28 +04:00
|
|
|
bool finished() Q_DECL_OVERRIDE;
|
2013-10-28 23:01:59 +04:00
|
|
|
private:
|
|
|
|
int _redirects;
|
|
|
|
};
|
|
|
|
|
2015-06-29 19:56:09 +03:00
|
|
|
/**
|
|
|
|
* @brief The OwncloudSetupWizard class
|
|
|
|
* @ingroup gui
|
2015-06-26 18:07:47 +03:00
|
|
|
*/
|
2012-02-17 14:11:18 +04:00
|
|
|
class OwncloudSetupWizard : public QObject
|
2011-09-28 20:14:48 +04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2013-07-04 21:59:40 +04:00
|
|
|
/** Run the wizard */
|
2013-07-22 15:59:52 +04:00
|
|
|
static void runWizard(QObject *obj, const char* amember, QWidget *parent = 0 );
|
2011-09-28 20:14:48 +04:00
|
|
|
signals:
|
2012-04-12 13:37:48 +04:00
|
|
|
// overall dialog close signal.
|
2013-07-31 17:46:41 +04:00
|
|
|
void ownCloudWizardDone( int );
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2013-07-31 17:46:41 +04:00
|
|
|
private slots:
|
2013-07-22 16:54:14 +04:00
|
|
|
void slotDetermineAuthType(const QString&);
|
2013-10-28 23:01:59 +04:00
|
|
|
void slotOwnCloudFoundAuth(const QUrl&, const QVariantMap&);
|
|
|
|
void slotNoOwnCloudFoundAuth(QNetworkReply *reply);
|
2013-11-14 20:02:41 +04:00
|
|
|
void slotNoOwnCloudFoundAuthTimeout(const QUrl&url);
|
2012-12-04 20:27:59 +04:00
|
|
|
|
2013-07-31 17:46:41 +04:00
|
|
|
void slotConnectToOCUrl(const QString&);
|
2015-04-09 14:38:52 +03:00
|
|
|
void slotAuthError();
|
2013-07-31 17:46:41 +04:00
|
|
|
|
|
|
|
void slotCreateLocalAndRemoteFolders(const QString&, const QString&);
|
2015-04-09 14:38:52 +03:00
|
|
|
void slotRemoteFolderExists(QNetworkReply*);
|
2013-07-31 17:46:41 +04:00
|
|
|
void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError);
|
2012-06-12 14:30:05 +04:00
|
|
|
void slotAssistantFinished( int );
|
2014-12-18 15:18:24 +03:00
|
|
|
void slotSkipFolderConfiguration();
|
2013-07-22 16:54:14 +04:00
|
|
|
|
2011-09-28 20:14:48 +04:00
|
|
|
private:
|
2013-07-31 17:46:41 +04:00
|
|
|
explicit OwncloudSetupWizard(QObject *parent = 0 );
|
|
|
|
~OwncloudSetupWizard();
|
|
|
|
void startWizard();
|
2012-04-12 13:37:48 +04:00
|
|
|
void testOwnCloudConnect();
|
2013-10-28 23:01:59 +04:00
|
|
|
void createRemoteFolder();
|
2013-07-31 17:46:41 +04:00
|
|
|
void finalizeSetup( bool );
|
2013-10-30 19:31:47 +04:00
|
|
|
bool ensureStartFromScratch(const QString &localFolder);
|
2015-04-27 18:43:07 +03:00
|
|
|
AccountState *applyAccountChanges();
|
2014-12-17 21:14:42 +03:00
|
|
|
bool checkDowngradeAdvised(QNetworkReply* reply);
|
2012-02-17 18:54:39 +04:00
|
|
|
|
2013-07-31 17:46:41 +04:00
|
|
|
OwncloudWizard* _ocWizard;
|
2014-07-08 20:32:43 +04:00
|
|
|
QString _initLocalFolder;
|
2013-07-31 17:46:41 +04:00
|
|
|
QString _remoteFolder;
|
2013-10-28 23:01:59 +04:00
|
|
|
|
2011-09-28 20:14:48 +04:00
|
|
|
};
|
|
|
|
|
2012-03-14 14:26:00 +04:00
|
|
|
}
|
|
|
|
|
2012-02-17 14:11:18 +04:00
|
|
|
#endif // OWNCLOUDSETUPWIZARD_H
|