Do not change default for Escape-Cancel

Two of the Enable/Disable configuration options were assuming
Confirm was enabled; otherwise disable. Escape to cancel should
not change the default answer.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
This commit is contained in:
Mark D Horn
2018-10-09 13:34:28 -07:00
committed by Mark Horn
parent e2366149cd
commit 681eb39690
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ func (aup *AutoUpdatePage) DeActivate() {
if aup.action == ActionConfirmButton {
model.AutoUpdate = true
} else {
} else if aup.action == ActionBackButton {
model.AutoUpdate = false
}
}
+8 -1
View File
@@ -83,7 +83,14 @@ func newTelemetryPage(tui *Tui) (Page, error) {
// DeActivate sets the model value and adjusts the "confirm" flag for this page
func (tp *TelemetryPage) DeActivate() {
tp.getModel().EnableTelemetry(tp.action == ActionConfirmButton)
model := tp.getModel()
if tp.action == ActionConfirmButton {
model.EnableTelemetry(true)
} else if tp.action == ActionBackButton {
model.EnableTelemetry(false)
}
tp.SetDone(true)
}