Bug 799215 - Stub installer's dual progress bars are confusing. Use a single progress bar for both. ui-r=philipp, r=bbondy

This commit is contained in:
Robert Strong 2014-03-19 10:40:04 -07:00
Родитель 2ead8b81d8
Коммит 1bc737a3a4
7 изменённых файлов: 113 добавлений и 79 удалений

Просмотреть файл

@ -42,4 +42,3 @@
!define OPTIONS_BKGRD_COLOR 0x0F1B26 !define OPTIONS_BKGRD_COLOR 0x0F1B26
!define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF !define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF
!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF
!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0xA1AAB3

Просмотреть файл

@ -42,4 +42,3 @@
!define OPTIONS_BKGRD_COLOR 0x0F1B26 !define OPTIONS_BKGRD_COLOR 0x0F1B26
!define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF !define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF
!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF
!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0xA1AAB3

Просмотреть файл

@ -46,4 +46,3 @@
!define OPTIONS_BKGRD_COLOR 0xF0F0F0 !define OPTIONS_BKGRD_COLOR 0xF0F0F0
!define INSTALL_BLURB_TEXT_COLOR 0x666666 !define INSTALL_BLURB_TEXT_COLOR 0x666666
!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0x666666 !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0x666666
!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0x999999

Просмотреть файл

@ -42,4 +42,3 @@
!define OPTIONS_BKGRD_COLOR 0x0F1B26 !define OPTIONS_BKGRD_COLOR 0x0F1B26
!define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF !define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF
!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF
!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0xA1AAB3

Просмотреть файл

