From 4bfb03ad2b14f5aaa149f471dff13a75ecb22a8c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 19 Feb 2016 20:02:49 +0100 Subject: fetch pool cart list works now diff --git a/src/rhlibrary/jingle_selector_widget.go b/src/rhlibrary/jingle_selector_widget.go index d709d57..aae373d 100644 --- a/src/rhlibrary/jingle_selector_widget.go +++ b/src/rhlibrary/jingle_selector_widget.go @@ -116,7 +116,7 @@ func addJingleComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (e glib.IdleAdd(func() { if err = updateJingleCutListRows(jingle, db, p); err != nil { - rhdl.Printf("error loading jingle cuts for %s", jingle.Group) + rhdl.Printf("error loading jingle cuts for %s: %v", jingle.Group, err) return } }) 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 { diff --git a/src/rhlibrary/show_selector_widget.go b/src/rhlibrary/show_selector_widget.go index 0c4a212..9905b75 100644 --- a/src/rhlibrary/show_selector_widget.go +++ b/src/rhlibrary/show_selector_widget.go @@ -121,7 +121,7 @@ func addShowComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (err glib.IdleAdd(func() { if err = updateShowCartListRows(show, db, p); err != nil { - rhdl.Printf("error loading show carts for %d", show.ID) + rhdl.Printf("error loading show carts for %d: %v", show.ID, err) return } }) -- cgit v0.10.2