mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 01:35:45 +08:00
Ref T506, only use displayInInfoWindow if not an overlay text message widget
This commit is contained in:
committed by
Mat Sutcliffe
parent
3c314e9882
commit
f2722d78f7
@@ -191,7 +191,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
if (msgSettings.popupSelcalMessages())
|
if (msgSettings.popupSelcalMessages())
|
||||||
{
|
{
|
||||||
emit this->displayInInfoWindow(CLogMessage(this).info(u"SELCAL received"), 3 * 1000);
|
this->emitDisplayInInfoWindow(CLogMessage(this).info(u"SELCAL received"), 3 * 1000);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (msgSettings.popup(message, ownAircraft))
|
if (msgSettings.popup(message, ownAircraft))
|
||||||
{
|
{
|
||||||
emit this->displayInInfoWindow(CVariant::from(message), 5 * 1000);
|
this->emitDisplayInInfoWindow(CVariant::from(message), 15 * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // message
|
} // message
|
||||||
@@ -537,6 +537,12 @@ namespace BlackGui
|
|||||||
return m_usedAsOverlayWidget ? true : this->isVisibleWidget();
|
return m_usedAsOverlayWidget ? true : this->isVisibleWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CTextMessageComponent::emitDisplayInInfoWindow(const CVariant &message, int displayDurationMs)
|
||||||
|
{
|
||||||
|
if (m_usedAsOverlayWidget) { return; }
|
||||||
|
emit this->displayInInfoWindow(message, displayDurationMs);
|
||||||
|
}
|
||||||
|
|
||||||
void CTextMessageComponent::handleEnteredTextMessage(const QString &textMessage)
|
void CTextMessageComponent::handleEnteredTextMessage(const QString &textMessage)
|
||||||
{
|
{
|
||||||
if (!this->isVisibleWidgetHack()) { return; }
|
if (!this->isVisibleWidgetHack()) { return; }
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ namespace BlackGui
|
|||||||
void updateAtcStationsButtons();
|
void updateAtcStationsButtons();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Message to be displayed in info window
|
//! Message to be displayed in central info window
|
||||||
|
//! \remark do not emit in overlay messages
|
||||||
void displayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs);
|
void displayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs);
|
||||||
|
|
||||||
//! Command line was entered
|
//! Command line was entered
|
||||||
@@ -213,6 +214,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
//! Visible widget hack
|
//! Visible widget hack
|
||||||
bool isVisibleWidgetHack() const;
|
bool isVisibleWidgetHack() const;
|
||||||
|
|
||||||
|
//! Emit the display in info window signal
|
||||||
|
void emitDisplayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs);
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -232,6 +232,8 @@ void SwiftGuiStd::initGuiSignals()
|
|||||||
connect(m_navigator.data(), &CNavigatorDialog::navigatorClosed, this, &SwiftGuiStd::onNavigatorClosed);
|
connect(m_navigator.data(), &CNavigatorDialog::navigatorClosed, this, &SwiftGuiStd::onNavigatorClosed);
|
||||||
|
|
||||||
// command line / text messages
|
// command line / text messages
|
||||||
|
// here we display SUP messages and such in a central window
|
||||||
|
ui->fr_CentralFrameInside->activateTextMessages(true);
|
||||||
connect(ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, ui->fr_CentralFrameInside, &COverlayMessagesFrame::showOverlayVariant);
|
connect(ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, ui->fr_CentralFrameInside, &COverlayMessagesFrame::showOverlayVariant);
|
||||||
|
|
||||||
// settings (GUI component), styles
|
// settings (GUI component), styles
|
||||||
|
|||||||
Reference in New Issue
Block a user