1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

OP-1763 Adding Widget for template selection gui.

This commit is contained in:
m_thread 2015-03-08 09:33:54 +01:00
parent 54b00dd3e6
commit 389577e62a
4 changed files with 199 additions and 3 deletions

View File

@ -41,7 +41,8 @@ HEADERS += setupwizardplugin.h \
pages/servopage.h \
pages/selectionpage.h \
pages/airframeinitialtuningpage.h \
vehicletemplateexportdialog.h
vehicletemplateexportdialog.h \
vehicletemplateselectorwidget.h
SOURCES += setupwizardplugin.cpp \
setupwizard.cpp \
@ -74,7 +75,8 @@ SOURCES += setupwizardplugin.cpp \
pages/servopage.cpp \
pages/selectionpage.cpp \
pages/airframeinitialtuningpage.cpp \
vehicletemplateexportdialog.cpp
vehicletemplateexportdialog.cpp \
vehicletemplateselectorwidget.cpp
OTHER_FILES += SetupWizard.pluginspec
@ -99,7 +101,8 @@ FORMS += \
pages/servopage.ui \
pages/selectionpage.ui \
pages/airframeinitialtuningpage.ui \
vehicletemplateexportdialog.ui
vehicletemplateexportdialog.ui \
vehicletemplateselectorwidget.ui
RESOURCES += \
wizardResources.qrc

View File

@ -0,0 +1,46 @@
/**
******************************************************************************
*
* @file vehicletemplateselectorwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup [Group]
* @{
* @addtogroup VehicleTemplateSelectorWidget
* @{
* @brief [Brief]
*****************************************************************************/
/*
* 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 "vehicletemplateselectorwidget.h"
#include "ui_vehicletemplateselectorwidget.h"
VehicleTemplateSelectorWidget::VehicleTemplateSelectorWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::VehicleTemplateSelectorWidget)
{
ui->setupUi(this);
}
VehicleTemplateSelectorWidget::~VehicleTemplateSelectorWidget()
{
delete ui;
}
void VehicleTemplateSelectorWidget::updateTemplates()
{
}

View File

@ -0,0 +1,61 @@
/**
******************************************************************************
*
* @file vehicletemplateselectorwidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup [Group]
* @{
* @addtogroup VehicleTemplateSelectorWidget
* @{
* @brief [Brief]
*****************************************************************************/
/*
* 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
*/
#ifndef VEHICLETEMPLATESELECTORWIDGET_H
#define VEHICLETEMPLATESELECTORWIDGET_H
#include <QWidget>
namespace Ui {
class VehicleTemplateSelectorWidget;
}
class VehicleTemplateSelectorWidget : public QWidget
{
Q_OBJECT
public:
explicit VehicleTemplateSelectorWidget(QWidget *parent = 0);
~VehicleTemplateSelectorWidget();
void setTemplateInfo(QString path, int vehicleType, int vehicleSubType) {
m_templateFolder = path;
m_vehicleType = vehicleType;
m_vehicleSubType = vehicleSubType;
updateTemplates();
}
private:
Ui::VehicleTemplateSelectorWidget *ui;
QString m_templateFolder;
int m_vehicleType;
int m_vehicleSubType;
private slots:
void updateTemplates();
};
#endif // VEHICLETEMPLATESELECTORWIDGET_H

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>VehicleTemplateSelectorWidget</class>
<widget class="QWidget" name="VehicleTemplateSelectorWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>626</width>
<height>461</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="2,0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,4">
<item>
<widget class="QListWidget" name="templateList">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item>
<widget class="QGraphicsView" name="templateImage">
<property name="minimumSize">
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(254, 254, 254, 0);</string>
</property>
<property name="interactive">
<bool>false</bool>
</property>
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing|QPainter::TextAntialiasing</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="templateDescription">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Information about the Vehicle in short.</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>