mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
refs #844, use inline UI for settings and settings in ATC component
Allow to toggle stations in/outside range
This commit is contained in:
committed by
Mathew Sutcliffe
parent
2108422dc2
commit
5d5da0641f
@@ -162,10 +162,14 @@ namespace BlackGui
|
||||
// update
|
||||
if (this->m_timestampOnlineStationsChanged > this->m_timestampLastReadOnlineStations)
|
||||
{
|
||||
const CAtcStationList onlineStations =
|
||||
// test: filter by frequency, see if this is better
|
||||
// sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidVoiceRoom()
|
||||
// sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidVoiceRoom()
|
||||
const CAtcStationsSettings settings = m_settingsAtc.getThreadLocal();
|
||||
CAtcStationList onlineStations =
|
||||
sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidFrequency();
|
||||
if (settings.showOnlyInRange())
|
||||
{
|
||||
onlineStations.removeIfOutsideRange();
|
||||
}
|
||||
|
||||
ui->tvp_AtcStationsOnline->updateContainerMaybeAsync(onlineStations);
|
||||
this->m_timestampLastReadOnlineStations = QDateTime::currentDateTimeUtc();
|
||||
@@ -309,7 +313,7 @@ namespace BlackGui
|
||||
|
||||
void CAtcStationComponent::ps_settingsChanged()
|
||||
{
|
||||
const CViewUpdateSettings settings = this->m_settings.get();
|
||||
const CViewUpdateSettings settings = this->m_settingsView.get();
|
||||
const int ms = settings.getAtcUpdateTime().toMs();
|
||||
this->m_updateTimer.setInterval(ms);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackgui/settings/viewupdatesettings.h"
|
||||
#include "blackgui/settings/atcstationssettings.h"
|
||||
#include "blackmisc/aviation/atcstation.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
@@ -136,7 +137,8 @@ namespace BlackGui
|
||||
QDateTime m_timestampOnlineStationsChanged; //!< stations marked as changed
|
||||
QDateTime m_timestampLastReadBookedStations; //!< stations read
|
||||
QDateTime m_timestampBookedStationsChanged; //!< stations marked as changed
|
||||
BlackMisc::CSettingReadOnly<BlackGui::Settings::TViewUpdateSettings> m_settings { this, &CAtcStationComponent::ps_settingsChanged };
|
||||
BlackMisc::CSettingReadOnly<BlackGui::Settings::TViewUpdateSettings> m_settingsView { this, &CAtcStationComponent::ps_settingsChanged };
|
||||
BlackMisc::CSettingReadOnly<BlackGui::Settings::TAtcStationsSettings> m_settingsAtc { this, &CAtcStationComponent::ps_settingsChanged };
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -61,6 +61,16 @@
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CSettingsAtcStationsInlineComponent" name="comp_AtcStationsSettings">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="fr_AtcStationsOnlineBottom">
|
||||
<property name="sizePolicy">
|
||||
@@ -288,6 +298,12 @@
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/atcstationview.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CSettingsAtcStationsInlineComponent</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/settingsatcstationsinlinecomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Reference in New Issue
Block a user