Hacktoberfestenhancement
Repository metrics
- Stars
- (28,262 stars)
- PR merge metrics
- (Avg merge 26d 11h) (38 merged PRs in 30d)
Description
Is your feature request related to a problem? Please describe:
I have some long-running interactions that use ProgressInfiniteDialog and it would be great to simply be able to change the message shown as progress continued, instead of hiding the dialog and creating a completely new one every time a new stage of the process begins.
Is it possible to construct a solution with the existing API?
No
Describe the solution you'd like to see:
Consider indeterminate action with multiple steps, such as a program installation or download+extract.
total, progress, err := StartDownload("...")
// assume "total" was 0/-1/undefined for this example (e.g: webserver didn't tell us)
dlg := dialog.NewProgressInfinite("Downloading Update", "Starting download...", w)
select {
case n, done := <-progress:
if done { break }
dlg.SetMessage(fmt.Sprintf("%d bytes retrieved...", n))
}
dlg.SetTitle("Extracting Update")
dlg.SetMessage("Starting file extraction...")
select {
case f, done := <- events:
if done { break }
dlg.SetMessage(fmt.Sprintf("Extracting %s...", f)
}