From abe0dbb93d11d9611ef668242cf30d1df3f01845 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 28 Dec 2023 15:37:08 -0800 Subject: [PATCH] Hook txEnabled up to the save button --- .../Meshtastic.xcdatamodeld/.xccurrentversion | 2 +- .../contents | 408 ++++++++++++++++++ .../Views/Settings/Config/LoRaConfig.swift | 5 + Meshtastic/Views/Settings/FirmwareApi.swift | 8 + 4 files changed, 422 insertions(+), 1 deletion(-) create mode 100644 Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModelV 23.xcdatamodel/contents create mode 100644 Meshtastic/Views/Settings/FirmwareApi.swift diff --git a/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion b/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion index 9d09b84f..550e3369 100644 --- a/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion +++ b/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - MeshtasticDataModelV22.xcdatamodel + MeshtasticDataModelV 23.xcdatamodel diff --git a/Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModelV 23.xcdatamodel/contents b/Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModelV 23.xcdatamodel/contents new file mode 100644 index 00000000..3b7675c0 --- /dev/null +++ b/Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModelV 23.xcdatamodel/contents @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Meshtastic/Views/Settings/Config/LoRaConfig.swift b/Meshtastic/Views/Settings/Config/LoRaConfig.swift index dccef435..82519eb4 100644 --- a/Meshtastic/Views/Settings/Config/LoRaConfig.swift +++ b/Meshtastic/Views/Settings/Config/LoRaConfig.swift @@ -314,6 +314,11 @@ struct LoRaConfig: View { if newTxPower != node!.loRaConfig!.txPower { hasChanges = true } } } + .onChange(of: txEnabled) { newTxEnabled in + if node != nil && node!.loRaConfig != nil { + if newTxEnabled != node!.loRaConfig!.txEnabled { hasChanges = true } + } + } } func setLoRaValues() { self.hopLimit = Int(node?.loRaConfig?.hopLimit ?? 3) diff --git a/Meshtastic/Views/Settings/FirmwareApi.swift b/Meshtastic/Views/Settings/FirmwareApi.swift new file mode 100644 index 00000000..1a80debe --- /dev/null +++ b/Meshtastic/Views/Settings/FirmwareApi.swift @@ -0,0 +1,8 @@ +// +// FirmwareApi.swift +// Meshtastic +// +// Created by Garth Vander Houwen on 12/27/23. +// + +import Foundation