@ -21,12 +21,9 @@ RequestExecutionLevel user
!addplugindir ./ !addplugindir ./
Var Dialog Var Dialog
Var ProgressbarDownload Var Progressbar
Var ProgressbarInstall Var LabelDownloading
Var LabelDownloadingDown Var LabelInstalling
Var LabelDownloadingInProgress
Var LabelInstallingInProgress
Var LabelInstallingToBeDone
Var LabelFreeSpace Var LabelFreeSpace
Var CheckboxSetAsDefault Var CheckboxSetAsDefault
Var CheckboxShortcutOnBar ; Used for Quicklaunch or Taskbar as appropriate Var CheckboxShortcutOnBar ; Used for Quicklaunch or Taskbar as appropriate
@ -63,6 +60,7 @@ Var InitialInstallDir
Var HandleDownload Var HandleDownload
Var CanSetAsDefault Var CanSetAsDefault
Var InstallCounterStep Var InstallCounterStep
Var InstallStepSize
Var TmpVal Var TmpVal
Var ExitCode Var ExitCode
@ -1101,40 +1099,22 @@ Function createInstall
ShowWindow $BitmapBlurb3 ${SW_HIDE} ShowWindow $BitmapBlurb3 ${SW_HIDE}
ShowWindow $LabelBlurb3 ${SW_HIDE} ShowWindow $LabelBlurb3 ${SW_HIDE}
nsDialogs::CreateControl /NOUNLOAD STATIC ${DEFAULT_STYLES}|${SS_SUNKEN} 0 260u 166u 1u 30u "" ${NSD_CreateProgressBar} 103u 166u 241u 9u ""
Pop $0 Pop $Progressbar
${NSD_AddStyle} $Progressbar ${PBS_MARQUEE}
${NSD_CreateLabelCenter} 103u 180u 157u 20u "$(DOWNLOADING_IN_PROGRESS)" SendMessage $Progressbar ${PBM_SETMARQUEE} 1 \
Pop $LabelDownloadingInProgress
SendMessage $LabelDownloadingInProgress ${WM_SETFONT} $FontNormal 0
SetCtlColors $LabelDownloadingInProgress ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
${NSD_CreateLabelCenter} 103u 180u 157u 20u "$(DOWNLOADING_DONE)"
Pop $LabelDownloadingDown
SendMessage $LabelDownloadingDown ${WM_SETFONT} $FontItalic 0
SetCtlColors $LabelDownloadingDown ${INSTALL_PROGRESS_TEXT_COLOR_FADED} transparent
ShowWindow $LabelDownloadingDown ${SW_HIDE}
${NSD_CreateLabelCenter} 260uu 180u 84u 20u "$(INSTALLING_TO_BE_DONE)"
Pop $LabelInstallingToBeDone
SendMessage $LabelInstallingToBeDone ${WM_SETFONT} $FontItalic 0
SetCtlColors $LabelInstallingToBeDone ${INSTALL_PROGRESS_TEXT_COLOR_FADED} transparent
${NSD_CreateLabelCenter} 260uu 180u 84u 20u "$(INSTALLING_IN_PROGRESS)"
Pop $LabelInstallingInProgress
SendMessage $LabelInstallingInProgress ${WM_SETFONT} $FontNormal 0
SetCtlColors $LabelInstallingInProgress ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
ShowWindow $LabelInstallingInProgress ${SW_HIDE}
${NSD_CreateProgressBar} 103u 166u 157u 9u ""
Pop $ProgressbarDownload
${NSD_AddStyle} $ProgressbarDownload ${PBS_MARQUEE}
SendMessage $ProgressbarDownload ${PBM_SETMARQUEE} 1 \
${ProgressbarMarqueeIntervalMS} ; start=1|stop=0 interval(ms)=+N ${ProgressbarMarqueeIntervalMS} ; start=1|stop=0 interval(ms)=+N
${NSD_CreateProgressBar} 260u 166u 84u 9u "" ${NSD_CreateLabelCenter} 103u 180u 241u 20u "$(DOWNLOADING_LABEL)"
Pop $ProgressbarInstall Pop $LabelDownloading
SendMessage $ProgressbarInstall ${PBM_SETRANGE32} 0 ${InstallProgresSteps} SendMessage $LabelDownloading ${WM_SETFONT} $FontNormal 0
SetCtlColors $LabelDownloading ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
${NSD_CreateLabelCenter} 103u 180u 241u 20u "$(INSTALLING_LABEL)"
Pop $LabelInstalling
SendMessage $LabelInstalling ${WM_SETFONT} $FontNormal 0
SetCtlColors $LabelInstalling ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
ShowWindow $LabelInstalling ${SW_HIDE}
${NSD_CreateBitmap} ${APPNAME_BMP_EDGE_DU} ${APPNAME_BMP_TOP_DU} \ ${NSD_CreateBitmap} ${APPNAME_BMP_EDGE_DU} ${APPNAME_BMP_TOP_DU} \
${APPNAME_BMP_WIDTH_DU} ${APPNAME_BMP_HEIGHT_DU} "" ${APPNAME_BMP_WIDTH_DU} ${APPNAME_BMP_HEIGHT_DU} ""
@ -1247,8 +1227,8 @@ Function OnDownload
IntOp $DownloadRetryCount $DownloadRetryCount + 1 IntOp $DownloadRetryCount $DownloadRetryCount + 1
${If} "$DownloadReset" != "true" ${If} "$DownloadReset" != "true"
StrCpy $DownloadedBytes "0" StrCpy $DownloadedBytes "0"
${NSD_AddStyle} $ProgressbarDownload ${PBS_MARQUEE} ${NSD_AddStyle} $Progressbar ${PBS_MARQUEE}
SendMessage $ProgressbarDownload ${PBM_SETMARQUEE} 1 \ SendMessage $Progressbar ${PBM_SETMARQUEE} 1 \
${ProgressbarMarqueeIntervalMS} ; start=1|stop=0 interval(ms)=+N ${ProgressbarMarqueeIntervalMS} ; start=1|stop=0 interval(ms)=+N
${EndIf} ${EndIf}
InetBgDL::Get /RESET /END InetBgDL::Get /RESET /END
@ -1302,9 +1282,13 @@ Function OnDownload
StrCpy $DownloadSizeBytes "$4" StrCpy $DownloadSizeBytes "$4"
System::Int64Op $4 / 2 System::Int64Op $4 / 2
Pop $HalfOfDownload Pop $HalfOfDownload
SendMessage $ProgressbarDownload ${PBM_SETMARQUEE} 0 0 ; start=1|stop=0 interval(ms)=+N System::Int64Op $HalfOfDownload / ${InstallProgresSteps}
${RemoveStyle} $ProgressbarDownload ${PBS_MARQUEE} Pop $InstallStepSize
SendMessage $ProgressbarDownload ${PBM_SETRANGE32} 0 $DownloadSizeBytes SendMessage $Progressbar ${PBM_SETMARQUEE} 0 0 ; start=1|stop=0 interval(ms)=+N
${RemoveStyle} $Progressbar ${PBS_MARQUEE}
System::Int64Op $HalfOfDownload + $DownloadSizeBytes
Pop $R9
SendMessage $Progressbar ${PBM_SETRANGE32} 0 $R9
${EndIf} ${EndIf}
; Don't update the status until after the download starts ; Don't update the status until after the download starts
@ -1361,12 +1345,14 @@ Function OnDownload
LockWindow on LockWindow on
; Update the progress bars first in the UI change so they take affect ; Update the progress bars first in the UI change so they take affect
; before other UI changes. ; before other UI changes.
SendMessage $ProgressbarDownload ${PBM_SETPOS} $DownloadSizeBytes 0 SendMessage $Progressbar ${PBM_SETPOS} $DownloadSizeBytes 0
SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0 System::Int64Op $InstallStepSize * ${InstallProgressFirstStep}
ShowWindow $LabelDownloadingInProgress ${SW_HIDE} Pop $R9
ShowWindow $LabelInstallingToBeDone ${SW_HIDE} SendMessage $Progressbar ${PBM_SETSTEP} $R9 0
ShowWindow $LabelInstallingInProgress ${SW_SHOW} SendMessage $Progressbar ${PBM_STEPIT} 0 0
ShowWindow $LabelDownloadingDown ${SW_SHOW} SendMessage $Progressbar ${PBM_SETSTEP} $InstallStepSize 0
ShowWindow $LabelDownloading ${SW_HIDE}
ShowWindow $LabelInstalling ${SW_SHOW}
ShowWindow $LabelBlurb2 ${SW_HIDE} ShowWindow $LabelBlurb2 ${SW_HIDE}
ShowWindow $BitmapBlurb2 ${SW_HIDE} ShowWindow $BitmapBlurb2 ${SW_HIDE}
ShowWindow $LabelBlurb3 ${SW_SHOW} ShowWindow $LabelBlurb3 ${SW_SHOW}
@ -1476,7 +1462,7 @@ Function OnDownload
LockWindow off LockWindow off
${EndIf} ${EndIf}
StrCpy $DownloadedBytes "$3" StrCpy $DownloadedBytes "$3"
SendMessage $ProgressbarDownload ${PBM_SETPOS} $3 0 SendMessage $Progressbar ${PBM_SETPOS} $3 0
${EndIf} ${EndIf}
${EndIf} ${EndIf}
FunctionEnd FunctionEnd
@ -1511,7 +1497,7 @@ Function StartInstall
IntOp $InstallCounterStep $InstallCounterStep + 1 IntOp $InstallCounterStep $InstallCounterStep + 1
LockWindow on LockWindow on
SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0 SendMessage $Progressbar ${PBM_STEPIT} 0 0
LockWindow off LockWindow off
Exec "$\"$PLUGINSDIR\download.exe$\" /INI=$PLUGINSDIR\${CONFIG_INI}" Exec "$\"$PLUGINSDIR\download.exe$\" /INI=$PLUGINSDIR\${CONFIG_INI}"
@ -1530,7 +1516,7 @@ Function CheckInstall
Return Return
${EndIf} ${EndIf}
SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0 SendMessage $Progressbar ${PBM_STEPIT} 0 0
${If} ${FileExists} "$INSTDIR\install.log" ${If} ${FileExists} "$INSTDIR\install.log"
Delete "$INSTDIR\install.tmp" Delete "$INSTDIR\install.tmp"
@ -1549,26 +1535,32 @@ Function CheckInstall
Delete "$PLUGINSDIR\${CONFIG_INI}" Delete "$PLUGINSDIR\${CONFIG_INI}"
System::Call "kernel32::GetTickCount()l .s" System::Call "kernel32::GetTickCount()l .s"
Pop $EndInstallPhaseTickCount Pop $EndInstallPhaseTickCount
System::Int64Op $InstallStepSize * 20
Pop $InstallStepSize
SendMessage $Progressbar ${PBM_SETSTEP} $InstallStepSize 0
${NSD_CreateTimer} FinishInstall ${InstallIntervalMS} ${NSD_CreateTimer} FinishInstall ${InstallIntervalMS}
${EndUnless} ${EndUnless}
${EndIf} ${EndIf}
FunctionEnd FunctionEnd
Function FinishInstall Function FinishInstall
; The full installer has complete but we still need to finish the progress ; The full installer has completed but the progress bar still needs to finish
; bar so increase the size of the step ; so increase the size of the step.
IntOp $InstallCounterStep $InstallCounterStep + 20 IntOp $InstallCounterStep $InstallCounterStep + 20
${If} ${InstallProgresSteps} < $InstallCounterStep ${If} ${InstallProgresSteps} < $InstallCounterStep
StrCpy $InstallCounterStep "${InstallProgresSteps}" StrCpy $InstallCounterStep "${InstallProgresSteps}"
${EndIf} ${EndIf}
SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0
${If} ${InstallProgresSteps} != $InstallCounterStep ${If} ${InstallProgresSteps} != $InstallCounterStep
SendMessage $Progressbar ${PBM_STEPIT} 0 0
Return Return
${EndIf} ${EndIf}
${NSD_KillTimer} FinishInstall ${NSD_KillTimer} FinishInstall
SendMessage $Progressbar ${PBM_GETRANGE} 0 0 $R9
SendMessage $Progressbar ${PBM_SETPOS} $R9 0
${If} "$CheckboxSetAsDefault" == "1" ${If} "$CheckboxSetAsDefault" == "1"
${GetParameters} $0 ${GetParameters} $0
ClearErrors ClearErrors
@ -1603,6 +1595,19 @@ Function FinishInstall
StrCpy $ExitCode "${ERR_SUCCESS}" StrCpy $ExitCode "${ERR_SUCCESS}"
StrCpy $InstallCounterStep 0
${NSD_CreateTimer} FinishProgressBar ${InstallIntervalMS}
FunctionEnd
Function FinishProgressBar
IntOp $InstallCounterStep $InstallCounterStep + 1
${If} $InstallCounterStep < 10
Return
${EndIf}
${NSD_KillTimer} FinishProgressBar
Call LaunchApp Call LaunchApp
Call SendPing Call SendPing

