mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Don't show message window again once it was hidden
The message window was shown again after a new message.
This commit is contained in:
committed by
Klaus Basan
parent
af8779142c
commit
64ea29dd39
@@ -83,7 +83,9 @@ namespace XSwiftBus
|
||||
m_scrollToTopCommand("org/swift-project/xswiftbus/scroll_top", "Scroll to top of XSwiftBus text messages", [this] { scrollToTop(); }),
|
||||
m_scrollToBottomCommand("org/swift-project/xswiftbus/scroll_bottom", "Scroll to bottom of XSwiftBus text messages", [this] { scrollToBottom(); }),
|
||||
m_debugCommand("org/swift-project/xswiftbus/debug", "", [this] { static int c = 0; this->addMessage({ "hello " + std::to_string(c++), 0, .75, 0 }); })
|
||||
{}
|
||||
{
|
||||
show();
|
||||
}
|
||||
|
||||
void CMessageBoxControl::addMessage(const CMessage &message)
|
||||
{
|
||||
@@ -91,7 +93,6 @@ namespace XSwiftBus
|
||||
m_messages.push_back(message);
|
||||
if (m_position + 1 >= m_messages.size() || ! m_visible)
|
||||
{
|
||||
show();
|
||||
scrollToBottom();
|
||||
}
|
||||
}
|
||||
@@ -128,8 +129,6 @@ namespace XSwiftBus
|
||||
|
||||
void CMessageBoxControl::scrollToBottom()
|
||||
{
|
||||
if (! m_visible) { return; }
|
||||
|
||||
m_position = m_messages.size();
|
||||
updateVisibleLines();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace XSwiftBus
|
||||
|
||||
CService::CService(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_messages.addMessage( { "xswiftbus started.", 0, 255, 255 } );
|
||||
m_airportUpdater = new QTimer(this);
|
||||
m_airportUpdater->start(60000);
|
||||
connect(m_airportUpdater, &QTimer::timeout, this, &CService::updateAirportsInRange);
|
||||
|
||||
Reference in New Issue
Block a user