diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-02-19 19:02:49 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-02-19 19:02:49 (GMT) |
commit | 4bfb03ad2b14f5aaa149f471dff13a75ecb22a8c (patch) | |
tree | ce1356b4db9acc3425c10346e0063c4870cd4526 /src/rhlibrary | |
parent | 89a4010fb1e8486a7f49a156fcc761f10ee77d9b (diff) |
fetch pool cart list works now
Diffstat (limited to 'src/rhlibrary')
-rw-r--r-- | src/rhlibrary/jingle_selector_widget.go | 2 | ||||
-rw-r--r-- | src/rhlibrary/pool_selector_widget.go | 26 | ||||
-rw-r--r-- | src/rhlibrary/show_selector_widget.go | 2 |
3 files changed, 22 insertions, 8 deletions
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 } }) |