[ui] delay hotplug event when the user has pressed Start

* Closes #793
* Also update issue template
This commit is contained in:
Pete Batard 2016-07-08 12:09:46 +01:00
parent 91eec034b1
commit cebfa4cc7a
3 changed files with 29 additions and 18 deletions

View File

@ -1,24 +1,23 @@
Report checklist
----------------
Checklist
---------
<Please complete the following and place an x into each [ ] to confirm that you have read and performed these preliminary steps>
(Place an x into each [ ] to confirm that you have read and performed the following)
- [ ] I had a look at https://github.com/pbatard/rufus/wiki/FAQ to see if my issue/question has been answered there.
- [ ] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered.
- [ ] I performed a search in the issue tracker for similar issues, using keywords relevant to my problem.
- [ ] I clicked on the 'Log' button in Rufus and I have copied it, into the line that says `<FULL LOG>` below.
- [ ] I clicked the `Log` button in Rufus and copy/pasted the log into the line that says `<FULL LOG>` below.
- [ ] The log I am copying is the FULL log, starting with the line `Rufus version: x.y.z` - I have NOT removed any part of it.
Additionally (if applicable):
- [ ] I have run a bad blocks check, by clicking the "bad blocks" check box in Rufus, and confirmed that my USB is not defective
- [ ] I have also tried one or more of the following:
- [ ] I ran a bad blocks check, by clicking the "bad blocks" check box in Rufus, and confirmed that my USB is not defective
- [ ] I also tried one or more of the following:
- [ ] Using a different USB drive
- [ ] Plugging the USB into a different port
- [ ] Running Rufus on a different computer
- [ ] If using an ISO image, I have clicked on the `#` button, at the bottom of Rufus, to compute the MD5, SHA1 and SHA256 checksums (which are therefore reported in the log I copied) and confirmed, by performing an internet search, that these values match the ones from the official image.
- [ ] If using an ISO image, I clicked on the `#` button (at the bottom of the Rufus interface), to compute the MD5, SHA1 and SHA256 checksums, which are therefore present in the log I copied. I confirmed, by performing an internet search, that these values match the ones from the official image.
Issue description
-----------------
<Describe your issue here>
<Please describe your issue here>
Log
---

View File

@ -2050,11 +2050,12 @@ void SaveVHD(void)
/*
* Main dialog callback
*/
#define PROCESS_QUEUED_EVENTS if (queued_hotplug_event) SendMessage(hDlg, UM_MEDIA_CHANGE, 0, 0)
static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
static DWORD DeviceNum = 0;
static uint64_t LastRefresh = 0;
static BOOL first_log_display = TRUE, isMarquee = FALSE;
static BOOL first_log_display = TRUE, isMarquee = FALSE, queued_hotplug_event = FALSE;
static ULONG ulRegister = 0;
static LPITEMIDLIST pidlDesktop = NULL;
static MY_SHChangeNotifyEntry NotifyEntry;
@ -2096,8 +2097,13 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
case DBT_CUSTOMEVENT: // Sent by our timer refresh function or for card reader media change
LastRefresh = _GetTickCount64();
KillTimer(hMainDialog, TID_REFRESH_TIMER);
GetDevices((DWORD)ComboBox_GetItemData(hDeviceList, ComboBox_GetCurSel(hDeviceList)));
user_changed_label = FALSE;
if (!format_op_in_progress) {
queued_hotplug_event = FALSE;
GetDevices((DWORD)ComboBox_GetItemData(hDeviceList, ComboBox_GetCurSel(hDeviceList)));
user_changed_label = FALSE;
} else {
queued_hotplug_event = TRUE;
}
return (INT_PTR)TRUE;
case DBT_DEVNODES_CHANGED:
// If it's been more than a second since last device refresh, arm a refresh timer
@ -2455,6 +2461,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
if (!zero_drive) {
if ((IsChecked(IDC_BOOT)) && (!BootCheck())) {
format_op_in_progress = FALSE;
PROCESS_QUEUED_EVENTS;
break;
}
@ -2482,6 +2489,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
lmprintf(MSG_276, iso_image), lmprintf(MSG_277, dd_image));
if (i < 0) { // Cancel
format_op_in_progress = FALSE;
PROCESS_QUEUED_EVENTS;
break;
} else if (i == 2) {
selection_default = BT_IMG;
@ -2495,18 +2503,21 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
APPLICATION_NAME, MB_OKCANCEL|MB_ICONWARNING|MB_IS_RTL, selected_langid) == IDCANCEL) {
format_op_in_progress = FALSE;
zero_drive = FALSE;
PROCESS_QUEUED_EVENTS;
break;
}
if ((SelectedDrive.nPartitions > 1) && (MessageBoxExU(hMainDialog, lmprintf(MSG_093),
lmprintf(MSG_094), MB_OKCANCEL|MB_ICONWARNING|MB_IS_RTL, selected_langid) == IDCANCEL)) {
format_op_in_progress = FALSE;
zero_drive = FALSE;
PROCESS_QUEUED_EVENTS;
break;
}
if ((!zero_drive) && (IsChecked(IDC_BOOT)) && (SelectedDrive.SectorSize != 512) &&
(MessageBoxExU(hMainDialog, lmprintf(MSG_196, SelectedDrive.SectorSize),
lmprintf(MSG_197), MB_OKCANCEL|MB_ICONWARNING|MB_IS_RTL, selected_langid) == IDCANCEL)) {
format_op_in_progress = FALSE;
PROCESS_QUEUED_EVENTS;
break;
}
@ -2530,6 +2541,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
if (format_thid == NULL) {
format_op_in_progress = FALSE;
zero_drive = FALSE;
PROCESS_QUEUED_EVENTS;
}
break;
case IDC_HASH:

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 2.10.967"
CAPTION "Rufus 2.10.968"
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -320,8 +320,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,10,967,0
PRODUCTVERSION 2,10,967,0
FILEVERSION 2,10,968,0
PRODUCTVERSION 2,10,968,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -338,13 +338,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.10.967"
VALUE "FileVersion", "2.10.968"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.10.967"
VALUE "ProductVersion", "2.10.968"
END
END
BLOCK "VarFileInfo"