Skip to content

Commit

Permalink
Merge branch 'support-tmux' into develop
Browse files Browse the repository at this point in the history
Closes #38 (PR)
  • Loading branch information
IdlePhysicist committed Feb 10, 2022
2 parents 788e98c + 9316c27 commit 8b37bc3
Show file tree
Hide file tree
Showing 11 changed files with 421 additions and 387 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/idlephysicist/cave-logger
go 1.16

require (
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200831155531-da485f47343b
code.rocketnine.space/tslocum/cview v1.5.7
github.com/gdamore/tcell/v2 v2.4.1-0.20210828201608-73703f7ed490
github.com/sirupsen/logrus v1.4.2
github.com/spf13/pflag v1.0.5
gitlab.com/tslocum/cview v1.4.9-0.20200901224443-f35f86924a49
modernc.org/sqlite v1.9.0
)
45 changes: 28 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
code.rocketnine.space/tslocum/cbind v0.1.5 h1:i6NkeLLNPNMS4NWNi3302Ay3zSU6MrqOT+yJskiodxE=
code.rocketnine.space/tslocum/cbind v0.1.5/go.mod h1:LtfqJTzM7qhg88nAvNhx+VnTjZ0SXBJtxBObbfBWo/M=
code.rocketnine.space/tslocum/cview v1.5.7 h1:dUL6jyNp/ubUfeds7G7zq8R3sZY+He+sPGxu3Qn21tY=
code.rocketnine.space/tslocum/cview v1.5.7/go.mod h1:4Wx6exftTIbeRai3s0VVjzVaSNyHlXTg9eHd3s89v9Q=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell/v2 v2.0.0-dev/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA=
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200831155531-da485f47343b h1:j9fvrLkgzxR1S/ZWI6fbw8hjNxU5/lxnVXBX2tuYGVA=
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200831155531-da485f47343b/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA=
github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
github.com/gdamore/tcell/v2 v2.4.1-0.20210828201608-73703f7ed490 h1:GtCvI6MZUKinE4yNoN9AanNi0aavmFHp+CyzXLUptVw=
github.com/gdamore/tcell/v2 v2.4.1-0.20210828201608-73703f7ed490/go.mod h1:Az6Jt+M5idSED2YPGtwnfJV0kXohgdCBPmHGSYc1r04=
github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.14-0.20210830053702-dc8fe66265af h1:Vz2tUCLqu+a1igkarhrqNG+OFBs0uJqB3ADWFsQA9jM=
github.com/mattn/go-runewidth v0.0.14-0.20210830053702-dc8fe66265af/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg=
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
Expand All @@ -36,10 +43,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
gitlab.com/tslocum/cbind v0.1.2-0.20200826214515-b5f2c6a8711a h1:6u2QDDcKdeFhyHT/srxPDzLfDJqwKTgy1v+3209LYBY=
gitlab.com/tslocum/cbind v0.1.2-0.20200826214515-b5f2c6a8711a/go.mod h1:HfB7qAhHSZbn1rFK8M9SvSN5NG6ScAg/3h3iE6xdeeI=
gitlab.com/tslocum/cview v1.4.9-0.20200901224443-f35f86924a49 h1:BQCW6LMs3qK/j0ZIyD3EF9AUsS1RZs9SvuDPdPkEqmw=
gitlab.com/tslocum/cview v1.4.9-0.20200901224443-f35f86924a49/go.mod h1:yC/rMZkRxbKb6kUvnRyVjNEpb7ZREKG0ynEMHJq+Sgo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand All @@ -53,17 +56,25 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210309040221-94ec62e08169/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c=
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78 h1:M8tBwCtWD/cZV9DZpFYRUgaymAYAr+aIUTWzDaM3uPs=
Expand Down
89 changes: 47 additions & 42 deletions internal/gui/cavers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,26 @@ import (
"strings"
"time"

"code.rocketnine.space/tslocum/cview"
"github.com/gdamore/tcell/v2"
tview "gitlab.com/tslocum/cview"

"github.com/idlephysicist/cave-logger/internal/model"
)

type cavers struct {
*tview.Table
cavers chan *model.Caver
filterCol, filterTerm, filterAction string
*cview.Table
filterCol, filterTerm string
}

