From 72afa55897b39cd738630cea73ce6666fdecece4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 14 Sep 2018 19:11:06 -0700 Subject: [PATCH] Add tip text to the StreamSegue telling users about the quit shortcut. Fixes #77 --- app/gui/StreamSegue.qml | 12 ++++++++++++ app/streaming/session.cpp | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/gui/StreamSegue.qml b/app/gui/StreamSegue.qml index 9ed6fa00..f76dc801 100644 --- a/app/gui/StreamSegue.qml +++ b/app/gui/StreamSegue.qml @@ -104,6 +104,18 @@ Item { } } + Label { + text: "Tip: Press Ctrl+Alt+Shift+Q to disconnect your session" + anchors.bottom: parent.bottom + anchors.bottomMargin: 50 + anchors.horizontalCenter: parent.horizontalCenter + font.pointSize: 18 + verticalAlignment: Text.AlignVCenter + + wrapMode: Text.Wrap + color: "white" + } + MessageDialog { id: errorDialog modality:Qt.WindowModal diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index c9eccfcd..685c5697 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -721,8 +721,14 @@ void Session::exec(int displayOriginX, int displayOriginY) return; } - // Manually pump the UI thread for the view - QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + // Wait 1.5 seconds before connecting to let the user + // have time to read any messages present on the segue + uint32_t start = SDL_GetTicks(); + while (!SDL_TICKS_PASSED(SDL_GetTicks(), start + 1500)) { + // Pump the UI loop while we wait + SDL_Delay(5); + QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + } // Wait for any old session to finish cleanup s_ActiveSessionSemaphore.acquire();