nextcloud-desktop/src/mirall/owncloudsetupwizard.h

112 lines
2.9 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 "mirall/owncloudwizard.h"
2012-03-26 17:19:40 +04:00
#include "mirall/theme.h"
namespace Mirall {
class SiteCopyFolder;
class SyncResult;
class ownCloudInfo;
class FolderMan;
class OwncloudSetupWizard : public QObject
{
Q_OBJECT
public:
2012-03-26 17:19:40 +04:00
explicit OwncloudSetupWizard( FolderMan *folderMan = 0, Theme *theme = 0, QObject *parent = 0 );
2012-04-12 13:37:48 +04:00
~OwncloudSetupWizard();
/**
* @intro wether or not to show the intro wizard page
*/
void startWizard(bool intro = false);
2012-04-12 13:37:48 +04:00
void installServer();
2012-04-12 13:37:48 +04:00
bool isBusy();
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-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
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 );
public slots:
protected slots:
2012-04-12 13:37:48 +04:00
// QProcess related slots:
void slotReadyReadStandardOutput();
void slotReadyReadStandardError();
void slotStateChanged( QProcess::ProcessState );
void slotError( QProcess::ProcessError );
void slotStarted();
void slotProcessFinished( int, QProcess::ExitStatus );
// wizard dialog signals
void slotInstallOCServer();
void slotConnectToOCUrl( const QString& );
void slotCreateOCLocalhost();
2012-12-04 20:27:59 +04:00
void slotCreateRemoteFolder(int);
private slots:
void slotOwnCloudFound( const QString&, const QString&, const QString&, const QString& );
2012-04-12 13:37:48 +04:00
void slotNoOwnCloudFound( QNetworkReply* );
void slotCreateRemoteFolderFinished( QNetworkReply::NetworkError );
void slotAssistantFinished( int );
private:
2012-04-12 13:37:48 +04:00
bool checkOwncloudAdmin( const QString& );
void runOwncloudAdmin( const QStringList& );
bool createRemoteFolder( const QString& );
void finalizeSetup( bool );
2012-04-12 13:37:48 +04:00
/* Start a request to the newly installed ownCloud to check the connection */
void testOwnCloudConnect();
2012-04-12 13:37:48 +04:00
OwncloudWizard *_ocWizard;
FolderMan *_folderMan;
QProcess *_process;
QString _configHandle;
2012-04-12 13:37:48 +04:00
QString _localFolder;
QString _remoteFolder;
};
}
#endif // OWNCLOUDSETUPWIZARD_H