Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / uavobjectbrowser / uavobjectbrowserconfiguration.cpp
blob87fc486d7989b6f3ebdb9e307c488efb22bcf059
1 /**
2 ******************************************************************************
4 * @file uavobjectbrowserconfiguration.cpp
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 #include "uavobjectbrowserconfiguration.h"
30 UAVObjectBrowserConfiguration::UAVObjectBrowserConfiguration(QString classId, QSettings &settings, QObject *parent) :
31 IUAVGadgetConfiguration(classId, parent)
33 m_unknownObjectColor = settings.value("unknownObjectColor", QColor(Qt::gray)).value<QColor>();
34 m_useCategorizedView = settings.value("CategorizedView", false).toBool();
35 m_useScientificView = settings.value("ScientificView", false).toBool();
36 m_showMetaData = settings.value("showMetaData", false).toBool();
37 m_showDescription = settings.value("showDescription", false).toBool();
38 m_splitterState = settings.value("splitterState").toByteArray();
39 m_recentlyUpdatedColor = settings.value("recentlyUpdatedColor", QColor(255, 230, 230)).value<QColor>();
40 m_manuallyChangedColor = settings.value("manuallyChangedColor", QColor(230, 230, 255)).value<QColor>();
41 m_recentlyUpdatedTimeout = settings.value("recentlyUpdatedTimeout", 500).toInt();
42 m_onlyHilightChangedValues = settings.value("onlyHilightChangedValues", false).toBool();
45 UAVObjectBrowserConfiguration::UAVObjectBrowserConfiguration(const UAVObjectBrowserConfiguration &obj) :
46 IUAVGadgetConfiguration(obj.classId(), obj.parent())
48 m_recentlyUpdatedColor = obj.m_recentlyUpdatedColor;
49 m_manuallyChangedColor = obj.m_manuallyChangedColor;
50 m_recentlyUpdatedTimeout = obj.m_recentlyUpdatedTimeout;
51 m_onlyHilightChangedValues = obj.m_onlyHilightChangedValues;
52 m_useCategorizedView = obj.m_useCategorizedView;
53 m_useScientificView = obj.m_useScientificView;
54 m_splitterState = obj.m_splitterState;
55 m_showMetaData = obj.m_showMetaData;
56 m_unknownObjectColor = obj.m_unknownObjectColor;
57 m_showDescription = obj.m_showDescription;
60 IUAVGadgetConfiguration *UAVObjectBrowserConfiguration::clone() const
62 return new UAVObjectBrowserConfiguration(*this);
65 /**
66 * Saves a configuration.
69 void UAVObjectBrowserConfiguration::saveConfig(QSettings &settings) const
71 settings.setValue("unknownObjectColor", m_unknownObjectColor);
72 settings.setValue("recentlyUpdatedColor", m_recentlyUpdatedColor);
73 settings.setValue("manuallyChangedColor", m_manuallyChangedColor);
74 settings.setValue("recentlyUpdatedTimeout", m_recentlyUpdatedTimeout);
75 settings.setValue("onlyHilightChangedValues", m_onlyHilightChangedValues);
76 settings.setValue("CategorizedView", m_useCategorizedView);
77 settings.setValue("ScientificView", m_useScientificView);
78 settings.setValue("showMetaData", m_showMetaData);
79 settings.setValue("showDescription", m_showDescription);
80 settings.setValue("splitterState", m_splitterState);