1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

GCS-Moved the wizard and calibration widgets to the stacked widget

so that they disapear during the wizard
This commit is contained in:
PT_Dreamer 2012-07-29 00:53:05 +01:00
parent 14b7666c1b
commit 6b84b58bfe
3 changed files with 38 additions and 37 deletions

View File

@ -86,6 +86,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent)
addUAVObjectToWidgetRelation("ManualControlSettings", "Deadband", m_config->deadband, 0, 0.01f);
connect(m_config->configurationWizard,SIGNAL(clicked()),this,SLOT(goToWizard()));
connect(m_config->stackedWidget,SIGNAL(currentChanged(int)),this,SLOT(disableWizardButton(int)));
connect(m_config->runCalibration,SIGNAL(toggled(bool)),this, SLOT(simpleCalibration(bool)));
connect(m_config->wzNext,SIGNAL(clicked()),this,SLOT(wzNext()));
@ -303,6 +304,14 @@ void ConfigInputWidget::goToWizard()
m_config->graphicsView->fitInView(m_txBackground, Qt::KeepAspectRatio );
}
void ConfigInputWidget::disableWizardButton(int value)
{
if(value!=0)
m_config->configurationWizard->setVisible(false);
else
m_config->configurationWizard->setVisible(true);
}
void ConfigInputWidget::wzCancel()
{
dimOtherControls(false);
@ -404,6 +413,12 @@ void ConfigInputWidget::wizardSetUpStep(enum wizardSteps step)
{
switch(step) {
case wizardWelcome:
foreach(QPointer<QWidget> wd,extraWidgets)
{
if(!wd.isNull())
delete wd;
}
extraWidgets.clear();
m_config->graphicsView->setVisible(false);
setTxMovement(nothing);
manualSettingsData=manualSettingsObj->getData();

View File

@ -45,6 +45,7 @@
#include <QtSvg/QGraphicsSvgItem>
#include "flightstatus.h"
#include "accessorydesired.h"
#include <QPointer>
class Ui_InputWidget;
@ -69,7 +70,7 @@ private:
void setTxMovement(txMovements movement);
Ui_InputWidget *m_config;
wizardSteps wizardStep;
QList<QWidget*> extraWidgets;
QList<QPointer<QWidget> > extraWidgets;
txMode transmitterMode;
txType transmitterType;
struct channelsStruct
@ -148,7 +149,7 @@ private slots:
void wzBack();
void wzCancel();
void goToWizard();
void disableWizardButton(int);
void openHelp();
void identifyControls();
void identifyLimits();

View File

@ -107,41 +107,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>663</width>
<height>745</height>
<width>671</width>
<height>755</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QPushButton" name="configurationWizard">
<property name="text">
<string>Start Configuration Wizard</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="runCalibration">
<property name="text">
<string>Run Calibration</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string/>
@ -154,6 +125,20 @@
</property>
<widget class="QWidget" name="advancedPage">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QPushButton" name="configurationWizard">
<property name="text">
<string>Start Configuration Wizard</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="runCalibration">
<property name="text">
<string>Run Calibration</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="channelSettings"/>
</item>
@ -388,8 +373,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>648</width>
<height>776</height>
<width>508</width>
<height>770</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_7">
@ -923,8 +908,8 @@ margin:1px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>663</width>
<height>745</height>
<width>550</width>
<height>147</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">