UI improvements

* mapping component does not need extra identifier as it uses "Identifiable"
* misc smaller adjustments
This commit is contained in:
Klaus Basan
2018-06-05 18:40:17 +02:00
parent 0849359722
commit 46a3f925a9
6 changed files with 22 additions and 29 deletions

View File

@@ -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());
}
}
}

View File

@@ -32,7 +32,7 @@
<layout class="QVBoxLayout" name="vl_IntroPage">
<item>
<widget class="QFrame" name="fr_Introduction">
<layout class="QHBoxLayout" name="hl_Introduction">
<layout class="QHBoxLayout" name="hl_Introduction" stretch="0,1">
<property name="spacing">
<number>20</number>
</property>
@@ -52,26 +52,16 @@
<item>
<widget class="QLabel" name="lbl_IntroText">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;You are about to write a new mapping for your current model to the swift DB. Hereby you agree&lt;br/&gt;with the swift CLA and license terms. For details please consult the swift about and legal page.&lt;br/&gt;Thank you for supporting swift&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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. &lt;/p&gt;&lt;p&gt;Thank you for supporting swift&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="hs_Introduction">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
@@ -519,6 +509,12 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>BlackGui::Components::CDbDistributorComponent</class>
<extends>QFrame</extends>
<header>blackgui/components/dbdistributorcomponent.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CDbAircraftIcaoSelectorComponent</class>
<extends>QFrame</extends>
@@ -567,12 +563,6 @@
<header>blackgui/editors/aircraftmodelform.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CDbDistributorComponent</class>
<extends>QFrame</extends>
<header>blackgui/components/dbdistributorcomponent.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CDbLoginComponent</class>
<extends>QFrame</extends>

View File

@@ -152,6 +152,7 @@ namespace BlackGui
QPointer<CMappingComponent> 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
{

View File

@@ -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<BlackGui::Settings::TViewUpdateSettings> m_settings { this, &CMappingComponent::settingsChanged }; //!< settings changed
};
} // namespace

View File

@@ -45,7 +45,6 @@ namespace BlackGui
//! Destructor
virtual ~CModelMatcherComponent();
public slots:
//! Tab (where this component is embedded) has been changed
void tabIndexChanged(int index);

View File

@@ -38,6 +38,12 @@
</property>
<item>
<widget class="BlackGui::Views::CNameVariantPairView" name="tvp_LiveData">
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>