Disk Config dialog: small refactor

This commit is contained in:
tomcw 2017-06-03 18:21:27 +01:00
parent 13aee80bd5
commit d81cb0d533

View File

@ -215,11 +215,13 @@ void CPageDisk::EnableDisk(HWND hWnd, BOOL bEnable)
void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected)
{
if (!IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE))
return;
// Search from "select hard drive"
DWORD dwOpenDialogIndex = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultHDDOptions[0]);
DWORD dwComboSelection = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0);
if (IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE))
{
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, -1, 0); // Set to "empty" item
if (dwComboSelection == dwOpenDialogIndex)
@ -230,7 +232,7 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
if (!bRes)
{
if (SendDlgItemMessage(hWnd, comboSelected, CB_GETCOUNT, 0, 0) == 3) // If there's already a disk...
if (SendDlgItemMessage(hWnd, comboSelected, CB_GETCOUNT, 0, 0) == 3) // If there's already a HDD...
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0); // then reselect it in the ComboBox
return;
}
@ -274,7 +276,6 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
}
}
}
}
void CPageDisk::HandleDiskCombo(HWND hWnd, UINT driveSelected, UINT comboSelected)
{