Skip to content

Commit e04b989

Browse files
committed
Change ProgressBarInfinite to Updating... label
1 parent b070304 commit e04b989

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

client/ui/client_ui.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func newServiceClient(args *newServiceClientArgs) *serviceClient {
355355
case args.showProfiles:
356356
s.showProfilesUI()
357357
case args.showUpdate:
358-
s.showUpdateProgress()
358+
s.showUpdateProgress(ctx)
359359
}
360360

361361
return s
@@ -401,11 +401,24 @@ func (s *serviceClient) updateIcon() {
401401
s.updateIndicationLock.Unlock()
402402
}
403403

404-
func (s *serviceClient) showUpdateProgress() {
404+
func (s *serviceClient) showUpdateProgress(ctx context.Context) {
405405
s.wUpdateProgress = s.app.NewWindow("Automatically updating client")
406-
progressBar := widget.NewProgressBarInfinite()
407-
s.wUpdateProgress.SetContent(container.NewGridWithRows(2, widget.NewLabel("Your client version is older than auto-update version set in Management, updating client now."), progressBar))
406+
loadingLabel := widget.NewLabel("Updating")
407+
s.wUpdateProgress.SetContent(container.NewGridWithRows(2, widget.NewLabel("Your client version is older than auto-update version set in Management, updating client now."), loadingLabel))
408408
s.wUpdateProgress.Show()
409+
go func() {
410+
dotCount := 0
411+
for {
412+
select {
413+
case <-ctx.Done():
414+
return
415+
case <-time.After(time.Second):
416+
dotCount++
417+
dotCount %= 4
418+
loadingLabel.SetText(fmt.Sprintf("Updating%s", strings.Repeat(".", dotCount)))
419+
}
420+
}
421+
}()
409422
s.wUpdateProgress.CenterOnScreen()
410423
s.wUpdateProgress.SetFixedSize(true)
411424
s.wUpdateProgress.SetCloseIntercept(func() {})

0 commit comments

Comments
 (0)