From eec7f593c502a18a3d9db9aeb5ce471f6edeba78 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 27 Aug 2024 21:17:35 -0700 Subject: [PATCH] Clean up labels and siri phrases --- Localizable.xcstrings | 15 +++++------ .../AppIntents/FactoryResetNodeIntent.swift | 2 +- .../AppIntents/MessageChannelIntent.swift | 2 +- Meshtastic/AppIntents/RestartNodeIntent.swift | 9 +++---- Meshtastic/AppIntents/ShortcutsProvider.swift | 26 ++++++++++--------- .../AppIntents/ShutDownNodeIntent.swift | 6 ++--- 6 files changed, 27 insertions(+), 33 deletions(-) diff --git a/Localizable.xcstrings b/Localizable.xcstrings index 3ae57f93..cf5fc247 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -7225,9 +7225,6 @@ }, "Factory Reset" : { - }, - "Factory Reset Node" : { - }, "Factory reset your device and app? " : { @@ -8167,6 +8164,9 @@ } } } + }, + "Group Message" : { + }, "Gusts %@" : { @@ -14582,9 +14582,6 @@ }, "Message" : { - }, - "Message Channel" : { - }, "Message content exceeds 228 bytes." : { @@ -17428,7 +17425,7 @@ "Reset NodeDB" : { }, - "Restart Node" : { + "Restart" : { }, "Restart to the node you are connected to" : { @@ -19175,7 +19172,7 @@ "Send" : { }, - "Send a Channel Message" : { + "Send a Group Message" : { }, "Send a message to a certain meshtastic channel" : { @@ -19924,7 +19921,7 @@ "Show Weather" : { }, - "Shut Down Node" : { + "Shut Down" : { }, "Shut Down Node?" : { diff --git a/Meshtastic/AppIntents/FactoryResetNodeIntent.swift b/Meshtastic/AppIntents/FactoryResetNodeIntent.swift index f83a507b..7ff2bd92 100644 --- a/Meshtastic/AppIntents/FactoryResetNodeIntent.swift +++ b/Meshtastic/AppIntents/FactoryResetNodeIntent.swift @@ -9,7 +9,7 @@ import Foundation import AppIntents struct FactoryResetNodeIntent: AppIntent { - static var title: LocalizedStringResource = "Factory Reset Node" + static var title: LocalizedStringResource = "Factory Reset" static var description: IntentDescription = "Perform a factory reset on the node you are connected to" func perform() async throws -> some IntentResult { diff --git a/Meshtastic/AppIntents/MessageChannelIntent.swift b/Meshtastic/AppIntents/MessageChannelIntent.swift index 4f104285..29d0a6c2 100644 --- a/Meshtastic/AppIntents/MessageChannelIntent.swift +++ b/Meshtastic/AppIntents/MessageChannelIntent.swift @@ -9,7 +9,7 @@ import Foundation import AppIntents struct MessageChannelIntent: AppIntent { - static var title: LocalizedStringResource = "Send a Channel Message" + static var title: LocalizedStringResource = "Send a Group Message" static var description: IntentDescription = "Send a message to a certain meshtastic channel" diff --git a/Meshtastic/AppIntents/RestartNodeIntent.swift b/Meshtastic/AppIntents/RestartNodeIntent.swift index 9bf8fd87..7ae8095a 100644 --- a/Meshtastic/AppIntents/RestartNodeIntent.swift +++ b/Meshtastic/AppIntents/RestartNodeIntent.swift @@ -9,13 +9,12 @@ import Foundation import AppIntents struct RestartNodeIntent: AppIntent { - static var title: LocalizedStringResource = "Restart Node" + static var title: LocalizedStringResource = "Restart" static var description: IntentDescription = "Restart to the node you are connected to" - func perform() async throws -> some IntentResult { - + try await requestConfirmation(result: .result(dialog: "Reboot Node?")) if !BLEManager.shared.isConnected { @@ -27,7 +26,7 @@ struct RestartNodeIntent: AppIntent { let fromUser = connectedNode.user, let toUser = connectedNode.user, let adminIndex = connectedNode.myInfo?.adminIndex { - + // Attempt to send shutdown, throw an error if it fails if !BLEManager.shared.sendReboot(fromUser: fromUser, toUser: toUser, adminIndex: adminIndex) { throw AppIntentErrors.AppIntentError.message("Failed to restart") @@ -35,8 +34,6 @@ struct RestartNodeIntent: AppIntent { } else { throw AppIntentErrors.AppIntentError.message("Failed to retrieve connected node or required data") } - return .result() } } - diff --git a/Meshtastic/AppIntents/ShortcutsProvider.swift b/Meshtastic/AppIntents/ShortcutsProvider.swift index e0f96ec3..b21c7e7d 100644 --- a/Meshtastic/AppIntents/ShortcutsProvider.swift +++ b/Meshtastic/AppIntents/ShortcutsProvider.swift @@ -11,24 +11,26 @@ import AppIntents struct ShortcutsProvider: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut(intent: ShutDownNodeIntent(), - phrases: ["Shut down node in \(.applicationName)", - "Turn off node in \(.applicationName)", - "Power down node in \(.applicationName)", - "Deactivate node in \(.applicationName)"], - shortTitle: "Shut Down Node", + phrases: ["Shut down \(.applicationName) node", + "Shut down my \(.applicationName) node", + "Turn off \(.applicationName) node", + "Power down \(.applicationName) node", + "Deactivate \(.applicationName) node"], + shortTitle: "Shut Down", systemImageName: "power") AppShortcut(intent: RestartNodeIntent(), - phrases: ["Restart node in \(.applicationName)", - "Reboot node in \(.applicationName)", - "Reset node in \(.applicationName)", - "Start node again in \(.applicationName)"], - shortTitle: "Restart Node", + phrases: ["Restart \(.applicationName) node", + "Restart my \(.applicationName) node", + "Reboot \(.applicationName) node", + "Reboot my \(.applicationName) node"], + shortTitle: "Restart", systemImageName: "arrow.circlepath") AppShortcut(intent: MessageChannelIntent(), - phrases: ["Message channel in \(.applicationName)"], - shortTitle: "Message Channel", + phrases: ["Message a \(.applicationName) channel", + "Send a \(.applicationName) group message"], + shortTitle: "Group Message", systemImageName: "message") } } diff --git a/Meshtastic/AppIntents/ShutDownNodeIntent.swift b/Meshtastic/AppIntents/ShutDownNodeIntent.swift index ea57548d..dcb43f3c 100644 --- a/Meshtastic/AppIntents/ShutDownNodeIntent.swift +++ b/Meshtastic/AppIntents/ShutDownNodeIntent.swift @@ -9,10 +9,9 @@ import Foundation import AppIntents struct ShutDownNodeIntent: AppIntent { - static var title: LocalizedStringResource = "Shut Down Node" + static var title: LocalizedStringResource = "Shut Down" static var description: IntentDescription = "Send a shutdown to the node you are connected to" - func perform() async throws -> some IntentResult { try await requestConfirmation(result: .result(dialog: "Shut Down Node?")) @@ -27,7 +26,7 @@ struct ShutDownNodeIntent: AppIntent { let fromUser = connectedNode.user, let toUser = connectedNode.user, let adminIndex = connectedNode.myInfo?.adminIndex { - + // Attempt to send shutdown, throw an error if it fails if !BLEManager.shared.sendShutdown(fromUser: fromUser, toUser: toUser, adminIndex: adminIndex) { throw AppIntentErrors.AppIntentError.message("Failed to shut down") @@ -35,7 +34,6 @@ struct ShutDownNodeIntent: AppIntent { } else { throw AppIntentErrors.AppIntentError.message("Failed to retrieve connected node or required data") } - return .result() } }