2011-04-06 13:48:02 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Duncan Mac-Vicar P. <duncan@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.
|
|
|
|
*/
|
2011-04-05 13:10:44 +04:00
|
|
|
|
|
|
|
#ifndef MIRALL_FOLDERWIZARD_H
|
|
|
|
#define MIRALL_FOLDERWIZARD_H
|
|
|
|
|
|
|
|
#include <QWizard>
|
2011-10-06 18:55:28 +04:00
|
|
|
#include <QNetworkReply>
|
|
|
|
#include <QTimer>
|
2011-04-05 13:10:44 +04:00
|
|
|
|
2011-10-11 16:23:32 +04:00
|
|
|
#include "folder.h"
|
|
|
|
|
2011-04-05 20:31:14 +04:00
|
|
|
#include "ui_folderwizardsourcepage.h"
|
|
|
|
#include "ui_folderwizardtargetpage.h"
|
2011-09-26 15:12:00 +04:00
|
|
|
#include "ui_folderwizardnetworkpage.h"
|
|
|
|
#include "ui_folderwizardowncloudpage.h"
|
|
|
|
|
2011-04-05 20:31:14 +04:00
|
|
|
|
2011-04-05 13:10:44 +04:00
|
|
|
namespace Mirall {
|
|
|
|
|
2011-10-06 18:55:28 +04:00
|
|
|
class ownCloudInfo;
|
|
|
|
class ownCloudDirCheck;
|
|
|
|
|
2011-04-05 20:31:14 +04:00
|
|
|
/**
|
|
|
|
* page to ask for the local source folder
|
|
|
|
*/
|
|
|
|
class FolderWizardSourcePage : public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
FolderWizardSourcePage();
|
|
|
|
~FolderWizardSourcePage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
2011-10-11 16:23:32 +04:00
|
|
|
void setFolderMap( Folder::Map *fm ) { _folderMap = fm; }
|
2011-04-05 20:31:14 +04:00
|
|
|
protected slots:
|
|
|
|
void on_localFolderChooseBtn_clicked();
|
|
|
|
void on_localFolderLineEdit_textChanged();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui_FolderWizardSourcePage _ui;
|
2011-10-11 16:23:32 +04:00
|
|
|
Folder::Map *_folderMap;
|
2011-04-05 20:31:14 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* page to ask for the target folder
|
|
|
|
*/
|
|
|
|
|
|
|
|
class FolderWizardTargetPage : public QWizardPage
|
2011-04-05 13:10:44 +04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2011-04-05 20:31:14 +04:00
|
|
|
FolderWizardTargetPage();
|
|
|
|
~FolderWizardTargetPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
|
|
|
|
virtual void initializePage();
|
|
|
|
protected slots:
|
|
|
|
void slotToggleItems();
|
|
|
|
void on_localFolder2ChooseBtn_clicked();
|
|
|
|
|
|
|
|
void on_localFolderRadioBtn_toggled();
|
2011-04-08 11:58:16 +04:00
|
|
|
void on_urlFolderRadioBtn_toggled();
|
2011-04-05 20:31:14 +04:00
|
|
|
void on_checkBoxOnlyOnline_toggled();
|
|
|
|
|
|
|
|
void on_localFolder2LineEdit_textChanged();
|
2011-04-08 11:58:16 +04:00
|
|
|
void on_urlFolderLineEdit_textChanged();
|
2011-04-05 20:31:14 +04:00
|
|
|
|
2011-10-05 19:49:03 +04:00
|
|
|
void slotOwnCloudFound( const QString&, const QString& );
|
2011-10-06 12:54:54 +04:00
|
|
|
void slotNoOwnCloudFound();
|
2011-10-06 18:55:28 +04:00
|
|
|
|
|
|
|
void slotFolderTextChanged( const QString& );
|
|
|
|
void slotTimerFires();
|
2011-10-12 17:14:39 +04:00
|
|
|
void slotDirCheckReply( const QString&, bool );
|
|
|
|
void showWarn( const QString& );
|
2011-04-05 13:10:44 +04:00
|
|
|
private:
|
2011-04-05 20:31:14 +04:00
|
|
|
Ui_FolderWizardTargetPage _ui;
|
2011-10-06 18:55:28 +04:00
|
|
|
QTimer *_timer;
|
|
|
|
ownCloudDirCheck *_ownCloudDirCheck;
|
2011-10-07 18:01:58 +04:00
|
|
|
bool _dirChecked;
|
2011-04-05 20:31:14 +04:00
|
|
|
};
|
|
|
|
|
2011-09-26 15:12:00 +04:00
|
|
|
class FolderWizardNetworkPage : public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
FolderWizardNetworkPage();
|
|
|
|
~FolderWizardNetworkPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui_FolderWizardNetworkPage _ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
class FolderWizardOwncloudPage : public QWizardPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
FolderWizardOwncloudPage();
|
|
|
|
~FolderWizardOwncloudPage();
|
|
|
|
|
|
|
|
virtual bool isComplete() const;
|
|
|
|
void initializePage();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui_FolderWizardOwncloudPage _ui;
|
|
|
|
|
|
|
|
};
|
2011-04-05 20:31:14 +04:00
|
|
|
|
2011-04-06 12:40:15 +04:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2011-04-05 20:31:14 +04:00
|
|
|
class FolderWizard : public QWizard
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum {
|
|
|
|
Page_Source,
|
2011-09-26 15:12:00 +04:00
|
|
|
Page_Target,
|
|
|
|
Page_Network,
|
|
|
|
Page_Owncloud
|
2011-04-05 20:31:14 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
FolderWizard(QWidget *parent = 0L);
|
2011-10-11 16:23:32 +04:00
|
|
|
void setFolderMap( Folder::Map* );
|
|
|
|
|
|
|
|
private:
|
2011-04-05 20:31:14 +04:00
|
|
|
|
2011-10-11 16:23:32 +04:00
|
|
|
FolderWizardSourcePage *_folderWizardSourcePage;
|
2011-04-05 13:10:44 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // ns Mirall
|
|
|
|
|
|
|
|
#endif
|