blob: 0d30d6333dc4a3ebf225a195cceaf0f984d5a2da (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
package gui
import (
"github.com/jroimartin/gocui"
)
// this function starts the queue and updates the gui with the result of an
// operation
func (gui *Gui) startQueue(g *gocui.Gui, v *gocui.View) error {
go func(gui_go *Gui, g_go *gocui.Gui) {
indicateQueueStarted(g_go)
for {
job, finished, err := gui_go.State.Queue.StartNext()
g_go.Update(func(gu *gocui.Gui) error {
gui_go.refreshMain(gu)
return nil
})
defer gui.updateKeyBindingsView(g, mainViewFeature.Name)
if err != nil {
return
}
if finished {
return
}
selectedEntity := gui_go.getSelectedRepository()
if job.Entity == selectedEntity {
gui_go.refreshViews(g, job.Entity)
}
}
}(gui, g)
return nil
}
// flashes the keybinding view's backgroun with green color to indicate that
// the queue is started
func indicateQueueStarted(g *gocui.Gui) error {
v, err := g.View(keybindingsViewFeature.Name)
if err != nil {
return err
}
v.BgColor = gocui.ColorGreen
v.FgColor = gocui.ColorBlack
return nil
}
|