Yast UI
YDownloadProgress Class Reference

Self-polling file growth progress indicator (optional widget) More...

Detailed Description

Self-polling file growth progress indicator (optional widget)

Following widget variants exist: DownloadProgress

Example:

# encoding: utf-8
module Yast
class DownloadProgress1Client < Client
def main
Yast.import "UI"
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
end
@filename = "/suse/sh/.y2log"
# string filename = "/var/log/y2log";
@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
nil
end
end
end
Yast::DownloadProgress1Client.new.main

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 HasSpecialWidget( :DownloadProgress ) before using it.

The documentation for this class was generated from the following file: