make results window raising optional

This commit is contained in:
Stephen Birarda 2017-04-18 15:13:42 -07:00
parent 822af3365b
commit 26d13ce002
3 changed files with 9 additions and 4 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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> _resultsWindow;