Archive/Unarchive

Several other improvements
This commit is contained in:
2019-02-21 10:47:08 -06:00
parent d8c9e1a26b
commit ff8a0ec0b7
6 changed files with 270 additions and 71 deletions

View File

@@ -13,10 +13,10 @@ import (
// TaskScreen holds all that's going on
type TaskScreen struct {
viewPort *ViewPort
message string
messageTimeout time.Duration
messageTime time.Time
cursor int
inputModal *termboxUtil.InputModal
confirmModal *termboxUtil.ConfirmModal
@@ -31,7 +31,9 @@ const (
func (screen *TaskScreen) initialize(bundle Bundle) error {
var err error
screen.currentTaskId = bundle.getInt(TaskBundleTaskIdKey, -1)
if bundle != nil {
screen.currentTaskId = bundle.getInt(TaskBundleTaskIdKey, -1)
}
if screen.currentTaskId == -1 {
return errors.New("Task Screen Initialization Failed")
}
@@ -92,12 +94,12 @@ func (screen *TaskScreen) drawFooter() {
}
func (screen *TaskScreen) moveCursorDown() bool {
screen.viewPort.cursor++
screen.cursor++
return true
}
func (screen *TaskScreen) moveCursorUp() bool {
screen.viewPort.cursor--
screen.cursor--
return true
}