From e04b989a12a627a1d532ae0d064c6ee6eaa24c78 Mon Sep 17 00:00:00 2001 From: M Essam Hamed Date: Wed, 1 Oct 2025 19:34:18 +0300 Subject: [PATCH] Change ProgressBarInfinite to Updating... label --- client/ui/client_ui.go | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/client/ui/client_ui.go b/client/ui/client_ui.go index 901adeb48..09c76d8c0 100644 --- a/client/ui/client_ui.go +++ b/client/ui/client_ui.go @@ -355,7 +355,7 @@ func newServiceClient(args *newServiceClientArgs) *serviceClient { case args.showProfiles: s.showProfilesUI() case args.showUpdate: - s.showUpdateProgress() + s.showUpdateProgress(ctx) } return s @@ -401,11 +401,24 @@ func (s *serviceClient) updateIcon() { s.updateIndicationLock.Unlock() } -func (s *serviceClient) showUpdateProgress() { +func (s *serviceClient) showUpdateProgress(ctx context.Context) { s.wUpdateProgress = s.app.NewWindow("Automatically updating client") - progressBar := widget.NewProgressBarInfinite() - s.wUpdateProgress.SetContent(container.NewGridWithRows(2, widget.NewLabel("Your client version is older than auto-update version set in Management, updating client now."), progressBar)) + loadingLabel := widget.NewLabel("Updating") + s.wUpdateProgress.SetContent(container.NewGridWithRows(2, widget.NewLabel("Your client version is older than auto-update version set in Management, updating client now."), loadingLabel)) s.wUpdateProgress.Show() + go func() { + dotCount := 0 + for { + select { + case <-ctx.Done(): + return + case <-time.After(time.Second): + dotCount++ + dotCount %= 4 + loadingLabel.SetText(fmt.Sprintf("Updating%s", strings.Repeat(".", dotCount))) + } + } + }() s.wUpdateProgress.CenterOnScreen() s.wUpdateProgress.SetFixedSize(true) s.wUpdateProgress.SetCloseIntercept(func() {})