summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-02-11 15:09:11 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-02-11 15:09:11 (GMT)
commit54c496bc55af3d1e81725f4b4708f26d1c8993cd (patch)
tree9157747320c8dc36801fed4c2e06f2632fe78d85 /src
parent54ef8a99328c6103d50b3925f706056c530b8279 (diff)
jingle group selector
Diffstat (limited to 'src')
-rw-r--r--src/rhlibrary/jingle_selector_widget.go50
-rw-r--r--src/rhlibrary/selector_widget.go2
2 files changed, 26 insertions, 26 deletions
diff --git a/src/rhlibrary/jingle_selector_widget.go b/src/rhlibrary/jingle_selector_widget.go
index 4d0015d..85cb741 100644
--- a/src/rhlibrary/jingle_selector_widget.go
+++ b/src/rhlibrary/jingle_selector_widget.go
@@ -34,38 +34,38 @@ import (
var (
jinglesMutex sync.Mutex
- jingles map[string]string // TODO: how should this look like?
+ jingles rddb.JingleList
jinglesComboBox *gtk.ComboBoxText
jinglesCurrentGroup string
jinglesCutListBin *gtk.Bin
jinglesCutList *gtk.Grid
)
-// func fetchJingles(db *rddb.DBChan) (err error) {
-// jinglesMutex.Lock()
-// defer jinglesMutex.Unlock()
+func fetchJingles(db *rddb.DBChan) (err error) {
+ jinglesMutex.Lock()
+ defer jinglesMutex.Unlock()
-// if jingles, err = db.GetJingleList(rhuser.Username); err != nil {
-// return err
-// }
-// return
-// }
+ if jingles, err = db.GetJingleList(rhuser.Username); err != nil {
+ return err
+ }
+ return
+}
-// func updateJingles(db *rddb.DBChan) (err error) {
-// if err = fetchJingles(db); err != nil {
-// return
-// }
+func updateJingles(db *rddb.DBChan) (err error) {
+ if err = fetchJingles(db); err != nil {
+ return
+ }
-// jinglesComboBox.RemoveAll()
-// for group, jingle := range jingles {
-// jinglesComboBox.Append(group, jingle.Description)
-// }
+ jinglesComboBox.RemoveAll()
+ for group, jingle := range jingles {
+ jinglesComboBox.Append(group, jingle.Description)
+ }
-// if !jinglesComboBox.SetActiveID(jinglesCurrentGroup) {
-// jinglesComboBox.SetActive(0)
-// }
-// return
-// }
+ if !jinglesComboBox.SetActiveID(jinglesCurrentGroup) {
+ jinglesComboBox.SetActive(0)
+ }
+ return
+}
func addJingleComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (err error) {
var box *gtk.Box
@@ -82,9 +82,9 @@ func addJingleComboBox(grid *gtk.Grid, db *rddb.DBChan, p *player.PlayerChan) (e
if jinglesComboBox, err = gtk.ComboBoxTextNew(); err != nil {
return
}
- // if err = updateJingles(db); err != nil {
- // return err
- // }
+ if err = updateJingles(db); err != nil {
+ return err
+ }
jinglesComboBox.Connect("changed", func(_ *gtk.ComboBoxText) {
// jingle := selectJingle()
// if jingle.ID == 0 {
diff --git a/src/rhlibrary/selector_widget.go b/src/rhlibrary/selector_widget.go
index 685b61a..3ab52d0 100644
--- a/src/rhlibrary/selector_widget.go
+++ b/src/rhlibrary/selector_widget.go
@@ -137,7 +137,7 @@ func getSelectorWidget(db *rddb.DBChan, p *player.PlayerChan) (gtk.IWidget, erro
case 0:
updateShows(db)
case 1:
- // updateJingles(db)
+ updateJingles(db)
case 2:
// updatePools(db)
case 3: