nextcloud-desktop/src/gui/owncloudsetupwizard.h

90 lines
2.4 KiB
C
Raw Normal View History

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.
*/
#ifndef OWNCLOUDSETUPWIZARD_H
#define OWNCLOUDSETUPWIZARD_H
#include <QObject>
#include <QWidget>
#include <QProcess>
#include <QNetworkReply>
#include <QPointer>
#include "accountfwd.h"
#include "theme.h"
#include "networkjobs.h"
#include "wizard/owncloudwizardcommon.h"
2014-11-10 00:34:07 +03:00
namespace OCC {
class AccountState;
class OwncloudWizard;
2015-06-29 19:56:09 +03:00
/**
* @brief The OwncloudSetupWizard class
* @ingroup gui
*/
class OwncloudSetupWizard : public QObject
{
Q_OBJECT
public:
/** Run the wizard */
static void runWizard(QObject *obj, const char *amember, QWidget *parent = nullptr);
static bool bringWizardToFrontIfVisible();
signals:
2012-04-12 13:37:48 +04:00
// overall dialog close signal.
2017-05-17 11:55:42 +03:00
void ownCloudWizardDone(int);
private slots:
void slotCheckServer(const QString &);
void slotSystemProxyLookupDone(const QNetworkProxy &proxy);
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();
2017-05-17 11:55:42 +03:00
void slotCreateLocalAndRemoteFolders(const QString &, const QString &);
void slotRemoteFolderExists(QNetworkReply *);
void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError);
2017-05-17 11:55:42 +03:00
void slotAssistantFinished(int);
void slotSkipFolderConfiguration();
private:
explicit OwncloudSetupWizard(QObject *parent = nullptr);
~OwncloudSetupWizard();
void startWizard();
2012-04-12 13:37:48 +04:00
void testOwnCloudConnect();
void createRemoteFolder();
2017-05-17 11:55:42 +03:00
void finalizeSetup(bool);
bool ensureStartFromScratch(const QString &localFolder);
AccountState *applyAccountChanges();
2017-05-17 11:55:42 +03:00
bool checkDowngradeAdvised(QNetworkReply *reply);
2017-05-17 11:55:42 +03:00
OwncloudWizard *_ocWizard;
QString _initLocalFolder;
QString _remoteFolder;
};
}
#endif // OWNCLOUDSETUPWIZARD_H