Add "don't show again" to hard reset and exit confirmations, further addressing #948
This commit is contained in:
13
src/config.c
13
src/config.c
@@ -484,6 +484,9 @@ load_general(void)
|
|||||||
|
|
||||||
sound_gain = config_get_int(cat, "sound_gain", 0);
|
sound_gain = config_get_int(cat, "sound_gain", 0);
|
||||||
|
|
||||||
|
confirm_reset = config_get_int(cat, "confirm_reset", 1);
|
||||||
|
confirm_exit = config_get_int(cat, "confirm_exit", 1);
|
||||||
|
|
||||||
#ifdef USE_LANGUAGE
|
#ifdef USE_LANGUAGE
|
||||||
/*
|
/*
|
||||||
* Currently, 86Box is English (US) only, but in the future
|
* Currently, 86Box is English (US) only, but in the future
|
||||||
@@ -1647,6 +1650,16 @@ save_general(void)
|
|||||||
else
|
else
|
||||||
config_delete_var(cat, "sound_gain");
|
config_delete_var(cat, "sound_gain");
|
||||||
|
|
||||||
|
if (confirm_reset != 1)
|
||||||
|
config_set_int(cat, "confirm_reset", confirm_reset);
|
||||||
|
else
|
||||||
|
config_delete_var(cat, "confirm_reset");
|
||||||
|
|
||||||
|
if (confirm_exit != 1)
|
||||||
|
config_set_int(cat, "confirm_exit", confirm_exit);
|
||||||
|
else
|
||||||
|
config_delete_var(cat, "confirm_exit");
|
||||||
|
|
||||||
#ifdef USE_LANGUAGE
|
#ifdef USE_LANGUAGE
|
||||||
if (plat_langid == 0x0409)
|
if (plat_langid == 0x0409)
|
||||||
config_delete_var(cat, "language");
|
config_delete_var(cat, "language");
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ extern int force_debug; /* (O) force debug output */
|
|||||||
extern int video_fps; /* (O) render speed in fps */
|
extern int video_fps; /* (O) render speed in fps */
|
||||||
#endif
|
#endif
|
||||||
extern int settings_only; /* (O) show only the settings dialog */
|
extern int settings_only; /* (O) show only the settings dialog */
|
||||||
extern int no_quit_confirm; /* (O) do not ask for confirmation on quit */
|
extern int confirm_exit_cmdl; /* (O) do not ask for confirmation on quit if set to 0 */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
extern uint64_t unique_id;
|
extern uint64_t unique_id;
|
||||||
extern uint64_t source_hwnd;
|
extern uint64_t source_hwnd;
|
||||||
@@ -109,6 +109,8 @@ extern int network_type; /* (C) net provider type */
|
|||||||
extern int network_card; /* (C) net interface num */
|
extern int network_card; /* (C) net interface num */
|
||||||
extern char network_host[522]; /* (C) host network intf */
|
extern char network_host[522]; /* (C) host network intf */
|
||||||
extern int hdd_format_type; /* (C) hard disk file format */
|
extern int hdd_format_type; /* (C) hard disk file format */
|
||||||
|
extern int confirm_reset, /* (C) enable reset confirmation */
|
||||||
|
confirm_exit; /* (C) enable exit confirmation */
|
||||||
#ifdef USE_DISCORD
|
#ifdef USE_DISCORD
|
||||||
extern int enable_discord; /* (C) enable Discord integration */
|
extern int enable_discord; /* (C) enable Discord integration */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
6
src/pc.c
6
src/pc.c
@@ -101,7 +101,7 @@ int force_debug = 0; /* (O) force debug output */
|
|||||||
int video_fps = RENDER_FPS; /* (O) render speed in fps */
|
int video_fps = RENDER_FPS; /* (O) render speed in fps */
|
||||||
#endif
|
#endif
|
||||||
int settings_only = 0; /* (O) show only the settings dialog */
|
int settings_only = 0; /* (O) show only the settings dialog */
|
||||||
int no_quit_confirm = 0; /* (O) do not ask for confirmation on quit */
|
int confirm_exit_cmdl = 1; /* (O) do not ask for confirmation on quit if set to 0 */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
uint64_t unique_id = 0;
|
uint64_t unique_id = 0;
|
||||||
uint64_t source_hwnd = 0;
|
uint64_t source_hwnd = 0;
|
||||||
@@ -140,6 +140,8 @@ int cpu_manufacturer = 0, /* (C) cpu manufacturer */
|
|||||||
cpu = 3, /* (C) cpu type */
|
cpu = 3, /* (C) cpu type */
|
||||||
fpu_type = 0; /* (C) fpu type */
|
fpu_type = 0; /* (C) fpu type */
|
||||||
int time_sync = 0; /* (C) enable time sync */
|
int time_sync = 0; /* (C) enable time sync */
|
||||||
|
int confirm_reset = 1, /* (C) enable reset confirmation */
|
||||||
|
confirm_exit = 1; /* (C) enable exit confirmation */
|
||||||
#ifdef USE_DISCORD
|
#ifdef USE_DISCORD
|
||||||
int enable_discord = 0; /* (C) enable Discord integration */
|
int enable_discord = 0; /* (C) enable Discord integration */
|
||||||
#endif
|
#endif
|
||||||
@@ -396,7 +398,7 @@ usage:
|
|||||||
settings_only = 1;
|
settings_only = 1;
|
||||||
} else if (!wcscasecmp(argv[c], L"--noconfirm") ||
|
} else if (!wcscasecmp(argv[c], L"--noconfirm") ||
|
||||||
!wcscasecmp(argv[c], L"-N")) {
|
!wcscasecmp(argv[c], L"-N")) {
|
||||||
no_quit_confirm = 1;
|
confirm_exit_cmdl = 0;
|
||||||
} else if (!wcscasecmp(argv[c], L"--crashdump") ||
|
} else if (!wcscasecmp(argv[c], L"--crashdump") ||
|
||||||
!wcscasecmp(argv[c], L"-R")) {
|
!wcscasecmp(argv[c], L"-R")) {
|
||||||
enable_crashdump = 1;
|
enable_crashdump = 1;
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi
|
|||||||
else if (ret == IDCANCEL) ret = -1;
|
else if (ret == IDCANCEL) ret = -1;
|
||||||
else ret = 0;
|
else ret = 0;
|
||||||
|
|
||||||
|
/* 10 is added to the return value if "don't show again" is checked. */
|
||||||
if (checked) ret += 10;
|
if (checked) ret += 10;
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
|
|||||||
@@ -315,9 +315,17 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case IDM_ACTION_HRESET:
|
case IDM_ACTION_HRESET:
|
||||||
win_notify_dlg_open();
|
win_notify_dlg_open();
|
||||||
i = ui_msgbox_ex(MBX_QUESTION_YN, (wchar_t *) IDS_2112, NULL, (wchar_t *) IDS_2137, (wchar_t *) IDS_2138, NULL);
|
if (confirm_reset)
|
||||||
if (i == 0)
|
i = ui_msgbox_ex(MBX_QUESTION_YN | MBX_DONTASK, (wchar_t *) IDS_2112, NULL, (wchar_t *) IDS_2137, (wchar_t *) IDS_2138, NULL);
|
||||||
|
else
|
||||||
|
i = 0;
|
||||||
|
if ((i % 10) == 0) {
|
||||||
pc_reset_hard();
|
pc_reset_hard();
|
||||||
|
if (i == 10) {
|
||||||
|
confirm_reset = 0;
|
||||||
|
config_save();
|
||||||
|
}
|
||||||
|
}
|
||||||
win_notify_dlg_closed();
|
win_notify_dlg_closed();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -327,11 +335,15 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case IDM_ACTION_EXIT:
|
case IDM_ACTION_EXIT:
|
||||||
win_notify_dlg_open();
|
win_notify_dlg_open();
|
||||||
if (no_quit_confirm)
|
if (confirm_exit && confirm_exit_cmdl)
|
||||||
i = 0;
|
i = ui_msgbox_ex(MBX_QUESTION_YN | MBX_DONTASK, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL);
|
||||||
else
|
else
|
||||||
i = ui_msgbox_ex(MBX_QUESTION_YN, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL);
|
i = 0;
|
||||||
if (i == 0) {
|
if ((i % 10) == 0) {
|
||||||
|
if (i == 10) {
|
||||||
|
confirm_exit = 0;
|
||||||
|
config_save();
|
||||||
|
}
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
#ifndef NO_KEYBOARD_HOOK
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
UnhookWindowsHookEx(hKeyboardHook);
|
||||||
#endif
|
#endif
|
||||||
@@ -701,11 +713,15 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
win_notify_dlg_open();
|
win_notify_dlg_open();
|
||||||
if (no_quit_confirm)
|
if (confirm_exit && confirm_exit_cmdl)
|
||||||
i = 0;
|
i = ui_msgbox_ex(MBX_QUESTION_YN | MBX_DONTASK, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL);
|
||||||
else
|
else
|
||||||
i = ui_msgbox_ex(MBX_QUESTION_YN, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL);
|
i = 0;
|
||||||
if (i == 0) {
|
if ((i % 10) == 0) {
|
||||||
|
if (i == 10) {
|
||||||
|
confirm_exit = 0;
|
||||||
|
config_save();
|
||||||
|
}
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
#ifndef NO_KEYBOARD_HOOK
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
UnhookWindowsHookEx(hKeyboardHook);
|
||||||
#endif
|
#endif
|
||||||
@@ -744,9 +760,17 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (manager_wm)
|
if (manager_wm)
|
||||||
break;
|
break;
|
||||||
win_notify_dlg_open();
|
win_notify_dlg_open();
|
||||||
i = ui_msgbox_ex(MBX_QUESTION_YN, (wchar_t *) IDS_2112, NULL, (wchar_t *) IDS_2137, (wchar_t *) IDS_2138, NULL);
|
if (confirm_reset)
|
||||||
if (i == 0)
|
i = ui_msgbox_ex(MBX_QUESTION_YN | MBX_DONTASK, (wchar_t *) IDS_2112, NULL, (wchar_t *) IDS_2137, (wchar_t *) IDS_2138, NULL);
|
||||||
|
else
|
||||||
|
i = 0;
|
||||||
|
if ((i % 10) == 0) {
|
||||||
pc_reset_hard();
|
pc_reset_hard();
|
||||||
|
if (i == 10) {
|
||||||
|
confirm_reset = 0;
|
||||||
|
config_save();
|
||||||
|
}
|
||||||
|
}
|
||||||
win_notify_dlg_closed();
|
win_notify_dlg_closed();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -754,11 +778,15 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (manager_wm)
|
if (manager_wm)
|
||||||
break;
|
break;
|
||||||
win_notify_dlg_open();
|
win_notify_dlg_open();
|
||||||
if (no_quit_confirm)
|
if (confirm_exit && confirm_exit_cmdl)
|
||||||
i = 0;
|
i = ui_msgbox_ex(MBX_QUESTION_YN | MBX_DONTASK, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL);
|
||||||
else
|
else
|
||||||
i = ui_msgbox_ex(MBX_QUESTION_YN, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL);
|
i = 0;
|
||||||
if (i == 0) {
|
if ((i % 10) == 0) {
|
||||||
|
if (i == 10) {
|
||||||
|
confirm_exit = 0;
|
||||||
|
config_save();
|
||||||
|
}
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
#ifndef NO_KEYBOARD_HOOK
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
UnhookWindowsHookEx(hKeyboardHook);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user