Ref T515, avoid unnecessary updating (last result ts) and UI adjustments

This commit is contained in:
Klaus Basan
2019-01-28 22:26:59 +01:00
committed by Mat Sutcliffe
parent 610e1559e1
commit 13357516fa
4 changed files with 12 additions and 24 deletions

View File

@@ -2,27 +2,18 @@
<ui version="4.0">
<class>CAircraftModelSetValidationDialog</class>
<widget class="QDialog" name="CAircraftModelSetValidationDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<property name="minimumSize">
<size>
<width>640</width>
<height>480</height>
</rect>
<height>400</height>
</size>
</property>
<property name="windowTitle">
<string>Model validation</string>
</property>
<layout class="QVBoxLayout" name="vl_AircraaftModelValidation">
<item>
<widget class="BlackGui::Components::CAircraftModelValidationComponent" name="comp_AircraftModelValidation">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
<widget class="BlackGui::Components::CAircraftModelValidationComponent" name="comp_AircraftModelValidation"/>
</item>
<item>
<widget class="QDialogButtonBox" name="bb_CAircraftModelSetValidationDialog">

View File

@@ -39,9 +39,12 @@ namespace BlackGui
// 1st init when running in distributed environment
QPointer<CAircraftModelValidationComponent> myself(this);
const qint64 lastResults = m_lastResults;
QTimer::singleShot(2500, this, [ = ]
{
if (!myself || !sGui || sGui->isShuttingDown()) { return; }
if (m_lastResults > lastResults) { return; } // values received in meantime
myself->requestLastResults();
});
}
@@ -53,6 +56,7 @@ namespace BlackGui
{
Q_UNUSED(simulator);
Q_UNUSED(valid);
m_lastResults = QDateTime::currentMSecsSinceEpoch();
ui->tvp_InvalidModels->updateContainerMaybeAsync(invalid);
ui->comp_Simulator->setValue(simulator);
ui->comp_Messages->clear();

View File

@@ -55,6 +55,7 @@ namespace BlackGui
private:
QScopedPointer<Ui::CAircraftModelValidationComponent> ui;
BlackMisc::CSetting<BlackMisc::Simulation::Settings::TModelMatching> m_matchingSettings { this }; //!< settings
qint64 m_lastResults = -1; //!< when received last results
//! Invalid models
void tempDisableModels(const BlackMisc::Simulation::CAircraftModelList &models);

View File

@@ -2,14 +2,6 @@
<ui version="4.0">
<class>CAircraftModelValidationComponent</class>
<widget class="QFrame" name="CAircraftModelValidationComponent">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle">
<string>Model validation</string>
</property>
@@ -50,7 +42,7 @@
<attribute name="title">
<string>Messages</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="vl_Messages">
<item>
<widget class="BlackGui::Components::CLogComponent" name="comp_Messages">
<property name="frameShape">
@@ -67,7 +59,7 @@
</item>
<item>
<widget class="QWidget" name="wi_Buttons" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="hl_ValidationButtons">
<item>
<widget class="QCheckBox" name="cb_EnableStartupCheck">
<property name="text">