mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Overlay text message focus setting
This commit is contained in:
@@ -23,11 +23,12 @@ namespace BlackGui
|
||||
ui(new Ui::CSettingsTextMessageInlineComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->cb_All, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
connect(ui->cb_Frequency, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
connect(ui->cb_Private, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
connect(ui->cb_All, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
connect(ui->cb_Frequency, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
connect(ui->cb_Private, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
connect(ui->cb_Supervisor, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
settingsChanged();
|
||||
connect(ui->cb_Focus, &QCheckBox::released, this, &CSettingsTextMessageInlineComponent::changeSettings);
|
||||
this->settingsChanged();
|
||||
}
|
||||
|
||||
CSettingsTextMessageInlineComponent::~CSettingsTextMessageInlineComponent()
|
||||
@@ -41,6 +42,7 @@ namespace BlackGui
|
||||
ui->cb_Frequency->setChecked(s.getPopupFrequencyMessages());
|
||||
ui->cb_Private->setChecked(s.getPopupPrivateMessages());
|
||||
ui->cb_Selcal->setChecked(s.getPopupSelcalMessages());
|
||||
ui->cb_Focus->setChecked(s.focusOverlayWindow());
|
||||
}
|
||||
|
||||
void CSettingsTextMessageInlineComponent::changeSettings()
|
||||
@@ -51,6 +53,7 @@ namespace BlackGui
|
||||
s.setPopupPrivateMessages(ui->cb_Private->isChecked());
|
||||
s.setSupervisorMessages(ui->cb_Supervisor->isChecked());
|
||||
s.setPopupSelcalMessages(ui->cb_Selcal->isChecked());
|
||||
s.setFocusOverlayWindows(ui->cb_Focus->isChecked());
|
||||
const CStatusMessage m = m_settings.setAndSave(s);
|
||||
CLogMessage::preformatted(m);
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>266</width>
|
||||
<height>23</height>
|
||||
<width>283</width>
|
||||
<height>45</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
<string>Overlay message settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hl_TextMessageSettings">
|
||||
<layout class="QGridLayout" name="gl_OverlayMessages">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
@@ -26,7 +26,7 @@
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_Overlay">
|
||||
<property name="toolTip">
|
||||
<string>Overlay</string>
|
||||
@@ -36,41 +36,48 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="cb_Supervisor">
|
||||
<property name="toolTip">
|
||||
<string>supervisor</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>supervisor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="cb_Private">
|
||||
<property name="text">
|
||||
<string>private</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_Supervisor">
|
||||
<property name="toolTip">
|
||||
<string>supervisor</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>super.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="cb_Selcal">
|
||||
<property name="text">
|
||||
<string>SELCAL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QCheckBox" name="cb_Frequency">
|
||||
<property name="toolTip">
|
||||
<string>frequency</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>freq.</string>
|
||||
<string>frequency</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="cb_Focus">
|
||||
<property name="text">
|
||||
<string>focus</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="cb_All">
|
||||
<property name="text">
|
||||
<string>all</string>
|
||||
@@ -79,6 +86,14 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>cb_Private</tabstop>
|
||||
<tabstop>cb_Supervisor</tabstop>
|
||||
<tabstop>cb_Selcal</tabstop>
|
||||
<tabstop>cb_Frequency</tabstop>
|
||||
<tabstop>cb_All</tabstop>
|
||||
<tabstop>cb_Focus</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -843,6 +843,8 @@ namespace BlackGui
|
||||
void CTextMessageComponent::focusTextEntry()
|
||||
{
|
||||
if (!ui->lep_TextMessages->isVisible()) { return; }
|
||||
const CTextMessageSettings s = m_messageSettings.get();
|
||||
if (m_usedAsOverlayWidget && !s.focusOverlayWindow()) { return; }
|
||||
ui->lep_TextMessages->setFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -64,11 +64,12 @@ namespace BlackGui
|
||||
QString CTextMessageSettings::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
return QStringLiteral("Private: %1 supervisor: %2 frequency: %3 all: %4").arg(
|
||||
return QStringLiteral("Private: %1 supervisor: %2 frequency: %3 all: %4 focus: %5").arg(
|
||||
boolToOnOff(this->getPopupPrivateMessages()),
|
||||
boolToOnOff(this->getPopupSupervisorMessages()),
|
||||
boolToOnOff(this->getPopupFrequencyMessages()),
|
||||
boolToOnOff(this->getPopupAllMessages())
|
||||
boolToOnOff(this->getPopupAllMessages()),
|
||||
boolToYesNo(this->focusOverlayWindow())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,12 +79,13 @@ namespace BlackGui
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexPopupAllMessages: return CVariant::fromValue(this->getPopupAllMessages());
|
||||
case IndexPopupFrequencyMessages: return CVariant::fromValue(this->popupFrequencyMessages());
|
||||
case IndexPopupPrivateMessages: return CVariant::fromValue(this->popupPrivateMessages());
|
||||
case IndexPopupAllMessages: return CVariant::fromValue(this->getPopupAllMessages());
|
||||
case IndexPopupFrequencyMessages: return CVariant::fromValue(this->popupFrequencyMessages());
|
||||
case IndexPopupPrivateMessages: return CVariant::fromValue(this->popupPrivateMessages());
|
||||
case IndexPopupSupervisorMessages: return CVariant::fromValue(this->popupSupervisorMessages());
|
||||
case IndexPopupSelcalMessages: return CVariant::fromValue(this->popupSelcalMessages());
|
||||
case IndexPopupSelcalMessages: return CVariant::fromValue(this->popupSelcalMessages());
|
||||
case IndexStyle: return CVariant::fromValue(this->getStyleSheet());
|
||||
case IndexFocus: return CVariant::fromValue(this->focusOverlayWindow());
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
@@ -94,11 +96,12 @@ namespace BlackGui
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexPopupAllMessages: this->setPopupAllMessages(variant.toBool()); break;
|
||||
case IndexPopupFrequencyMessages: this->setPopupFrequencyMessages(variant.toBool()); break;
|
||||
case IndexPopupSupervisorMessages: this->setSupervisorMessages(variant.toBool()); break;
|
||||
case IndexPopupPrivateMessages: this->setPopupPrivateMessages(variant.toBool()); break;
|
||||
case IndexPopupSelcalMessages: this->setPopupSelcalMessages(variant.toBool()); break;
|
||||
case IndexPopupAllMessages: this->setPopupAllMessages(variant.toBool()); break;
|
||||
case IndexPopupFrequencyMessages: this->setPopupFrequencyMessages(variant.toBool()); break;
|
||||
case IndexPopupSupervisorMessages: this->setSupervisorMessages(variant.toBool()); break;
|
||||
case IndexPopupPrivateMessages: this->setPopupPrivateMessages(variant.toBool()); break;
|
||||
case IndexPopupSelcalMessages: this->setPopupSelcalMessages(variant.toBool()); break;
|
||||
case IndexFocus: this->setFocusOverlayWindows(variant.toBool()); break;
|
||||
case IndexStyle: this->setStyleSheet(variant.toQString()); break;
|
||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace BlackGui
|
||||
IndexPopupFrequencyMessages,
|
||||
IndexPopupAllMessages,
|
||||
IndexPopupSelcalMessages,
|
||||
IndexFocus,
|
||||
IndexStyle
|
||||
};
|
||||
|
||||
@@ -97,6 +98,12 @@ namespace BlackGui
|
||||
//! CSS style sheet
|
||||
void setStyleSheet(const QString &styleSheet) { m_styleSheet = styleSheet; }
|
||||
|
||||
//! Focus in the overlay window
|
||||
bool focusOverlayWindow() const { return m_focus; }
|
||||
|
||||
//! Set focus in overlay window
|
||||
void setFocusOverlayWindows(bool focus) { m_focus = focus; }
|
||||
|
||||
//! Reset style sheet
|
||||
void resetStyleSheet() { m_styleSheet.clear(); }
|
||||
|
||||
@@ -115,6 +122,7 @@ namespace BlackGui
|
||||
bool m_popupFrequencyMessages = false; //!< show if tuned in
|
||||
bool m_popupAllMessages = false;
|
||||
bool m_popupSelcalMessages = true;
|
||||
bool m_focus = true;
|
||||
QString m_styleSheet;
|
||||
|
||||
BLACK_METACLASS(
|
||||
|
||||
Reference in New Issue
Block a user