Added confirmation dialogs on hard reset and exit.
*** WARNING *** 86Box v2.00 is now in feature freeze, any new features are going to be added in v2.10 instead. Bug reports for v2.00 are still accepted, however.
This commit is contained in:
@@ -815,7 +815,7 @@ BEGIN
|
||||
2048 "86Box"
|
||||
IDS_2049 "86Box Error"
|
||||
IDS_2050 "86Box Fatal Error"
|
||||
IDS_2051 "This will reset 86Box.\nAre you sure you want to save the settings?"
|
||||
IDS_2051 "This will hard reset the emulated machine.\nAre you sure you want to save the settings?"
|
||||
IDS_2052 "Use CTRL+ALT+PAGE DOWN to return to windowed mode"
|
||||
IDS_2053 "Speed"
|
||||
IDS_2054 "ZIP %03i %i (%s): %ls"
|
||||
@@ -891,9 +891,10 @@ BEGIN
|
||||
IDS_2116 "%u MB (CHS: %i, %i, %i)"
|
||||
IDS_2117 "Floppy %i (%s): %ls"
|
||||
IDS_2118 "All images (*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF)\0*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF\0Advanced sector images (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0Basic sector images (*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0Flux images (*.FDI)\0*.FDI\0Surface images (*.86F;*.MFM)\0*.86F;*.MFM\0All files (*.*)\0*.*\0"
|
||||
IDS_2119 "You must save the settings first before attempting to configure the memory boards"
|
||||
IDS_2120 "Unable to initialize FreeType, freetype.dll is required"
|
||||
IDS_2121 "Unable to initialize SDL, SDL2.dll is required"
|
||||
IDS_2119 "Unable to initialize FreeType, freetype.dll is required"
|
||||
IDS_2120 "Unable to initialize SDL, SDL2.dll is required"
|
||||
IDS_2121 "Are you sure you want to hard reset the emulated machine?"
|
||||
IDS_2122 "Are you sure you want to quit 86Box?"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
*
|
||||
* Several dialogs for the application.
|
||||
*
|
||||
* Version: @(#)win_dialog.c 1.0.10 2018/04/29
|
||||
* Version: @(#)win_dialog.c 1.0.11 2019/09/22
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*/
|
||||
#define UNICODE
|
||||
#include <windows.h>
|
||||
@@ -67,6 +67,11 @@ ui_msgbox(int flags, void *arg)
|
||||
fl = (MB_YESNOCANCEL | MB_ICONQUESTION);
|
||||
cap = plat_get_string(IDS_STRINGS); /* "86Box" */
|
||||
break;
|
||||
|
||||
case MBX_QUESTION_YN: /* question */
|
||||
fl = (MB_YESNO | MB_ICONQUESTION);
|
||||
cap = plat_get_string(IDS_STRINGS); /* "86Box" */
|
||||
break;
|
||||
}
|
||||
|
||||
/* If ANSI string, convert it. */
|
||||
|
||||
@@ -379,7 +379,7 @@ sdl_init_common(int fs)
|
||||
/* Try loading the DLL. */
|
||||
sdl_handle = dynld_module(PATH_SDL_DLL, sdl_imports);
|
||||
if (sdl_handle == NULL) {
|
||||
ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2121);
|
||||
ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2120);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HMENU hmenu;
|
||||
|
||||
int sb_borders[3];
|
||||
int i, sb_borders[3];
|
||||
RECT rect;
|
||||
|
||||
int temp_x, temp_y;
|
||||
@@ -297,7 +297,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_ACTION_HRESET:
|
||||
pc_reset(1);
|
||||
i = ui_msgbox(MBX_QUESTION_YN, (wchar_t *)IDS_2121);
|
||||
if (i == 0)
|
||||
pc_reset(1);
|
||||
break;
|
||||
|
||||
case IDM_ACTION_RESET_CAD:
|
||||
@@ -305,7 +307,12 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_ACTION_EXIT:
|
||||
PostQuitMessage(0);
|
||||
i = ui_msgbox(MBX_QUESTION_YN, (wchar_t *)IDS_2122);
|
||||
if (i == 0) {
|
||||
UnhookWindowsHookEx(hKeyboardHook);
|
||||
KillTimer(hwnd, TIMER_1SEC);
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_ACTION_CTRL_ALT_ESC:
|
||||
@@ -661,6 +668,15 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_SYSKEYUP:
|
||||
return(0);
|
||||
|
||||
case WM_CLOSE:
|
||||
i = ui_msgbox(MBX_QUESTION_YN, (wchar_t *)IDS_2122);
|
||||
if (i == 0) {
|
||||
UnhookWindowsHookEx(hKeyboardHook);
|
||||
KillTimer(hwnd, TIMER_1SEC);
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
UnhookWindowsHookEx(hKeyboardHook);
|
||||
KillTimer(hwnd, TIMER_1SEC);
|
||||
@@ -681,6 +697,8 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case WM_SHUTDOWN:
|
||||
UnhookWindowsHookEx(hKeyboardHook);
|
||||
KillTimer(hwnd, TIMER_1SEC);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user