- LYXERR0("FOCUS: " << qApp->focusWidget());
- int res = QMessageBox::information(qApp->focusWidget(),
- toqstr(title),
- toqstr(formatted(question)),
- toqstr(b1),
- toqstr(b2),
- b3.empty() ? QString::null : toqstr(b3),
- default_button, cancel_button);
+ //LYXERR0("FOCUS: " << qApp->focusWidget());
+ QPushButton * b[4] = { 0, 0, 0, 0 };
+ QMessageBox msg_box(QMessageBox::Information,
+ toqstr(title), toqstr(question),
+ QMessageBox::NoButton, qApp->focusWidget());
+ b[0] = msg_box.addButton(b1.empty() ? "OK" : toqstr(b1),
+ QMessageBox::ActionRole);
+ if (!b2.empty())
+ b[1] = msg_box.addButton(toqstr(b2), QMessageBox::ActionRole);
+ if (!b3.empty())
+ b[2] = msg_box.addButton(toqstr(b3), QMessageBox::ActionRole);
+ if (!b4.empty())
+ b[3] = msg_box.addButton(toqstr(b4), QMessageBox::ActionRole);
+ msg_box.setDefaultButton(b[default_button]);
+ msg_box.setEscapeButton(static_cast<QAbstractButton *>(b[cancel_button]));
+ int res = msg_box.exec();
+
+ qApp->restoreOverrideCursor();
+
+ if (long_op)
+ theApp()->startLongOperation();