Merge pull request #1107 from dhrdlicka/feature/settings-tweaks

Tweaks to the Settings dialog
This commit is contained in:
Miran Grča
2020-11-20 01:06:46 +01:00
committed by GitHub
4 changed files with 48 additions and 16 deletions

View File

@@ -96,7 +96,7 @@
#define IDS_2120 2120 // "No ROMs found" #define IDS_2120 2120 // "No ROMs found"
#define IDS_2121 2121 // "Save changes\nThis will hard..." #define IDS_2121 2121 // "Save changes\nThis will hard..."
#define IDS_2122 2122 // "Discard changes\nAll changes..." #define IDS_2122 2122 // "Discard changes\nAll changes..."
#define IDS_2123 2123 // "Cancel\nGo back to the..." #define IDS_2123 2123 // "Do you want to save the settings?"
#define IDS_2124 2124 // "About 86Box" #define IDS_2124 2124 // "About 86Box"
#define IDS_2125 2125 // "86Box v" EMU_VERSION #define IDS_2125 2125 // "86Box v" EMU_VERSION
#define IDS_2126 2126 // "An emulator of old computers..." #define IDS_2126 2126 // "An emulator of old computers..."

View File

@@ -988,7 +988,7 @@ BEGIN
IDS_2120 "No ROMs found" IDS_2120 "No ROMs found"
IDS_2121 "Save changes\nThis will hard reset the emulated machine." IDS_2121 "Save changes\nThis will hard reset the emulated machine."
IDS_2122 "Discard changes\nAll changes made to the settings will be lost." IDS_2122 "Discard changes\nAll changes made to the settings will be lost."
IDS_2123 "Cancel\nGo back to the Settings window." IDS_2123 "Do you want to save the settings?"
IDS_2124 "About 86Box" IDS_2124 "About 86Box"
IDS_2125 "86Box v" EMU_VERSION IDS_2125 "86Box 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_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."
@@ -1021,9 +1021,9 @@ BEGIN
IDS_2133 LIB_NAME_FLUIDSYNTH " is required for FluidSynth MIDI output." IDS_2133 LIB_NAME_FLUIDSYNTH " is required for FluidSynth MIDI output."
IDS_2134 "Entering fullscreen mode" IDS_2134 "Entering fullscreen mode"
IDS_2135 "Don't show this message again" IDS_2135 "Don't show this message again"
IDS_2136 "Don't Exit" IDS_2136 "Don't exit"
IDS_2137 "Reset" IDS_2137 "Reset"
IDS_2138 "Don't Reset" IDS_2138 "Don't reset"
IDS_2139 "MO images (*.IM?;*.MDI)\0*.IM?;*.MDI\0All files (*.*)\0*.*\0" IDS_2139 "MO images (*.IM?;*.MDI)\0*.IM?;*.MDI\0All files (*.*)\0*.*\0"
END END
@@ -1035,8 +1035,8 @@ BEGIN
IDS_4099 "MFM/RLL or ESDI CD-ROM drives never existed" IDS_4099 "MFM/RLL or ESDI CD-ROM drives never existed"
IDS_4100 "Custom..." IDS_4100 "Custom..."
IDS_4101 "Custom (large)..." IDS_4101 "Custom (large)..."
IDS_4102 "Add New Hard Disk" IDS_4102 "Add new hard disk"
IDS_4103 "Add Existing Hard Disk" IDS_4103 "Add existing hard disk"
IDS_4104 "HDI disk images cannot be larger than 4 GB." IDS_4104 "HDI disk images cannot be larger than 4 GB."
IDS_4105 "Disk images cannot be larger than 127 GB." IDS_4105 "Disk images cannot be larger than 127 GB."
IDS_4106 "Hard disk images (*.HD?;*.IM?;*.VHD)\0*.HD?;*.IM?;*.VHD\0All files (*.*)\0*.*\0" IDS_4106 "Hard disk images (*.HD?;*.IM?;*.VHD)\0*.HD?;*.IM?;*.VHD\0All files (*.*)\0*.*\0"
@@ -1054,7 +1054,7 @@ BEGIN
IDS_4118 "The selected file will be overwritten. Are you sure you want to use it?" IDS_4118 "The selected file will be overwritten. Are you sure you want to use it?"
IDS_4119 "Unsupported disk image" IDS_4119 "Unsupported disk image"
IDS_4120 "Overwrite" IDS_4120 "Overwrite"
IDS_4121 "Don't Overwrite" IDS_4121 "Don't overwrite"
IDS_4352 "MFM/RLL" IDS_4352 "MFM/RLL"
IDS_4353 "XTA" IDS_4353 "XTA"

