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