diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-30 04:17:05 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-30 04:17:05 (GMT) |
commit | 6940d171812565209efe679a5d923417c3f47d4a (patch) | |
tree | 2a05d2f8865ff1127f854db41bf31143f64ccf2d /src/Preferences.h | |
parent | 2b19f33ee1ddce246c2bfe0a05fe379d0117a741 (diff) |
reorganized file structure layout. more to follow...
git-svn-id: http://svn.clifford.at/openscad/trunk@364 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/Preferences.h')
-rw-r--r-- | src/Preferences.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/Preferences.h b/src/Preferences.h new file mode 100644 index 0000000..39599fd --- /dev/null +++ b/src/Preferences.h @@ -0,0 +1,54 @@ +#ifndef PREFERENCES_H_ +#define PREFERENCES_H_ + +#include <QMainWindow> +#include <QSettings> +#include "ui_Preferences.h" + +class Preferences : public QMainWindow, public Ui::Preferences +{ + Q_OBJECT; + +public: + ~Preferences(); + static Preferences *inst() { if (!instance) instance = new Preferences(); return instance; } + + enum RenderColor { + BACKGROUND_COLOR, + OPENCSG_FACE_FRONT_COLOR, + OPENCSG_FACE_BACK_COLOR, + CGAL_FACE_FRONT_COLOR, + CGAL_FACE_2D_COLOR, + CGAL_FACE_BACK_COLOR, + CGAL_EDGE_FRONT_COLOR, + CGAL_EDGE_BACK_COLOR, + CGAL_EDGE_2D_COLOR, + CROSSHAIR_COLOR + }; + const QColor &color(RenderColor idx); + QVariant getValue(const QString &key) const; + void apply() const; + +public slots: + void actionTriggered(class QAction *); + void colorSchemeChanged(); + void fontFamilyChanged(const QString &); + void fontSizeChanged(const QString &); + +signals: + void requestRedraw() const; + void fontChanged(const QString &family, uint size) const; + +private: + Preferences(QWidget *parent = NULL); + void keyPressEvent(QKeyEvent *e); + void updateGUI(); + void removeDefaultSettings(); + + QSettings::SettingsMap defaultmap; + QHash<QString, QMap<RenderColor, QColor> > colorschemes; + + static Preferences *instance; +}; + +#endif |