From 0df11124b3688abbfb59f04d6fd62b194ad272bc Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 26 Aug 2013 14:24:42 -0700 Subject: [PATCH] tweak to how activateWindow() is called after dialog boxes --- interface/src/Menu.cpp | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 33fb4d5dfe..2b4b07f898 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -680,11 +680,11 @@ void Menu::editPreferences() { dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); layout->addWidget(buttons); - if (dialog.exec() != QDialog::Accepted) { - // restore the main window's active state - applicationInstance->getWindow()->activateWindow(); - return; - } + int ret = dialog.exec(); + applicationInstance->getWindow()->activateWindow(); + if (ret != QDialog::Accepted) { + return; + } QByteArray newHostname; @@ -727,9 +727,6 @@ void Menu::editPreferences() { _fieldOfView = fieldOfView->value(); applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height()); - - // restore the main window's active state - applicationInstance->getWindow()->activateWindow(); } void Menu::goToDomain() { @@ -753,11 +750,11 @@ void Menu::goToDomain() { dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); layout->addWidget(buttons); - if (dialog.exec() != QDialog::Accepted) { - // restore the main window's active state - applicationInstance->getWindow()->activateWindow(); - return; - } + int ret = dialog.exec(); + applicationInstance->getWindow()->activateWindow(); + if (ret != QDialog::Accepted) { + return; + } QByteArray newHostname; @@ -783,8 +780,6 @@ void Menu::goToDomain() { // set the new hostname NodeList::getInstance()->setDomainHostname(newHostname.constData()); } - // restore the main window's active state - applicationInstance->getWindow()->activateWindow(); } void Menu::goToLocation() { @@ -814,11 +809,11 @@ void Menu::goToLocation() { dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); layout->addWidget(buttons); - if (dialog.exec() != QDialog::Accepted) { - // restore the main window's active state - appInstance->getWindow()->activateWindow(); - return; - } + int ret = dialog.exec(); + applicationInstance->getWindow()->activateWindow(); + if (ret != QDialog::Accepted) { + return; + } QByteArray newCoordinates; @@ -844,8 +839,6 @@ void Menu::goToLocation() { } } } - // restore the main window's active state - appInstance->getWindow()->activateWindow(); }