dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
modelviewgadgetoptionspage.cpp
Go to the documentation of this file.
1 
12 /*
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.
17  *
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.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
29 
30 #include "ui_modelviewoptionspage.h"
31 
33  QObject *parent)
34  : IOptionsPage(parent)
35  , m_config(config)
36 {
37 }
38 
39 QWidget *ModelViewGadgetOptionsPage::createPage(QWidget *parent)
40 {
41  m_page = new Ui::ModelViewOptionsPage();
42  QWidget *w = new QWidget(parent);
43  m_page->setupUi(w);
44 
45  m_page->modelPathChooser->setExpectedKind(Utils::PathChooser::File);
46  m_page->modelPathChooser->setPromptDialogFilter(tr("3D model (*.dae *.3ds)"));
47  m_page->modelPathChooser->setPromptDialogTitle(tr("Choose 3D model"));
48  m_page->backgroundPathChooser->setExpectedKind(Utils::PathChooser::File);
49  m_page->backgroundPathChooser->setPromptDialogFilter(tr("Images (*.png *.jpg *.bmp *.xpm)"));
50  m_page->backgroundPathChooser->setPromptDialogTitle(tr("Choose background image"));
51 
52  m_page->modelPathChooser->setPath(m_config->acFilename());
53  m_page->backgroundPathChooser->setPath(m_config->bgFilename());
54  m_page->enableVbo->setChecked(m_config->vboEnabled());
55 
56  return w;
57 }
58 
60 {
61  m_config->setAcFilename(m_page->modelPathChooser->path());
62  m_config->setBgFilename(m_page->backgroundPathChooser->path());
63  m_config->setVboEnabled(m_page->enableVbo->isChecked());
64 }
65 
67 {
68  delete m_page;
69 }
ModelViewGadgetOptionsPage(ModelViewGadgetConfiguration *config, QObject *parent=nullptr)
QWidget * createPage(QWidget *parent)