try to load the config from the packr box (doesn't work)
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
6fba083fdd
commit
2b7db182f9
|
@ -122,6 +122,8 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData) {
|
||||||
mh.Rows[row].HumanData[5].Color = defaultTextBlack
|
mh.Rows[row].HumanData[5].Color = defaultTextBlack
|
||||||
mh.Rows[row].HumanData[6].Text = fmt.Sprintf("Details %s",item.Name)
|
mh.Rows[row].HumanData[6].Text = fmt.Sprintf("Details %s",item.Name)
|
||||||
|
|
||||||
|
mh.Rows[row].PbVM = item
|
||||||
|
|
||||||
log.Println("\titem=", item)
|
log.Println("\titem=", item)
|
||||||
log.Println("\titem.Name=", item.Name)
|
log.Println("\titem.Name=", item.Name)
|
||||||
log.Println("\tRows[row]=", mh.Rows[row])
|
log.Println("\tRows[row]=", mh.Rows[row])
|
||||||
|
|
18
main.go
18
main.go
|
@ -68,11 +68,13 @@ func onExit(err error) {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var packrBox packr.Box
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// This puts all the files in that directory in the binary
|
// This puts all the files in that directory in the binary
|
||||||
// This directory includes the default config file if there is not already one
|
// This directory includes the default config file if there is not already one
|
||||||
box := packr.NewBox("./resources")
|
packrBox = packr.NewBox("./resources")
|
||||||
defaultConfig, _ := box.FindString("cloud.json")
|
defaultConfig, _ := packrBox.FindString("cloud.json")
|
||||||
|
|
||||||
// This will parse the command line and config file
|
// This will parse the command line and config file
|
||||||
parseConfig(defaultConfig)
|
parseConfig(defaultConfig)
|
||||||
|
@ -146,6 +148,18 @@ func buttonClick(b *gui.ButtonMap) {
|
||||||
if (b.Note == "QUIT") {
|
if (b.Note == "QUIT") {
|
||||||
onExit(nil)
|
onExit(nil)
|
||||||
}
|
}
|
||||||
|
if (b.Note == "CONFIG") {
|
||||||
|
log.Println("TRY TO LOAD DEFAULT CONFIG")
|
||||||
|
defaultConfig, _ := packrBox.FindString("test.json")
|
||||||
|
config.LoadData(defaultConfig)
|
||||||
|
log.Println("defaultConfig =", defaultConfig)
|
||||||
|
for account, _ := range config.StringMap("accounts") {
|
||||||
|
log.Println("gui.State = splash BUT THERE IS AN ACCOUNT = ", account)
|
||||||
|
log.Println("gui.State = splash BUT THERE IS AN ACCOUNT = ", account)
|
||||||
|
log.Println("SETTING gui.State =", gui.Data.State)
|
||||||
|
}
|
||||||
|
gui.Data.State = "done"
|
||||||
|
}
|
||||||
if (b.Note == "DEBUG") {
|
if (b.Note == "DEBUG") {
|
||||||
log.Println("debug.PrintStack() (SHOULD BE JUST THIS goroutine)")
|
log.Println("debug.PrintStack() (SHOULD BE JUST THIS goroutine)")
|
||||||
debug.PrintStack()
|
debug.PrintStack()
|
||||||
|
|
Loading…
Reference in New Issue