From b35ccc3a3533a3fcf9c7434584470537b6d0001e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 17 Sep 2015 14:04:27 -0300 Subject: Preferences: start to port preferences to a more sane design Our preferences dialog right now is a rather huge dialog with more than 9 subpages, and all of those pages are programmed inside of the same class, same methods and all that - which means that if I change something on the dialog I can break any other thing quite easily. The idea of this patch series is to make it harder to break user settings and the settings dialog. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- .../preferences/abstractpreferenceswidget.h | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 desktop-widgets/preferences/abstractpreferenceswidget.h (limited to 'desktop-widgets/preferences/abstractpreferenceswidget.h') diff --git a/desktop-widgets/preferences/abstractpreferenceswidget.h b/desktop-widgets/preferences/abstractpreferenceswidget.h new file mode 100644 index 000000000..2f607c4c9 --- /dev/null +++ b/desktop-widgets/preferences/abstractpreferenceswidget.h @@ -0,0 +1,27 @@ +#ifndef ABSTRACTPREFERENCESWIDGET_H +#define ABSTRACTPREFERENCESWIDGET_H + +#include +#include + +class AbstractPreferencesWidget : public QWidget { + Q_OBJECT +public: + AbstractPreferencesWidget(const QString& name, const QIcon& icon, float positionHeight); + QIcon icon() const; + QString name() const; + float positionHeight() const; + + /* gets the values from the preferences and should set the correct values in + * the interface */ + virtual void refreshSettings() = 0; + + /* gets the values from the interface and set in the preferences object. */ + virtual void syncSettings() = 0; + +private: + QIcon _icon; + QString _name; + float _positionHeight; +}; +#endif \ No newline at end of file -- cgit v1.2.3-70-g09d2