mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 09:57:06 +08:00
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:
67
src/blackgui/editors/ownmodelsetform.cpp
Normal file
67
src/blackgui/editors/ownmodelsetform.cpp
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user