dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavobjectbrowseroptionspage.cpp
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
30 #include <QLabel>
31 #include <QSpinBox>
32 #include <QPushButton>
33 #include <QHBoxLayout>
34 #include <QVBoxLayout>
35 #include <QColorDialog>
36 
37 #include "ui_uavobjectbrowseroptionspage.h"
38 
40  QObject *parent)
41  : IOptionsPage(parent)
42  , m_config(config)
43 {
44 }
45 
46 QWidget *UAVObjectBrowserOptionsPage::createPage(QWidget *parent)
47 {
48  m_page = new Ui::UAVObjectBrowserOptionsPage();
49  QWidget *w = new QWidget(parent);
50  m_page->setupUi(w);
51 
52  m_page->recentlyUpdatedButton->setColor(m_config->recentlyUpdatedColor());
53  m_page->manuallyChangedButton->setColor(m_config->manuallyChangedColor());
54  m_page->notPresentOnHwButton->setColor(m_config->notPresentOnHwColor());
55  m_page->highlightBox->setChecked(m_config->onlyHighlightChangedValues());
56 
57  return w;
58 }
59 
61 {
62  m_config->setRecentlyUpdatedColor(m_page->recentlyUpdatedButton->color());
63  m_config->setManuallyChangedColor(m_page->manuallyChangedButton->color());
64  m_config->setNotPresentOnHwColor(m_page->notPresentOnHwButton->color());
65  m_config->setOnlyHighlightChangedValues(m_page->highlightBox->isChecked());
66 }
67 
69 {
70  delete m_page;
71 }
UAVObjectBrowserOptionsPage(UAVObjectBrowserConfiguration *config, QObject *parent=nullptr)
QWidget * createPage(QWidget *parent)