diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index 3057e4d7..d021e627 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -458,7 +458,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject { if decodedInfo.moduleConfig.payloadVariant == ModuleConfig.OneOf_PayloadVariant.cannedMessage(decodedInfo.moduleConfig.cannedMessage) { if decodedInfo.moduleConfig.cannedMessage.enabled { - self.getCannedMessageModuleMessages(destNum: self.connectedPeripheral.num, wantResponse: true) + _ = self.getCannedMessageModuleMessages(destNum: self.connectedPeripheral.num, wantResponse: true) } } } diff --git a/Meshtastic/Helpers/MeshPackets.swift b/Meshtastic/Helpers/MeshPackets.swift index 67eb547f..5eeea6af 100644 --- a/Meshtastic/Helpers/MeshPackets.swift +++ b/Meshtastic/Helpers/MeshPackets.swift @@ -1038,16 +1038,8 @@ func nodeInfoAppPacket (packet: MeshPacket, context: NSManagedObjectContext) { func adminAppPacket (packet: MeshPacket, context: NSManagedObjectContext) { - //print(packet.payloadVariant.debugDescription) - if let messages = try? CannedMessageModuleConfig(serializedData: packet.decoded.payload) { - //let adminMessageId = bleManager.saveCannedMessageModuleMessages(messages: messages, fromUser: node!.user!, toUser: node!.user!, wantResponse: true) - //if adminMessageId > 0 { - - //} - //print(messages) - } else { - //print(try! packet.decoded.jsonString()) + print(messages) } } diff --git a/Meshtastic/Views/Bluetooth/Connect.swift b/Meshtastic/Views/Bluetooth/Connect.swift index 50757c31..9e409840 100644 --- a/Meshtastic/Views/Bluetooth/Connect.swift +++ b/Meshtastic/Views/Bluetooth/Connect.swift @@ -39,25 +39,26 @@ struct Connect: View { if node != nil { Text(bleManager.connectedPeripheral.longName).font(.title2) } - Text("BLE Name: ").font(.caption)+Text(bleManager.connectedPeripheral.peripheral.name ?? "Unknown") + Text("ble.name").font(.caption)+Text(": \(bleManager.connectedPeripheral.peripheral.name ?? "Unknown")") .font(.caption).foregroundColor(Color.gray) if node != nil { - Text("FW Version: ").font(.caption)+Text(node?.myInfo?.firmwareVersion ?? "Unknown") + Text("firmware.version").font(.caption)+Text(": \(node?.myInfo?.firmwareVersion ?? "Unknown")") .font(.caption).foregroundColor(Color.gray) } if bleManager.isSubscribed { - Text("Subscribed to mesh").font(.caption) + Text("subscribed").font(.caption) .foregroundColor(.green) } else { - Text("Communicating with device. . . ").font(.caption) + Text("communicating").font(.caption) .foregroundColor(.orange) } } Spacer() VStack(alignment: .center) { - Text("Preferred").font(.caption2) - Text("Radio").font(.caption2) - Toggle("Preferred Radio", isOn: $bleManager.preferredPeripheral) + Text("preferred.radio").font(.caption2) + .multilineTextAlignment(.center) + .frame(width: 75) + Toggle("preferred.radio", isOn: $bleManager.preferredPeripheral) .toggleStyle(SwitchToggleStyle(tint: .accentColor)) .labelsHidden() .onChange(of: bleManager.preferredPeripheral) { value in @@ -91,7 +92,7 @@ struct Connect: View { isPreferredRadio = false } } label: { - Label("Disconnect", systemImage: "antenna.radiowaves.left.and.right.slash") + Label("disconnect", systemImage: "antenna.radiowaves.left.and.right.slash") } } .contextMenu{ @@ -112,7 +113,7 @@ struct Connect: View { NavigationLink { LoRaConfig(node: node) } label: { - Label("Set LoRa Region", systemImage: "globe.americas.fill") + Label("set.region", systemImage: "globe.americas.fill") .foregroundColor(.red) .font(.title) } @@ -127,7 +128,7 @@ struct Connect: View { .imageScale(.large).foregroundColor(.orange) .padding(.trailing) if bleManager.timeoutTimerCount == 0 { - Text("Connecting . . .") + Text("connecting") .font(.title3) .foregroundColor(.orange) } else { @@ -151,7 +152,7 @@ struct Connect: View { .symbolRenderingMode(.hierarchical) .imageScale(.large).foregroundColor(.red) .padding(.trailing) - Text("No device connected").font(.title3) + Text("not.connected").font(.title3) } .padding() } @@ -215,7 +216,7 @@ struct Connect: View { }) { - Label("Disconnect", systemImage: "antenna.radiowaves.left.and.right.slash") + Label("disconnect", systemImage: "antenna.radiowaves.left.and.right.slash") } .buttonStyle(.bordered) diff --git a/Meshtastic/Views/Messages/Contacts.swift b/Meshtastic/Views/Messages/Contacts.swift index b6705dc5..4e07be06 100644 --- a/Meshtastic/Views/Messages/Contacts.swift +++ b/Meshtastic/Views/Messages/Contacts.swift @@ -28,7 +28,7 @@ struct Contacts: View { NavigationSplitView { List { - Section(header: Text("channels")) { + Section(header: Text("Channels (groups)")) { // Display Contacts for the rest of the non admin channels if node != nil && node!.myInfo != nil && node!.myInfo!.channels != nil { ForEach(node!.myInfo!.channels!.array as! [ChannelEntity], id: \.self) { (channel: ChannelEntity) in @@ -92,24 +92,24 @@ struct Contacts: View { } .frame(maxWidth: .infinity, maxHeight: 80, alignment: .leading) .contextMenu { - if false { // Hide mute channel menu item until I can check it in notifications - Button { - channel.mute = !channel.mute - - do { - try context.save() - // Would rather not do this but the merge changes on - // A single object is only working on mac GVH - context.refreshAllObjects() - //context.refresh(channel, mergeChanges: true) - } catch { - context.rollback() - print("💥 Save Channel Mute Error") - } - } label: { - Label(channel.mute ? "Show Alerts" : "Hide Alerts", systemImage: channel.mute ? "bell" : "bell.slash") - } - } +// Hide mute channel menu item until I can check it in notifications +// Button { +// channel.mute = !channel.mute +// +// do { +// try context.save() +// // Would rather not do this but the merge changes on +// // A single object is only working on mac GVH +// context.refreshAllObjects() +// //context.refresh(channel, mergeChanges: true) +// } catch { +// context.rollback() +// print("💥 Save Channel Mute Error") +// } +// } label: { +// Label(channel.mute ? "Show Alerts" : "Hide Alerts", systemImage: channel.mute ? "bell" : "bell.slash") +// } + if channel.allPrivateMessages.count > 0 { Button(role: .destructive) { isPresentingDeleteChannelMessagesConfirm = true diff --git a/Meshtastic/Views/Settings/Config/PositionConfig.swift b/Meshtastic/Views/Settings/Config/PositionConfig.swift index 533cad90..23779e06 100644 --- a/Meshtastic/Views/Settings/Config/PositionConfig.swift +++ b/Meshtastic/Views/Settings/Config/PositionConfig.swift @@ -208,7 +208,7 @@ struct PositionConfig: View { Button("Save Position Config to \(bleManager.connectedPeripheral != nil ? bleManager.connectedPeripheral.longName : "Unknown")?") { if fixedPosition { - let sendPosition = bleManager.sendPosition(destNum: bleManager.connectedPeripheral.num, wantAck: true) + _ = bleManager.sendPosition(destNum: bleManager.connectedPeripheral.num, wantAck: true) } var pc = Config.PositionConfig() diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index b12c646f..228a93e7 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -6,12 +6,21 @@ */ "available.radios"="Available Radios"; +"ble.name"="BLE Name"; "cancel"="Cancel"; "channels"="Channels (groups)"; "connected.radio"="Connected Radio"; +"communicating"="Communicating with device. ."; +"connecting"="Connecting . ."; "contacts"="Contacts"; "delete"="Delete"; "direct.messages"="Direct Messages"; +"disconnect"="Disconnect"; +"firmware.version"="Firmware Version"; +"not.connected"="No device connected"; +"preferred.radio"="Preferred Radio"; "save"="Save"; +"subscribed"="Subscribed to mesh"; "select.contact"="Select a Contact"; +"set.region"="Set LoRa Region"; "unknown.age"="Unknown Age";