mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-25 12:14:33 -04:00
[ui] fix quickformat option being ignored when unchecked
This commit is contained in:
parent
078aaf7714
commit
555397403a
2 changed files with 13 additions and 9 deletions
12
src/rufus.c
12
src/rufus.c
|
@ -697,15 +697,19 @@ static void EnableQuickFormat(BOOL enable)
|
|||
{
|
||||
HWND hCtrl = GetDlgItem(hMainDialog, IDC_QUICK_FORMAT);
|
||||
|
||||
// Keep track of the current state if we are going to disable it
|
||||
if (IsWindowEnabled(hCtrl) && !enable) {
|
||||
uQFChecked = IsChecked(IDC_QUICK_FORMAT);
|
||||
}
|
||||
|
||||
// Disable/restore the quick format control depending on large FAT32 or ReFS
|
||||
if (((fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32))) || (fs == FS_REFS)) {
|
||||
enable = FALSE;
|
||||
CheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, BST_CHECKED);
|
||||
}
|
||||
|
||||
if (IsWindowEnabled(hCtrl) && !enable) {
|
||||
uQFChecked = IsChecked(IDC_QUICK_FORMAT);
|
||||
CheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, BST_CHECKED);
|
||||
} else if (!IsWindowEnabled(hCtrl) && enable) {
|
||||
// Restore state if we are re-enabling the control
|
||||
if (!IsWindowEnabled(hCtrl) && enable) {
|
||||
CheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, uQFChecked);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue