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

LP-16 Buttons not shown when widget is in Wizard.

This commit is contained in:
m_thread 2015-07-16 16:48:34 +02:00
parent ba8b01cc6b
commit fd3eaa2fef
4 changed files with 8 additions and 4 deletions

View File

@ -47,7 +47,7 @@ AirframeInitialTuningPage::~AirframeInitialTuningPage()
void AirframeInitialTuningPage::initializePage()
{
ui->selectorWidget->setTemplateInfo(getWizard()->getVehicleType(), getWizard()->getVehicleSubType());
ui->selectorWidget->setTemplateInfo(getWizard()->getVehicleType(), getWizard()->getVehicleSubType(), false);
}
bool AirframeInitialTuningPage::validatePage()

View File

@ -64,7 +64,7 @@ VehicleTemplateExportDialog::VehicleTemplateExportDialog(QWidget *parent) :
m_uavoManager = pm->getObject<UAVObjectManager>();
ui->Photo->setScene(new QGraphicsScene(this));
ui->Type->setText(setupVehicleType());
ui->selectionWidget->setTemplateInfo(m_type, m_subType);
ui->selectionWidget->setTemplateInfo(m_type, m_subType, true);
connect(ui->Name, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
connect(ui->Owner, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));

View File

@ -58,8 +58,9 @@ VehicleTemplateSelectorWidget::~VehicleTemplateSelectorWidget()
delete ui;
}
void VehicleTemplateSelectorWidget::setTemplateInfo(int vehicleType, int vehicleSubType)
void VehicleTemplateSelectorWidget::setTemplateInfo(int vehicleType, int vehicleSubType, bool showTemplateControls)
{
ui->buttonFrame->setVisible(showTemplateControls);
m_vehicleType = vehicleType;
m_vehicleSubType = vehicleSubType;
updateTemplates();
@ -297,6 +298,9 @@ void VehicleTemplateSelectorWidget::setupTemplateList()
item->setData(Qt::UserRole + 2, QVariant::fromValue(vtemplate->editable()));
if (vtemplate->editable()) {
item->setData(Qt::ForegroundRole, QVariant::fromValue(QColor(Qt::darkGreen)));
item->setData(Qt::ToolTipRole, QVariant::fromValue(tr("Local template.")));
} else {
item->setData(Qt::ToolTipRole, QVariant::fromValue(tr("Built-in template.")));
}
item->setData(Qt::UserRole + 3, QVariant::fromValue(vtemplate->templatePath()));
}

View File

@ -72,7 +72,7 @@ class VehicleTemplateSelectorWidget : public QWidget {
public:
explicit VehicleTemplateSelectorWidget(QWidget *parent = 0);
~VehicleTemplateSelectorWidget();
void setTemplateInfo(int vehicleType, int vehicleSubType);
void setTemplateInfo(int vehicleType, int vehicleSubType, bool showTemplateControls);
QJsonObject *selectedTemplate() const;
public slots:
void templateSelectionChanged();