summaryrefslogtreecommitdiff
path: root/machine.test.go
blob: 960ff83143270f9439d737a68e5892a4e8ab6c98 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package zoopb

import (
	"go.wit.com/log"
)

func (mt *MachinesTable) lookupWidgetId(id int) {
	log.Info("no shit. got to lookupWidgdetId() id =", id, "on mt", mt.GetUuid())
}

func (mt *MachinesTable) Custom(f func(int)) {
	mt.pb.RegisterCustom(mt.lookupWidgetId)
}

func (mt *MachinesTable) Delete() {
	if mt == nil {
		log.Info("mt == nil table already deleted")
		return
	}
	log.Info("implement table Delete here")
	mt.parent.DeleteTable(mt.pb)
}

func (mt *MachinesTable) UpdateTable(pb *Machines) {
	// mt.parent.UpdateTable(pb)
}

func (mt *MachinesTable) GetUuid() string {
	return mt.pb.Uuid
}

type machineButtonFunc struct {
	title  string
	f      func(*Machine) string
	Custom func(*Machine)
}

/*
func (mt *MachinesTable) doButtonFunc(name string) bool {
	for _, sf := range mt.buttonFuncs {
		if sf.title != name {
			continue
		}
		// log.Info("zoopb: found timefunc name:", name)
		r := new(guipb.ButtonRow)
		r.Header = new(guipb.Widget)
		r.Header.Name = name
		all := mt.x.All()
		for all.Scan() {
			m := all.Next()
			tmp := fmt.Sprintf("%s %s %d", name, sf.f(m), all.Cur())
			r.Vals = append(r.Vals, tmp)
			// log.Info("zoopb: adding", name, r.Vals)
		}
		mt.pb.ButtonRows = append(mt.pb.ButtonRows, r)
		return true
	}
	return false
}
*/

func (it *MachinesIterator) Cur() int {
	return it.index
}

func (it *MachineIterator) Cur() int {
	return it.index
}