nextcloud-desktop/src/gui/owncloudsetupwizard.h

102 lines
2.6 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 DetermineAuthTypeJob class
* @ingroup gui
*/
class DetermineAuthTypeJob : public AbstractNetworkJob {
Q_OBJECT
public:
explicit DetermineAuthTypeJob(AccountPtr account, QObject *parent = 0);
void start() Q_DECL_OVERRIDE;
signals:
void authType(WizardCommon::AuthType);
private slots:
bool finished() Q_DECL_OVERRIDE;
private:
int _redirects;
};
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 = 0 );
signals:
2012-04-12 13:37:48 +04:00
// 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);
2012-12-04 20:27:59 +04:00
void slotConnectToOCUrl(const QString&);
2015-04-09 14:38:52 +03:00
void slotAuthError();
void slotCreateLocalAndRemoteFolders(const QString&, const QString&);
2015-04-09 14:38:52 +03:00
void slotRemoteFolderExists(QNetworkReply*);
void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError);
void slotAssistantFinished( int );
void slotSkipFolderConfiguration();
private:
explicit OwncloudSetupWizard(QObject *parent = 0 );
~OwncloudSetupWizard();
void startWizard();
2012-04-12 13:37:48 +04:00
void testOwnCloudConnect();
void createRemoteFolder();
void finalizeSetup( bool );
bool ensureStartFromScratch(const QString &localFolder);
AccountState *applyAccountChanges();
bool checkDowngradeAdvised(QNetworkReply* reply);
OwncloudWizard* _ocWizard;
QString _initLocalFolder;
QString _remoteFolder;
};
}
#endif // OWNCLOUDSETUPWIZARD_H