removed old testing code

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-07 17:07:45 -07:00
parent 3f2645e4b0
commit 9b3e15c7df
2 changed files with 2 additions and 48 deletions

7
gui.go
View File

@ -253,13 +253,6 @@ func setupUI() {
tabcount = 0
maintab.SetMargined(tabcount, true)
name = "jcarrTable"
table, mh, model := makeJcarrtable(name)
log.Println(table, mh, model)
maintab.Append(name, table)
tabcount += 1
maintab.SetMargined(tabcount, true)
maintab.Append("List examples", makeNumbersPage())
tabcount += 1
maintab.SetMargined(tabcount, true)

View File

@ -38,6 +38,7 @@ type modelHandler struct {
checkStates []int
vms []vmRowData
columnTypes string
funcColumnTypes func() []ui.TableValue
}
func newDefaultModelHandler() *modelHandler {
@ -53,21 +54,6 @@ func newDefaultModelHandler() *modelHandler {
return mh
}
func newJcarrModelHandler() *modelHandler {
mh := new(modelHandler)
mh.rows = 10
mh.columnTypes = "standard"
mh.bgcolorColumn = 0
mh.checkStates = make([]int, mh.rows)
mh.vms = make([]vmRowData, mh.rows)
mh.vms[8].hostname = "jcarr"
mh.vms[9].hostname = "jcarr2"
mh.yellowRow = -1
log.Println("Called newJcarrModelhandler() with mh=", mh)
spew.Dump(mh)
return mh
}
func standardColumnTypes() []ui.TableValue {
return []ui.TableValue{
ui.TableColor{}, // row background color
@ -81,14 +67,6 @@ func (mh *modelHandler) ColumnTypes(m *ui.TableModel) []ui.TableValue {
// log.Println("ColumnTypes() with m=", m, "mh=", mh)
if (mh.columnTypes == "standard") {
return standardColumnTypes()
/*
return []ui.TableValue{
ui.TableColor{}, // row background color
ui.TableString(""), // column 0 text
ui.TableColor{}, // column 0 text color
ui.TableString("test"), // column 1 button text
}
*/
}
return []ui.TableValue{
ui.TableString(""), // column 0 text
@ -227,23 +205,6 @@ func makeDemotable(name string) *ui.Table {
return table
}
func makeJcarrtable(name string) (*ui.Table, *modelHandler, *ui.TableModel) {
mh := newJcarrModelHandler()
mh.name = name
model := ui.NewTableModel(mh)
table := ui.NewTable(
&ui.TableParams{
Model: model,
RowBackgroundColorModelColumn: mh.bgcolorColumn,
})
table.AppendTextColumn("hostname", 1, ui.TableModelColumnNeverEditable, nil)
table.AppendButtonColumn("Details", 3, ui.TableModelColumnAlwaysEditable)
return table, mh, model
}
func newModelHandler(rows int) *modelHandler {
mh := new(modelHandler)
mh.rows = rows
@ -269,7 +230,7 @@ func makeTable(name string, rows int, row1Name string) (*ui.Table, *modelHandler
RowBackgroundColorModelColumn: mh.bgcolorColumn,
})
table.AppendTextColumn(row1Name, 1, ui.TableModelColumnNeverEditable, nil)
table.AppendTextColumn(row1Name, 1, ui.TableModelColumnAlwaysEditable, nil)
table.AppendButtonColumn("Details", 3, ui.TableModelColumnAlwaysEditable)
return table, mh, model