2011-09-27 21:10:01 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
|
2011-09-30 19:42:28 +04:00
|
|
|
* Copyright (C) by Klaas Freitag <freitag@kde.org>
|
2011-09-27 21:10:01 +04:00
|
|
|
*
|
|
|
|
* 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 MIRALL_OWNCLOUDWIZARD_H
|
|
|
|
#define MIRALL_OWNCLOUDWIZARD_H
|
|
|
|
|
|
|
|
#include <QWizard>
|
|
|
|
|
|
|
|
#include "ui_owncloudwizardselecttypepage.h"
|
|
|
|
#include "ui_createanowncloudpage.h"
|
|
|
|
#include "ui_owncloudftpaccesspage.h"
|
|
|
|
#include "ui_owncloudwizardresultpage.h"
|
2011-09-30 14:51:56 +04:00
|
|
|
#include "ui_owncloudcredentialspage.h"
|
2012-07-25 18:51:29 +04:00
|
|
|
#include "ui_owncloudsetuppage.h"
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
class QVariant;
|
2011-09-27 21:10:01 +04:00
|
|
|
|
|
|
|
namespace Mirall {
|
|
|
|
|
2012-07-25 18:51:29 +04:00
|
|
|
class OwncloudSetupPage: public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
OwncloudSetupPage();
|
|
|
|
~OwncloudSetupPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
virtual void initializePage();
|
|
|
|
virtual int nextId() const;
|
|
|
|
void setOCUrl( const QString& );
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void slotPwdStoreChanged( int );
|
|
|
|
void slotSecureConChanged( int );
|
2012-09-14 06:47:39 +04:00
|
|
|
void handleNewOcUrl(const QString& ocUrl);
|
2012-07-25 18:51:29 +04:00
|
|
|
void setupCustomization();
|
|
|
|
private:
|
|
|
|
Ui_OwncloudSetupPage _ui;
|
|
|
|
};
|
|
|
|
|
2011-11-24 19:25:15 +04:00
|
|
|
class OwncloudWizard: public QWizard
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum {
|
2012-07-25 18:51:29 +04:00
|
|
|
Page_oCSetup,
|
2011-11-24 19:25:15 +04:00
|
|
|
Page_SelectType,
|
|
|
|
Page_Create_OC,
|
|
|
|
Page_OC_Credentials,
|
|
|
|
Page_FTP,
|
|
|
|
Page_Install
|
|
|
|
};
|
|
|
|
|
|
|
|
enum LogType {
|
|
|
|
LogPlain,
|
|
|
|
LogParagraph
|
|
|
|
};
|
|
|
|
|
|
|
|
OwncloudWizard(QWidget *parent = 0L);
|
|
|
|
|
|
|
|
void setOCUrl( const QString& );
|
|
|
|
|
2012-07-26 12:01:43 +04:00
|
|
|
void setupCustomMedia( QVariant, QLabel* );
|
2012-08-14 14:23:06 +04:00
|
|
|
QString ocUrl() const;
|
2012-07-26 12:01:43 +04:00
|
|
|
|
2011-11-24 19:25:15 +04:00
|
|
|
public slots:
|
|
|
|
void appendToResultWidget( const QString& msg, LogType type = LogParagraph );
|
|
|
|
void slotCurrentPageChanged( int );
|
|
|
|
void showOCUrlLabel( bool );
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void connectToOCUrl( const QString& );
|
|
|
|
void installOCServer();
|
|
|
|
void installOCLocalhost();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString _configFile;
|
|
|
|
QString _oCUrl;
|
|
|
|
};
|
|
|
|
|
2011-09-27 21:10:01 +04:00
|
|
|
/**
|
|
|
|
* page to ask for the type of Owncloud to connect to
|
|
|
|
*/
|
|
|
|
|
|
|
|
class OwncloudWizardSelectTypePage: public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
OwncloudWizardSelectTypePage();
|
|
|
|
~OwncloudWizardSelectTypePage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
virtual void initializePage();
|
2011-09-28 20:14:48 +04:00
|
|
|
int nextId() const;
|
2011-09-30 12:24:01 +04:00
|
|
|
void setOCUrl( const QString& );
|
2011-10-14 18:39:53 +04:00
|
|
|
void showOCUrlLabel( const QString& );
|
|
|
|
|
2011-09-27 21:10:01 +04:00
|
|
|
private:
|
|
|
|
Ui_OwncloudWizardSelectTypePage _ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CreateAnOwncloudPage: public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
CreateAnOwncloudPage();
|
|
|
|
~CreateAnOwncloudPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
virtual void initializePage();
|
2011-09-28 20:14:48 +04:00
|
|
|
virtual int nextId() const;
|
2011-09-29 18:36:27 +04:00
|
|
|
|
|
|
|
QString domain() const;
|
|
|
|
|
2011-09-27 21:10:01 +04:00
|
|
|
private:
|
|
|
|
Ui_CreateAnOwncloudPage _ui;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-09-30 14:51:56 +04:00
|
|
|
class OwncloudCredentialsPage: public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
OwncloudCredentialsPage();
|
|
|
|
~OwncloudCredentialsPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
virtual void initializePage();
|
|
|
|
virtual int nextId() const;
|
|
|
|
|
2012-04-12 16:06:59 +04:00
|
|
|
protected slots:
|
|
|
|
void slotPwdStoreChanged( int );
|
2011-09-30 14:51:56 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui_OwncloudCredentialsPage _ui;
|
|
|
|
|
|
|
|
};
|
2011-09-27 21:10:01 +04:00
|
|
|
/**
|
|
|
|
* page to ask for the ftp credentials etc. for ftp install
|
|
|
|
*/
|
|
|
|
class OwncloudFTPAccessPage : public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
OwncloudFTPAccessPage();
|
|
|
|
~OwncloudFTPAccessPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
virtual void initializePage();
|
2011-09-29 18:36:27 +04:00
|
|
|
void setFTPUrl( const QString& );
|
2011-10-14 20:13:34 +04:00
|
|
|
virtual int nextId() const;
|
2011-09-27 21:10:01 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui_OwncloudFTPAccessPage _ui;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* page to display the install result
|
|
|
|
*/
|
|
|
|
class OwncloudWizardResultPage : public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
OwncloudWizardResultPage();
|
|
|
|
~OwncloudWizardResultPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
virtual void initializePage();
|
|
|
|
|
2011-09-28 20:14:48 +04:00
|
|
|
public slots:
|
2011-11-24 19:25:15 +04:00
|
|
|
void appendResultText( const QString&, OwncloudWizard::LogType type = OwncloudWizard::LogParagraph );
|
2011-10-14 18:39:53 +04:00
|
|
|
void showOCUrlLabel( const QString&, bool );
|
2011-09-28 20:14:48 +04:00
|
|
|
|
2012-07-26 12:01:43 +04:00
|
|
|
protected:
|
|
|
|
void setupCustomization();
|
|
|
|
|
2011-09-27 21:10:01 +04:00
|
|
|
private:
|
|
|
|
Ui_OwncloudWizardResultPage _ui;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // ns Mirall
|
|
|
|
|
|
|
|
#endif
|