Skip to content

Commit

Permalink
Disabled button during processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Aug 21, 2024
1 parent 81869ba commit 8e7ace0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions internal/steps/step_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import (

type StepTemplateStep struct {
BaseStep
Wizard wizard.Wizard
result *widget.Label
logs *widget.Entry
exportDone bool
Wizard wizard.Wizard
result *widget.Label
logs *widget.Entry
exportDone bool
installSteps *widget.Button
}

func (s StepTemplateStep) GetContainer(parent fyne.Window) *fyne.Container {
Expand Down Expand Up @@ -59,14 +60,16 @@ func (s StepTemplateStep) GetContainer(parent fyne.Window) *fyne.Container {
s.logs.Hide()
s.exportDone = false

installSteps := widget.NewButton("Install Step Templates", func() {
s.installSteps = widget.NewButton("Install Step Templates", func() {
s.logs.Hide()
s.result.SetText("🔵 Installing step templates.")
s.exportDone = true
previous.Disable()
next.Disable()
s.installSteps.Disable()
defer previous.Enable()
defer next.Enable()
defer s.installSteps.Enable()

message, err := s.Execute()
if err != nil {
Expand All @@ -78,7 +81,7 @@ func (s StepTemplateStep) GetContainer(parent fyne.Window) *fyne.Container {
next.Enable()
s.result.SetText("🟢 Step templates installed.")
})
middle := container.New(layout.NewVBoxLayout(), heading, label1, installSteps, s.result, s.logs)
middle := container.New(layout.NewVBoxLayout(), heading, label1, s.installSteps, s.result, s.logs)

content := container.NewBorder(nil, bottom, nil, nil, middle)

Expand Down

0 comments on commit 8e7ace0

Please sign in to comment.