DownloadProgress — Self-polling file growth progress indicator (optional widget)
DownloadProgress
( | string label , |
string filename , | |
integer
expectedSize
) ; |
label
label above the indicator
filename
file name with full path of the file to poll
expectedSize
expected final size of the file in bytes
This widget automatically displays the progress of a lengthy download operation. The widget itself (i.e. the UI) polls the specified file and automatically updates the display as required even if the download is taking place in the foreground.
![]() | Note |
---|---|
This is a "special" widget, i.e. not all UIs necessarily support it. Check for availability with |
if ( HasSpecialWidget( `DownloadProgress ) {... `DownloadProgress( "Base system (230k)", "/tmp/aaa_base.rpm", 230*1024 );
{ if ( ! UI::HasSpecialWidget(`DownloadProgress) ) { UI::OpenDialog( `VBox( `Label("Error: This UI doesn't support the DownloadProgress widget!"), `PushButton(`opt(`default), "&OK") ) ); UI::UserInput(); UI::CloseDialog(); return; } string filename = "/suse/sh/.y2log"; // string filename = "/var/log/y2log"; integer expected_size = 20 * 1024; UI::OpenDialog( `VBox( `DownloadProgress("YaST2 log file", filename, expected_size ), `HSpacing(50), // force width `PushButton(`opt(`default), "&Close") ) ); UI::UserInput(); UI::CloseDialog(); }