2 ******************************************************************************
4 * @file videogadgetoptionspage.cpp
5 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup VideoGadgetPlugin Video Gadget Plugin
10 * @brief A video 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
28 #include "videogadgetoptionspage.h"
29 #include "videogadgetconfiguration.h"
30 #include "helpdialog.h"
32 #include "ui_videooptionspage.h"
34 VideoGadgetOptionsPage::VideoGadgetOptionsPage(VideoGadgetConfiguration
*config
, QObject
*parent
) :
35 IOptionsPage(parent
), m_config(config
)
40 QWidget
*VideoGadgetOptionsPage::createPage(QWidget
*parent
)
42 m_page
= new Ui::VideoOptionsPage();
43 QWidget
*w
= new QWidget(parent
);
47 m_page
->respectAspectRatioCheckBox
->setVisible(false);
48 m_page
->helpButton
->setVisible(false);
50 m_page
->displayVideoCheckBox
->setChecked(m_config
->displayVideo());
51 m_page
->displayControlsCheckBox
->setChecked(m_config
->displayControls());
52 m_page
->autoStartCheckBox
->setChecked(m_config
->autoStart());
53 m_page
->respectAspectRatioCheckBox
->setChecked(m_config
->respectAspectRatio());
54 m_page
->descPlainTextEdit
->setPlainText(m_config
->pipelineDesc());
55 m_page
->infoPlainTextEdit
->setPlainText(m_config
->pipelineInfo());
57 connect(m_page
->helpButton
, SIGNAL(clicked()), this, SLOT(openHelpDialog()));
62 void VideoGadgetOptionsPage::apply()
64 m_config
->setDisplayVideo(m_page
->displayVideoCheckBox
->isChecked());
65 m_config
->setDisplayControls(m_page
->displayControlsCheckBox
->isChecked());
66 m_config
->setAutoStart(m_page
->autoStartCheckBox
->isChecked());
67 m_config
->setRespectAspectRatio(m_page
->respectAspectRatioCheckBox
->isChecked());
68 m_config
->setPipelineDesc(m_page
->descPlainTextEdit
->toPlainText());
69 m_config
->setPipelineInfo(m_page
->infoPlainTextEdit
->toPlainText());
72 void VideoGadgetOptionsPage::finish()
77 void VideoGadgetOptionsPage::openHelpDialog()