mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
@@ -132,6 +132,17 @@ namespace BlackMisc
|
|||||||
return withHash ? u'#' % h : h;
|
return withHash ? u'#' % h : h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CRgbColor::packed() const
|
||||||
|
{
|
||||||
|
if (!isValid()) { return 0; }
|
||||||
|
return static_cast<int>(toQColor().rgb() & qRgba(255, 255, 255, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
CRgbColor CRgbColor::fromPacked(int rgb)
|
||||||
|
{
|
||||||
|
return { qRed(rgb), qGreen(rgb), qBlue(rgb) };
|
||||||
|
}
|
||||||
|
|
||||||
void CRgbColor::setByString(const QString &color, bool isName)
|
void CRgbColor::setByString(const QString &color, bool isName)
|
||||||
{
|
{
|
||||||
if (color.isEmpty()) { return; }
|
if (color.isEmpty()) { return; }
|
||||||
|
|||||||
@@ -86,6 +86,12 @@ namespace BlackMisc
|
|||||||
//! Hex value
|
//! Hex value
|
||||||
QString hex(bool withHash = false) const;
|
QString hex(bool withHash = false) const;
|
||||||
|
|
||||||
|
//! Value packed in 24 bit integer
|
||||||
|
int packed() const;
|
||||||
|
|
||||||
|
//! Construct from packed 24 bit integer value
|
||||||
|
static CRgbColor fromPacked(int rgb);
|
||||||
|
|
||||||
//! Hex or color name
|
//! Hex or color name
|
||||||
void setByString(const QString &color, bool isName = false);
|
void setByString(const QString &color, bool isName = false);
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ namespace BlackSimPlugin
|
|||||||
s.setMaxPlanes(ui->sb_MaxAircraft->value());
|
s.setMaxPlanes(ui->sb_MaxAircraft->value());
|
||||||
s.setFollowAircraftDistanceM(ui->sb_FollowAircraftDistanceM->value());
|
s.setFollowAircraftDistanceM(ui->sb_FollowAircraftDistanceM->value());
|
||||||
s.setDrawingLabels(ui->cb_DrawLabels->isChecked());
|
s.setDrawingLabels(ui->cb_DrawLabels->isChecked());
|
||||||
|
s.setLabelColor(ui->cs_LabelColor->getColor().packed());
|
||||||
s.setNightTextureModeQt(ui->cb_NightTextureMode->currentText());
|
s.setNightTextureModeQt(ui->cb_NightTextureMode->currentText());
|
||||||
s.setBundlingTaxiAndLandingLights(ui->cb_BundleTaxiLandingLights->isChecked());
|
s.setBundlingTaxiAndLandingLights(ui->cb_BundleTaxiLandingLights->isChecked());
|
||||||
s.setTcasEnabled(ui->cb_TcasEnabled->isChecked());
|
s.setTcasEnabled(ui->cb_TcasEnabled->isChecked());
|
||||||
@@ -95,7 +96,12 @@ namespace BlackSimPlugin
|
|||||||
marginToInt(ui->le_MsgBoxMarginsRight->text(), 20),
|
marginToInt(ui->le_MsgBoxMarginsRight->text(), 20),
|
||||||
marginToInt(ui->le_MsgBoxMarginsBottom->text(), 20),
|
marginToInt(ui->le_MsgBoxMarginsBottom->text(), 20),
|
||||||
ui->sb_MessageBoxLines->value(),
|
ui->sb_MessageBoxLines->value(),
|
||||||
ui->sb_MessageBoxDuration->value()
|
ui->sb_MessageBoxDuration->value(),
|
||||||
|
ui->cs_ColorFreq->getColor().packed(),
|
||||||
|
ui->cs_ColorPriv->getColor().packed(),
|
||||||
|
ui->cs_ColorServ->getColor().packed(),
|
||||||
|
ui->cs_ColorStat->getColor().packed(),
|
||||||
|
ui->cs_ColorSup->getColor().packed()
|
||||||
);
|
);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
@@ -107,6 +113,7 @@ namespace BlackSimPlugin
|
|||||||
ui->sb_FollowAircraftDistanceM->setValue(settings.getFollowAircraftDistanceM());
|
ui->sb_FollowAircraftDistanceM->setValue(settings.getFollowAircraftDistanceM());
|
||||||
ui->ds_MaxDrawDistanceNM->setValue(settings.getMaxDrawDistanceNM());
|
ui->ds_MaxDrawDistanceNM->setValue(settings.getMaxDrawDistanceNM());
|
||||||
ui->cb_DrawLabels->setChecked(settings.isDrawingLabels());
|
ui->cb_DrawLabels->setChecked(settings.isDrawingLabels());
|
||||||
|
ui->cs_LabelColor->setColor(CRgbColor::fromPacked(settings.getLabelColor()));
|
||||||
ui->cb_BundleTaxiLandingLights->setChecked(settings.isBundlingTaxiAndLandingLights());
|
ui->cb_BundleTaxiLandingLights->setChecked(settings.isBundlingTaxiAndLandingLights());
|
||||||
ui->cb_TcasEnabled->setChecked(settings.isTcasEnabled());
|
ui->cb_TcasEnabled->setChecked(settings.isTcasEnabled());
|
||||||
ui->cb_TerrainProbeEnabled->setChecked(settings.isTerrainProbeEnabled());
|
ui->cb_TerrainProbeEnabled->setChecked(settings.isTerrainProbeEnabled());
|
||||||
@@ -128,7 +135,7 @@ namespace BlackSimPlugin
|
|||||||
const std::vector<int> values = settings.getMessageBoxValuesVector();
|
const std::vector<int> values = settings.getMessageBoxValuesVector();
|
||||||
if (values.size() >= 6)
|
if (values.size() >= 6)
|
||||||
{
|
{
|
||||||
// left, top, right, bottom, height
|
// left, top, right, bottom, height, duration
|
||||||
ui->le_MsgBoxMarginsLeft->setText(QString::number(values[0]));
|
ui->le_MsgBoxMarginsLeft->setText(QString::number(values[0]));
|
||||||
ui->le_MsgBoxMarginsTop->setText(QString::number(values[1]));
|
ui->le_MsgBoxMarginsTop->setText(QString::number(values[1]));
|
||||||
ui->le_MsgBoxMarginsRight->setText(QString::number(values[2]));
|
ui->le_MsgBoxMarginsRight->setText(QString::number(values[2]));
|
||||||
@@ -136,6 +143,15 @@ namespace BlackSimPlugin
|
|||||||
ui->sb_MessageBoxLines->setValue(values[4]);
|
ui->sb_MessageBoxLines->setValue(values[4]);
|
||||||
ui->sb_MessageBoxDuration->setValue(values[5]);
|
ui->sb_MessageBoxDuration->setValue(values[5]);
|
||||||
}
|
}
|
||||||
|
if (values.size() >= 11)
|
||||||
|
{
|
||||||
|
// freq, priv, serv, stat, sup
|
||||||
|
ui->cs_ColorFreq->setColor(CRgbColor::fromPacked(values[6]));
|
||||||
|
ui->cs_ColorPriv->setColor(CRgbColor::fromPacked(values[7]));
|
||||||
|
ui->cs_ColorServ->setColor(CRgbColor::fromPacked(values[8]));
|
||||||
|
ui->cs_ColorStat->setColor(CRgbColor::fromPacked(values[9]));
|
||||||
|
ui->cs_ColorSup->setColor(CRgbColor::fromPacked(values[10]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorXPlaneConfigWindow::onSettingsChanged()
|
void CSimulatorXPlaneConfigWindow::onSettingsChanged()
|
||||||
|
|||||||
@@ -135,55 +135,65 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_LabelColor">
|
||||||
|
<property name="text">
|
||||||
|
<string>Label color</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="BlackGui::Components::CColorSelector" name="cs_LabelColor" />
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="lbl_BundleLights">
|
<widget class="QLabel" name="lbl_BundleLights">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Bundle lights</string>
|
<string>Bundle lights</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QCheckBox" name="cb_BundleTaxiLandingLights">
|
<widget class="QCheckBox" name="cb_BundleTaxiLandingLights">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>bundle taxi and landing lights</string>
|
<string>bundle taxi and landing lights</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="lbl_TcasEnabled">
|
<widget class="QLabel" name="lbl_TcasEnabled">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>TCAS</string>
|
<string>TCAS</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QCheckBox" name="cb_TcasEnabled">
|
<widget class="QCheckBox" name="cb_TcasEnabled">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>show traffic on TCAS</string>
|
<string>show traffic on TCAS</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QLabel" name="lbl_DebugMode">
|
<widget class="QLabel" name="lbl_DebugMode">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Logging</string>
|
<string>Logging</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="8" column="1">
|
||||||
<widget class="QCheckBox" name="cb_LogRenderPhases">
|
<widget class="QCheckBox" name="cb_LogRenderPhases">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>log.render phases</string>
|
<string>log.render phases</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="lbl_MessageBox">
|
<widget class="QLabel" name="lbl_MessageBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Message box </string>
|
<string>Message box </string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1">
|
<item row="9" column="1">
|
||||||
<widget class="QWidget" name="wi_MessageBox" native="true">
|
<widget class="QWidget" name="wi_MessageBox" native="true">
|
||||||
<layout class="QHBoxLayout" name="hl_MessageBox">
|
<layout class="QHBoxLayout" name="hl_MessageBox">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
@@ -214,14 +224,14 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QLabel" name="lbl_MessageBoxDuration">
|
<widget class="QLabel" name="lbl_MessageBoxDuration">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Box disappears after</string>
|
<string>Box disappears after</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="1">
|
<item row="10" column="1">
|
||||||
<widget class="QSpinBox" name="sb_MessageBoxDuration">
|
<widget class="QSpinBox" name="sb_MessageBoxDuration">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>ms</string>
|
<string>ms</string>
|
||||||
@@ -237,14 +247,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="11" column="0">
|
||||||
<widget class="QLabel" name="lbl_MessageBoxMargins">
|
<widget class="QLabel" name="lbl_MessageBoxMargins">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Box margins px.</string>
|
<string>Box margins px.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="1">
|
<item row="11" column="1">
|
||||||
<widget class="QWidget" name="wi_Margins" native="true">
|
<widget class="QWidget" name="wi_Margins" native="true">
|
||||||
<layout class="QGridLayout" name="gl_MessageBoxMargins">
|
<layout class="QGridLayout" name="gl_MessageBoxMargins">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
@@ -318,14 +328,79 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="12" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_MessageColors">
|
||||||
|
<property name="text">
|
||||||
|
<string>Message colors</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="1">
|
||||||
|
<widget class="QWidget" name="wi_MessageColors" native="true">
|
||||||
|
<layout class="QGridLayout" name="gl_MessageColors">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="1" column="0"><widget class="BlackGui::Components::CColorSelector" name="cs_ColorFreq" /></item>
|
||||||
|
<item row="1" column="1"><widget class="BlackGui::Components::CColorSelector" name="cs_ColorPriv" /></item>
|
||||||
|
<item row="1" column="2"><widget class="BlackGui::Components::CColorSelector" name="cs_ColorServ" /></item>
|
||||||
|
<item row="1" column="3"><widget class="BlackGui::Components::CColorSelector" name="cs_ColorStat" /></item>
|
||||||
|
<item row="1" column="4"><widget class="BlackGui::Components::CColorSelector" name="cs_ColorSup" /></item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_ColorFreq">
|
||||||
|
<property name="text">
|
||||||
|
<string>Freq</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="lbl_ColorPriv">
|
||||||
|
<property name="text">
|
||||||
|
<string>Priv</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLabel" name="lbl_ColorServ">
|
||||||
|
<property name="text">
|
||||||
|
<string>Serv</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<widget class="QLabel" name="lbl_ColorStat">
|
||||||
|
<property name="text">
|
||||||
|
<string>Sup</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="4">
|
||||||
|
<widget class="QLabel" name="lbl_ColorSup">
|
||||||
|
<property name="text">
|
||||||
|
<string>Sup</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="13" column="0">
|
||||||
<widget class="QLabel" name="lbl_NightTextureMode">
|
<widget class="QLabel" name="lbl_NightTextureMode">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Night texture</string>
|
<string>Night texture</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="1">
|
<item row="13" column="1">
|
||||||
<widget class="QComboBox" name="cb_NightTextureMode">
|
<widget class="QComboBox" name="cb_NightTextureMode">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -344,14 +419,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="lbl_TerrainProbeEnabled">
|
<widget class="QLabel" name="lbl_TerrainProbeEnabled">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Terrain probe</string>
|
<string>Terrain probe</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QCheckBox" name="cb_TerrainProbeEnabled">
|
<widget class="QCheckBox" name="cb_TerrainProbeEnabled">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>probe to determine ground elevation</string>
|
<string>probe to determine ground elevation</string>
|
||||||
@@ -393,12 +468,18 @@
|
|||||||
<header>blackgui/components/dbusserveraddressselector.h</header>
|
<header>blackgui/components/dbusserveraddressselector.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CColorSelector</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/components/colorselector.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>sb_MaxAircraft</tabstop>
|
<tabstop>sb_MaxAircraft</tabstop>
|
||||||
<tabstop>ds_MaxDrawDistanceNM</tabstop>
|
<tabstop>ds_MaxDrawDistanceNM</tabstop>
|
||||||
<tabstop>sb_FollowAircraftDistanceM</tabstop>
|
<tabstop>sb_FollowAircraftDistanceM</tabstop>
|
||||||
<tabstop>cb_DrawLabels</tabstop>
|
<tabstop>cb_DrawLabels</tabstop>
|
||||||
|
<tabstop>cs_LabelColor</tabstop>
|
||||||
<tabstop>cb_BundleTaxiLandingLights</tabstop>
|
<tabstop>cb_BundleTaxiLandingLights</tabstop>
|
||||||
<tabstop>cb_TcasEnabled</tabstop>
|
<tabstop>cb_TcasEnabled</tabstop>
|
||||||
<tabstop>cb_LogRenderPhases</tabstop>
|
<tabstop>cb_LogRenderPhases</tabstop>
|
||||||
@@ -407,6 +488,11 @@
|
|||||||
<tabstop>le_MsgBoxMarginsBottom</tabstop>
|
<tabstop>le_MsgBoxMarginsBottom</tabstop>
|
||||||
<tabstop>le_MsgBoxMarginsLeft</tabstop>
|
<tabstop>le_MsgBoxMarginsLeft</tabstop>
|
||||||
<tabstop>le_MsgBoxMarginsRight</tabstop>
|
<tabstop>le_MsgBoxMarginsRight</tabstop>
|
||||||
|
<tabstop>cs_ColorFreq</tabstop>
|
||||||
|
<tabstop>cs_ColorPriv</tabstop>
|
||||||
|
<tabstop>cs_ColorServ</tabstop>
|
||||||
|
<tabstop>cs_ColorStat</tabstop>
|
||||||
|
<tabstop>cs_ColorSup</tabstop>
|
||||||
<tabstop>cb_NightTextureMode</tabstop>
|
<tabstop>cb_NightTextureMode</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
Reference in New Issue
Block a user