tweak to how activateWindow() is called after dialog boxes

This commit is contained in:
ZappoMan 2013-08-26 14:24:42 -07:00
parent 943e1f9110
commit 0df11124b3

View file

@ -680,11 +680,11 @@ void Menu::editPreferences() {
dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject()));
layout->addWidget(buttons); layout->addWidget(buttons);
if (dialog.exec() != QDialog::Accepted) { int ret = dialog.exec();
// restore the main window's active state applicationInstance->getWindow()->activateWindow();
applicationInstance->getWindow()->activateWindow(); if (ret != QDialog::Accepted) {
return; return;
} }
QByteArray newHostname; QByteArray newHostname;
@ -727,9 +727,6 @@ void Menu::editPreferences() {
_fieldOfView = fieldOfView->value(); _fieldOfView = fieldOfView->value();
applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height()); applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height());
// restore the main window's active state
applicationInstance->getWindow()->activateWindow();
} }
void Menu::goToDomain() { void Menu::goToDomain() {
@ -753,11 +750,11 @@ void Menu::goToDomain() {
dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject()));
layout->addWidget(buttons); layout->addWidget(buttons);
if (dialog.exec() != QDialog::Accepted) { int ret = dialog.exec();
// restore the main window's active state applicationInstance->getWindow()->activateWindow();
applicationInstance->getWindow()->activateWindow(); if (ret != QDialog::Accepted) {
return; return;
} }
QByteArray newHostname; QByteArray newHostname;
@ -783,8 +780,6 @@ void Menu::goToDomain() {
// set the new hostname // set the new hostname
NodeList::getInstance()->setDomainHostname(newHostname.constData()); NodeList::getInstance()->setDomainHostname(newHostname.constData());
} }
// restore the main window's active state
applicationInstance->getWindow()->activateWindow();
} }
void Menu::goToLocation() { void Menu::goToLocation() {
@ -814,11 +809,11 @@ void Menu::goToLocation() {
dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject()));
layout->addWidget(buttons); layout->addWidget(buttons);
if (dialog.exec() != QDialog::Accepted) { int ret = dialog.exec();
// restore the main window's active state applicationInstance->getWindow()->activateWindow();
appInstance->getWindow()->activateWindow(); if (ret != QDialog::Accepted) {
return; return;
} }
QByteArray newCoordinates; QByteArray newCoordinates;
@ -844,8 +839,6 @@ void Menu::goToLocation() {
} }
} }
} }
// restore the main window's active state
appInstance->getWindow()->activateWindow();
} }