From 124b92e7fe83c7f436807711bef22cdf3af6816e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 17 Dec 2016 03:55:37 +0100 Subject: remove manual selector diff --git a/src/rhlibrary/selector_widget.go b/src/rhlibrary/selector_widget.go index 30929c8..88c1943 100644 --- a/src/rhlibrary/selector_widget.go +++ b/src/rhlibrary/selector_widget.go @@ -30,64 +30,6 @@ import ( "github.com/gotk3/gotk3/gtk" ) -func getManualSelectorWidget(db *rddb.DB, p *player.Player) (gtk.IWidget, error) { - var grid *gtk.Grid - grid, err := gtk.GridNew() - if err != nil { - return nil, err - } - grid.SetColumnSpacing(3) - - var cartl, cutl *gtk.Label - var cart, cut *gtk.SpinButton - - if cartl, err = gtk.LabelNew("Cart:"); err != nil { - return nil, err - } - if cart, err = gtk.SpinButtonNewWithRange(1, 999999, 1); err != nil { - return nil, err - } - - if cutl, err = gtk.LabelNew("Cut:"); err != nil { - return nil, err - } - if cut, err = gtk.SpinButtonNewWithRange(1, 999, 1); err != nil { - return nil, err - } - - var loadBtn *gtk.Button - if loadBtn, err = gtk.ButtonNewWithLabel("LOAD"); err != nil { - return nil, err - } - loadBtn.Connect("clicked", func(_ *gtk.Button) { - if err := p.Load((uint)(cart.GetValueAsInt()), (uint)(cut.GetValueAsInt())); err != nil { - rhdl.Println(err) // TODO: feedback at GUI? - } - }) - - var unloadBtn *gtk.Button - if unloadBtn, err = gtk.ButtonNewWithLabel("UNLOAD"); err != nil { - return nil, err - } - unloadBtn.Connect("clicked", func(_ *gtk.Button) { - if err := p.Unload(); err != nil { - rhdl.Println(err) // TODO: feedback at GUI? - } - }) - - grid.Attach(cartl, 1, 1, 1, 1) - grid.Attach(cart, 2, 1, 1, 1) - grid.Attach(cutl, 1, 2, 1, 1) - grid.Attach(cut, 2, 2, 1, 1) - grid.Attach(loadBtn, 1, 3, 2, 1) - grid.Attach(unloadBtn, 1, 4, 2, 1) - - grid.SetHAlign(gtk.ALIGN_CENTER) - grid.SetVAlign(gtk.ALIGN_CENTER) - - return grid, nil -} - type getSelectorFunc func(*rddb.DB, *player.Player) (gtk.IWidget, error) func addSelectorPage(nb *gtk.Notebook, title string, getWidget getSelectorFunc, db *rddb.DB, p *player.Player) (err error) { @@ -128,10 +70,6 @@ func getSelectorWidget(db *rddb.DB, p *player.Player) (gtk.IWidget, error) { return nil, err } - if err = addSelectorPage(nb, "Manuell", getManualSelectorWidget, db, p); err != nil { - return nil, err - } - nb.Connect("switch-page", func(_ *gtk.Notebook, _ gtk.IWidget, pagenum uint) { switch pagenum { case 0: @@ -140,8 +78,6 @@ func getSelectorWidget(db *rddb.DB, p *player.Player) (gtk.IWidget, error) { updateJingles(db) case 2: updatePools(db) - case 3: - // nothing to do here default: rhl.Printf("selector error invalid page: %d", pagenum) } -- cgit v0.10.2