LP-419 cleanup QSettings usage throughout GCS
[librepilot.git] / ground / gcs / src / plugins / uavobjectbrowser / uavobjectbrowserconfiguration.h
blobc0e943b6470d9187ddee15821c9d33d2566aed0b
1 /**
2 ******************************************************************************
4 * @file uavobjectbrowserconfiguration.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
9 * @{
10 * @brief The UAVObject Browser gadget plugin
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef UAVOBJECTBROWSERCONFIGURATION_H
29 #define UAVOBJECTBROWSERCONFIGURATION_H
31 #include <coreplugin/iuavgadgetconfiguration.h>
33 #include <QColor>
35 using namespace Core;
37 class UAVObjectBrowserConfiguration : public IUAVGadgetConfiguration {
38 Q_OBJECT Q_PROPERTY(QColor m_unknownObjectColor READ unknownObjectColor WRITE setUnknownObjectColor)
39 Q_PROPERTY(QColor m_recentlyUpdatedColor READ recentlyUpdatedColor WRITE setRecentlyUpdatedColor)
40 Q_PROPERTY(QColor m_manuallyChangedColor READ manuallyChangedColor WRITE setManuallyChangedColor)
41 Q_PROPERTY(int m_recentlyUpdatedTimeout READ recentlyUpdatedTimeout WRITE setRecentlyUpdatedTimeout)
42 Q_PROPERTY(bool m_onlyHilightChangedValues READ onlyHighlightChangedValues WRITE setOnlyHighlightChangedValues)
43 Q_PROPERTY(bool m_useCategorizedView READ categorizedView WRITE setCategorizedView)
44 Q_PROPERTY(bool m_useScientificView READ scientificView WRITE setScientificView)
45 Q_PROPERTY(bool m_showDescription READ showDescription WRITE setShowDescription)
46 Q_PROPERTY(bool m_showMetaData READ showMetaData WRITE setShowMetaData)
47 Q_PROPERTY(QByteArray m_splitterState READ splitterState WRITE setSplitterState)
49 public:
50 explicit UAVObjectBrowserConfiguration(QString classId, QSettings &settings, QObject *parent = 0);
51 explicit UAVObjectBrowserConfiguration(const UAVObjectBrowserConfiguration &obj);
53 IUAVGadgetConfiguration *clone() const;
54 void saveConfig(QSettings &settings) const;
56 QColor unknownObjectColor() const
58 return m_unknownObjectColor;
60 QColor recentlyUpdatedColor() const
62 return m_recentlyUpdatedColor;
64 QColor manuallyChangedColor() const
66 return m_manuallyChangedColor;
68 int recentlyUpdatedTimeout() const
70 return m_recentlyUpdatedTimeout;
72 bool onlyHighlightChangedValues() const
74 return m_onlyHilightChangedValues;
76 bool categorizedView() const
78 return m_useCategorizedView;
80 bool scientificView() const
82 return m_useScientificView;
84 bool showMetaData() const
86 return m_showMetaData;
88 bool showDescription() const
90 return m_showDescription;
92 QByteArray splitterState() const
94 return m_splitterState;
97 public slots:
98 void setUnknownObjectColor(QColor color)
100 m_unknownObjectColor = color;
102 void setRecentlyUpdatedColor(QColor color)
104 m_recentlyUpdatedColor = color;
106 void setManuallyChangedColor(QColor color)
108 m_manuallyChangedColor = color;
110 void setRecentlyUpdatedTimeout(int timeout)
112 m_recentlyUpdatedTimeout = timeout;
114 void setOnlyHighlightChangedValues(bool hilight)
116 m_onlyHilightChangedValues = hilight;
118 void setCategorizedView(bool value)
120 m_useCategorizedView = value;
122 void setScientificView(bool value)
124 m_useScientificView = value;
126 void setShowMetaData(bool value)
128 m_showMetaData = value;
130 void setShowDescription(bool value)
132 m_showDescription = value;
134 void setSplitterState(QByteArray arg)
136 m_splitterState = arg;
139 private:
140 QColor m_unknownObjectColor;
141 QColor m_recentlyUpdatedColor;
142 QColor m_manuallyChangedColor;
143 bool m_onlyHilightChangedValues;
144 int m_recentlyUpdatedTimeout;
145 bool m_useCategorizedView;
146 bool m_useScientificView;
147 bool m_showMetaData;
148 bool m_showDescription;
149 QByteArray m_splitterState;
152 #endif // UAVOBJECTBROWSERCONFIGURATION_H