Make "Exit" the default button for fatal errors
This commit is contained in:
2
src/pc.c
2
src/pc.c
@@ -283,7 +283,7 @@ fatal(const char *fmt, ...)
|
|||||||
to avoid things like threads getting stuck. */
|
to avoid things like threads getting stuck. */
|
||||||
do_stop();
|
do_stop();
|
||||||
|
|
||||||
ui_msgbox_ex(MBX_ERROR | MBX_FATAL | MBX_ANSI, NULL, temp, (wchar_t *) IDS_2119, NULL, NULL);
|
ui_msgbox(MBX_ERROR | MBX_FATAL | MBX_ANSI, temp);
|
||||||
|
|
||||||
fflush(stdlog);
|
fflush(stdlog);
|
||||||
|
|
||||||
|
@@ -64,7 +64,8 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi
|
|||||||
TASKDIALOG_BUTTON tdbuttons[3],
|
TASKDIALOG_BUTTON tdbuttons[3],
|
||||||
tdb_yes = {IDYES, STRING_OR_RESOURCE(btn1)},
|
tdb_yes = {IDYES, STRING_OR_RESOURCE(btn1)},
|
||||||
tdb_no = {IDNO, STRING_OR_RESOURCE(btn2)},
|
tdb_no = {IDNO, STRING_OR_RESOURCE(btn2)},
|
||||||
tdb_cancel = {IDCANCEL, STRING_OR_RESOURCE(btn3)};
|
tdb_cancel = {IDCANCEL, STRING_OR_RESOURCE(btn3)},
|
||||||
|
tdb_exit = {IDCLOSE, MAKEINTRESOURCE(IDS_2119)};
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* Configure the default OK button. */
|
/* Configure the default OK button. */
|
||||||
@@ -84,6 +85,13 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi
|
|||||||
if (flags & MBX_FATAL) {
|
if (flags & MBX_FATAL) {
|
||||||
tdconfig.pszMainIcon = TD_ERROR_ICON;
|
tdconfig.pszMainIcon = TD_ERROR_ICON;
|
||||||
tdconfig.pszMainInstruction = MAKEINTRESOURCE(IDS_2050); /* "Fatal error" */
|
tdconfig.pszMainInstruction = MAKEINTRESOURCE(IDS_2050); /* "Fatal error" */
|
||||||
|
|
||||||
|
/* replace default "OK" button with "Exit" button */
|
||||||
|
if (btn1)
|
||||||
|
tdconfig.cButtons = 0;
|
||||||
|
else
|
||||||
|
tdconfig.dwCommonButtons = 0;
|
||||||
|
tdbuttons[tdconfig.cButtons++] = tdb_exit;
|
||||||
} else {
|
} else {
|
||||||
tdconfig.pszMainIcon = TD_WARNING_ICON;
|
tdconfig.pszMainIcon = TD_WARNING_ICON;
|
||||||
tdconfig.pszMainInstruction = MAKEINTRESOURCE(IDS_2049); /* "Error" */
|
tdconfig.pszMainInstruction = MAKEINTRESOURCE(IDS_2049); /* "Error" */
|
||||||
|
Reference in New Issue
Block a user