Ref T506, only use displayInInfoWindow if not an overlay text message widget

This commit is contained in:
Klaus Basan
2019-01-07 19:56:43 +01:00
committed by Mat Sutcliffe
parent 3c314e9882
commit f2722d78f7
3 changed files with 15 additions and 3 deletions

View File

@@ -191,7 +191,7 @@ namespace BlackGui
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;
}
@@ -246,7 +246,7 @@ namespace BlackGui
{
if (msgSettings.popup(message, ownAircraft))
{
emit this->displayInInfoWindow(CVariant::from(message), 5 * 1000);
this->emitDisplayInInfoWindow(CVariant::from(message), 15 * 1000);
}
}
} // message
@@ -537,6 +537,12 @@ namespace BlackGui
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)
{
if (!this->isVisibleWidgetHack()) { return; }

View File

@@ -103,7 +103,8 @@ namespace BlackGui
void updateAtcStationsButtons();
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);
//! Command line was entered
@@ -213,6 +214,9 @@ namespace BlackGui
//! Visible widget hack
bool isVisibleWidgetHack() const;
//! Emit the display in info window signal
void emitDisplayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs);
};
} // ns
} // ns