When reading configuration from the wx gui, an error no longer closes the whole

app. Now only the bochsrc parsing terminates with an error. Improved message box
shown at this point.
This commit is contained in:
Volker Ruppert 2016-12-26 16:12:54 +00:00
parent e1d8aa4b56
commit 97a4909b73

View File

@ -281,19 +281,17 @@ BxEvent *MyApp::DefaultCallback(void *thisptr, BxEvent *event)
case BX_ASYNC_EVT_LOG_MSG:
case BX_SYNC_EVT_LOG_ASK: {
wxLogDebug(wxT("DefaultCallback: log ask event"));
wxString text;
text.Printf(wxT("Error: %s"), event->u.logmsg.msg);
if (wxBochsClosing) {
// gui closing down, do something simple and nongraphical.
wxString text;
text.Printf(wxT("Error: %s"), event->u.logmsg.msg);
fprintf(stderr, "%s\n", (const char *)text.mb_str(wxConvUTF8));
} else {
wxMessageBox(text, wxT("Error"), wxOK | wxICON_ERROR);
// maybe I can make OnLogAsk display something that looks appropriate.
// theFrame->OnLogAsk(event);
}
event->retcode = BX_LOG_ASK_CHOICE_DIE;
// There is only one thread at this point. if I choose DIE here, it will
// call fatal() and kill the whole app.
} else {
wxString levelName(SIM->get_log_level_name(event->u.logmsg.level), wxConvUTF8);
wxMessageBox(wxString(event->u.logmsg.msg, wxConvUTF8), levelName, wxOK | wxICON_ERROR);
event->retcode = BX_LOG_ASK_CHOICE_CONTINUE;
}
break;
}
case BX_SYNC_EVT_TICK: