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
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2013-07-04 21:59:40 +04:00
|
|
|
*
|
|
|
|
* 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"
|
2015-06-26 16:40:34 +03:00
|
|
|
#include "quotainfo.h"
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "progressdispatcher.h"
|
2015-07-20 19:15:45 +03:00
|
|
|
#include "owncloudgui.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
|
|
|
|
2015-06-29 19:56:09 +03:00
|
|
|
/**
|
|
|
|
* @brief The AccountSettings class
|
|
|
|
* @ingroup gui
|
2015-06-26 18:07:47 +03:00
|
|
|
*/
|
2013-07-04 21:59:40 +04:00
|
|
|
class AccountSettings : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-04-17 18:56:17 +03:00
|
|
|
explicit AccountSettings(AccountState *accountState, QWidget *parent = 0);
|
2013-07-04 21:59:40 +04:00
|
|
|
~AccountSettings();
|
2015-07-28 12:20:22 +03:00
|
|
|
QSize sizeHint() const Q_DECL_OVERRIDE { return ownCloudGui::settingsDialogSize(); }
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void folderChanged();
|
|
|
|
void openFolderAlias( const QString& );
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void slotOpenOC();
|
|
|
|
void slotUpdateQuota( qint64,qint64 );
|
2013-11-25 18:33:35 +04:00
|
|
|
void slotAccountStateChanged(int state);
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2015-07-15 12:37:38 +03:00
|
|
|
AccountState* accountsState() { return _accountState; }
|
2013-09-11 12:24:31 +04:00
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
protected slots:
|
|
|
|
void slotAddFolder();
|
|
|
|
void slotEnableCurrentFolder();
|
2016-11-25 16:23:56 +03:00
|
|
|
void slotScheduleCurrentFolder();
|
|
|
|
void slotForceSyncCurrentFolder();
|
2013-07-04 21:59:40 +04:00
|
|
|
void slotRemoveCurrentFolder();
|
2015-08-13 12:53:00 +03:00
|
|
|
void slotOpenCurrentFolder();
|
2013-07-04 21:59:40 +04:00
|
|
|
void slotFolderWizardAccepted();
|
|
|
|
void slotFolderWizardRejected();
|
2015-05-12 16:16:32 +03:00
|
|
|
void slotDeleteAccount();
|
2015-11-13 16:50:07 +03:00
|
|
|
void slotToggleSignInState();
|
|
|
|
void slotOpenAccountWizard();
|
|
|
|
void slotAccountAdded(AccountState *);
|
2015-03-27 13:46:03 +03:00
|
|
|
void refreshSelectiveSyncStatus();
|
2015-06-26 16:40:34 +03:00
|
|
|
void slotCustomContextMenuRequested(const QPoint&);
|
2015-09-25 13:22:51 +03:00
|
|
|
void slotFolderListClicked( const QModelIndex& indx );
|
2015-09-16 04:07:04 +03:00
|
|
|
void doExpand();
|
2015-09-01 16:37:01 +03:00
|
|
|
void slotLinkActivated(const QString &link);
|
2013-07-04 21:59:40 +04:00
|
|
|
|
|
|
|
private:
|
2015-07-15 12:37:38 +03:00
|
|
|
void showConnectionLabel(const QString& message,
|
|
|
|
QStringList errors = QStringList());
|
2015-06-26 16:40:34 +03:00
|
|
|
bool event(QEvent*) Q_DECL_OVERRIDE;
|
2015-11-13 16:50:07 +03:00
|
|
|
void createAccountToolbox();
|
2013-07-19 19:05:35 +04:00
|
|
|
|
2017-04-12 16:24:54 +03:00
|
|
|
/// Returns the alias of the selected folder, empty string if none
|
|
|
|
QString selectedFolderAlias() const;
|
|
|
|
|
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-10-11 19:51:55 +04:00
|
|
|
bool _wasDisabledBefore;
|
2014-12-17 16:09:57 +03:00
|
|
|
AccountState *_accountState;
|
2015-06-26 16:40:34 +03:00
|
|
|
QuotaInfo _quotaInfo;
|
2015-11-13 16:50:07 +03:00
|
|
|
QAction *_toggleSignInOutAction;
|
|
|
|
QAction *_addAccountAction;
|
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
|