Просмотреть файл

@ -52,10 +52,8 @@ SEND_PING=S&end information about this installation to Mozilla
BROWSE_BUTTON=B&rowse… BROWSE_BUTTON=B&rowse…
DEST_FOLDER=Destination Folder DEST_FOLDER=Destination Folder
DOWNLOADING_IN_PROGRESS=Downloading… DOWNLOADING_LABEL=Downloading $BrandShortName…
DOWNLOADING_DONE=Downloaded INSTALLING_LABEL=Installing $BrandShortName…
INSTALLING_TO_BE_DONE=Installing
INSTALLING_IN_PROGRESS=Installing…
SELECT_FOLDER_TEXT=Select the folder to install $BrandShortName in. SELECT_FOLDER_TEXT=Select the folder to install $BrandShortName in.

Просмотреть файл

@ -84,7 +84,9 @@
; !define SHCNF_DWORD 0x0003 ; !define SHCNF_DWORD 0x0003
; !define SHCNF_FLUSH 0x1000 ; !define SHCNF_FLUSH 0x1000
!define SHCNF_DWORDFLUSH 0x1003 !ifndef SHCNF_DWORDFLUSH
!define SHCNF_DWORDFLUSH 0x1003
!endif
!ifndef SHCNE_ASSOCCHANGED !ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000 !define SHCNE_ASSOCCHANGED 0x08000000
!endif !endif
@ -949,8 +951,12 @@
!endif !endif
!macroend !macroend
!define KEY_SET_VALUE 0x0002 !ifndef KEY_SET_VALUE
!define KEY_WOW64_64KEY 0x0100 !define KEY_SET_VALUE 0x0002
!endif
!ifndef KEY_WOW64_64KEY
!define KEY_WOW64_64KEY 0x0100
!endif
!ifndef HAVE_64BIT_OS !ifndef HAVE_64BIT_OS
!define CREATE_KEY_SAM ${KEY_SET_VALUE} !define CREATE_KEY_SAM ${KEY_SET_VALUE}
!else !else
@ -7250,24 +7256,53 @@
################################################################################ ################################################################################
# Helpers for the new user interface # Helpers for the new user interface
!define MAXDWORD 0xffffffff !ifndef MAXDWORD
!define MAXDWORD 0xffffffff
!endif
!define DT_WORDBREAK 0x0010 !ifndef DT_WORDBREAK
!define DT_SINGLELINE 0x0020 !define DT_WORDBREAK 0x0010
!define DT_NOCLIP 0x0100 !endif
!define DT_CALCRECT 0x0400 !ifndef DT_SINGLELINE
!define DT_EDITCONTROL 0x2000 !define DT_SINGLELINE 0x0020
!define DT_RTLREADING 0x00020000 !endif
!define DT_NOFULLWIDTHCHARBREAK 0x00080000 !ifndef DT_NOCLIP
!define DT_NOCLIP 0x0100
!endif
!ifndef DT_CALCRECT
!define DT_CALCRECT 0x0400
!endif
!ifndef DT_EDITCONTROL
!define DT_EDITCONTROL 0x2000
!endif
!ifndef DT_RTLREADING
!define DT_RTLREADING 0x00020000
!endif
!ifndef DT_NOFULLWIDTHCHARBREAK
!define DT_NOFULLWIDTHCHARBREAK 0x00080000
!endif
!define WS_EX_NOINHERITLAYOUT 0x00100000 !ifndef WS_EX_NOINHERITLAYOUT
!define WS_EX_LAYOUTRTL 0x00400000 !define WS_EX_NOINHERITLAYOUT 0x00100000
!endif
!ifndef WS_EX_LAYOUTRTL
!define WS_EX_LAYOUTRTL 0x00400000
!endif
!define PBS_MARQUEE 0x08 !ifndef PBS_MARQUEE
!define PBS_MARQUEE 0x08
!endif
!define /math PBM_SETRANGE32 ${WM_USER} + 6 !ifndef PBM_SETRANGE32
!define PBM_SETRANGE32 0x406
!endif
!ifndef PBM_GETRANGE
!define PBM_GETRANGE 0x407
!endif
!define SHACF_FILESYSTEM 1 !ifndef SHACF_FILESYSTEM
!define SHACF_FILESYSTEM 1
!endif
!define MOZ_LOADTRANSPARENT ${LR_LOADFROMFILE}|${LR_LOADTRANSPARENT}|${LR_LOADMAP3DCOLORS} !define MOZ_LOADTRANSPARENT ${LR_LOADFROMFILE}|${LR_LOADTRANSPARENT}|${LR_LOADMAP3DCOLORS}