From 53a3d5e11355ec6bed2e27bc26459a50e435b643 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 12 Aug 2018 02:42:03 +0200 Subject: termui: add and remove labels --- termui/termui.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'termui/termui.go') diff --git a/termui/termui.go b/termui/termui.go index d2585c4b..535842e4 100644 --- a/termui/termui.go +++ b/termui/termui.go @@ -20,6 +20,7 @@ type termUI struct { bugTable *bugTable showBug *showBug errorPopup *errorPopup + inputPopup *inputPopup } func (tui *termUI) activateWindow(window window) error { @@ -49,6 +50,7 @@ func Run(repo repository.Repo) error { bugTable: newBugTable(c), showBug: newShowBug(c), errorPopup: newErrorPopup(), + inputPopup: newInputPopup(), } ui.activeWindow = ui.bugTable @@ -108,6 +110,10 @@ func layout(g *gocui.Gui) error { return err } + if err := ui.inputPopup.layout(g); err != nil { + return err + } + return nil } @@ -129,6 +135,10 @@ func keybindings(g *gocui.Gui) error { return err } + if err := ui.inputPopup.keybindings(g); err != nil { + return err + } + return nil } @@ -156,7 +166,7 @@ func newBugWithEditor(repo cache.RepoCacher) error { } if err == input.ErrEmptyTitle { - ui.errorPopup.activate("Empty title, aborting.") + ui.errorPopup.Activate("Empty title, aborting.") } else { _, err := repo.NewBug(title, message) if err != nil { @@ -189,7 +199,7 @@ func addCommentWithEditor(bug cache.BugCacher) error { } if err == input.ErrEmptyMessage { - ui.errorPopup.activate("Empty message, aborting.") + ui.errorPopup.Activate("Empty message, aborting.") } else { err := bug.AddComment(message) if err != nil { @@ -222,7 +232,7 @@ func setTitleWithEditor(bug cache.BugCacher) error { } if err == input.ErrEmptyTitle { - ui.errorPopup.activate("Empty title, aborting.") + ui.errorPopup.Activate("Empty title, aborting.") } else { err := bug.SetTitle(title) if err != nil { -- cgit