func newCavers(g *Gui) *cavers {
cavers := &cavers{
Table: tview.NewTable().
SetScrollBarVisibility(tview.ScrollBarNever).
SetSelectable(true, false).
Select(0, 0).
SetFixed(1, 1),
}

cavers.SetTitle(``).SetTitleAlign(tview.AlignLeft)
t := cview.NewTable()
t.SetScrollBarVisibility(cview.ScrollBarNever)
t.SetSelectable(true, false)
t.SetSortClicked(false)
t.Select(0, 0)
t.SetFixed(1, 1)

cavers := &cavers{Table: t}
cavers.SetBorder(true)
cavers.setEntries(g)
cavers.setKeybinding(g)
Expand Down Expand Up @@ -64,47 +62,54 @@ func (c *cavers) setKeybinding(g *Gui) {

func (c *cavers) setEntries(g *Gui) {
c.entries(g)
table := c.Clear()
c.Clear()

headers := []string{
"Name",
"Club",
"Count",
"Last Trip",
headers := [][]byte{
[]byte("Name"),
[]byte("Club"),
[]byte("Count"),
[]byte("Last Trip"),
}

for i, header := range headers {
table.SetCell(0, i, &tview.TableCell{
c.SetCell(0, i, &cview.TableCell{
Text: header,
NotSelectable: true,
Align: tview.AlignLeft,
Color: tview.Styles.PrimaryTextColor,
BackgroundColor: tview.Styles.PrimitiveBackgroundColor,
Align: cview.AlignLeft,
Color: cview.Styles.PrimaryTextColor,
BackgroundColor: cview.Styles.PrimitiveBackgroundColor,
Attributes: tcell.AttrBold,
})
}

var cell *cview.TableCell
for i, caver := range g.state.resources.people {
table.SetCell(i+1, 0, tview.NewTableCell(caver.Name).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(30).
SetExpansion(1))

table.SetCell(i+1, 1, tview.NewTableCell(caver.Club).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(0).
SetExpansion(1))

table.SetCell(i+1, 2, tview.NewTableCell(strconv.FormatInt(caver.Count, 10)).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(0).
SetExpansion(1))

table.SetCell(i+1, 3, tview.NewTableCell(caver.LastTrip).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(0).
SetExpansion(1))
cell = cview.NewTableCell(caver.Name)
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(30)
cell.SetExpansion(1)
c.SetCell(i+1, 0, cell)

cell = cview.NewTableCell(caver.Club)
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(0)
cell.SetExpansion(1)
c.SetCell(i+1, 1, cell)

cell = cview.NewTableCell(strconv.FormatInt(caver.Count, 10))
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(0)
cell.SetExpansion(1)
c.SetCell(i+1, 2, cell)

cell = cview.NewTableCell(caver.LastTrip)
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(0)
cell.SetExpansion(1)
c.SetCell(i+1, 3, cell)
}

c.Select(1, 1)
}

func (c *cavers) updateEntries(g *Gui) {
Expand Down
117 changes: 62 additions & 55 deletions internal/gui/caves.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,26 @@ import (
"strings"
"time"

"code.rocketnine.space/tslocum/cview"
"github.com/gdamore/tcell/v2"
tview "gitlab.com/tslocum/cview"

"github.com/idlephysicist/cave-logger/internal/model"
)

type caves struct {
*tview.Table
caves chan *model.Cave
filterCol, filterTerm, filterAction string
*cview.Table
filterCol, filterTerm string
}

func newCaves(g *Gui) *caves {
caves := &caves{
Table: tview.NewTable().
SetScrollBarVisibility(tview.ScrollBarNever).
SetSelectable(true, false).
Select(0, 0).
SetFixed(1, 1),
}

caves.SetTitle(``).SetTitleAlign(tview.AlignLeft)
t := cview.NewTable()
t.SetScrollBarVisibility(cview.ScrollBarNever)
t.SetSelectable(true, false)
t.SetSortClicked(false)
t.Select(0, 0)
t.SetFixed(1, 1)

caves := &caves{Table: t}
caves.SetBorder(true)
caves.setEntries(g)
caves.setKeybinding(g)
Expand Down Expand Up @@ -80,59 +78,68 @@ func (c *caves) entries(g *Gui) {

func (c *caves) setEntries(g *Gui) {
c.entries(g)
table := c.Clear()

headers := []string{
"Name",
"Region",
"Country",
"SRT",
"Visits",
"Last Visit",
c.Clear()

headers := [][]byte{
[]byte("Name"),
[]byte("Region"),
[]byte("Country"),
[]byte("SRT"),
[]byte("Visits"),
[]byte("Last Visit"),
}

for i, header := range headers {
table.SetCell(0, i, &tview.TableCell{
c.SetCell(0, i, &cview.TableCell{
Text: header,
NotSelectable: true,
Align: tview.AlignLeft,
Color: tview.Styles.PrimaryTextColor,
BackgroundColor: tview.Styles.PrimitiveBackgroundColor,
Align: cview.AlignLeft,
Color: cview.Styles.PrimaryTextColor,
BackgroundColor: cview.Styles.PrimitiveBackgroundColor,
Attributes: tcell.AttrBold,
})
}

var cell *cview.TableCell
for i, cave := range g.state.resources.locations {
table.SetCell(i+1, 0, tview.NewTableCell(cave.Name).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(30).
SetExpansion(1))

table.SetCell(i+1, 1, tview.NewTableCell(cave.Region).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(30).
SetExpansion(1))

table.SetCell(i+1, 2, tview.NewTableCell(cave.Country).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(0).
SetExpansion(1))

table.SetCell(i+1, 3, tview.NewTableCell(yesOrNo(cave.SRT)).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(0).
SetExpansion(1))

table.SetCell(i+1, 4, tview.NewTableCell(strconv.FormatInt(cave.Visits, 10)).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(0).
SetExpansion(1))

table.SetCell(i+1, 5, tview.NewTableCell(cave.LastVisit).
SetTextColor(tview.Styles.PrimaryTextColor).
SetMaxWidth(0).
SetExpansion(1))
cell = cview.NewTableCell(cave.Name)
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(30)
cell.SetExpansion(1)
c.SetCell(i+1, 0, cell)

cell = cview.NewTableCell(cave.Region)
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(30)
cell.SetExpansion(1)
c.SetCell(i+1, 1, cell)

cell = cview.NewTableCell(cave.Country)
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(0)
cell.SetExpansion(1)
c.SetCell(i+1, 2, cell)

cell = cview.NewTableCell(yesOrNo(cave.SRT))
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(0)
cell.SetExpansion(1)
c.SetCell(i+1, 3, cell)

cell = cview.NewTableCell(strconv.FormatInt(cave.Visits, 10))
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(0)
cell.SetExpansion(1)
c.SetCell(i+1, 4, cell)

cell = cview.NewTableCell(cave.LastVisit)
cell.SetTextColor(cview.Styles.PrimaryTextColor)
cell.SetMaxWidth(0)
cell.SetExpansion(1)
c.SetCell(i+1, 5, cell)
}

c.Select(1, 1)
}

func (c *caves) updateEntries(g *Gui) {
Expand Down
Loading

0 comments on commit 8b37bc3

Please sign in to comment.