Some resources work

This commit is contained in:
Brian Buller 2019-02-26 14:23:12 -06:00
parent dbf94a42a2
commit 1c290b6b0b
2 changed files with 8 additions and 2 deletions

View File

@ -37,6 +37,9 @@ const (
ResStrTaskListNotLoaded ResStrTaskListNotLoaded
ResStrDoneListNotLoaded ResStrDoneListNotLoaded
ResStrInvalidRefreshRequest ResStrInvalidRefreshRequest
ResStrErrLoadingTaskList
ResStrErrLoadingDoneList
ResStrErrSavingList
ResModeCLI ResourceId = 1 << (iota + 9) ResModeCLI ResourceId = 1 << (iota + 9)
ResModeUI ResModeUI
@ -48,6 +51,9 @@ func (a *AppState) initLanguage() {
// Strings that are the same regardless of mode // Strings that are the same regardless of mode
a.lang.addString((ResStrTaskListNotLoaded), "Task list hasn't been loaded") a.lang.addString((ResStrTaskListNotLoaded), "Task list hasn't been loaded")
a.lang.addString((ResStrDoneListNotLoaded), "Done list hasn't been loaded") a.lang.addString((ResStrDoneListNotLoaded), "Done list hasn't been loaded")
a.lang.addString((ResStrErrLoadingTaskList), "Error loading Task list")
a.lang.addString((ResStrErrLoadingDoneList), "Error loading Done list")
a.lang.addString((ResStrErrSavingList), "Error saving list")
// CLI Strings // CLI Strings
a.lang.addString((ResStrListChanged | ResModeCLI), "List changed somewhere else") a.lang.addString((ResStrListChanged | ResModeCLI), "List changed somewhere else")

View File

@ -25,7 +25,7 @@ func (a *AppState) opListTasks(args []string) int {
} }
if showAll { if showAll {
if err := app.LoadDoneList(); err != nil { if err := app.LoadDoneList(); err != nil {
fmt.Println("Error loading 'Done' list") fmt.Println(a.s(ResStrErrLoadingDoneList))
fmt.Println(err.Error()) fmt.Println(err.Error())
return 1 return 1
} }
@ -71,7 +71,7 @@ func (a *AppState) opToggleTaskComplete(args []string) int {
} }
} }
if a.WriteList() != nil { if a.WriteList() != nil {
fmt.Println("Error saving list") fmt.Println(a.s(ResStrErrSavingList))
return 1 return 1
} }
return 0 return 0