From 52af088d8c9d9610eb8ab5e476cf084c0119d60c Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 19 Feb 2024 21:39:53 -0800 Subject: [PATCH] Bump version, fix mqtt port bug, make connected node details smaller on all the settings views, clean up text on position config view --- Meshtastic.xcodeproj/project.pbxproj | 8 ++++---- Meshtastic/Helpers/Mqtt/MqttClientProxyManager.swift | 6 ++++-- Meshtastic/Views/Settings/Config/BluetoothConfig.swift | 1 - Meshtastic/Views/Settings/Config/DeviceConfig.swift | 1 - Meshtastic/Views/Settings/Config/DisplayConfig.swift | 1 - Meshtastic/Views/Settings/Config/LoRaConfig.swift | 1 - .../Settings/Config/Module/AmbientLightingConfig.swift | 1 - .../Settings/Config/Module/CannedMessagesConfig.swift | 1 - .../Settings/Config/Module/DetectionSensorConfig.swift | 1 - .../Config/Module/ExternalNotificationConfig.swift | 1 - .../Views/Settings/Config/Module/MQTTConfig.swift | 1 - .../Views/Settings/Config/Module/RangeTestConfig.swift | 1 - .../Views/Settings/Config/Module/RtttlConfig.swift | 1 - .../Views/Settings/Config/Module/SerialConfig.swift | 1 - .../Settings/Config/Module/StoreForwardConfig.swift | 1 - .../Views/Settings/Config/Module/TelemetryConfig.swift | 1 - Meshtastic/Views/Settings/Config/NetworkConfig.swift | 1 - Meshtastic/Views/Settings/Config/PositionConfig.swift | 10 ++++------ 18 files changed, 12 insertions(+), 27 deletions(-) diff --git a/Meshtastic.xcodeproj/project.pbxproj b/Meshtastic.xcodeproj/project.pbxproj index c6bef2b3..c7601ad9 100644 --- a/Meshtastic.xcodeproj/project.pbxproj +++ b/Meshtastic.xcodeproj/project.pbxproj @@ -1545,7 +1545,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.23; + MARKETING_VERSION = 2.2.24; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; @@ -1579,7 +1579,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.23; + MARKETING_VERSION = 2.2.24; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; @@ -1701,7 +1701,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.23; + MARKETING_VERSION = 2.2.24; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1734,7 +1734,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.23; + MARKETING_VERSION = 2.2.24; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Meshtastic/Helpers/Mqtt/MqttClientProxyManager.swift b/Meshtastic/Helpers/Mqtt/MqttClientProxyManager.swift index 2d7dc6c1..e21351cb 100644 --- a/Meshtastic/Helpers/Mqtt/MqttClientProxyManager.swift +++ b/Meshtastic/Helpers/Mqtt/MqttClientProxyManager.swift @@ -31,8 +31,10 @@ class MqttClientProxyManager { if host == nil || host!.isEmpty { host = defaultServerAddress } else if host != nil && host!.contains(":") { - host = host!.components(separatedBy: ":")[0] - defaultServerPort = Int(host!.components(separatedBy: ":")[1])! + if let fullHost = host { + host = fullHost.components(separatedBy: ":")[0] + defaultServerPort = Int(fullHost.components(separatedBy: ":")[1]) ?? 1883 + } } if let host = host { let port = defaultServerPort diff --git a/Meshtastic/Views/Settings/Config/BluetoothConfig.swift b/Meshtastic/Views/Settings/Config/BluetoothConfig.swift index 8eb93d6e..81533001 100644 --- a/Meshtastic/Views/Settings/Config/BluetoothConfig.swift +++ b/Meshtastic/Views/Settings/Config/BluetoothConfig.swift @@ -46,7 +46,6 @@ struct BluetoothConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? -1 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/DeviceConfig.swift b/Meshtastic/Views/Settings/Config/DeviceConfig.swift index 4d4c227c..54d4d912 100644 --- a/Meshtastic/Views/Settings/Config/DeviceConfig.swift +++ b/Meshtastic/Views/Settings/Config/DeviceConfig.swift @@ -51,7 +51,6 @@ struct DeviceConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/DisplayConfig.swift b/Meshtastic/Views/Settings/Config/DisplayConfig.swift index c102897c..c2e2523f 100644 --- a/Meshtastic/Views/Settings/Config/DisplayConfig.swift +++ b/Meshtastic/Views/Settings/Config/DisplayConfig.swift @@ -51,7 +51,6 @@ struct DisplayConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/LoRaConfig.swift b/Meshtastic/Views/Settings/Config/LoRaConfig.swift index 767aa51d..e1875294 100644 --- a/Meshtastic/Views/Settings/Config/LoRaConfig.swift +++ b/Meshtastic/Views/Settings/Config/LoRaConfig.swift @@ -75,7 +75,6 @@ struct LoRaConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift b/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift index affc872f..0a449682 100644 --- a/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift @@ -47,7 +47,6 @@ struct AmbientLightingConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift b/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift index cb5585d2..02fb0539 100644 --- a/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift @@ -58,7 +58,6 @@ struct CannedMessagesConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/DetectionSensorConfig.swift b/Meshtastic/Views/Settings/Config/Module/DetectionSensorConfig.swift index 23b33a90..64688edc 100644 --- a/Meshtastic/Views/Settings/Config/Module/DetectionSensorConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/DetectionSensorConfig.swift @@ -63,7 +63,6 @@ struct DetectionSensorConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift b/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift index 511385d8..cf218762 100644 --- a/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift @@ -55,7 +55,6 @@ struct ExternalNotificationConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift index bfaaa031..b89792ed 100644 --- a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift @@ -59,7 +59,6 @@ struct MQTTConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift b/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift index d1de7ccf..ac80a840 100644 --- a/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift @@ -43,7 +43,6 @@ struct RangeTestConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/RtttlConfig.swift b/Meshtastic/Views/Settings/Config/Module/RtttlConfig.swift index e1838f96..0d43b4f5 100644 --- a/Meshtastic/Views/Settings/Config/Module/RtttlConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/RtttlConfig.swift @@ -41,7 +41,6 @@ struct RtttlConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift b/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift index c3fa234d..8d27dddf 100644 --- a/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift @@ -51,7 +51,6 @@ struct SerialConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/StoreForwardConfig.swift b/Meshtastic/Views/Settings/Config/Module/StoreForwardConfig.swift index 2f9cc65c..4edc42b0 100644 --- a/Meshtastic/Views/Settings/Config/Module/StoreForwardConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/StoreForwardConfig.swift @@ -51,7 +51,6 @@ struct StoreForwardConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift b/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift index c3a48697..9f153808 100644 --- a/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift @@ -45,7 +45,6 @@ struct TelemetryConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/NetworkConfig.swift b/Meshtastic/Views/Settings/Config/NetworkConfig.swift index 3d98e13d..96ac19b4 100644 --- a/Meshtastic/Views/Settings/Config/NetworkConfig.swift +++ b/Meshtastic/Views/Settings/Config/NetworkConfig.swift @@ -49,7 +49,6 @@ struct NetworkConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) diff --git a/Meshtastic/Views/Settings/Config/PositionConfig.swift b/Meshtastic/Views/Settings/Config/PositionConfig.swift index 674f994d..c5bdd94b 100644 --- a/Meshtastic/Views/Settings/Config/PositionConfig.swift +++ b/Meshtastic/Views/Settings/Config/PositionConfig.swift @@ -97,7 +97,6 @@ struct PositionConfig: View { } } else if node != nil && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 { Text("Configuration for: \(node?.user?.longName ?? "Unknown")") - .font(.title3) } else { Text("Please connect to a radio to configure settings.") .font(.callout) @@ -106,7 +105,7 @@ struct PositionConfig: View { Section(header: Text("Position Packet")) { - Picker("Position Broadcast Interval", selection: $positionBroadcastSeconds) { + Picker("Interval", selection: $positionBroadcastSeconds) { ForEach(UpdateIntervals.allCases) { at in if at.rawValue >= 900 { Text(at.description) @@ -114,11 +113,10 @@ struct PositionConfig: View { } } .pickerStyle(DefaultPickerStyle()) - Text("The maximum interval that can elapse without a node sending a position") + Text("The maximum interval that can elapse without a node broadcasting a position") .font(.caption) Toggle(isOn: $smartPositionEnabled) { - - Label("Smart Position Broadcast", systemImage: "location.fill.viewfinder") + Label("Smart Position", systemImage: "location.fill.viewfinder") } .toggleStyle(SwitchToggleStyle(tint: .accentColor)) if smartPositionEnabled { @@ -171,7 +169,7 @@ struct PositionConfig: View { Label("Fixed Position", systemImage: "location.square.fill") } .toggleStyle(SwitchToggleStyle(tint: .accentColor)) - Text("If enabled your current phone location will be sent to the device and will broadcast over the mesh on the position interval. Fixed positon will always use the most recent position the device has.") + Text("If enabled your current phone location will be sent to the device and will broadcast over the mesh on the position interval. Fixed position will always use the most recent position the device has.") .font(.caption) } }