refs #618, GUI dialog to create own model set

* new tab in model mapping component
* form + dialog to select appropriate models
This commit is contained in:
Klaus Basan
2016-03-14 20:27:46 +01:00
parent 17cbd31095
commit 42d5ceff32
14 changed files with 992 additions and 74 deletions

View File

@@ -0,0 +1,67 @@
/* Copyright (C) 2016
* swift project Community / Contributors
*
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "ownmodelsetform.h"
#include "ui_ownmodelsetform.h"
#include "blackgui/models/distributorlistmodel.h"
#include "blackgui/guiapplication.h"
#include "blackmisc/simulation/distributorlist.h"
using namespace BlackMisc::Simulation;
using namespace BlackGui::Models;
namespace BlackGui
{
namespace Editors
{
COwnModelSetForm::COwnModelSetForm(QWidget *parent) :
QFrame(parent),
ui(new Ui::COwnModelSetForm)
{
ui->setupUi(this);
this->ui->tvp_Distributors->setDistributorMode(CDistributorListModel::Minimal);
}
COwnModelSetForm::~COwnModelSetForm()
{
// void
}
void COwnModelSetForm::reloadData()
{
Q_ASSERT_X(sGui && sGui->hasWebDataServices(), Q_FUNC_INFO, "Missing web data services");
const CDistributorList distributors(sGui->getWebDataServices()->getDistributors());
if (!distributors.isEmpty())
{
this->ui->tvp_Distributors->updateContainerMaybeAsync(distributors);
}
}
bool COwnModelSetForm::selectedDistributors() const
{
return this->ui->rb_SelectedDistributors->isChecked();
}
bool COwnModelSetForm::dbDataOnly() const
{
return this->ui->rb_DbDataOnly->isChecked();
}
bool COwnModelSetForm::dbIcaoCodesOnly() const
{
return this->ui->rb_DbIcaoCodesOnly->isChecked();
}
CDistributorList COwnModelSetForm::getSelectedDistributors() const
{
return ui->tvp_Distributors->selectedObjects();
}
} // ns
} // ns