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>
|
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 QModelIndex;
|
|
|
|
class QNetworkReply;
|
|
|
|
class QListWidgetItem;
|
2015-03-27 13:46:03 +03:00
|
|
|
class QLabel;
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
namespace OCC {
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class AccountSettings;
|
|
|
|
}
|
|
|
|
|
|
|
|
class FolderMan;
|
2015-03-27 13:46:03 +03:00
|
|
|
|
2013-11-04 19:36:23 +04:00
|
|
|
class Account;
|
2014-12-17 16:09:57 +03:00
|
|
|
class AccountState;
|
2015-03-27 13:46:03 +03:00
|
|
|
class FolderStatusModel;
|
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& );
|
|
|
|
|
|
|
|
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-07-26 15:44:38 +04:00
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
void slotUpdateQuota( qint64,qint64 );
|
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 );
|
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
protected slots:
|
|
|
|
void slotAddFolder();
|
|
|
|
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();
|
2013-07-18 00:32:47 +04:00
|
|
|
void slotHideProgress();
|
2015-03-27 13:46:03 +03:00
|
|
|
void refreshSelectiveSyncStatus();
|
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-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;
|
2015-03-27 13:46:03 +03:00
|
|
|
|
|
|
|
FolderStatusModel *_model;
|
2013-07-04 21:59:40 +04:00
|
|
|
QUrl _OCUrl;
|
2013-09-11 12:24:31 +04:00
|
|
|
QStringList _generalErrors;
|
2013-10-11 19:51:55 +04:00
|
|
|
bool _wasDisabledBefore;
|
2014-12-17 16:09:57 +03:00
|
|
|
AccountState *_accountState;
|
2015-03-27 13:46:03 +03:00
|
|
|
QLabel *_quotaLabel;
|
2014-03-14 16:03:16 +04:00
|
|
|
private slots:
|
|
|
|
void slotFolderSyncStateChange();
|
2014-12-17 16:09:57 +03:00
|
|
|
void slotAccountStateChanged(AccountState*);
|
2015-03-27 13:46:03 +03:00
|
|
|
void slotCustomContextMenuRequested(const QPoint&);
|
2013-07-04 21:59:40 +04:00
|
|
|
};
|
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
} // namespace OCC
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
#endif // ACCOUNTSETTINGS_H
|