summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-10-26 12:57:02 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-10-26 12:57:02 +0200
commitab0058448abc0f51d0165c0278bdd4878a3f4d13 (patch)
treebfb7f05382b68e2689be0ef4a983a7df70a4f3bd /interact.go
parent1312d9dc80d3c43fce59e41ca3798abafd67e5f3 (diff)
Colorbuxfix, MoreMultichoice
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go27
1 files changed, 16 insertions, 11 deletions
diff --git a/interact.go b/interact.go
index 51b9e94..f61b398 100644
--- a/interact.go
+++ b/interact.go
@@ -14,7 +14,7 @@ import (
//var mastercol *color.Color
-func interact() {
+func interact(fulldb bool) {
//stdOut()
shell := ishell.New()
shell.SetMultiChoicePrompt(" ->", " - ")
@@ -31,9 +31,11 @@ func interact() {
boldGreen := color.New(color.FgGreen, color.Bold).SprintFunc()
boldYell := color.New(color.FgYellow, color.Bold).SprintFunc()
+ promptcol := boldBlue
//PromptColor(GetColor())
- promptcol := PromptColor(GetColor()).SprintFunc()
-
+ if fulldb {
+ promptcol = PromptColor(GetColor()).SprintFunc()
+ }
// display info.
//shell.Println("Starting interactive Shell")
shell.SetPrompt(promptcol(">>>"))
@@ -534,9 +536,9 @@ func interact() {
})
// Gather Tasks For Bills
shell.AddCmd(&ishell.Cmd{
- Name: "bill",
- Help: "Select Tasks to be billed",
- LongHelp: ` Usage: bill
+ Name: "charge",
+ Help: "Select Tasks to be charged",
+ LongHelp: ` Usage: charge
Select the tasks that should be merged into a Bill.
The Initial selection cannot be changed afterward. Only the complete
bill can be deleted and a new selection made.`,
@@ -544,7 +546,7 @@ func interact() {
nix := []int{0}
ids, str := getTaskList(nix, true)
choices := c.Checklist(str,
- "What Tasks do you want to bill ?",
+ "Which Tasks should be charged in the new bill ?",
nil)
out := func() (c []int) {
for _, v := range choices {
@@ -644,7 +646,7 @@ func interact() {
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: ")
+ c.Print("Name your Item for the Bill: ")
tsk := c.ReadLine()
var hrf float64
for {
@@ -828,10 +830,13 @@ func getNewInterMultiInput(question, old, border string) (out string) {
func Multichoice(question string,list []string) (int) {
shell := ishell.New()
- shell.SetMultiChoicePrompt(" ->"," - ")
+ marker := li+li+">"
+ shell.SetMultiChoicePrompt(marker,nli)
shell.SetChecklistOptions("[ ] ", "[X] ")
-
- choice := shell.MultiChoice(list,question)
+ qu1 := line(marker,false)
+ qu2 := frame(question,true)
+ quest := qu1 + strings.TrimLeft(qu2,"\n")
+ choice := shell.MultiChoice(list,quest)
return choice
/*shell.AddCmd(&ishell.Cmd{
Name: "choice",