2010-03-31 15:35:04 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file modelviewgadgetoptionspage.cpp
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @brief
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
* @defgroup modelview
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "modelviewgadgetoptionspage.h"
|
|
|
|
#include "modelviewgadgetconfiguration.h"
|
|
|
|
|
2010-06-01 10:07:53 +02:00
|
|
|
#include "ui_modelviewoptionspage.h"
|
|
|
|
|
2010-03-31 15:35:04 +02:00
|
|
|
|
|
|
|
ModelViewGadgetOptionsPage::ModelViewGadgetOptionsPage(ModelViewGadgetConfiguration *config, QObject *parent) :
|
|
|
|
IOptionsPage(parent),
|
|
|
|
m_config(config)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QWidget *ModelViewGadgetOptionsPage::createPage(QWidget *parent)
|
|
|
|
{
|
2010-06-01 10:07:53 +02:00
|
|
|
m_page = new Ui::ModelViewOptionsPage();
|
|
|
|
QWidget *w = new QWidget(parent);
|
|
|
|
m_page->setupUi(w);
|
2010-03-31 15:35:04 +02:00
|
|
|
|
2010-06-01 10:07:53 +02:00
|
|
|
m_page->modelPathChooser->setExpectedKind(Utils::PathChooser::File);
|
|
|
|
m_page->modelPathChooser->setPromptDialogFilter(tr("3D model (*.dae *.3ds)"));
|
|
|
|
m_page->modelPathChooser->setPromptDialogTitle(tr("Choose 3D model"));
|
|
|
|
m_page->backgroundPathChooser->setExpectedKind(Utils::PathChooser::File);
|
|
|
|
m_page->backgroundPathChooser->setPromptDialogFilter(tr("Images (*.png *.jpg *.bmp *.xpm)"));
|
|
|
|
m_page->backgroundPathChooser->setPromptDialogTitle(tr("Choose background image"));
|
2010-03-31 15:35:04 +02:00
|
|
|
|
|
|
|
|
2010-06-01 10:07:53 +02:00
|
|
|
m_page->modelPathChooser->setPath(m_config->acFilename());
|
|
|
|
m_page->backgroundPathChooser->setPath(m_config->bgFilename());
|
2010-03-31 15:35:04 +02:00
|
|
|
|
2010-06-01 10:07:53 +02:00
|
|
|
return w;
|
2010-03-31 15:35:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void ModelViewGadgetOptionsPage::apply()
|
|
|
|
{
|
2010-06-01 10:07:53 +02:00
|
|
|
m_config->setAcFilename(m_page->modelPathChooser->path());
|
|
|
|
m_config->setBgFilename(m_page->backgroundPathChooser->path());
|
2010-06-10 13:15:06 +02:00
|
|
|
m_config->setVboEnabled(m_page->enableVbo->isChecked());
|
2010-03-31 15:35:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void ModelViewGadgetOptionsPage::finish()
|
|
|
|
{
|
2010-06-01 10:07:53 +02:00
|
|
|
delete m_page;
|
2010-03-31 15:35:04 +02:00
|
|
|
}
|
|
|
|
|