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
|
|
|
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "folder.h"
|
|
|
|
#include "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-11-04 19:36:23 +04:00
|
|
|
class Account;
|
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();
|
|
|
|
|
|
|
|
|
|
|
|
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& );
|
2014-08-15 17:01:01 +04:00
|
|
|
void accountIconChanged( const QIcon& );
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void slotFolderActivated( const QModelIndex& );
|
|
|
|
void slotOpenOC();
|
|
|
|
void slotUpdateFolderState( Folder* );
|
|
|
|
void slotDoubleClicked( const QModelIndex& );
|
2014-03-14 16:03:16 +04:00
|
|
|
void slotSetProgress(const QString& folder, const Progress::Info& progress);
|
2013-11-25 20:34:20 +04:00
|
|
|
void slotButtonsSetEnabled();
|
2014-08-15 17:01:01 +04:00
|
|
|
void slotSyncStateChange(const QString& alias = QString());
|
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-11-25 18:33:35 +04:00
|
|
|
void slotAccountStateChanged(int state);
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2013-09-11 12:24:31 +04:00
|
|
|
void setGeneralErrors( const QStringList& errors );
|
2014-03-26 22:30:13 +04:00
|
|
|
void setFolderList( const Folder::Map& );
|
2013-09-11 12:24:31 +04:00
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
protected slots:
|
|
|
|
void slotAddFolder();
|
|
|
|
void slotAddFolder( Folder* );
|
|
|
|
void slotEnableCurrentFolder();
|
2013-10-30 19:58:08 +04:00
|
|
|
void slotSyncCurrentFolderNow();
|
2013-07-04 21:59:40 +04:00
|
|
|
void slotRemoveCurrentFolder();
|
|
|
|
void slotResetCurrentFolder();
|
|
|
|
void slotFolderWizardAccepted();
|
|
|
|
void slotFolderWizardRejected();
|
|
|
|
void slotOpenAccountWizard();
|
2013-07-18 00:32:47 +04:00
|
|
|
void slotHideProgress();
|
2014-08-11 17:09:17 +04:00
|
|
|
void slotSelectiveSync();
|
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;
|
2014-08-19 16:06:28 +04:00
|
|
|
void folderToModelItem(QStandardItem *, Folder * , bool accountConnected);
|
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-09-11 12:24:31 +04:00
|
|
|
QStringList _generalErrors;
|
2013-10-11 19:51:55 +04:00
|
|
|
bool _wasDisabledBefore;
|
2013-11-04 19:36:23 +04:00
|
|
|
Account *_account;
|
2014-03-14 16:03:16 +04:00
|
|
|
private slots:
|
|
|
|
void slotFolderSyncStateChange();
|
2014-03-26 20:41:04 +04:00
|
|
|
void slotAccountChanged(Account*,Account*);
|
2013-07-04 21:59:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Mirall
|
|
|
|
|
|
|
|
#endif // ACCOUNTSETTINGS_H
|