From a340167493c6e7c0c482553fa9301d84d090f3f6 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 15 Feb 2019 02:44:19 +0100 Subject: [PATCH] Some 1st model set wizard improvements * only use DB models * icon for create button * confirm message before overriding the model set * info if there are no models --- .../components/dbownmodelsetcomponent.h | 6 +- .../components/firstmodelsetcomponent.cpp | 21 ++ .../components/firstmodelsetcomponent.ui | 319 ++++++++++-------- 3 files changed, 209 insertions(+), 137 deletions(-) diff --git a/src/blackgui/components/dbownmodelsetcomponent.h b/src/blackgui/components/dbownmodelsetcomponent.h index 73373e035..7761c0714 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.h +++ b/src/blackgui/components/dbownmodelsetcomponent.h @@ -102,12 +102,12 @@ namespace BlackGui //! Simulator void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator); - //! \copydoc BlackGui::Components::CSimulatorSelector::setMode - void setSimulatorSelectorMode(CSimulatorSelector::Mode mode); - //! Deferred init of simulator void triggerSetSimulatorDeferred(const BlackMisc::Simulation::CSimulatorInfo &simulator); + //! \copydoc BlackGui::Components::CSimulatorSelector::setMode + void setSimulatorSelectorMode(CSimulatorSelector::Mode mode); + //! \copydoc CDbMappingComponentAware::setMappingComponent virtual void setMappingComponent(CDbMappingComponent *component) override; diff --git a/src/blackgui/components/firstmodelsetcomponent.cpp b/src/blackgui/components/firstmodelsetcomponent.cpp index 1346005fd..cb4906910 100644 --- a/src/blackgui/components/firstmodelsetcomponent.cpp +++ b/src/blackgui/components/firstmodelsetcomponent.cpp @@ -272,6 +272,27 @@ namespace BlackGui modelsForSet = modelsForSet.findByDistributors(distributors); } + if (ui->cb_DbDataOnly->isChecked()) { modelsForSet.removeObjectsWithoutDbKey(); } + if (modelsForSet.isEmpty()) + { + this->showOverlayHTMLMessage("Selection yielded no result!"); + return; + } + + // just in case, paranoia + if (!m_modelSetDialog || !m_modelSetDialog->modelSetComponent()) + { + this->showOverlayHTMLMessage("No model set dialog, cannot continue"); + return; + } + + const int modelsSetCount = m_modelSetDialog->modelSetComponent()->getModelSetCount(); + if (modelsSetCount > 0) + { + QMessageBox::StandardButton override = QMessageBox::question(this, "Override", "Override existing model set?", QMessageBox::Yes | QMessageBox::No); + if (override != QMessageBox::Yes) { return; } + } + m_modelSetDialog->modelSetComponent()->setModelSet(modelsForSet, simulator); ui->pb_ModelSet->click(); } diff --git a/src/blackgui/components/firstmodelsetcomponent.ui b/src/blackgui/components/firstmodelsetcomponent.ui index 3cd678e44..e2d4edde4 100644 --- a/src/blackgui/components/firstmodelsetcomponent.ui +++ b/src/blackgui/components/firstmodelsetcomponent.ui @@ -6,14 +6,14 @@ 0 0 - 356 - 500 + 481 + 279 Configure a 1st model set - + @@ -56,143 +56,174 @@ 5 - - - Simulator - - - - - - - 100 - 0 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Models - - - - - - Models: - - - + + + + 0 + + + 0 + + + 0 + + + 0 + - - - Model dir.: + + + Simulator + + + + + + 100 + 0 + + + + + - - - - change + + + + Selection + + + + + with DB data only + + + true + + + + - - - - clear directory or multiple directories - - - clear - - - - - - - true - - - model directory from settings - - - - - - - Model set - - - - - - - true - - - model info - - - - - - - true - - - model set info - - - - - - - display - - - - - - - - 100 - 0 - - - - display - - - - - - - reload - - - - - - - create + + + + Models + + + + + true + + + model directory from settings + + + + + + + Models: + + + + + + + Model set + + + + + + + Model dir.: + + + + + + + clear directory or multiple directories + + + clear + + + + + + + + 100 + 0 + + + + display + + + + + + + display + + + + + + + create + + + + :/diagona/icons/diagona/icons/tick-white.png:/diagona/icons/diagona/icons/tick-white.png + + + false + + + + + + + true + + + model info + + + + + + + true + + + model set info + + + + + + + reload + + + + + + + change + + + + @@ -200,10 +231,16 @@ + + + 0 + 0 + + Distributions - + @@ -229,6 +266,20 @@ 1 - + + le_ModelDirectories + pb_ClearModelDir + pb_ChangeModelDir + le_ModelsInfo + pb_Models + pb_ModelsTriggerReload + cb_DbDataOnly + le_ModelSetInfo + pb_ModelSet + pb_CreateModelSet + + + +