From 46a3f925a998eea52a44d88836bc50f20c9e06e0 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 5 Jun 2018 18:40:17 +0200 Subject: [PATCH] UI improvements * mapping component does not need extra identifier as it uses "Identifiable" * misc smaller adjustments --- src/blackgui/components/aircraftcomponent.cpp | 4 +-- .../components/dbquickmappingwizard.ui | 32 +++++++------------ src/blackgui/components/mappingcomponent.cpp | 4 ++- src/blackgui/components/mappingcomponent.h | 4 --- .../components/modelmatchercomponent.h | 1 - src/blackgui/components/simulatorcomponent.ui | 6 ++++ 6 files changed, 22 insertions(+), 29 deletions(-) diff --git a/src/blackgui/components/aircraftcomponent.cpp b/src/blackgui/components/aircraftcomponent.cpp index 247dcc8f9..8b86b551c 100644 --- a/src/blackgui/components/aircraftcomponent.cpp +++ b/src/blackgui/components/aircraftcomponent.cpp @@ -100,7 +100,7 @@ namespace BlackGui const bool visible = (this->isVisibleWidget() && this->currentWidget() == ui->tb_AircraftInRange); if (this->countAircraftInView() < 1 || visible) { - ui->tvp_AircraftInRange->updateContainer(sGui->getIContextNetwork()->getAircraftInRange()); + ui->tvp_AircraftInRange->updateContainerMaybeAsync(sGui->getIContextNetwork()->getAircraftInRange()); } } if (sGui->getIContextSimulator()->getSimulatorStatus() > 0) @@ -108,7 +108,7 @@ namespace BlackGui const bool visible = (this->isVisibleWidget() && this->currentWidget() == ui->tb_AirportsInRange); if (this->countAirportsInRangeInView() < 1 || visible) { - ui->tvp_AirportsInRange->updateContainer(sGui->getIContextSimulator()->getAirportsInRange()); + ui->tvp_AirportsInRange->updateContainerMaybeAsync(sGui->getIContextSimulator()->getAirportsInRange()); } } } diff --git a/src/blackgui/components/dbquickmappingwizard.ui b/src/blackgui/components/dbquickmappingwizard.ui index 5ccd5fde3..3b762b214 100644 --- a/src/blackgui/components/dbquickmappingwizard.ui +++ b/src/blackgui/components/dbquickmappingwizard.ui @@ -32,7 +32,7 @@ - + 20 @@ -52,26 +52,16 @@ - <html><head/><body><p>You are about to write a new mapping for your current model to the swift DB. Hereby you agree<br/>with the swift CLA and license terms. For details please consult the swift about and legal page.<br/>Thank you for supporting swift</p></body></html> + <html><head/><body><p>You are about to write a new mapping for your current model to the swift DB. Hereby you agree with the swift CLA and license terms. For details please consult the swift about and legal page. </p><p>Thank you for supporting swift</p></body></html> Qt::RichText + + true + - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -519,6 +509,12 @@ + + BlackGui::Components::CDbDistributorComponent + QFrame +
blackgui/components/dbdistributorcomponent.h
+ 1 +
BlackGui::Components::CDbAircraftIcaoSelectorComponent QFrame @@ -567,12 +563,6 @@
blackgui/editors/aircraftmodelform.h
1
- - BlackGui::Components::CDbDistributorComponent - QFrame -
blackgui/components/dbdistributorcomponent.h
- 1 -
BlackGui::Components::CDbLoginComponent QFrame diff --git a/src/blackgui/components/mappingcomponent.cpp b/src/blackgui/components/mappingcomponent.cpp index 730080bb0..cdbfea944 100644 --- a/src/blackgui/components/mappingcomponent.cpp +++ b/src/blackgui/components/mappingcomponent.cpp @@ -152,6 +152,7 @@ namespace BlackGui QPointer myself(this); QTimer::singleShot(2500, this, [ = ] { + if (!myself) { return; } const CSimulatorInfo simulator(myself->getConnectedOrSelectedSimulator()); myself->onModelSetSimulatorChanged(simulator); myself->onModelSetChanged(simulator); @@ -512,6 +513,7 @@ namespace BlackGui void CMappingComponent::updateRenderedAircraftView(bool forceUpdate) { + if (!sGui || sGui->isShuttingDown()) { return; } m_updateTimer.start(); // restart if (!forceUpdate && !this->isVisibleWidget()) { @@ -524,7 +526,7 @@ namespace BlackGui if (sGui->getIContextSimulator()->getSimulatorStatus() > 0) { const CSimulatedAircraftList aircraft(sGui->getIContextNetwork()->getAircraftInRange()); - ui->tvp_RenderedAircraft->updateContainer(aircraft); + ui->tvp_RenderedAircraft->updateContainerMaybeAsync(aircraft); } else { diff --git a/src/blackgui/components/mappingcomponent.h b/src/blackgui/components/mappingcomponent.h index 48b90957d..01514afeb 100644 --- a/src/blackgui/components/mappingcomponent.h +++ b/src/blackgui/components/mappingcomponent.h @@ -168,9 +168,6 @@ namespace BlackGui //! Connection status has been changed void onNetworkConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to); - //! Identifier for data send from this component - const BlackMisc::CIdentifier &mappingIdentifier() const { return m_identifier; } - //! Update simulated aircraft view void updateRenderedAircraftView(bool forceUpdate = false); @@ -192,7 +189,6 @@ namespace BlackGui QTimer m_updateTimer; BlackMisc::CTokenBucket m_bucket { 3, BlackMisc::PhysicalQuantities::CTime(5.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()), 1}; Views::CCheckBoxDelegate *m_currentMappingsViewDelegate = nullptr; //! checkbox in view - BlackMisc::CIdentifier m_identifier { "MappingComponent", this }; BlackMisc::CSettingReadOnly m_settings { this, &CMappingComponent::settingsChanged }; //!< settings changed }; } // namespace diff --git a/src/blackgui/components/modelmatchercomponent.h b/src/blackgui/components/modelmatchercomponent.h index 471050ed6..cb7c10d77 100644 --- a/src/blackgui/components/modelmatchercomponent.h +++ b/src/blackgui/components/modelmatchercomponent.h @@ -45,7 +45,6 @@ namespace BlackGui //! Destructor virtual ~CModelMatcherComponent(); - public slots: //! Tab (where this component is embedded) has been changed void tabIndexChanged(int index); diff --git a/src/blackgui/components/simulatorcomponent.ui b/src/blackgui/components/simulatorcomponent.ui index 475a5299e..33b6a4ef3 100644 --- a/src/blackgui/components/simulatorcomponent.ui +++ b/src/blackgui/components/simulatorcomponent.ui @@ -38,6 +38,12 @@ + + QAbstractItemView::NoSelection + + + QAbstractItemView::SelectRows + false