Skip to content

Commit

Permalink
[Bugfix]Gui: ensure message boxes appear and stay on top of main window
Browse files Browse the repository at this point in the history
  • Loading branch information
0penBrain authored and wwmayer committed Sep 5, 2022
1 parent c35244e commit b687e2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Gui/DlgMacroExecuteImp.cpp
Expand Up @@ -409,7 +409,7 @@ void DlgMacroExecuteImp::on_deleteButton_clicked()
MacroItem * mitem = static_cast<MacroItem *>(item);

if (mitem->systemWide) {
QMessageBox::critical(qApp->activeWindow(), QObject::tr("Delete macro"),
QMessageBox::critical(Gui::getMainWindow(), QObject::tr("Delete macro"),
QObject::tr("Not allowed to delete system-wide macros"));
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Sketcher/Gui/EditDatumDialog.cpp
Expand Up @@ -77,7 +77,7 @@ void EditDatumDialog::exec(bool atCursor)
if (Constr->isDimensional()) {

if (sketch->hasConflicts()) {
QMessageBox::critical(qApp->activeWindow(), QObject::tr("Distance constraint"),
QMessageBox::critical(Gui::getMainWindow(), QObject::tr("Distance constraint"),
QObject::tr("Not allowed to edit the datum because the sketch contains conflicting constraints"));
return;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ void EditDatumDialog::accepted()
tryAutoRecompute(sketch);
}
catch (const Base::Exception& e) {
QMessageBox::critical(qApp->activeWindow(), QObject::tr("Dimensional constraint"), QString::fromUtf8(e.what()));
QMessageBox::critical(Gui::getMainWindow(), QObject::tr("Dimensional constraint"), QString::fromUtf8(e.what()));
Gui::Command::abortCommand();

if(sketch->noRecomputes) // if setdatum failed, it is highly likely that solver information is invalid.
Expand Down

0 comments on commit b687e2c

Please sign in to comment.