2 ******************************************************************************
4 * @file uavobjectbrowser.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
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
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
27 #include "uavobjectbrowser.h"
28 #include "uavobjectbrowserwidget.h"
30 UAVObjectBrowser::UAVObjectBrowser(QString classId
, UAVObjectBrowserWidget
*widget
, QWidget
*parent
) :
31 IUAVGadget(classId
, parent
),
35 connect(m_widget
, SIGNAL(viewOptionsChanged(bool, bool, bool, bool)), this, SLOT(viewOptionsChangedSlot(bool, bool, bool, bool)));
36 connect(m_widget
, SIGNAL(splitterChanged(QByteArray
)), this, SLOT(splitterChanged(QByteArray
)));
39 UAVObjectBrowser::~UAVObjectBrowser()
44 void UAVObjectBrowser::loadConfiguration(IUAVGadgetConfiguration
*config
)
46 UAVObjectBrowserConfiguration
*m
= qobject_cast
<UAVObjectBrowserConfiguration
*>(config
);
49 m_widget
->setUnknownObjectColor(m
->unknownObjectColor());
50 m_widget
->setRecentlyUpdatedColor(m
->recentlyUpdatedColor());
51 m_widget
->setManuallyChangedColor(m
->manuallyChangedColor());
52 m_widget
->setRecentlyUpdatedTimeout(m
->recentlyUpdatedTimeout());
53 m_widget
->setOnlyHighlightChangedValues(m
->onlyHighlightChangedValues());
54 m_widget
->setViewOptions(m
->categorizedView(), m
->showMetaData(), m
->scientificView(), m
->showDescription());
55 m_widget
->setSplitterState(m
->splitterState());
58 void UAVObjectBrowser::saveState(QSettings
&settings
) const
60 m_widget
->saveState(settings
);
64 void UAVObjectBrowser::restoreState(QSettings
&settings
)
66 m_widget
->restoreState(settings
);
69 void UAVObjectBrowser::viewOptionsChangedSlot(bool categorized
, bool scientific
, bool metadata
, bool description
)
72 m_config
->setCategorizedView(categorized
);
73 m_config
->setScientificView(scientific
);
74 m_config
->setShowMetaData(metadata
);
75 m_config
->setShowDescription(description
);
79 void UAVObjectBrowser::splitterChanged(QByteArray state
)
82 m_config
->setSplitterState(state
);