diff --git a/TAKTracker.xcodeproj/project.pbxproj b/TAKTracker.xcodeproj/project.pbxproj index a942abb..997bd11 100644 --- a/TAKTracker.xcodeproj/project.pbxproj +++ b/TAKTracker.xcodeproj/project.pbxproj @@ -20,6 +20,8 @@ A50C5F5B2A5F92FF001E52E6 /* SettingsStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A50C5F5A2A5F92FF001E52E6 /* SettingsStore.swift */; }; A50C5F5D2A601CF0001E52E6 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A50C5F5C2A601CF0001E52E6 /* SettingsView.swift */; }; A50C5F5F2A6032D2001E52E6 /* EmergencyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A50C5F5E2A6032D2001E52E6 /* EmergencyView.swift */; }; + A51B12EA2BB1E28800C25239 /* AdvancedOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51B12E92BB1E28800C25239 /* AdvancedOptions.swift */; }; + A51B12EC2BB1E29800C25239 /* SituationalAwarenessOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51B12EB2BB1E29800C25239 /* SituationalAwarenessOptions.swift */; }; A54F70872AB0AEA400D8C541 /* DataPackageParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54F70862AB0AEA400D8C541 /* DataPackageParserTests.swift */; }; A54F70892AB0C40B00D8C541 /* TCPMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54F70882AB0C40B00D8C541 /* TCPMessageTests.swift */; }; A54F708A2AB0C41100D8C541 /* TCPMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5BF02012A5EBCA40043065B /* TCPMessage.swift */; }; @@ -105,6 +107,8 @@ A50C5F5A2A5F92FF001E52E6 /* SettingsStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsStore.swift; sourceTree = ""; }; A50C5F5C2A601CF0001E52E6 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; A50C5F5E2A6032D2001E52E6 /* EmergencyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmergencyView.swift; sourceTree = ""; }; + A51B12E92BB1E28800C25239 /* AdvancedOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedOptions.swift; sourceTree = ""; }; + A51B12EB2BB1E29800C25239 /* SituationalAwarenessOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SituationalAwarenessOptions.swift; sourceTree = ""; }; A54F70862AB0AEA400D8C541 /* DataPackageParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataPackageParserTests.swift; sourceTree = ""; }; A54F70882AB0C40B00D8C541 /* TCPMessageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCPMessageTests.swift; sourceTree = ""; }; A5582CC22AD5CB4600DE0D5C /* TAKTrackerTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TAKTrackerTestCase.swift; sourceTree = ""; }; @@ -234,6 +238,8 @@ A55ABF4E2ABDC0A800195AB7 /* TAKOptions.swift */, A55ABF502ABDC0E900195AB7 /* MapOptions.swift */, A55ABF522ABDC11900195AB7 /* AboutInformation.swift */, + A51B12E92BB1E28800C25239 /* AdvancedOptions.swift */, + A51B12EB2BB1E29800C25239 /* SituationalAwarenessOptions.swift */, ); path = SettingsScreens; sourceTree = ""; @@ -650,10 +656,12 @@ A5E7B0182A76AA8B00D9203F /* TAKLogger.swift in Sources */, A508213F2AB3D19B00E0CBD8 /* TAKCAConfigResponseParser.swift in Sources */, A55ABF492ABDC02200195AB7 /* ConnectionOptions.swift in Sources */, + A51B12EC2BB1E29800C25239 /* SituationalAwarenessOptions.swift in Sources */, A5D8D3A82A53B465002F0E3E /* LocationManager.swift in Sources */, A55ABF4D2ABDC08800195AB7 /* DeviceOptions.swift in Sources */, A55CE96B2AB1D8860081AF86 /* Converter.swift in Sources */, 4630FD1C2B5071D200988ED4 /* MessageData.swift in Sources */, + A51B12EA2BB1E28800C25239 /* AdvancedOptions.swift in Sources */, A55ABF472ABDBFEA00195AB7 /* ServerInformation.swift in Sources */, A5BF02022A5EBCA40043065B /* TCPMessage.swift in Sources */, A55ABF452ABDBF9A00195AB7 /* UserInformation.swift in Sources */, @@ -841,9 +849,9 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CODE_SIGN_ENTITLEMENTS = TAKTracker/TAKTracker.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 58; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_ASSET_PATHS = "TAKTracker/Preview\\ Content"; - DEVELOPMENT_TEAM = BCKVL9BZPW; + DEVELOPMENT_TEAM = 5LZ5HR44P3; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; @@ -862,7 +870,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1; + MARKETING_VERSION = 1.2; PRODUCT_BUNDLE_IDENTIFIER = com.flighttactics.TAKTracker; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -880,9 +888,9 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CODE_SIGN_ENTITLEMENTS = TAKTracker/TAKTracker.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 58; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_ASSET_PATHS = "TAKTracker/Preview\\ Content"; - DEVELOPMENT_TEAM = BCKVL9BZPW; + DEVELOPMENT_TEAM = 5LZ5HR44P3; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; @@ -901,7 +909,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1; + MARKETING_VERSION = 1.2; PRODUCT_BUNDLE_IDENTIFIER = com.flighttactics.TAKTracker; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -917,7 +925,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 58; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = 5LZ5HR44P3; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; @@ -939,7 +947,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 58; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = 5LZ5HR44P3; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; @@ -959,7 +967,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 58; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = 5LZ5HR44P3; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.1; @@ -977,7 +985,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 58; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = 5LZ5HR44P3; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.1; diff --git a/TAKTracker.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TAKTracker.xcworkspace/xcshareddata/swiftpm/Package.resolved index 89aac50..f2a35f2 100644 --- a/TAKTracker.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/TAKTracker.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "fde2bb25a2ae91a7c7605521d48605d47226394f8d90d6636a7f3cb6288cdeec", "pins" : [ { "identity" : "certificatesigningrequest", @@ -55,5 +56,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/TAKTracker/Communications/TCPMessage.swift b/TAKTracker/Communications/TCPMessage.swift index 705660c..b0eeaee 100644 --- a/TAKTracker/Communications/TCPMessage.swift +++ b/TAKTracker/Communications/TCPMessage.swift @@ -240,6 +240,9 @@ class TCPMessage: NSObject, ObservableObject { case .waiting: TAKLogger.debug("[TCPMessage]: Entered state: waiting") DispatchQueue.main.async { + SettingsStore.global.isConnectedToServer = false + SettingsStore.global.shouldTryReconnect = true + SettingsStore.global.isConnectingToServer = false SettingsStore.global.connectionStatus = ConnectionStatus.Waiting.description } case .failed: diff --git a/TAKTracker/Parsers/TAKCAConfigResponseParser.swift b/TAKTracker/Parsers/TAKCAConfigResponseParser.swift index 06d9d41..8c2b8c4 100644 --- a/TAKTracker/Parsers/TAKCAConfigResponseParser.swift +++ b/TAKTracker/Parsers/TAKCAConfigResponseParser.swift @@ -20,7 +20,12 @@ class TAKCAConfigResponseParser: NSObject, XMLParserDelegate { if(elementName == "nameEntry") { if let nameVal = attributeDict["name"], let valueVal = attributeDict["value"] { - nameEntries[nameVal] = valueVal + // Only ever take the first value coming back + if(!nameEntries.keys.contains(nameVal)) { + nameEntries[nameVal] = valueVal + } else { + TAKLogger.info("[TAKConfigResponseParser]: Multiple entries received for \(nameVal), only using first") + } } } diff --git a/TAKTracker/Screens/MainScreen.swift b/TAKTracker/Screens/MainScreen.swift index d45920e..929b8b9 100644 --- a/TAKTracker/Screens/MainScreen.swift +++ b/TAKTracker/Screens/MainScreen.swift @@ -255,14 +255,11 @@ struct MainScreen: View { .imageScale(.large) .foregroundColor(settingsStore.isAlertActivated ? .red : .white) } - Spacer() - - Button(action: { sheet = .chat }) { - Image(systemName: "bubble.left") - .imageScale(.large) - .foregroundColor(.white) - } - Spacer() +// Button(action: { sheet = .chat }) { +// Image(systemName: "bubble.left") +// .imageScale(.large) +// .foregroundColor(.white) +// } Button(action: { sheet = .settings }) { Image(systemName: "gear") diff --git a/TAKTracker/Screens/SettingsScreens/AboutInformation.swift b/TAKTracker/Screens/SettingsScreens/AboutInformation.swift index 91063cf..84c099a 100644 --- a/TAKTracker/Screens/SettingsScreens/AboutInformation.swift +++ b/TAKTracker/Screens/SettingsScreens/AboutInformation.swift @@ -10,17 +10,19 @@ import SwiftUI struct SwiftTAK: View { var body: some View { - Text(""" -SwiftTAK Copyright 2023 Flight Tactics + List{ + Text(""" + SwiftTAK Copyright 2023 Flight Tactics -https://github.com/flighttactics/SwiftTAK + https://github.com/flighttactics/SwiftTAK -Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -""").padding([.leading, .trailing], 12) + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + """).padding([.leading, .trailing], 12) + } } } @@ -38,6 +40,7 @@ struct TAKTrackerInfo: View { NavigationLink(destination: SwiftTAK()) { Text("SwiftTAK") } + .navigationBarTitleDisplayMode(.inline) } } } @@ -45,12 +48,12 @@ struct TAKTrackerInfo: View { struct AboutInformation: View { var body: some View { Group { - Text("TAK Tracker v\(AppConstants.getAppVersion())") - .frame(maxWidth: .infinity, alignment: .center) - .foregroundColor(.secondary) NavigationLink(destination: TAKTrackerInfo()) { Text("About") } + Text("TAK Tracker v\(AppConstants.getAppVersion())") + .frame(maxWidth: .infinity, alignment: .center) + .foregroundColor(.secondary) } } } diff --git a/TAKTracker/Screens/SettingsScreens/AdvancedModeToggle.swift b/TAKTracker/Screens/SettingsScreens/AdvancedModeToggle.swift index e944ae2..92c303d 100644 --- a/TAKTracker/Screens/SettingsScreens/AdvancedModeToggle.swift +++ b/TAKTracker/Screens/SettingsScreens/AdvancedModeToggle.swift @@ -15,13 +15,13 @@ struct AdvancedModeToggle: View { Group { VStack { HStack { - Text("Enable Advanced Mode") + Text("Enable Map Display") .font(.system(size: 18, weight: .medium)) .foregroundColor(.secondary) Spacer() } - Picker(selection: $settingsStore.enableAdvancedMode, label: Text("Advanced Mode"), content: { + Picker(selection: $settingsStore.enableAdvancedMode, label: Text("Map Display"), content: { Text("On").tag(true) Text("Off").tag(false) }) diff --git a/TAKTracker/Screens/SettingsScreens/AdvancedOptions.swift b/TAKTracker/Screens/SettingsScreens/AdvancedOptions.swift new file mode 100644 index 0000000..1d34354 --- /dev/null +++ b/TAKTracker/Screens/SettingsScreens/AdvancedOptions.swift @@ -0,0 +1,27 @@ +// +// AdvancedOptions.swift +// TAKTracker +// +// Created by Cory Foy on 3/25/24. +// + +import Foundation +import SwiftUI + +struct AdvancedOptions: View { + var body: some View { + NavigationLink(destination: AdvancedOptionsScreen()) { + Text("Advanced Options") + } + .navigationBarTitleDisplayMode(.inline) + } +} + +struct AdvancedOptionsScreen: View { + var body: some View { + List { + DeviceOptions() + TAKOptions() + } + } +} diff --git a/TAKTracker/Screens/SettingsScreens/SituationalAwarenessOptions.swift b/TAKTracker/Screens/SettingsScreens/SituationalAwarenessOptions.swift new file mode 100644 index 0000000..4189763 --- /dev/null +++ b/TAKTracker/Screens/SettingsScreens/SituationalAwarenessOptions.swift @@ -0,0 +1,32 @@ +// +// SituationalAwarenessOptions.swift +// TAKTracker +// +// Created by Cory Foy on 3/25/24. +// + +import Foundation +import SwiftUI + +struct SituationalAwarenessOptions: View { + var body: some View { + NavigationLink(destination: SituationalAwarenessScreen()) { + Text("Situational Awareness") + } + .navigationBarTitleDisplayMode(.inline) + } +} + +struct SituationalAwarenessScreen: View { + @Environment(\.dismiss) var dismiss + @StateObject var settingsStore: SettingsStore = SettingsStore.global + + var body: some View { + List { + AdvancedModeToggle() + if(settingsStore.enableAdvancedMode) { + MapOptions() + } + } + } +} diff --git a/TAKTracker/Screens/SettingsView.swift b/TAKTracker/Screens/SettingsView.swift index 622d9ed..2503f4b 100644 --- a/TAKTracker/Screens/SettingsView.swift +++ b/TAKTracker/Screens/SettingsView.swift @@ -22,13 +22,8 @@ struct SettingsView: View { UserInformation() ServerInformation() ConnectionOptions(isProcessingDataPackage: $isProcessingDataPackage) - DeviceOptions() - AdvancedModeToggle() - - if(settingsStore.enableAdvancedMode) { - MapOptions() - TAKOptions() - } + SituationalAwarenessOptions() + AdvancedOptions() AboutInformation() } .navigationBarTitle("Settings")