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 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 */
|
2018-11-11 12:56:22 +03:00
|
|
|
static void runWizard(QObject *obj, const char *amember, QWidget *parent = nullptr);
|
2017-04-20 09:55:44 +03:00
|
|
|
static bool bringWizardToFrontIfVisible();
|
2011-09-28 20:14:48 +04:00
|
|
|
signals:
|
2012-04-12 13:37:48 +04:00
|
|
|
// overall dialog close signal.
|
2017-05-17 11:55:42 +03:00
|
|
|
void ownCloudWizardDone(int);
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2013-07-31 17:46:41 +04:00
|
|
|
private slots:
|
2017-10-19 11:54:46 +03:00
|
|
|
void slotCheckServer(const QString &);
|
2016-09-26 16:45:30 +03:00
|
|
|
void slotSystemProxyLookupDone(const QNetworkProxy &proxy);
|
2017-10-19 11:54:46 +03:00
|
|
|
|
|
|
|
void slotFindServer();
|
|
|
|
void slotFindServerBehindRedirect();
|
|
|
|
void slotFoundServer(const QUrl &, const QJsonObject &);
|
|
|
|
void slotNoServerFound(QNetworkReply *reply);
|
|
|
|
void slotNoServerFoundTimeout(const QUrl &url);
|
|
|
|
|
|
|
|
void slotDetermineAuthType();
|
2012-12-04 20:27:59 +04:00
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
void slotConnectToOCUrl(const QString &);
|
2015-04-09 14:38:52 +03:00
|
|
|
void slotAuthError();
|
2013-07-31 17:46:41 +04:00
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
void slotCreateLocalAndRemoteFolders(const QString &, const QString &);
|
|
|
|
void slotRemoteFolderExists(QNetworkReply *);
|
2013-07-31 17:46:41 +04:00
|
|
|
void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError);
|
2017-05-17 11:55:42 +03: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:
|
2018-11-11 12:56:22 +03:00
|
|
|
explicit OwncloudSetupWizard(QObject *parent = nullptr);
|
2013-07-31 17:46:41 +04:00
|
|
|
~OwncloudSetupWizard();
|
|
|
|
void startWizard();
|
2012-04-12 13:37:48 +04:00
|
|
|
void testOwnCloudConnect();
|
2013-10-28 23:01:59 +04:00
|
|
|
void createRemoteFolder();
|
2017-05-17 11:55:42 +03: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();
|
2017-05-17 11:55:42 +03:00
|
|
|
bool checkDowngradeAdvised(QNetworkReply *reply);
|
2012-02-17 18:54:39 +04:00
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
OwncloudWizard *_ocWizard;
|
2014-07-08 20:32:43 +04:00
|
|
|
QString _initLocalFolder;
|
2013-07-31 17:46:41 +04:00
|
|
|
QString _remoteFolder;
|
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
|