mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +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
|
// update
|
||||||
if (this->m_timestampOnlineStationsChanged > this->m_timestampLastReadOnlineStations)
|
if (this->m_timestampOnlineStationsChanged > this->m_timestampLastReadOnlineStations)
|
||||||
{
|
{
|
||||||
const CAtcStationList onlineStations =
|
// sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidVoiceRoom()
|
||||||
// test: filter by frequency, see if this is better
|
const CAtcStationsSettings settings = m_settingsAtc.getThreadLocal();
|
||||||
// sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidVoiceRoom()
|
CAtcStationList onlineStations =
|
||||||
sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidFrequency();
|
sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidFrequency();
|
||||||
|
if (settings.showOnlyInRange())
|
||||||
|
{
|
||||||
|
onlineStations.removeIfOutsideRange();
|
||||||
|
}
|
||||||
|
|
||||||
ui->tvp_AtcStationsOnline->updateContainerMaybeAsync(onlineStations);
|
ui->tvp_AtcStationsOnline->updateContainerMaybeAsync(onlineStations);
|
||||||
this->m_timestampLastReadOnlineStations = QDateTime::currentDateTimeUtc();
|
this->m_timestampLastReadOnlineStations = QDateTime::currentDateTimeUtc();
|
||||||
@@ -309,7 +313,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CAtcStationComponent::ps_settingsChanged()
|
void CAtcStationComponent::ps_settingsChanged()
|
||||||
{
|
{
|
||||||
const CViewUpdateSettings settings = this->m_settings.get();
|
const CViewUpdateSettings settings = this->m_settingsView.get();
|
||||||
const int ms = settings.getAtcUpdateTime().toMs();
|
const int ms = settings.getAtcUpdateTime().toMs();
|
||||||
this->m_updateTimer.setInterval(ms);
|
this->m_updateTimer.setInterval(ms);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||||
#include "blackgui/settings/viewupdatesettings.h"
|
#include "blackgui/settings/viewupdatesettings.h"
|
||||||
|
#include "blackgui/settings/atcstationssettings.h"
|
||||||
#include "blackmisc/aviation/atcstation.h"
|
#include "blackmisc/aviation/atcstation.h"
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
#include "blackmisc/identifiable.h"
|
#include "blackmisc/identifiable.h"
|
||||||
@@ -136,7 +137,8 @@ namespace BlackGui
|
|||||||
QDateTime m_timestampOnlineStationsChanged; //!< stations marked as changed
|
QDateTime m_timestampOnlineStationsChanged; //!< stations marked as changed
|
||||||
QDateTime m_timestampLastReadBookedStations; //!< stations read
|
QDateTime m_timestampLastReadBookedStations; //!< stations read
|
||||||
QDateTime m_timestampBookedStationsChanged; //!< stations marked as changed
|
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
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -61,6 +61,16 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<widget class="QFrame" name="fr_AtcStationsOnlineBottom">
|
<widget class="QFrame" name="fr_AtcStationsOnlineBottom">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -288,6 +298,12 @@
|
|||||||
<extends>QTableView</extends>
|
<extends>QTableView</extends>
|
||||||
<header>blackgui/views/atcstationview.h</header>
|
<header>blackgui/views/atcstationview.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CSettingsAtcStationsInlineComponent</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/components/settingsatcstationsinlinecomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
Reference in New Issue
Block a user