mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 12:55:31 +08:00
Ref T730, removed voice room selection in ATC station component and settings
This commit is contained in:
committed by
Mat Sutcliffe
parent
96669ea507
commit
be4776ce85
@@ -221,7 +221,6 @@ namespace BlackGui
|
|||||||
int inRangeCount = -1;
|
int inRangeCount = -1;
|
||||||
|
|
||||||
if (settings.showOnlyWithValidFrequency()) { onlineStations = onlineStations.stationsWithValidFrequency(); }
|
if (settings.showOnlyWithValidFrequency()) { onlineStations = onlineStations.stationsWithValidFrequency(); }
|
||||||
if (settings.showOnlyWithValidVoiceRoom()) { onlineStations = onlineStations.stationsWithValidVoiceRoom(); }
|
|
||||||
if (settings.showOnlyInRange())
|
if (settings.showOnlyInRange())
|
||||||
{
|
{
|
||||||
onlineStations.removeIfOutsideRange();
|
onlineStations.removeIfOutsideRange();
|
||||||
@@ -341,7 +340,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CAtcStationComponent::connectionStatusChanged(const CConnectionStatus &from, const CConnectionStatus &to)
|
void CAtcStationComponent::connectionStatusChanged(const CConnectionStatus &from, const CConnectionStatus &to)
|
||||||
{
|
{
|
||||||
Q_UNUSED(from);
|
Q_UNUSED(from)
|
||||||
if (to.isConnected())
|
if (to.isConnected())
|
||||||
{
|
{
|
||||||
ui->tvp_AtcStationsOnline->clear();
|
ui->tvp_AtcStationsOnline->clear();
|
||||||
@@ -383,13 +382,13 @@ namespace BlackGui
|
|||||||
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
|
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
|
||||||
this->update();
|
this->update();
|
||||||
});
|
});
|
||||||
Q_UNUSED(index);
|
Q_UNUSED(index)
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAtcStationComponent::onCountChanged(int count, bool withFilter)
|
void CAtcStationComponent::onCountChanged(int count, bool withFilter)
|
||||||
{
|
{
|
||||||
Q_UNUSED(count);
|
Q_UNUSED(count)
|
||||||
Q_UNUSED(withFilter);
|
Q_UNUSED(withFilter)
|
||||||
const int ib = ui->tw_Atc->indexOf(ui->tb_AtcStationsBooked);
|
const int ib = ui->tw_Atc->indexOf(ui->tb_AtcStationsBooked);
|
||||||
QString b = ui->tw_Atc->tabBar()->tabText(ib);
|
QString b = ui->tw_Atc->tabBar()->tabText(ib);
|
||||||
b = CGuiUtility::replaceTabCountValue(b, this->countBookedStations());
|
b = CGuiUtility::replaceTabCountValue(b, this->countBookedStations());
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ namespace BlackGui
|
|||||||
ui(new Ui::CSettingsAtcStationsInlineComponent)
|
ui(new Ui::CSettingsAtcStationsInlineComponent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->rb_All->setChecked(true); // default for AFV
|
||||||
|
|
||||||
connect(ui->rb_InRange, &QRadioButton::toggled, this, &CSettingsAtcStationsInlineComponent::changeSettings, Qt::QueuedConnection);
|
connect(ui->rb_InRange, &QRadioButton::toggled, this, &CSettingsAtcStationsInlineComponent::changeSettings, Qt::QueuedConnection);
|
||||||
connect(ui->cb_Frequency, &QRadioButton::released, this, &CSettingsAtcStationsInlineComponent::changeSettings, Qt::QueuedConnection);
|
connect(ui->cb_Frequency, &QRadioButton::released, this, &CSettingsAtcStationsInlineComponent::changeSettings, Qt::QueuedConnection);
|
||||||
connect(ui->cb_VoiceRoom, &QRadioButton::released, this, &CSettingsAtcStationsInlineComponent::changeSettings, Qt::QueuedConnection);
|
|
||||||
|
|
||||||
QPointer<CSettingsAtcStationsInlineComponent> myself(this);
|
QPointer<CSettingsAtcStationsInlineComponent> myself(this);
|
||||||
QTimer::singleShot(2000, this, [ = ]
|
QTimer::singleShot(2000, this, [ = ]
|
||||||
@@ -61,19 +62,16 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui->cb_Frequency->setChecked(s.showOnlyWithValidFrequency());
|
ui->cb_Frequency->setChecked(s.showOnlyWithValidFrequency());
|
||||||
ui->cb_VoiceRoom->setChecked(s.showOnlyWithValidVoiceRoom());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettingsAtcStationsInlineComponent::changeSettings()
|
void CSettingsAtcStationsInlineComponent::changeSettings()
|
||||||
{
|
{
|
||||||
const bool onlyInRange = ui->rb_InRange->isChecked();
|
const bool onlyInRange = ui->rb_InRange->isChecked();
|
||||||
const bool freq = ui->cb_Frequency->isChecked();
|
const bool freq = ui->cb_Frequency->isChecked();
|
||||||
const bool voice = ui->cb_VoiceRoom->isChecked();
|
|
||||||
CAtcStationsSettings s = m_atcSettings.getThreadLocal();
|
CAtcStationsSettings s = m_atcSettings.getThreadLocal();
|
||||||
const CAtcStationsSettings oldSettings = s;
|
const CAtcStationsSettings oldSettings = s;
|
||||||
s.setShowOnlyInRange(onlyInRange);
|
s.setShowOnlyInRange(onlyInRange);
|
||||||
s.setShowOnlyWithValidFrequency(freq);
|
s.setShowOnlyWithValidFrequency(freq);
|
||||||
s.setShowOnlyWithValidVoiceRoom(voice);
|
|
||||||
if (oldSettings == s) { return; }
|
if (oldSettings == s) { return; }
|
||||||
m_atcSettings.setAndSave(s);
|
m_atcSettings.setAndSave(s);
|
||||||
emit this->changed();
|
emit this->changed();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Frame</string>
|
<string>ATC stations settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="hl_AtcStationsInlineComponent">
|
<layout class="QHBoxLayout" name="hl_AtcStationsInlineComponent">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
@@ -36,16 +36,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="cb_VoiceRoom">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>valid voice rooms only</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>voice room only</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="hs_Settings">
|
<spacer name="hs_Settings">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@@ -64,6 +54,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>all</string>
|
<string>all</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -72,7 +65,7 @@
|
|||||||
<string>in range</string>
|
<string>in range</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
QString CAtcStationsSettings::convertToQString(bool i18n) const
|
QString CAtcStationsSettings::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n)
|
||||||
static const QString s("In range only: %1 valid freq: %2 valid voice room: %3");
|
static const QString s("In range only: %1 valid freq: %2");
|
||||||
return s.arg(boolToOnOff(this->showOnlyInRange()), boolToOnOff(this->showOnlyWithValidFrequency()), boolToOnOff(this->showOnlyWithValidVoiceRoom()));
|
return s.arg(boolToOnOff(this->showOnlyInRange()), boolToOnOff(this->showOnlyWithValidFrequency()));
|
||||||
}
|
}
|
||||||
|
|
||||||
CVariant CAtcStationsSettings::propertyByIndex(const CPropertyIndex &index) const
|
CVariant CAtcStationsSettings::propertyByIndex(const CPropertyIndex &index) const
|
||||||
@@ -32,7 +32,6 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
case IndexInRangeOnly: return CVariant::fromValue(m_showOnlyInRange);
|
case IndexInRangeOnly: return CVariant::fromValue(m_showOnlyInRange);
|
||||||
case IndexValidFrequencyOnly: return CVariant::fromValue(m_onlyWithValidFrequency);
|
case IndexValidFrequencyOnly: return CVariant::fromValue(m_onlyWithValidFrequency);
|
||||||
case IndexValidVoiceRoomOnly: return CVariant::fromValue(m_onlyWithValidVoiceRoom);
|
|
||||||
default: return CValueObject::propertyByIndex(index);
|
default: return CValueObject::propertyByIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,7 +44,6 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
case IndexInRangeOnly: this->setShowOnlyInRange(variant.toBool()); break;
|
case IndexInRangeOnly: this->setShowOnlyInRange(variant.toBool()); break;
|
||||||
case IndexValidFrequencyOnly: this->setShowOnlyWithValidFrequency(variant.toBool()); break;
|
case IndexValidFrequencyOnly: this->setShowOnlyWithValidFrequency(variant.toBool()); break;
|
||||||
case IndexValidVoiceRoomOnly: this->setShowOnlyWithValidVoiceRoom(variant.toBool()); break;
|
|
||||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ namespace BlackGui
|
|||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
IndexInRangeOnly = BlackMisc::CPropertyIndex::GlobalIndexCAtcStationsSettings,
|
IndexInRangeOnly = BlackMisc::CPropertyIndex::GlobalIndexCAtcStationsSettings,
|
||||||
IndexValidFrequencyOnly,
|
IndexValidFrequencyOnly
|
||||||
IndexValidVoiceRoomOnly
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Default constructor
|
//! Default constructor
|
||||||
@@ -46,12 +45,6 @@ namespace BlackGui
|
|||||||
//! Show only with valid frequency
|
//! Show only with valid frequency
|
||||||
void setShowOnlyWithValidFrequency(bool onlyValidFrequency) { m_onlyWithValidFrequency = onlyValidFrequency; }
|
void setShowOnlyWithValidFrequency(bool onlyValidFrequency) { m_onlyWithValidFrequency = onlyValidFrequency; }
|
||||||
|
|
||||||
//! Show only with valid voice room?
|
|
||||||
bool showOnlyWithValidVoiceRoom() const { return m_onlyWithValidVoiceRoom; }
|
|
||||||
|
|
||||||
//! Show only with valid voice room
|
|
||||||
void setShowOnlyWithValidVoiceRoom(bool onlyValidVoiceRoom) { m_onlyWithValidVoiceRoom = onlyValidVoiceRoom; }
|
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|
||||||
@@ -64,13 +57,11 @@ namespace BlackGui
|
|||||||
private:
|
private:
|
||||||
bool m_showOnlyInRange = true;
|
bool m_showOnlyInRange = true;
|
||||||
bool m_onlyWithValidFrequency = true;
|
bool m_onlyWithValidFrequency = true;
|
||||||
bool m_onlyWithValidVoiceRoom = false;
|
|
||||||
|
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
CAtcStationsSettings,
|
CAtcStationsSettings,
|
||||||
BLACK_METAMEMBER(showOnlyInRange),
|
BLACK_METAMEMBER(showOnlyInRange),
|
||||||
BLACK_METAMEMBER(onlyWithValidFrequency),
|
BLACK_METAMEMBER(onlyWithValidFrequency)
|
||||||
BLACK_METAMEMBER(onlyWithValidVoiceRoom)
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user