refs #634, a component allowing to test model matching

* adjusted corresponding components
* new component for matcher
This commit is contained in:
Klaus Basan
2016-04-04 13:02:09 +02:00
parent aa6370c325
commit b567e2e57b
8 changed files with 562 additions and 19 deletions

View File

@@ -11,6 +11,7 @@
#include "ui_dbmappingcomponent.h"
#include "blackgui/components/dbautostashingcomponent.h"
#include "blackgui/components/dbmodelmappingmodifycomponent.h"
#include "blackgui/components/modelmatchercomponent.h"
#include "blackgui/guiapplication.h"
#include "blackgui/guiutility.h"
#include "blackgui/shortcut.h"
@@ -68,7 +69,8 @@ namespace BlackGui
connect(ui->comp_StashAircraft, &CDbStashComponent::modelsSuccessfullyPublished, this, &CDbMappingComponent::ps_onModelsSuccessfullyPublished);
connect(ui->comp_OwnModelSet->view(), &CAircraftModelView::rowCountChanged, this, &CDbMappingComponent::ps_onModelSetCountChanged);
connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, this, &CDbMappingComponent::tabIndexChanged);
connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, this, &CDbMappingComponent::ps_tabIndexChanged);
connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, ui->comp_ModelMatcher , &CModelMatcherComponent::tabIndexChanged);
// how to display forms
ui->editor_AircraftIcao->setSelectOnly();
@@ -454,6 +456,30 @@ namespace BlackGui
}
}
void CDbMappingComponent::ps_tabIndexChanged(int index)
{
TabIndex ti = static_cast<CDbMappingComponent::TabIndex>(index);
switch (ti)
{
case CDbMappingComponent::TabOwnModelSet:
ui->frp_Editors->setVisible(true);
ui->editor_Model->setVisible(true);
this->resizeForSelect();
break;
case CDbMappingComponent::TabModelMatcher:
ui->editor_Model->setVisible(false);
ui->frp_Editors->setVisible(false);
this->resizeForSelect();
break;
default:
ui->frp_Editors->setVisible(true);
ui->editor_Model->setVisible(true);
break;
}
emit this->tabIndexChanged(index);
}
void CDbMappingComponent::ps_onModelsSuccessfullyPublished(const CAircraftModelList &models)
{
if (models.isEmpty()) { return; }