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.go23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/rhlibrary/pool_selector_widget.go b/src/rhlibrary/pool_selector_widget.go
index aa33e2f..d6ddec6 100644
--- a/src/rhlibrary/pool_selector_widget.go
+++ b/src/rhlibrary/pool_selector_widget.go
@@ -72,6 +72,19 @@ func updatePools(db *rddb.DBChan) (err error) {
return
}
+func selectPool() rddb.PoolListEntry {
+ id := poolsComboBox.GetActiveID()
+ if id == "" {
+ return rddb.PoolListEntry{}
+ }
+ poolsCurrentGroup = id
+
+ poolsMutex.Lock()
+ defer poolsMutex.Unlock()
+
+ return pools[poolsCurrentGroup]
+}
+
func addPoolComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (err error) {
var box *gtk.Box
if box, err = gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 10); err != nil {
@@ -91,10 +104,10 @@ func addPoolComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (err
return err
}
poolsComboBox.Connect("changed", func(_ *gtk.ComboBoxText) {
- // pool := selectPool()
- // if pool.Group == "" {
- // return
- // }
+ pool := selectPool()
+ if pool.Group == "" {
+ return
+ }
// glib.IdleAdd(func() {
// if err = updatePoolCartListRows(pool, db, p); err != nil {
@@ -102,7 +115,7 @@ func addPoolComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (err
// return
// }
// })
- // rhdl.Printf("pool %s is now selected: %s", pool.Group, pool.Description)
+ rhdl.Printf("pool %s is now selected: %s", pool.Group, pool.Description)
})
box.PackStart(poolsComboBox, true, true, 0)