View File

@@ -813,7 +813,7 @@ endif
ifneq ($(WX), n) ifneq ($(WX), n)
LIBS += $(WX_LIBS) -lm LIBS += $(WX_LIBS) -lm
endif endif
LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lpsapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -lversion -lwinmm -static -lstdc++ LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lpsapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -luxtheme -lversion -lwinmm -static -lstdc++
ifneq ($(X64), y) ifneq ($(X64), y)
LIBS += -Wl,--large-address-aware LIBS += -Wl,--large-address-aware
endif endif

View File

@@ -20,6 +20,7 @@
#define BITMAP WINDOWS_BITMAP #define BITMAP WINDOWS_BITMAP
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
#include <uxtheme.h>
#undef BITMAP #undef BITMAP
#ifdef ENABLE_SETTINGS_LOG #ifdef ENABLE_SETTINGS_LOG
#include <assert.h> #include <assert.h>
@@ -207,6 +208,17 @@ settings_show_window(HWND hdlg, int id, int condition)
} }
static void
settings_listview_enable_styles(HWND hdlg, int id)
{
HWND h;
h = GetDlgItem(hdlg, id);
SetWindowTheme(h, L"Explorer", NULL);
ListView_SetExtendedListViewStyle(h, LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
}
static void static void
settings_listview_select(HWND hdlg, int id, int selection) settings_listview_select(HWND hdlg, int id, int selection)
{ {
@@ -217,6 +229,17 @@ settings_listview_select(HWND hdlg, int id, int selection)
} }
static void
settings_process_messages()
{
MSG msg;
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
static BOOL static BOOL
image_list_init(HWND hdlg, int id, const uint8_t *icon_ids) image_list_init(HWND hdlg, int id, const uint8_t *icon_ids)
{ {
@@ -495,7 +518,7 @@ win_settings_changed(void)
static int static int
settings_msgbox_reset(void) settings_msgbox_reset(int button)
{ {
int changed, i = 0; int changed, i = 0;
HWND h; HWND h;
@@ -506,7 +529,7 @@ settings_msgbox_reset(void)
h = hwndMain; h = hwndMain;
hwndMain = hwndParentDialog; hwndMain = hwndParentDialog;
i = ui_msgbox_ex(MBX_QUESTION | MBX_LINKS, (wchar_t *) IDS_2051, NULL, (wchar_t *) IDS_2121, (wchar_t *) IDS_2122, (wchar_t *) IDS_2123); i = ui_msgbox_ex(MBX_QUESTION | MBX_LINKS, (wchar_t *) (button ? IDS_2051 : IDS_2123), NULL, (wchar_t *) IDS_2121, (wchar_t *) IDS_2122, NULL);
hwndMain = h; hwndMain = h;
@@ -1067,6 +1090,8 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
} }
c++; c++;
settings_process_messages();
} }
settings_enable_window(hdlg, IDC_COMBO_VIDEO, !(machines[temp_machine].flags & MACHINE_VIDEO_ONLY)); settings_enable_window(hdlg, IDC_COMBO_VIDEO, !(machines[temp_machine].flags & MACHINE_VIDEO_ONLY));
@@ -2437,7 +2462,6 @@ win_settings_hard_disks_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
uint8_t id = 0; uint8_t id = 0;
wchar_t *twcs; wchar_t *twcs;
vhd_footer_t *vft = NULL; vhd_footer_t *vft = NULL;
MSG msg;
switch (message) { switch (message) {
case WM_INITDIALOG: case WM_INITDIALOG:
@@ -2606,10 +2630,7 @@ win_settings_hard_disks_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
fwrite(big_buf, 1, 1048576, f); fwrite(big_buf, 1, 1048576, f);
SendMessage(h, PBM_SETPOS, (WPARAM) (i + 1), (LPARAM) 0); SendMessage(h, PBM_SETPOS, (WPARAM) (i + 1), (LPARAM) 0);
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) { settings_process_messages();
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} }
} }
@@ -3114,6 +3135,8 @@ win_settings_hard_disks_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPar
lv1_current_sel = -1; lv1_current_sel = -1;
recalc_location_controls(hdlg, 0, 0); recalc_location_controls(hdlg, 0, 0);
settings_listview_enable_styles(hdlg, IDC_LIST_HARD_DISKS);
ignore_change = 0; ignore_change = 0;
return TRUE; return TRUE;
@@ -4168,6 +4191,8 @@ win_settings_floppy_and_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam
settings_set_check(hdlg, IDC_CHECKTURBO, temp_fdd_turbo[lv1_current_sel]); settings_set_check(hdlg, IDC_CHECKTURBO, temp_fdd_turbo[lv1_current_sel]);
settings_set_check(hdlg, IDC_CHECKBPB, temp_fdd_check_bpb[lv1_current_sel]); settings_set_check(hdlg, IDC_CHECKBPB, temp_fdd_check_bpb[lv1_current_sel]);
settings_listview_enable_styles(hdlg, IDC_LIST_FLOPPY_DRIVES);
lv2_current_sel = 0; lv2_current_sel = 0;
win_settings_cdrom_drives_init_columns(hdlg); win_settings_cdrom_drives_init_columns(hdlg);
image_list_init(hdlg, IDC_LIST_CDROM_DRIVES, (const uint8_t *) cd_icons); image_list_init(hdlg, IDC_LIST_CDROM_DRIVES, (const uint8_t *) cd_icons);
@@ -4190,6 +4215,8 @@ win_settings_floppy_and_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam
settings_set_cur_sel(hdlg, IDC_COMBO_CD_BUS, b); settings_set_cur_sel(hdlg, IDC_COMBO_CD_BUS, b);
cdrom_recalc_location_controls(hdlg, 0); cdrom_recalc_location_controls(hdlg, 0);
settings_listview_enable_styles(hdlg, IDC_LIST_CDROM_DRIVES);
ignore_change = 0; ignore_change = 0;
return TRUE; return TRUE;
@@ -4352,6 +4379,8 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam
settings_set_cur_sel(hdlg, IDC_COMBO_MO_BUS, b); settings_set_cur_sel(hdlg, IDC_COMBO_MO_BUS, b);
mo_recalc_location_controls(hdlg, 0); mo_recalc_location_controls(hdlg, 0);
settings_listview_enable_styles(hdlg, IDC_LIST_MO_DRIVES);
lv2_current_sel = 0; lv2_current_sel = 0;
win_settings_zip_drives_init_columns(hdlg); win_settings_zip_drives_init_columns(hdlg);
image_list_init(hdlg, IDC_LIST_ZIP_DRIVES, (const uint8_t *) zip_icons); image_list_init(hdlg, IDC_LIST_ZIP_DRIVES, (const uint8_t *) zip_icons);
@@ -4374,6 +4403,8 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam
settings_set_cur_sel(hdlg, IDC_COMBO_ZIP_BUS, b); settings_set_cur_sel(hdlg, IDC_COMBO_ZIP_BUS, b);
zip_recalc_location_controls(hdlg, 0); zip_recalc_location_controls(hdlg, 0);
settings_listview_enable_styles(hdlg, IDC_LIST_ZIP_DRIVES);
ignore_change = 0; ignore_change = 0;
return TRUE; return TRUE;
@@ -4622,7 +4653,7 @@ win_settings_confirm(HWND hdlg, int button)
int i; int i;
SendMessage(hwndChildDialog, WM_SAVESETTINGS, 0, 0); SendMessage(hwndChildDialog, WM_SAVESETTINGS, 0, 0);
i = settings_msgbox_reset(); i = settings_msgbox_reset(button);
if (i > 0) { if (i > 0) {
if (i == 2) if (i == 2)
win_settings_save(); win_settings_save();
@@ -4659,6 +4690,7 @@ win_settings_main_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
image_list_init(hdlg, IDC_SETTINGSCATLIST, (const uint8_t *) cat_icons); image_list_init(hdlg, IDC_SETTINGSCATLIST, (const uint8_t *) cat_icons);
win_settings_main_insert_categories(h); win_settings_main_insert_categories(h);
settings_listview_select(hdlg, IDC_SETTINGSCATLIST, first_cat); settings_listview_select(hdlg, IDC_SETTINGSCATLIST, first_cat);
settings_listview_enable_styles(hdlg, IDC_SETTINGSCATLIST);
return TRUE; return TRUE;
case WM_NOTIFY: case WM_NOTIFY:
if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_SETTINGSCATLIST)) { if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_SETTINGSCATLIST)) {