mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[ui] fix progress display of network downloads
* Also fix a memory leak with the GRUB download buffer
This commit is contained in:
parent
b830c040d2
commit
d1d16ce1c5
2 changed files with 25 additions and 15 deletions
24
src/rufus.c
24
src/rufus.c
|
@ -1761,7 +1761,7 @@ void SetBoot(int fs, int bt)
|
|||
static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static DWORD DeviceNum = 0, LastRefresh = 0;
|
||||
static BOOL first_log_display = TRUE, user_changed_label = FALSE;
|
||||
static BOOL first_log_display = TRUE, user_changed_label = FALSE, isMarquee = FALSE;
|
||||
static ULONG ulRegister = 0;
|
||||
static LPITEMIDLIST pidlDesktop = NULL;
|
||||
static MY_SHChangeNotifyEntry NotifyEntry;
|
||||
|
@ -2280,7 +2280,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
|||
break;
|
||||
|
||||
case UM_PROGRESS_INIT:
|
||||
if (wParam == PBS_MARQUEE) {
|
||||
isMarquee = (wParam == PBS_MARQUEE);
|
||||
if (isMarquee) {
|
||||
progress_style = GetWindowLong(hProgress, GWL_STYLE);
|
||||
SetWindowLong(hProgress, GWL_STYLE, progress_style | PBS_MARQUEE);
|
||||
SendMessage(hProgress, PBM_SETMARQUEE, TRUE, 0);
|
||||
|
@ -2293,13 +2294,21 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
|||
break;
|
||||
|
||||
case UM_PROGRESS_EXIT:
|
||||
// Remove marquee style if previously set
|
||||
progress_style = GetWindowLong(hProgress, GWL_STYLE);
|
||||
SetWindowLong(hProgress, GWL_STYLE, progress_style & (~PBS_MARQUEE));
|
||||
if (isMarquee) {
|
||||
// Remove marquee style if previously set
|
||||
progress_style = GetWindowLong(hProgress, GWL_STYLE);
|
||||
SetWindowLong(hProgress, GWL_STYLE, progress_style & (~PBS_MARQUEE));
|
||||
SetTaskbarProgressValue(0, MAX_PROGRESS);
|
||||
SendMessage(hProgress, PBM_SETPOS, 0, 0);
|
||||
} else if (!IS_ERROR(FormatStatus)) {
|
||||
SetTaskbarProgressValue(MAX_PROGRESS, MAX_PROGRESS);
|
||||
// This is the only way to achieve instantaneous progress transition to 100%
|
||||
SendMessage(hProgress, PBM_SETRANGE, 0, ((MAX_PROGRESS+1)<<16) & 0xFFFF0000);
|
||||
SendMessage(hProgress, PBM_SETPOS, (MAX_PROGRESS+1), 0);
|
||||
SendMessage(hProgress, PBM_SETRANGE, 0, (MAX_PROGRESS<<16) & 0xFFFF0000);
|
||||
}
|
||||
SendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_NORMAL, 0);
|
||||
SetTaskbarProgressState(TASKBAR_NORMAL);
|
||||
SetTaskbarProgressValue(0, MAX_PROGRESS);
|
||||
SendMessage(hProgress, PBM_SETPOS, 0, 0);
|
||||
break;
|
||||
|
||||
case UM_FORMAT_COMPLETED:
|
||||
|
@ -2768,6 +2777,7 @@ out:
|
|||
safe_free(locale_name);
|
||||
safe_free(update.download_url);
|
||||
safe_free(update.release_notes);
|
||||
safe_free(grub2_buf);
|
||||
if (argv != NULL) {
|
||||
for (i=0; i<argc; i++) safe_free(argv[i]);
|
||||
safe_free(argv);
|
||||
|
|
16
src/rufus.rc
16
src/rufus.rc
|
@ -32,7 +32,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
|
||||
CAPTION "Rufus 2.0.0.589"
|
||||
CAPTION "Rufus 2.0.0.590"
|
||||
FONT 8, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
|
||||
|
@ -157,7 +157,7 @@ END
|
|||
|
||||
IDD_DIALOG_XP DIALOGEX 12, 12, 242, 376
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Rufus 2.0.0.589"
|
||||
CAPTION "Rufus 2.0.0.590"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
|
||||
|
@ -283,7 +283,7 @@ END
|
|||
IDD_DIALOG_RTL DIALOGEX 12, 12, 242, 376
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
|
||||
CAPTION "Rufus 2.0.0.589"
|
||||
CAPTION "Rufus 2.0.0.590"
|
||||
FONT 8, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
|
||||
|
@ -415,7 +415,7 @@ END
|
|||
IDD_DIALOG_RTL_XP DIALOGEX 12, 12, 242, 376
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
|
||||
CAPTION "Rufus 2.0.0.589"
|
||||
CAPTION "Rufus 2.0.0.590"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
|
||||
|
@ -671,8 +671,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,0,589
|
||||
PRODUCTVERSION 2,0,0,589
|
||||
FILEVERSION 2,0,0,590
|
||||
PRODUCTVERSION 2,0,0,590
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -689,13 +689,13 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "2.0.0.589"
|
||||
VALUE "FileVersion", "2.0.0.590"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||
VALUE "OriginalFilename", "rufus.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "2.0.0.589"
|
||||
VALUE "ProductVersion", "2.0.0.590"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
Loading…
Reference in a new issue