2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-09-17 20:16:40 +00:00
|
|
|
#ifndef PREFERENCES_WIDGET_H
|
|
|
|
#define PREFERENCES_WIDGET_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/pref.h"
|
2015-09-17 20:16:40 +00:00
|
|
|
|
|
|
|
class AbstractPreferencesWidget;
|
|
|
|
class QListWidget;
|
|
|
|
class QStackedWidget;
|
|
|
|
class QDialogButtonBox;
|
2015-09-17 20:53:39 +00:00
|
|
|
class QAbstractButton;
|
2015-09-17 20:16:40 +00:00
|
|
|
|
2015-10-31 23:02:16 +00:00
|
|
|
class PreferencesDialog : public QDialog {
|
2015-09-17 20:16:40 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-10-31 23:02:16 +00:00
|
|
|
static PreferencesDialog* instance();
|
|
|
|
virtual ~PreferencesDialog();
|
2015-09-17 20:16:40 +00:00
|
|
|
void addPreferencePage(AbstractPreferencesWidget *page);
|
|
|
|
void refreshPages();
|
2015-10-31 23:02:16 +00:00
|
|
|
void emitSettingsChanged();
|
2015-10-02 14:09:13 +00:00
|
|
|
signals:
|
|
|
|
void settingsChanged();
|
2015-09-17 20:16:40 +00:00
|
|
|
private:
|
2015-10-31 23:02:16 +00:00
|
|
|
PreferencesDialog();
|
2015-09-17 20:16:40 +00:00
|
|
|
void cancelRequested();
|
2015-11-02 20:50:17 +00:00
|
|
|
void applyRequested(bool closeIt);
|
2015-09-17 20:16:40 +00:00
|
|
|
void defaultsRequested();
|
2015-09-17 20:53:39 +00:00
|
|
|
void buttonClicked(QAbstractButton *btn);
|
2015-09-17 20:16:40 +00:00
|
|
|
QList<AbstractPreferencesWidget*> pages;
|
|
|
|
QListWidget *pagesList;
|
|
|
|
QStackedWidget *pagesStack;
|
|
|
|
QDialogButtonBox *buttonBox;
|
|
|
|
};
|
|
|
|
|
2015-11-02 20:50:17 +00:00
|
|
|
#endif
|