2013-07-04 21:59:40 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
|
|
|
|
*
|
|
|
|
* 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; version 2 of the License.
|
|
|
|
*
|
|
|
|
* 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 ACCOUNTSETTINGS_H
|
|
|
|
#define ACCOUNTSETTINGS_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QUrl>
|
|
|
|
#include <QPointer>
|
2013-07-18 00:32:47 +04:00
|
|
|
#include <QHash>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QStandardItem>
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
#include "mirall/folder.h"
|
2013-07-05 20:46:43 +04:00
|
|
|
#include "mirall/progressdispatcher.h"
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
class QStandardItemModel;
|
|
|
|
class QModelIndex;
|
|
|
|
class QStandardItem;
|
|
|
|
class QNetworkReply;
|
|
|
|
class QListWidgetItem;
|
|
|
|
|
|
|
|
namespace Mirall {
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class AccountSettings;
|
|
|
|
}
|
|
|
|
|
|
|
|
class FolderMan;
|
2013-07-20 03:26:11 +04:00
|
|
|
class IgnoreListEditor;
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
class AccountSettings : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-07-22 15:59:52 +04:00
|
|
|
explicit AccountSettings(QWidget *parent = 0);
|
2013-07-04 21:59:40 +04:00
|
|
|
~AccountSettings();
|
|
|
|
|
|
|
|
void setFolderList( const Folder::Map& );
|
|
|
|
void buttonsSetEnabled();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void folderChanged();
|
2013-10-08 16:12:05 +04:00
|
|
|
void openProtocol();
|
2013-07-04 21:59:40 +04:00
|
|
|
void openFolderAlias( const QString& );
|
|
|
|
void infoFolderAlias( const QString& );
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void slotFolderActivated( const QModelIndex& );
|
|
|
|
void slotOpenOC();
|
|
|
|
void slotUpdateFolderState( Folder* );
|
|
|
|
void slotCheckConnection();
|
|
|
|
void slotOCInfo( const QString&, const QString&, const QString&, const QString& );
|
|
|
|
void slotOCInfoFail( QNetworkReply* );
|
|
|
|
void slotDoubleClicked( const QModelIndex& );
|
|
|
|
void slotFolderOpenAction( const QString& );
|
2013-07-31 00:22:04 +04:00
|
|
|
void slotSetProgress(const QString&, const Progress::Info& progress);
|
2013-08-02 16:22:01 +04:00
|
|
|
void slotProgressProblem(const QString& folder, const Progress::SyncProblem& problem);
|
2013-07-26 15:44:38 +04:00
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
void slotUpdateQuota( qint64,qint64 );
|
2013-07-20 00:14:07 +04:00
|
|
|
void slotIgnoreFilesEditor();
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2013-09-11 12:24:31 +04:00
|
|
|
void setGeneralErrors( const QStringList& errors );
|
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
protected slots:
|
|
|
|
void slotAddFolder();
|
|
|
|
void slotAddFolder( Folder* );
|
|
|
|
void slotEnableCurrentFolder();
|
|
|
|
void slotRemoveCurrentFolder();
|
|
|
|
void slotInfoAboutCurrentFolder();
|
|
|
|
void slotResetCurrentFolder();
|
|
|
|
void slotFolderWizardAccepted();
|
|
|
|
void slotFolderWizardRejected();
|
|
|
|
void slotOpenAccountWizard();
|
2013-07-18 00:32:47 +04:00
|
|
|
void slotHideProgress();
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
private:
|
2013-07-24 16:40:34 +04:00
|
|
|
QString shortenFilename( const QString& folder, const QString& file ) const;
|
2013-07-04 21:59:40 +04:00
|
|
|
void folderToModelItem( QStandardItem *, Folder * );
|
2013-07-19 19:05:35 +04:00
|
|
|
QStandardItem* itemForFolder(const QString& );
|
2013-09-11 12:24:31 +04:00
|
|
|
void showConnectionLabel( const QString& message, const QString& tooltip = QString() );
|
2013-07-19 19:05:35 +04:00
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
Ui::AccountSettings *ui;
|
2013-07-20 03:26:11 +04:00
|
|
|
QPointer<IgnoreListEditor> _ignoreEditor;
|
2013-07-04 21:59:40 +04:00
|
|
|
QStandardItemModel *_model;
|
|
|
|
QUrl _OCUrl;
|
2013-07-18 00:32:47 +04:00
|
|
|
QHash<QStandardItem*, QTimer*> _hideProgressTimers;
|
2013-07-22 14:57:58 +04:00
|
|
|
QString _kindContext;
|
2013-09-11 12:24:31 +04:00
|
|
|
QStringList _generalErrors;
|
2013-07-26 15:44:38 +04:00
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Mirall
|
|
|
|
|
|
|
|
#endif // ACCOUNTSETTINGS_H
|