diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-02-18 17:05:25 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-02-18 17:05:25 (GMT) |
commit | 89a4010fb1e8486a7f49a156fcc761f10ee77d9b (patch) | |
tree | b0c1db3d288e6623ce961c21de87cc73ebe342b5 /src/rhlibrary | |
parent | 4ccefb55c3644910dfc5e341a5701a3c5a1d4181 (diff) |
selecting pool works now
Diffstat (limited to 'src/rhlibrary')
-rw-r--r-- | src/rhlibrary/pool_selector_widget.go | 23 |
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) |