GuiApplication::notify(): fine tune ErrorException handling; close all windows before showing the alert. This should get rid of the recursive alert box when an the exception is caught.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23333 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-28 20:40:55 +00:00
parent 265434519e
commit 0e67e8423f

View File

@ -468,8 +468,16 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
}
catch (ExceptionMessage const & e) {
if (e.type_ == ErrorException) {
LyX::cref().emergencyCleanup();
setQuitOnLastWindowClosed(false);
closeAllViews();
Alert::error(e.title_, e.details_);
LyX::cref().exit(1);
#ifndef NDEBUG
// Properly crash in debug mode in order to get a useful backtrace.
abort();
#endif
// In release mode, try to exit gracefully.
this->exit(1);
} else if (e.type_ == WarningException) {
Alert::warning(e.title_, e.details_);
return false;