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
|
|
|
|
2013-07-22 16:54:14 +04:00
|
|
|
#include "mirall/wizard/owncloudwizard.h"
|
2012-03-26 17:19:40 +04:00
|
|
|
#include "mirall/theme.h"
|
2011-09-28 20:14:48 +04:00
|
|
|
|
|
|
|
namespace Mirall {
|
|
|
|
|
2011-10-05 14:11:10 +04:00
|
|
|
class SiteCopyFolder;
|
|
|
|
class SyncResult;
|
2012-02-17 18:54:39 +04:00
|
|
|
class ownCloudInfo;
|
2011-09-28 20:14:48 +04: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-22 15:59:52 +04:00
|
|
|
explicit OwncloudSetupWizard(QObject *parent = 0 );
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
~OwncloudSetupWizard();
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2012-10-20 15:58:27 +04:00
|
|
|
/**
|
|
|
|
* @intro wether or not to show the intro wizard page
|
|
|
|
*/
|
2013-03-02 00:30:22 +04:00
|
|
|
void startWizard();
|
2011-09-29 18:36:27 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
void installServer();
|
2011-09-29 18:36:27 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
bool isBusy();
|
2011-09-29 21:05:49 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
void writeOwncloudConfig();
|
|
|
|
|
|
|
|
/**
|
2011-09-30 12:24:01 +04:00
|
|
|
* returns the configured owncloud url if its already configured, otherwise an empty
|
|
|
|
* string.
|
|
|
|
*/
|
2012-02-15 17:44:09 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
void setupLocalSyncFolder();
|
2011-10-14 18:39:53 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
OwncloudWizard *wizard();
|
2011-10-14 18:39:53 +04:00
|
|
|
|
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 );
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2011-09-28 20:14:48 +04:00
|
|
|
signals:
|
2012-04-12 13:37:48 +04:00
|
|
|
// issued if the oC Setup process (owncloud-admin) is finished.
|
|
|
|
void ownCloudSetupFinished( bool );
|
|
|
|
// overall dialog close signal.
|
|
|
|
void ownCloudWizardDone( int );
|
2011-09-28 20:14:48 +04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
protected slots:
|
2012-04-12 13:37:48 +04:00
|
|
|
// wizard dialog signals
|
|
|
|
void slotConnectToOCUrl( const QString& );
|
2013-07-22 16:54:14 +04:00
|
|
|
void slotDetermineAuthType(const QString&);
|
2012-12-04 20:27:59 +04:00
|
|
|
|
2012-02-17 18:54:39 +04:00
|
|
|
private slots:
|
2012-04-21 01:58:09 +04:00
|
|
|
void slotCreateRemoteFolderFinished( QNetworkReply::NetworkError );
|
2012-06-12 14:30:05 +04:00
|
|
|
void slotAssistantFinished( int );
|
2013-02-10 17:03:09 +04:00
|
|
|
void slotClearPendingRequests();
|
2013-04-28 00:24:32 +04:00
|
|
|
void slotAuthCheckReply( const QString&, QNetworkReply * );
|
2013-07-22 16:54:14 +04:00
|
|
|
|
|
|
|
void slotOwnCloudFoundAuth( const QString&, const QString&, const QString&, const QString& );
|
|
|
|
void slotNoOwnCloudFoundAuth( QNetworkReply* );
|
|
|
|
void slotAuthCheckReplyFinished();
|
2011-09-28 20:14:48 +04:00
|
|
|
private:
|
2013-04-28 00:24:32 +04:00
|
|
|
bool createRemoteFolder();
|
|
|
|
void checkRemoteFolder();
|
|
|
|
|
2012-06-12 14:30:05 +04:00
|
|
|
void finalizeSetup( bool );
|
2012-02-17 18:54:39 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
/* Start a request to the newly installed ownCloud to check the connection */
|
|
|
|
void testOwnCloudConnect();
|
2012-02-17 18:54:39 +04:00
|
|
|
|
2012-04-12 13:37:48 +04:00
|
|
|
OwncloudWizard *_ocWizard;
|
2013-02-10 17:03:09 +04:00
|
|
|
QPointer<QNetworkReply> _mkdirRequestReply;
|
|
|
|
QPointer<QNetworkReply> _checkInstallationRequest;
|
2013-04-28 00:24:32 +04:00
|
|
|
QPointer<QNetworkReply> _checkRemoteFolderRequest;
|
|
|
|
|
2012-06-12 14:30:05 +04:00
|
|
|
QString _configHandle;
|
2012-04-12 13:37:48 +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
|