[XSwiftBus] Add message window menu items

- Popup window when a new message arrives
- Automatically hide window message after 5s

ref T359
This commit is contained in:
Roland Winklmeier
2018-09-24 19:12:42 +02:00
committed by Klaus Basan
parent cfc9c3166e
commit ab45757c8d
5 changed files with 55 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ namespace XSwiftBus
CService::CService() : CDBusObject()
{
m_messages.addMessage({ "xswiftbus started.", 0, 255, 255 });
addTextMessage("xswiftbus started.", 0, 255, 255);
updateAirportsInRange();
}
@@ -60,6 +60,13 @@ namespace XSwiftBus
{
m_messages.addMessage({ line, static_cast<float>(red), static_cast<float>(green), static_cast<float>(blue) });
}
if (!m_messages.isVisible() && m_popupMessageWindow) { m_messages.toggle(); }
if (m_disappearMessageWindow)
{
m_disappearMessageWindowTime = std::chrono::system_clock::now() + std::chrono::seconds(5);
}
}
std::string CService::getAircraftModelPath() const
@@ -628,6 +635,15 @@ namespace XSwiftBus
int CService::process()
{
invokeQueuedDBusCalls();
if (m_disappearMessageWindowTime != std::chrono::system_clock::time_point()
&& std::chrono::system_clock::now() > m_disappearMessageWindowTime
&& m_messages.isVisible())
{
m_messages.toggle();
m_disappearMessageWindowTime = std::chrono::system_clock::time_point();
}
return 1;
}