diff --git a/src/blackgui/components/dbownmodelsetformdialog.cpp b/src/blackgui/components/dbownmodelsetformdialog.cpp index cf13facaa..dd5ad9e33 100644 --- a/src/blackgui/components/dbownmodelsetformdialog.cpp +++ b/src/blackgui/components/dbownmodelsetformdialog.cpp @@ -95,6 +95,7 @@ namespace BlackGui void CDbOwnModelSetFormDialog::simulatorChanged(const CSimulatorInfo &simulator) { Q_ASSERT_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); + Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator"); this->setSimulator(simulator); this->getMappingComponent()->setOwnModelsSimulator(simulator); this->getMappingComponent()->setOwnModelSetSimulator(simulator); diff --git a/src/blackgui/editors/ownmodelsetform.cpp b/src/blackgui/editors/ownmodelsetform.cpp index 6d29e426e..f53ad67e9 100644 --- a/src/blackgui/editors/ownmodelsetform.cpp +++ b/src/blackgui/editors/ownmodelsetform.cpp @@ -18,6 +18,7 @@ #include #include +#include using namespace BlackMisc::Simulation; using namespace BlackGui::Models; @@ -36,11 +37,16 @@ namespace BlackGui ui->comp_SimulatorSelector->setMode(CSimulatorSelector::RadioButtons); ui->comp_SimulatorSelector->setLeftMargin(0); - connect(ui->comp_SimulatorSelector, &CSimulatorSelector::changed, this, &COwnModelSetForm::onSimulatorChanged); + connect(ui->comp_SimulatorSelector, &CSimulatorSelector::changed, this, &COwnModelSetForm::onSimulatorChanged, Qt::QueuedConnection); connect(ui->rb_DisplayAllDistributors, &QRadioButton::clicked, this, &COwnModelSetForm::changeDistributorDisplay); connect(ui->rb_DisplayPreferencesDistributors, &QRadioButton::clicked, this, &COwnModelSetForm::changeDistributorDisplay); - this->onSimulatorChanged(ui->comp_SimulatorSelector->getValue()); + QPointer myself(this); + QTimer::singleShot(1250, [ = ] + { + if (!myself) { return; } + this->onSimulatorChanged(ui->comp_SimulatorSelector->getValue()); + }); } COwnModelSetForm::~COwnModelSetForm() @@ -95,6 +101,7 @@ namespace BlackGui void COwnModelSetForm::onSimulatorChanged(const CSimulatorInfo &simulator) { + Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Expect single simulator"); this->setSimulator(simulator); this->reloadData(); emit this->simulatorChanged(simulator); diff --git a/src/blackgui/editors/ownmodelsetform.h b/src/blackgui/editors/ownmodelsetform.h index de6483aec..bd1121d7d 100644 --- a/src/blackgui/editors/ownmodelsetform.h +++ b/src/blackgui/editors/ownmodelsetform.h @@ -34,7 +34,7 @@ namespace BlackGui explicit COwnModelSetForm(QWidget *parent = nullptr); //! Destructor - virtual ~COwnModelSetForm(); + virtual ~COwnModelSetForm() override; //! Reload data void reloadData(); diff --git a/src/blackgui/editors/ownmodelsetform.ui b/src/blackgui/editors/ownmodelsetform.ui index 202a43457..67a5f9093 100644 --- a/src/blackgui/editors/ownmodelsetform.ui +++ b/src/blackgui/editors/ownmodelsetform.ui @@ -6,10 +6,16 @@ 0 0 - 433 - 324 + 450 + 350 + + + 350 + 300 + + Frame @@ -27,211 +33,192 @@ 3 - - - 6 + + + Selection - - - - Own models for which DB data are available - - - DB data only - - - bg_SourceSet - - - - - - - Model has ICAO code, but not necessarily valid data - - - ICAO data - - - false - - - bg_SourceSet - - - - - - - Distributors: - - - - - - - Source set: - - - - - - - Mode: - - - - - - - Model has ICAO code known in DB - - - DB ICAO data - - - true - - - bg_SourceSet - - - - - - - new set, existing data will be deleted - - - full - - - true - - - bg_Mode - - - - - - - add to existing set - - - incremental - - - bg_Mode - - - - - - - selected - - - bg_Distributors - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - - - - - consolidate with DB - - - true - - - - - - - Simulator: - - - - - - - from preferences - - - bg_DisplayedDistributors - - - - - - - If checked the distributors from the settings page will be used - - - sort by dist. preferences - - - - - - - all distributors - - - true - - - bg_DisplayedDistributors - - - - - - - all - - - true - - - bg_Distributors - - - - - - - all from below - - - bg_Distributors - - - - + + + + + Mode: + + + + + + + new set, existing data will be deleted + + + full + + + false + + + + + + + Simulator: + + + + + + + add to existing set + + + incremental + + + + + + + Model has ICAO code known in DB + + + DB ICAO data + + + false + + + + + + + Model has ICAO code, but not necessarily valid data + + + ICAO data + + + false + + + + + + + consolidate with DB + + + true + + + + + + + Source set: + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + + Own models for which DB data are available + + + DB data only + + + + + + + Distributors: + + + + + + + selected + + + + + + + from preferences + + + + + + + all from below + + + + + + + all + + + true + + + + + + + all distributors + + + false + + + + + + + If checked the distributors from the settings page will be used + + + sort by dist. preferences + + + + + - - - QAbstractItemView::SelectRows + + + Distributors - - false - - - false - + + + + + QAbstractItemView::SelectRows + + + false + + + false + + + + @@ -249,27 +236,12 @@
blackgui/views/distributorview.h
- - rb_Full - rb_Incremental - cb_ConsolidateModelSet - rb_DbDataOnly - rb_DbIcaoCodesOnly - rb_WithIcaoData - rb_DistributorsSelected - rb_DistributorsFromBelow - rb_DistributorsAll - rb_DisplayPreferencesDistributors - rb_DisplayAllDistributors - cb_SortByPreferences - tvp_Distributors - + -