summaryrefslogtreecommitdiff
path: root/src/rhlibrary/pool_selector_widget.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/rhlibrary/pool_selector_widget.go')
-rw-r--r--src/rhlibrary/pool_selector_widget.go26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/rhlibrary/pool_selector_widget.go b/src/rhlibrary/pool_selector_widget.go
index d6ddec6..cc01fcc 100644
--- a/src/rhlibrary/pool_selector_widget.go
+++ b/src/rhlibrary/pool_selector_widget.go
@@ -30,6 +30,7 @@ import (
"code.helsinki.at/rhrd-go/player"
"code.helsinki.at/rhrd-go/rddb"
+ "github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
)
@@ -109,12 +110,12 @@ func addPoolComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (err
return
}
- // glib.IdleAdd(func() {
- // if err = updatePoolCartListRows(pool, db, p); err != nil {
- // rhdl.Printf("error loading pool carts for %s", pool.Group)
- // return
- // }
- // })
+ glib.IdleAdd(func() {
+ if err = updatePoolCartListRows(pool, db, p); err != nil {
+ rhdl.Printf("error loading pool carts for %s: %v", pool.Group, err)
+ return
+ }
+ })
rhdl.Printf("pool %s is now selected: %s", pool.Group, pool.Description)
})
@@ -125,6 +126,19 @@ func addPoolComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (err
return
}
+func updatePoolCartListRows(pool rddb.PoolListEntry, db *rddb.DBChan, p *player.PlayerChan) (err error) {
+ carts, err := db.GetPoolCartList(pool)
+ if err != nil {
+ return err
+ }
+
+ for num, cart := range carts {
+ rhdl.Printf("Pool Cart [%d]: %+v", num, cart)
+ }
+
+ return
+}
+
func getPoolsSelectorWidget(db *rddb.DBChan, p *player.PlayerChan) (gtk.IWidget, error) {
grid, err := gtk.GridNew()
if err != nil {