diff --git a/main.go b/main.go index 20d5cd8..0cb0f09 100644 --- a/main.go +++ b/main.go @@ -13,15 +13,15 @@ import ( var ( // Info/Statuses - batteryLevel *widgets.QLineEdit - batteryRange *widgets.QLineEdit - chargingState *widgets.QLineEdit - minutesToFull *widgets.QLineEdit - fastChargerInd *widgets.QLineEdit - batteryHeaterInd *widgets.QLineEdit - chargeDoorOpenInd *widgets.QLineEdit - insideTemp *widgets.QLineEdit - outsideTemp *widgets.QLineEdit + batteryLevel *widgets.QLabel + batteryRange *widgets.QLabel + chargingState *widgets.QLabel + minutesToFull *widgets.QLabel + fastChargerInd *widgets.QLabel + batteryHeaterInd *widgets.QLabel + chargeDoorOpenInd *widgets.QLabel + insideTemp *widgets.QLabel + outsideTemp *widgets.QLabel // Controls tempSetting *widgets.QLineEdit @@ -52,27 +52,18 @@ func main() { vboxLayout := widgets.NewQVBoxLayout() statusLayout := widgets.NewQFormLayout(nil) - batteryLevel = widgets.NewQLineEdit(nil) - batteryLevel.SetReadOnly(true) + batteryLevel = widgets.NewQLabel(nil, 0) batteryLevel.SetFixedWidth(30) - batteryRange = widgets.NewQLineEdit(nil) - batteryRange.SetReadOnly(true) - chargingState = widgets.NewQLineEdit(nil) - chargingState.SetReadOnly(true) - minutesToFull = widgets.NewQLineEdit(nil) - minutesToFull.SetReadOnly(true) - fastChargerInd = widgets.NewQLineEdit(nil) - fastChargerInd.SetReadOnly(true) - batteryHeaterInd = widgets.NewQLineEdit(nil) - - batteryHeaterInd.SetReadOnly(true) - chargeDoorOpenInd = widgets.NewQLineEdit(nil) - chargeDoorOpenInd.SetReadOnly(true) - insideTemp = widgets.NewQLineEdit(nil) - insideTemp.SetReadOnly(true) + batteryRange = widgets.NewQLabel(nil, 0) + chargingState = widgets.NewQLabel(nil, 0) + minutesToFull = widgets.NewQLabel(nil, 0) + fastChargerInd = widgets.NewQLabel(nil, 0) + batteryHeaterInd = widgets.NewQLabel(nil, 0) + + chargeDoorOpenInd = widgets.NewQLabel(nil, 0) + insideTemp = widgets.NewQLabel(nil, 0) insideTemp.SetFixedWidth(25) - outsideTemp = widgets.NewQLineEdit(nil) - outsideTemp.SetReadOnly(true) + outsideTemp = widgets.NewQLabel(nil, 0) outsideTemp.SetFixedWidth(25) tempSetting = widgets.NewQLineEdit(nil) tempSetting.SetFixedWidth(25) @@ -323,6 +314,7 @@ func honkHorn(c bool) { showDialogue("There was an error honking the horn\n%+v", err) fmt.Printf("%+v\n", err) } + go setValues() } func flash(c bool) { err := vehicle.FlashLights() @@ -330,6 +322,7 @@ func flash(c bool) { showDialogue("There was an error flashing the lights\n%+v", err) fmt.Printf("%+v\n", err) } + go setValues() } func openTrunk(c bool) { err := vehicle.OpenTrunk("rear") @@ -337,6 +330,7 @@ func openTrunk(c bool) { showDialogue("There was an error opening your trunk\n%+v", err) fmt.Printf("%+v\n", err) } + go setValues() } func openFrunk(c bool) { err := vehicle.OpenTrunk("front") @@ -344,6 +338,7 @@ func openFrunk(c bool) { showDialogue("There was an error opening your frunk\n%+v", err) fmt.Printf("%+v\n", err) } + go setValues() } func showDialogue(msg string, a ...interface{}) {