diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-12 02:42:03 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-12 02:42:03 +0200 |
commit | 53a3d5e11355ec6bed2e27bc26459a50e435b643 (patch) | |
tree | 36fc783081f21bed66398e3f93b6c0c1b6bd1275 /termui/termui.go | |
parent | f51cc4a33fcac3ebf2024e0c6cb97cb809f8db71 (diff) | |
download | git-bug-53a3d5e11355ec6bed2e27bc26459a50e435b643.tar.gz |
termui: add and remove labels
Diffstat (limited to 'termui/termui.go')
-rw-r--r-- | termui/termui.go | 16 |
1 files changed, 13 insertions, 3 deletions
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 { |