diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2018-11-11 14:00:04 +0100 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2018-11-11 14:00:04 +0100 |
| commit | e3b6e0b00dbce15bf19a6f7d1bf39ea033651a0b (patch) | |
| tree | 94f45b0cbe9645cf161110268cc19d04c095b724 | |
| parent | 2c8198db725c4ff892129ea36a5dfa7aaf644577 (diff) | |
Bugfixes on Resume Task
| -rw-r--r-- | interact.go | 4 | ||||
| -rw-r--r-- | sqlite.go | 30 |
2 files changed, 24 insertions, 10 deletions
diff --git a/interact.go b/interact.go index c824627..0b1ec67 100644 --- a/interact.go +++ b/interact.go @@ -943,7 +943,9 @@ func Multichoice(question string,list []string) (int) { qu1 := line(marker,false) qu2 := frame(question,true) quest := qu1 + strings.TrimLeft(qu2,"\n") - choice := shell.MultiChoice(list,quest) + choice := -1 + choice = shell.MultiChoice(list,quest) + return choice /*shell.AddCmd(&ishell.Cmd{ Name: "choice", @@ -232,16 +232,18 @@ func newTaskTime(tim string) { fmt.Println(nli+timstr) task := "" for{ - task = getInterInput(sli+"Specify Task: ") + task = getInterInput(bonus+sli+"Specify Task: ") if task == "" { nm,st := GetTaskSums(currproject.Id) if len(nm) > 0 { ch := Multichoice("What Task should be Started at "+timstr+"?",st) - task = nm[ch] bonus = line("xxx",true) - break + if ch>=0{ + task = nm[ch] + break + } } - fmt.Println(nli,boldRed("An empty Taskname is not acceptable")) + fmt.Println(bonus+nli,boldRed("An empty Taskname is not acceptable")) }else{break} } //if proj == 0 { @@ -286,8 +288,15 @@ func newTask(resume bool) { nm,st := GetTaskSums(currproject.Id) if len(nm)>0 { ch := Multichoice("What Task should be resumed?",st) - task = nm[ch] bonus = line("xxx",true) + if ch>=0{ + task = nm[ch] + // bonus = line("xxx",true) + }else{ + fmt.Println(bonus+nli,boldRed("Aborted")) + fmt.Println(bonus+frame(negR(),false)) + return + } }else{ fmt.Println(nli,boldRed("There are no Tasks to resume")) fmt.Println(frame(negR(),false)) @@ -309,16 +318,19 @@ func newTask(resume bool) { } else { //fmt.Println(boldGreen("Starting new Task")) for{ - task = getInterInput(sli+"Specify Task: ") + task = getInterInput(bonus+sli+"Specify Task: ") if task == "" { nm,st := GetTaskSums(currproject.Id) if len(nm) > 0 { ch := Multichoice("What Task should be restarted?",st) - task = nm[ch] bonus = line("xxx",true) - break + if ch>=0{ + task = nm[ch] + // bonus = line("xxx",true) + break + } } - fmt.Println(nli,boldRed("An empty Taskname is not acceptable")) + fmt.Println(bonus+nli,boldRed("An empty Taskname is not acceptable")) }else{break} } } |
