1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[ui] fix quick format not always being disabled for Large FAT32

* Also remove no longer needed 'progress_in_use' variable
This commit is contained in:
Pete Batard 2018-04-17 09:14:31 +02:00
parent 3b8ef8d308
commit 42c158917c
4 changed files with 27 additions and 27 deletions

View file

@ -69,7 +69,6 @@ uint32_t bufnum, sum_count[CHECKSUM_MAX] = { 16, 20, 32 };
HANDLE data_ready[CHECKSUM_MAX] = { 0 }, thread_ready[CHECKSUM_MAX] = { 0 };
DWORD read_size[2];
unsigned char ALIGNED(64) buffer[2][BUFFER_SIZE];
extern BOOL progress_in_use;
/*
* Rotate 32 bit integers by n bytes.
@ -927,7 +926,6 @@ DWORD WINAPI SumThread(void* param)
bufnum = 0;
_bufnum = 0;
read_size[0] = 1; // Don't trigger the first loop break
progress_in_use = TRUE;
for (rb = 0; ;rb += read_size[_bufnum]) {
// Update the progress and check for cancel
if (GetTickCount64() > LastRefresh + MAX_REFRESH) {
@ -983,7 +981,6 @@ DWORD WINAPI SumThread(void* param)
r = 0;
out:
progress_in_use = FALSE;
for (i = 0; i < CHECKSUM_MAX; i++) {
if (sum_thread[i] != NULL)
TerminateThread(sum_thread[i], 1);

View file

@ -76,8 +76,6 @@ char* default_msg_table[MSG_MAX-MSG_000] = {"%s", 0};
char* current_msg_table[MSG_MAX-MSG_000] = {"%s", 0};
char** msg_table = NULL;
extern BOOL progress_in_use;
static void mtab_destroy(BOOL reinit)
{
size_t j;

View file

@ -111,7 +111,7 @@ DWORD MainThreadId;
HWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL;
HWND hLogDialog = NULL, hProgress = NULL, hDiskID;
BOOL use_own_c32[NB_OLD_C32] = {FALSE, FALSE}, mbr_selected_by_user = FALSE, display_togo_option = FALSE;
BOOL iso_op_in_progress = FALSE, format_op_in_progress = FALSE, right_to_left_mode = FALSE, progress_in_use = FALSE, has_uefi_csm;
BOOL iso_op_in_progress = FALSE, format_op_in_progress = FALSE, right_to_left_mode = FALSE, has_uefi_csm;
BOOL enable_HDDs = FALSE, force_update = FALSE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE, lock_drive = TRUE;
BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32, usb_debug, use_fake_units, preserve_timestamps;
BOOL zero_drive = FALSE, list_non_usb_removable_drives = FALSE, disable_file_indexing, large_drive = FALSE, write_as_image = FALSE;
@ -680,6 +680,25 @@ static void EnableMBRBootOptions(BOOL enable, BOOL remove_checkboxes)
EnableWindow(hDiskID, actual_enable_mbr);
}
static void EnableQuickFormat(BOOL enable)
{
HWND hCtrl = GetDlgItem(hMainDialog, 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)) {
if (IsWindowEnabled(hCtrl)) {
uQFChecked = IsChecked(IDC_QUICK_FORMAT);
CheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, BST_CHECKED);
EnableWindow(hCtrl, FALSE);
}
} else {
if (!IsWindowEnabled(hCtrl)) {
CheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, uQFChecked);
EnableWindow(hCtrl, enable);
}
}
}
static void EnableBootOptions(BOOL enable, BOOL remove_checkboxes)
{
BOOL actual_enable_bb, actual_enable = enable;
@ -699,7 +718,7 @@ static void EnableBootOptions(BOOL enable, BOOL remove_checkboxes)
EnableMBRBootOptions(actual_enable, remove_checkboxes);
EnableWindow(GetDlgItem(hMainDialog, IDC_LABEL), actual_enable);
EnableWindow(GetDlgItem(hMainDialog, IDC_QUICK_FORMAT), actual_enable);
EnableQuickFormat(actual_enable);
EnableWindow(GetDlgItem(hMainDialog, IDC_BAD_BLOCKS), actual_enable_bb);
EnableWindow(GetDlgItem(hMainDialog, IDC_NB_PASSES), actual_enable_bb);
EnableWindow(GetDlgItem(hMainDialog, IDC_EXTENDED_LABEL), actual_enable);
@ -3030,19 +3049,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
break;
fs = (int)ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem));
SetClusterSizes(fs);
// 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) ) {
if (IsWindowEnabled(GetDlgItem(hMainDialog, IDC_QUICK_FORMAT))) {
uQFChecked = IsChecked(IDC_QUICK_FORMAT);
CheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, BST_CHECKED);
EnableWindow(GetDlgItem(hMainDialog, IDC_QUICK_FORMAT), FALSE);
}
} else {
if (!IsWindowEnabled(GetDlgItem(hMainDialog, IDC_QUICK_FORMAT))) {
CheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, uQFChecked);
EnableWindow(GetDlgItem(hMainDialog, IDC_QUICK_FORMAT), TRUE);
}
}
EnableQuickFormat(TRUE);
if (fs < 0) {
EnableBootOptions(TRUE, TRUE);
SetMBRProps();
@ -3470,7 +3477,6 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
}
SetTaskbarProgressState(TASKBAR_NORMAL);
SetTaskbarProgressValue(0, MAX_PROGRESS);
progress_in_use = TRUE;
break;
case UM_PROGRESS_EXIT:
@ -3489,7 +3495,6 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
}
SendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_NORMAL, 0);
SetTaskbarProgressState(TASKBAR_NORMAL);
progress_in_use = FALSE;
break;
case UM_NO_UPDATE:

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.0.1250"
CAPTION "Rufus 3.0.1251"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -371,8 +371,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,1250,0
PRODUCTVERSION 3,0,1250,0
FILEVERSION 3,0,1251,0
PRODUCTVERSION 3,0,1251,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -389,13 +389,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.0.1250"
VALUE "FileVersion", "3.0.1251"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.0.1250"
VALUE "ProductVersion", "3.0.1251"
END
END
BLOCK "VarFileInfo"