mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-21 10:25:12 -04:00
[ui] disable drag and drop during drive creation
* Closes #1672 * Also fix Rufus MBR not being selected when switching partition scheme to MBR * Also fix users being prompted twice for ISO → ESP
This commit is contained in:
parent
f2ca5a3121
commit
c9e71de898
4 changed files with 28 additions and 23 deletions
|
@ -11,7 +11,7 @@
|
||||||
<Identity
|
<Identity
|
||||||
Name="19453.net.Rufus"
|
Name="19453.net.Rufus"
|
||||||
Publisher="CN=7AC86D13-3E5A-491A-ADD5-80095C212740"
|
Publisher="CN=7AC86D13-3E5A-491A-ADD5-80095C212740"
|
||||||
Version="3.14.1767.0" />
|
Version="3.14.1768.0" />
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>Rufus</DisplayName>
|
<DisplayName>Rufus</DisplayName>
|
||||||
|
|
37
src/rufus.c
37
src/rufus.c
|
@ -643,6 +643,7 @@ static void SetFSFromISO(void)
|
||||||
static void SetMBRProps(void)
|
static void SetMBRProps(void)
|
||||||
{
|
{
|
||||||
BOOL needs_masquerading = HAS_WINPE(img_report) && (!img_report.uses_minint);
|
BOOL needs_masquerading = HAS_WINPE(img_report) && (!img_report.uses_minint);
|
||||||
|
fs_type = (int)ComboBox_GetCurItemData(hFileSystem);
|
||||||
|
|
||||||
if ((!mbr_selected_by_user) && ((image_path == NULL) || (boot_type != BT_IMAGE) || (fs_type != FS_NTFS) || HAS_GRUB(img_report) ||
|
if ((!mbr_selected_by_user) && ((image_path == NULL) || (boot_type != BT_IMAGE) || (fs_type != FS_NTFS) || HAS_GRUB(img_report) ||
|
||||||
((image_options & IMOP_WINTOGO) && ComboBox_GetCurItemData(hImageOption)) )) {
|
((image_options & IMOP_WINTOGO) && ComboBox_GetCurItemData(hImageOption)) )) {
|
||||||
|
@ -1328,7 +1329,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
WPARAM ret = BOOTCHECK_CANCEL;
|
WPARAM ret = BOOTCHECK_CANCEL;
|
||||||
BOOL in_files_dir = FALSE;
|
BOOL in_files_dir = FALSE, esp_already_asked = FALSE;
|
||||||
const char* grub = "grub";
|
const char* grub = "grub";
|
||||||
const char* core_img = "core.img";
|
const char* core_img = "core.img";
|
||||||
const char* ldlinux = "ldlinux";
|
const char* ldlinux = "ldlinux";
|
||||||
|
@ -1378,6 +1379,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
|
||||||
write_as_esp = TRUE;
|
write_as_esp = TRUE;
|
||||||
else if (i == 3)
|
else if (i == 3)
|
||||||
write_as_image = TRUE;
|
write_as_image = TRUE;
|
||||||
|
esp_already_asked = TRUE;
|
||||||
} else {
|
} else {
|
||||||
char* choices[2] = { lmprintf(MSG_276, iso_image), lmprintf(MSG_277, dd_image) };
|
char* choices[2] = { lmprintf(MSG_276, iso_image), lmprintf(MSG_277, dd_image) };
|
||||||
i = SelectionDialog(lmprintf(MSG_274, "ISOHybrid"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image),
|
i = SelectionDialog(lmprintf(MSG_274, "ISOHybrid"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image),
|
||||||
|
@ -1451,7 +1453,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE * MB) && HAS_REGULAR_EFI(img_report) &&
|
if ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE * MB) && HAS_REGULAR_EFI(img_report) &&
|
||||||
(partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type)) {
|
(partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type) && !esp_already_asked) {
|
||||||
// The ISO is small enough to be written as an ESP and we are using GPT
|
// The ISO is small enough to be written as an ESP and we are using GPT
|
||||||
// so ask the users if they want to write it as an ESP.
|
// so ask the users if they want to write it as an ESP.
|
||||||
char* iso_image = lmprintf(MSG_036);
|
char* iso_image = lmprintf(MSG_036);
|
||||||
|
@ -2379,6 +2381,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
partition_type = (int)ComboBox_GetCurItemData(hPartitionScheme);
|
partition_type = (int)ComboBox_GetCurItemData(hPartitionScheme);
|
||||||
SetPartitionSchemeAndTargetSystem(TRUE);
|
SetPartitionSchemeAndTargetSystem(TRUE);
|
||||||
SetFileSystemAndClusterSize(NULL);
|
SetFileSystemAndClusterSize(NULL);
|
||||||
|
SetMBRProps();
|
||||||
EnableMBRBootOptions(TRUE, TRUE);
|
EnableMBRBootOptions(TRUE, TRUE);
|
||||||
selected_pt = partition_type;
|
selected_pt = partition_type;
|
||||||
break;
|
break;
|
||||||
|
@ -2778,21 +2781,23 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DROPFILES:
|
case WM_DROPFILES:
|
||||||
droppedFileInfo = (HDROP)wParam;
|
if (format_thread == NULL) {
|
||||||
wbuffer = calloc(MAX_PATH, sizeof(wchar_t));
|
droppedFileInfo = (HDROP)wParam;
|
||||||
if (wbuffer == NULL) {
|
wbuffer = calloc(MAX_PATH, sizeof(wchar_t));
|
||||||
uprintf("Failed to alloc buffer for drag-n-drop");
|
if (wbuffer == NULL) {
|
||||||
break;
|
uprintf("Failed to alloc buffer for drag-n-drop");
|
||||||
}
|
break;
|
||||||
DragQueryFileW(droppedFileInfo, 0, wbuffer, MAX_PATH);
|
}
|
||||||
safe_free(image_path);
|
DragQueryFileW(droppedFileInfo, 0, wbuffer, MAX_PATH);
|
||||||
image_path = wchar_to_utf8(wbuffer);
|
safe_free(image_path);
|
||||||
safe_free(wbuffer);
|
image_path = wchar_to_utf8(wbuffer);
|
||||||
|
safe_free(wbuffer);
|
||||||
|
|
||||||
if (image_path != NULL) {
|
if (image_path != NULL) {
|
||||||
img_provided = TRUE;
|
img_provided = TRUE;
|
||||||
// Simulate image selection click
|
// Simulate image selection click
|
||||||
SendMessage(hDlg, WM_COMMAND, IDC_SELECT, 0);
|
SendMessage(hDlg, WM_COMMAND, IDC_SELECT, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 3.14.1767"
|
CAPTION "Rufus 3.14.1768"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -395,8 +395,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,14,1767,0
|
FILEVERSION 3,14,1768,0
|
||||||
PRODUCTVERSION 3,14,1767,0
|
PRODUCTVERSION 3,14,1768,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -414,13 +414,13 @@ BEGIN
|
||||||
VALUE "Comments", "https://rufus.ie"
|
VALUE "Comments", "https://rufus.ie"
|
||||||
VALUE "CompanyName", "Akeo Consulting"
|
VALUE "CompanyName", "Akeo Consulting"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.14.1767"
|
VALUE "FileVersion", "3.14.1768"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||||
VALUE "OriginalFilename", "rufus-3.14.exe"
|
VALUE "OriginalFilename", "rufus-3.14.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.14.1767"
|
VALUE "ProductVersion", "3.14.1768"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
2
src/ui.c
2
src/ui.c
|
@ -529,7 +529,7 @@ void AdjustForLowDPI(HWND hDlg)
|
||||||
for (i = 0; i < ARRAYSIZE(adjust_dpi_ids); i++) {
|
for (i = 0; i < ARRAYSIZE(adjust_dpi_ids); i++) {
|
||||||
dy += ddy;
|
dy += ddy;
|
||||||
// "...and the other thing I really like about Microsoft's UI handling is how "
|
// "...and the other thing I really like about Microsoft's UI handling is how "
|
||||||
//."you never have to introduce weird hardcoded constants all over the place, "
|
// "you never have to introduce weird hardcoded constants all over the place, "
|
||||||
// "just to make your UI look good...", said NO ONE ever.
|
// "just to make your UI look good...", said NO ONE ever.
|
||||||
if (adjust_dpi_ids[i][0] == IDC_QUICK_FORMAT)
|
if (adjust_dpi_ids[i][0] == IDC_QUICK_FORMAT)
|
||||||
dy += 1;
|
dy += 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue