mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T431, FSD setup allow to force 4 letter airline ICAO code
This commit is contained in:
@@ -44,6 +44,7 @@ namespace BlackGui
|
||||
ui->cb_GndFlagSend->isChecked(), ui->cb_GndFlagReceive->isChecked(),
|
||||
ui->cb_FastPositionSend->isChecked(), ui->cb_FastPositionReceive->isChecked()
|
||||
);
|
||||
s.setForce3LetterAirlineCodes(ui->cb_3LetterAirlineICAO->isChecked());
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -62,6 +63,7 @@ namespace BlackGui
|
||||
ui->cb_AircraftPartsSend->setChecked(d & CFsdSetup::SendAircraftParts);
|
||||
ui->cb_FastPositionReceive->setChecked(d & CFsdSetup::ReceiveInterimPositions);
|
||||
ui->cb_FastPositionSend->setChecked(d & CFsdSetup::SendInterimPositions);
|
||||
ui->cb_3LetterAirlineICAO->setChecked(setup.force3LetterAirlineCodes());
|
||||
}
|
||||
|
||||
bool CFsdSetupForm::isFsdSetupEnabled() const
|
||||
@@ -84,12 +86,8 @@ namespace BlackGui
|
||||
{
|
||||
ui->le_TextCodec->setReadOnly(readonly);
|
||||
ui->pb_SetDefaults->setEnabled(!readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_AircraftPartsReceive, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_AircraftPartsSend, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_FastPositionReceive, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_FastPositionSend, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_GndFlagReceive, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_GndFlagSend, readonly);
|
||||
CGuiUtility::checkBoxesReadOnly(this, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_Override, false); // always editable
|
||||
|
||||
if (readonly && ui->cb_Override->isChecked())
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>255</width>
|
||||
<width>248</width>
|
||||
<height>82</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -130,6 +130,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QCheckBox" name="cb_3LetterAirlineICAO">
|
||||
<property name="toolTip">
|
||||
<string>force 3 letter airline ICAO code</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>3 letter airline</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
@@ -142,6 +152,7 @@
|
||||
<tabstop>cb_FastPositionSend</tabstop>
|
||||
<tabstop>cb_FastPositionReceive</tabstop>
|
||||
<tabstop>le_TextCodec</tabstop>
|
||||
<tabstop>cb_3LetterAirlineICAO</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -45,13 +45,15 @@ namespace BlackMisc
|
||||
|
||||
QString CFsdSetup::sendReceiveDetailsToString(SendReceiveDetails details)
|
||||
{
|
||||
static const QString ds("Send parts; %1 gnd: %2 interim: %3 Receive parts: %4 gnd: %5 interim: %6");
|
||||
static const QString ds("Send parts; %1 gnd: %2 interim: %3 Receive parts: %4 gnd: %5 interim: %6 3letter: %7");
|
||||
return ds.arg(boolToYesNo(details.testFlag(SendAircraftParts)),
|
||||
boolToYesNo(details.testFlag(SendGndFlag)),
|
||||
boolToYesNo(details.testFlag(SendInterimPositions)),
|
||||
boolToYesNo(details.testFlag(ReceiveAircraftParts)),
|
||||
boolToYesNo(details.testFlag(ReceiveGndFlag)),
|
||||
boolToYesNo(details.testFlag(ReceiveInterimPositions)));
|
||||
boolToYesNo(details.testFlag(ReceiveInterimPositions)),
|
||||
boolToYesNo(details.testFlag(Force3LetterAirlineICAO))
|
||||
);
|
||||
}
|
||||
|
||||
void CFsdSetup::setSendReceiveDetails(bool partsSend, bool partsReceive, bool gndSend, bool gndReceive, bool interimSend, bool interimReceive)
|
||||
@@ -66,9 +68,16 @@ namespace BlackMisc
|
||||
this->setSendReceiveDetails(s);
|
||||
}
|
||||
|
||||
void CFsdSetup::setForce3LetterAirlineCodes(bool force)
|
||||
{
|
||||
SendReceiveDetails d = this->getSendReceiveDetails();
|
||||
d.setFlag(Force3LetterAirlineICAO, force);
|
||||
this->setSendReceiveDetails(d);
|
||||
}
|
||||
|
||||
const CFsdSetup &CFsdSetup::vatsimStandard()
|
||||
{
|
||||
static const CFsdSetup s(AllParts);
|
||||
static const CFsdSetup s(VATSIMDefault);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,13 +46,15 @@ namespace BlackMisc
|
||||
ReceiveAircraftParts = 1 << 3, //!< aircraft parts in
|
||||
ReceiveInterimPositions = 1 << 4, //!< fast position updates in
|
||||
ReceiveGndFlag = 1 << 5, //!< gnd.flag in (position)
|
||||
Force3LetterAirlineICAO = 1 << 6, //!< force 3 letter airline ICAO code
|
||||
AllSending = SendAircraftParts | SendInterimPositions | SendGndFlag, //!< all out
|
||||
AllReceive = ReceiveAircraftParts | ReceiveInterimPositions | ReceiveGndFlag, //!< all in
|
||||
All = AllReceive | AllSending, //!< all
|
||||
AllParts = SendAircraftParts | ReceiveAircraftParts, //!< send/receive parts
|
||||
AllSendingWithoutGnd = SendAircraftParts | SendInterimPositions, //!< all out, but no gnd.flag
|
||||
AllReceiveWithoutGnd = ReceiveAircraftParts | ReceiveInterimPositions, //!< all in, but no gnd.flag
|
||||
AllWithoutGnd = AllReceiveWithoutGnd | AllSendingWithoutGnd //!< all, but no gnd.flag
|
||||
AllWithoutGnd = AllReceiveWithoutGnd | AllSendingWithoutGnd, //!< all, but no gnd.flag
|
||||
VATSIMDefault = AllParts | Force3LetterAirlineICAO
|
||||
};
|
||||
Q_DECLARE_FLAGS(SendReceiveDetails, SendReceiveDetailsFlag)
|
||||
|
||||
@@ -98,6 +100,11 @@ namespace BlackMisc
|
||||
bool receiveInterimPositions() const { return this->getSendReceiveDetails().testFlag(ReceiveInterimPositions); }
|
||||
//! @}
|
||||
|
||||
//! Airline codes @{
|
||||
bool force3LetterAirlineCodes() const { return this->getSendReceiveDetails().testFlag(Force3LetterAirlineICAO); }
|
||||
void setForce3LetterAirlineCodes(bool force);
|
||||
//! @}
|
||||
|
||||
//! Validate, provide details about issues
|
||||
CStatusMessageList validate() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user