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 SETTINGSDIALOG_H
|
|
|
|
#define SETTINGSDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QStyledItemDelegate>
|
|
|
|
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "progressdispatcher.h"
|
2015-11-04 18:40:22 +03:00
|
|
|
#include "owncloudgui.h"
|
2013-07-05 20:46:43 +04:00
|
|
|
|
2014-12-01 13:37:06 +03:00
|
|
|
class QAction;
|
2015-08-11 12:30:58 +03:00
|
|
|
class QActionGroup;
|
|
|
|
class QToolBar;
|
2013-07-04 21:59:40 +04:00
|
|
|
class QStandardItemModel;
|
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
namespace OCC {
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2015-04-17 18:56:17 +03:00
|
|
|
class AccountState;
|
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
namespace Ui {
|
2017-05-17 11:55:42 +03:00
|
|
|
class SettingsDialog;
|
2013-07-04 21:59:40 +04:00
|
|
|
}
|
|
|
|
class AccountSettings;
|
|
|
|
class Application;
|
2013-07-22 14:11:12 +04:00
|
|
|
class FolderMan;
|
2013-10-01 15:52:07 +04:00
|
|
|
class ownCloudGui;
|
2015-11-10 17:12:35 +03:00
|
|
|
class ActivitySettings;
|
2013-07-04 21:59:40 +04:00
|
|
|
|
2015-06-29 19:56:09 +03:00
|
|
|
/**
|
|
|
|
* @brief The SettingsDialog class
|
|
|
|
* @ingroup gui
|
2015-06-26 18:07:47 +03:00
|
|
|
*/
|
2013-07-04 21:59:40 +04:00
|
|
|
class SettingsDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-10-01 15:52:07 +04:00
|
|
|
explicit SettingsDialog(ownCloudGui *gui, QWidget *parent = 0);
|
2013-07-04 21:59:40 +04:00
|
|
|
~SettingsDialog();
|
|
|
|
|
|
|
|
void addAccount(const QString &title, QWidget *widget);
|
|
|
|
|
2013-10-01 15:52:07 +04:00
|
|
|
public slots:
|
2015-08-19 16:51:48 +03:00
|
|
|
void showFirstPage();
|
2013-11-29 14:18:59 +04:00
|
|
|
void showActivityPage();
|
2017-07-04 15:08:41 +03:00
|
|
|
void showIssuesList(const QString &folderAlias);
|
2014-12-01 13:37:06 +03:00
|
|
|
void slotSwitchPage(QAction *action);
|
2017-05-17 11:55:42 +03:00
|
|
|
void slotRefreshActivity(AccountState *accountState);
|
2017-01-22 15:58:36 +03:00
|
|
|
void slotAccountAvatarChanged();
|
2017-10-05 22:08:38 +03:00
|
|
|
void slotAccountDisplayNameChanged();
|
2013-10-01 15:52:07 +04:00
|
|
|
|
2013-09-20 16:18:28 +04:00
|
|
|
protected:
|
2014-07-10 01:22:28 +04:00
|
|
|
void reject() Q_DECL_OVERRIDE;
|
|
|
|
void accept() Q_DECL_OVERRIDE;
|
2015-08-13 11:26:35 +03:00
|
|
|
void changeEvent(QEvent *) Q_DECL_OVERRIDE;
|
2013-09-20 16:18:28 +04:00
|
|
|
|
2014-08-15 17:01:01 +04:00
|
|
|
private slots:
|
2015-04-17 18:56:17 +03:00
|
|
|
void accountAdded(AccountState *);
|
|
|
|
void accountRemoved(AccountState *);
|
2014-08-15 17:01:01 +04:00
|
|
|
|
2013-07-04 21:59:40 +04:00
|
|
|
private:
|
2015-08-11 18:56:02 +03:00
|
|
|
void customizeStyle();
|
2015-11-16 19:02:05 +03:00
|
|
|
|
2015-08-11 18:56:02 +03:00
|
|
|
QIcon createColorAwareIcon(const QString &name);
|
|
|
|
QAction *createColorAwareAction(const QString &iconName, const QString &fileName);
|
2017-05-17 11:55:42 +03:00
|
|
|
QAction *createActionWithIcon(const QIcon &icon, const QString &text, const QString &iconPath = QString());
|
2017-01-22 15:58:36 +03:00
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
Ui::SettingsDialog *const _ui;
|
2015-08-11 12:30:58 +03:00
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
QActionGroup *_actionGroup;
|
2015-08-11 12:30:58 +03:00
|
|
|
// Maps the actions from the action group to the corresponding widgets
|
2017-05-17 11:55:42 +03:00
|
|
|
QHash<QAction *, QWidget *> _actionGroupWidgets;
|
2015-08-11 12:30:58 +03:00
|
|
|
|
2017-01-22 15:58:36 +03:00
|
|
|
// Maps the action in the dialog to their according account. Needed in
|
|
|
|
// case the account avatar changes
|
2017-05-17 11:55:42 +03:00
|
|
|
QHash<Account *, QAction *> _actionForAccount;
|
2017-01-22 15:58:36 +03:00
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
QToolBar *_toolBar;
|
2015-08-11 12:30:58 +03:00
|
|
|
|
2015-11-10 17:12:35 +03:00
|
|
|
ActivitySettings *_activitySettings;
|
2015-11-02 00:29:37 +03:00
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
QAction *_activityAction;
|
2015-04-17 18:56:17 +03:00
|
|
|
ownCloudGui *_gui;
|
2013-07-04 21:59:40 +04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SETTINGSDIALOG_H
|