From 3506ad90e00a0b5168e0297b13ee6a25565da373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Fri, 20 Nov 2020 18:27:25 +0100 Subject: [PATCH] Closing Settings now equals to clicking Cancel --- src/win/win_settings.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/win/win_settings.c b/src/win/win_settings.c index f6e0f0c8c..05ee5cec5 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -520,7 +520,7 @@ win_settings_changed(void) static int -settings_msgbox_reset(int button) +settings_msgbox_reset() { int changed, i = 0; HWND h; @@ -531,10 +531,7 @@ settings_msgbox_reset(int button) h = hwndMain; hwndMain = hwndParentDialog; - if (button) - i = ui_msgbox_ex(MBX_QUESTION_OK | MBX_WARNING, (wchar_t *) IDS_2051, (wchar_t *) IDS_2142, (wchar_t *) IDS_2140, NULL, NULL); - else - i = ui_msgbox_ex(MBX_QUESTION | MBX_LINKS, (wchar_t *) IDS_2123, NULL, (wchar_t *) IDS_2121, (wchar_t *) IDS_2122, NULL); + i = ui_msgbox_ex(MBX_QUESTION_OK | MBX_WARNING, (wchar_t *) IDS_2051, (wchar_t *) IDS_2143, (wchar_t *) IDS_2141, NULL, NULL); hwndMain = h; @@ -4974,12 +4971,12 @@ static LRESULT CALLBACK #else static BOOL CALLBACK #endif -win_settings_confirm(HWND hdlg, int button) +win_settings_confirm(HWND hdlg) { int i; SendMessage(hwndChildDialog, WM_SAVESETTINGS, 0, 0); - i = settings_msgbox_reset(button); + i = settings_msgbox_reset(); if (i > 0) { if (i == 2) win_settings_save(); @@ -4988,9 +4985,9 @@ win_settings_confirm(HWND hdlg, int button) EndDialog(hdlg, 0); win_notify_dlg_closed(); - return button ? TRUE : FALSE; + return TRUE; } else - return button ? FALSE : TRUE; + return FALSE; } @@ -5065,11 +5062,14 @@ win_settings_main_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } break; case WM_CLOSE: - return win_settings_confirm(hdlg, 0); + DestroyWindow(hwndChildDialog); + EndDialog(hdlg, 0); + win_notify_dlg_closed(); + return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: - return win_settings_confirm(hdlg, 1); + return win_settings_confirm(hdlg); case IDCANCEL: DestroyWindow(hwndChildDialog); EndDialog(hdlg, 0);