Improve fatals and missing romset messages (also introducing ui_msgbox_header as a middle-of-the-road option)

This commit is contained in:
RichardG867
2020-06-18 21:05:53 -03:00
parent 47544cd02b
commit 6eb7314c5b
5 changed files with 20 additions and 7 deletions

View File

@@ -36,8 +36,8 @@
#define IDS_2060 2060 // "On"
#define IDS_2061 2061 // "Off"
#define IDS_2062 2062 // "All floppy images (*.DSK..."
#define IDS_2063 2063 // "Configured ROM set not avai.."
#define IDS_2064 2064 // "Configured video BIOS not.."
#define IDS_2063 2063 // "Machine ""%S"" is not..."
#define IDS_2064 2064 // "Video card ""%S"" is not..."
#define IDS_2065 2065 // "Machine"
#define IDS_2066 2066 // "Display"
#define IDS_2067 2067 // "Input devices"
@@ -101,6 +101,7 @@
#define IDS_2125 2125 // EMU_NAME " v" EMU_VERSION
#define IDS_2126 2126 // "An emulator of old computers..."
#define IDS_2127 2127 // "OK"
#define IDS_2128 2128 // "Hardware not available"
#define IDS_4096 4096 // "Hard disk (%s)"
#define IDS_4097 4097 // "%01i:%01i"

View File

@@ -39,6 +39,7 @@ extern "C" {
#define MBX_LINKS 0x100
extern int ui_msgbox(int flags, void *message);
extern int ui_msgbox_header(int flags, void *header, void *message);
extern int ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, void *btn3);
extern void ui_check_menu_item(int id, int checked);

View File

@@ -283,7 +283,7 @@ fatal(const char *fmt, ...)
to avoid things like threads getting stuck. */
do_stop();
ui_msgbox(MBX_ERROR|MBX_FATAL|MBX_ANSI, temp);
ui_msgbox_ex(MBX_ERROR | MBX_FATAL | MBX_ANSI, NULL, temp, (wchar_t *) IDS_2119, NULL, NULL);
fflush(stdlog);
@@ -553,6 +553,7 @@ int
pc_init_modules(void)
{
int c, m;
wchar_t temp[512];
pc_log("Scanning for ROM images:\n");
c = m = 0;
@@ -568,11 +569,12 @@ pc_init_modules(void)
/* Load the ROMs for the selected machine. */
if (! machine_available(machine)) {
swprintf(temp, sizeof(temp), plat_get_string(IDS_2063), machine_getname());
c = 0;
machine = -1;
while (machine_get_internal_name_ex(c) != NULL) {
if (machine_available(c)) {
ui_msgbox(MBX_INFO, (wchar_t *)IDS_2063);
ui_msgbox_header(MBX_INFO, (wchar_t *) IDS_2128, temp);
machine = c;
config_save();
break;
@@ -588,11 +590,12 @@ pc_init_modules(void)
/* Make sure we have a usable video card. */
if (! video_card_available(gfxcard)) {
swprintf(temp, sizeof(temp), plat_get_string(IDS_2064), video_card_getname(gfxcard));
c = 0;
while (video_get_internal_name(c) != NULL) {
gfxcard = -1;
if (video_card_available(c)) {
ui_msgbox(MBX_INFO, (wchar_t *)IDS_2064);
ui_msgbox_header(MBX_INFO, (wchar_t *) IDS_2128, temp);
gfxcard = c;
config_save();
break;

View File

@@ -892,12 +892,12 @@ BEGIN
IDS_2060 "On"
IDS_2061 "Off"
IDS_2062 "All images (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0Basic sector images (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0Surface images (*.86F)\0*.86F\0"
IDS_2063 "Configured ROM set not available.\nDefaulting to an available ROM set."
IDS_2063 "Machine ""%S"" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine."
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_2064 "Configured video BIOS not available.\nDefaulting to an available video BIOS."
IDS_2064 "Video card ""%S"" is not available due to missing ROMs in the roms/video directory. Switching to an available video card."
IDS_2065 "Machine"
IDS_2066 "Display"
IDS_2067 "Input devices"
@@ -965,6 +965,7 @@ BEGIN
IDS_2125 EMU_NAME " v" EMU_VERSION
IDS_2126 "An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information."
IDS_2127 "OK"
IDS_2128 "Hardware not available"
END
STRINGTABLE DISCARDABLE

View File

@@ -50,6 +50,13 @@ ui_msgbox(int flags, void *message)
}
int
ui_msgbox_header(int flags, void *header, void *message)
{
return ui_msgbox_ex(flags, header, message, NULL, NULL, NULL);
}
int
ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, void *btn3) {
WCHAR temp[512];