summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go30
1 files changed, 19 insertions, 11 deletions
diff --git a/interact.go b/interact.go
index 4b54315..7336550 100644
--- a/interact.go
+++ b/interact.go
@@ -494,7 +494,11 @@ func interact() {
LongHelp: ` Usage: test
Test functions in interactive mode`,
Func: func(c *ishell.Context) {
- multichoice("Geh scheissn")
+ //multichoice("Geh scheissn")
+
+ nm,st := GetTaskSums(currproject.id)
+ i := Multichoice("Sicha?",st)
+ fmt.Println(nm[i])
},
})
@@ -590,8 +594,8 @@ func interact() {
billprojid = projids[0]
}
- seltasks := getSelectedTasks(selids)
- count, hours, dur := analyzeTasks(seltasks)
+ seltasks := GetSelectedTasks(selids)
+ count, hours, dur := AnalyzeTasks(seltasks)
//c.Printf("%v Tasks Selected. Totaling %.2f (h) - Dates: %s\n",count,hours,dur)
proj, cust := getProject(billprojid)
@@ -626,8 +630,8 @@ func interact() {
if len(restids) == 0 {
break
}
- resttasks := getSelectedTasks(restids)
- rcount, rhours, _ := analyzeTasks(resttasks)
+ resttasks := GetSelectedTasks(restids)
+ rcount, rhours, _ := AnalyzeTasks(resttasks)
rids, rstr := getTaskList(restids, false)
qu := "Select Tasks to Group as Billitem"
@@ -647,8 +651,8 @@ func interact() {
restids = removeItems(restids, taskids)
if len(taskids) > 0 {
- ittasks := getSelectedTasks(taskids)
- itcount, ithours, itdur := analyzeTasks(ittasks)
+ ittasks := GetSelectedTasks(taskids)
+ itcount, ithours, itdur := AnalyzeTasks(ittasks)
c.Printf("\n%v Tasks Selected, Total %.2f(h), Date: %s\n", itcount, ithours, itdur)
c.ShowPrompt(false)
c.Print("Name your Task for the Bill: ")
@@ -782,8 +786,8 @@ func getNewInterMultiInput(question, old, border string) (out string) {
if old != "" {
shell.Println(border,"Current:\n", old)
+ shell.Println(border,"Should current entry be replaced? A Newline will be added otherwise")
}
- shell.Println(border,"Should current entry be replaced? A Newline will be added otherwise")
if isInterSure(border+" ") {
shell.Println(border, question, "(Multiline input, end with ';')")
out = shell.ReadMultiLines(";")
@@ -806,13 +810,17 @@ func getNewInterMultiInput(question, old, border string) (out string) {
}*/
}
-func multichoice(about string) {
+// Invoke an Multiplechoice Question with a question and
+// the list of options and return the selected list id
+func Multichoice(question string,list []string) (int) {
shell := ishell.New()
shell.SetMultiChoicePrompt(" ->", " - ")
shell.SetChecklistOptions("[ ] ", "[X] ")
- shell.AddCmd(&ishell.Cmd{
+ choice := shell.MultiChoice(list,question)
+ return choice
+ /*shell.AddCmd(&ishell.Cmd{
Name: "choice",
Help: "multiple choice prompt",
Func: func(c *ishell.Context) {
@@ -831,5 +839,5 @@ func multichoice(about string) {
})
str := "choice"
shell.Process(str)
- shell.Println(about)
+ shell.Println(about)*/
}