From 26d13ce0028472f1ab571c88ad70858a4c8a1817 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 18 Apr 2017 15:13:42 -0700 Subject: [PATCH] make results window raising optional --- tools/oven/src/ui/DomainBakeWidget.cpp | 4 +++- tools/oven/src/ui/OvenMainWindow.cpp | 7 +++++-- tools/oven/src/ui/OvenMainWindow.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/oven/src/ui/DomainBakeWidget.cpp b/tools/oven/src/ui/DomainBakeWidget.cpp index 27364a54de..bfae2d70d4 100644 --- a/tools/oven/src/ui/DomainBakeWidget.cpp +++ b/tools/oven/src/ui/DomainBakeWidget.cpp @@ -241,7 +241,9 @@ void DomainBakeWidget::handleBakerProgress(int baked, int total) { if (it != _bakers.end()) { auto resultRow = it->second; - auto resultsWindow = qApp->getMainWindow()->showResultsWindow(); + + // grab the results window, don't force it to be brought to the top + auto resultsWindow = qApp->getMainWindow()->showResultsWindow(false); int percentage = roundf(float(baked) / float(total) * 100.0f); diff --git a/tools/oven/src/ui/OvenMainWindow.cpp b/tools/oven/src/ui/OvenMainWindow.cpp index 1987bab660..dd40fb1f8f 100644 --- a/tools/oven/src/ui/OvenMainWindow.cpp +++ b/tools/oven/src/ui/OvenMainWindow.cpp @@ -37,7 +37,7 @@ OvenMainWindow::~OvenMainWindow() { } } -ResultsWindow* OvenMainWindow::showResultsWindow() { +ResultsWindow* OvenMainWindow::showResultsWindow(bool shouldRaise) { if (!_resultsWindow) { // we don't have a results window right now, so make a new one _resultsWindow = new ResultsWindow; @@ -51,7 +51,10 @@ ResultsWindow* OvenMainWindow::showResultsWindow() { // show the results window and make sure it is in front _resultsWindow->show(); - _resultsWindow->raise(); + + if (shouldRaise) { + _resultsWindow->raise(); + } // return a pointer to the results window the caller can use return _resultsWindow; diff --git a/tools/oven/src/ui/OvenMainWindow.h b/tools/oven/src/ui/OvenMainWindow.h index 2d5d2aec99..a557d5e8dd 100644 --- a/tools/oven/src/ui/OvenMainWindow.h +++ b/tools/oven/src/ui/OvenMainWindow.h @@ -25,7 +25,7 @@ public: OvenMainWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags()); ~OvenMainWindow(); - ResultsWindow* showResultsWindow(); + ResultsWindow* showResultsWindow(bool shouldRaise = true); private: QPointer _resultsWindow;