A couple more localized strings, filter out default location for distance text on node list

This commit is contained in:
Garth Vander Houwen 2023-01-02 01:27:57 -08:00
parent e11f1b7f89
commit e95ccee52e
8 changed files with 18 additions and 17 deletions

View file

@ -93,7 +93,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject {
self.timeoutTimerCount += 1
self.lastConnectionError = ""
if timeoutTimerCount == 2 {
if timeoutTimerCount == 10 {
if connectedPeripheral != nil {
self.centralManager?.cancelPeripheralConnection(connectedPeripheral.peripheral)
}

View file

@ -194,7 +194,7 @@ struct Connect: View {
}
} else {
Text("Bluetooth: OFF")
Text("bluetooth.off")
.foregroundColor(.red)
.font(.title)
}

View file

@ -30,7 +30,7 @@ struct ConnectedDevice: View {
}
} else {
Text("Bluetooth Off").font(.subheadline).foregroundColor(.red)
Text("bluetooth.off").font(.subheadline).foregroundColor(.red)
}
}
}

View file

@ -134,7 +134,7 @@ struct DeviceMetricsLog: View {
Button(role: .destructive) {
isPresentingClearLogConfirm = true
} label: {
Label("Clear Log", systemImage: "trash.fill")
Label("clear.log", systemImage: "trash.fill")
}
.buttonStyle(.bordered)
.buttonBorderShape(.capsule)
@ -145,7 +145,7 @@ struct DeviceMetricsLog: View {
isPresented: $isPresentingClearLogConfirm,
titleVisibility: .visible
) {
Button("Delete all device metrics?", role: .destructive) {
Button("device.metrics.delete", role: .destructive) {
if clearTelemetry(destNum: node.num, metricsType: 0, context: context) {
print("Cleared Device Metrics for \(node.num)")
} else {
@ -164,7 +164,7 @@ struct DeviceMetricsLog: View {
.controlSize(.large)
.padding()
}
.navigationTitle("Device Metrics Log")
.navigationTitle("device.metrics.log")
.navigationBarTitleDisplayMode(.inline)
.navigationBarItems(trailing:
ZStack {
@ -177,14 +177,14 @@ struct DeviceMetricsLog: View {
isPresented: $isExporting,
document: CsvDocument(emptyCsv: exportString),
contentType: .commaSeparatedText,
defaultFilename: String("\(node.user!.longName ?? "Node") Device Telemetry Log"),
defaultFilename: String("\(node.user!.longName ?? "Node") \(NSLocalizedString("device.metrics.log", comment: "Device Metrics Log"))"),
onCompletion: { result in
if case .success = result {
print("Device Telemetry log download succeeded.")
print("Device metrics log download succeeded.")
self.isExporting = false
} else {
print("Device Telemetry log download failed: \(result).")
print("Device metrics log download failed: \(result).")
}
}
)

View file

@ -53,7 +53,7 @@ struct NodeList: View {
HStack(alignment: .bottom) {
let lastPostion = node.positions!.reversed()[0] as! PositionEntity
let myCoord = CLLocation(latitude: LocationHelper.currentLocation.latitude, longitude: LocationHelper.currentLocation.longitude)
if lastPostion.coordinate != nil {
if lastPostion.coordinate != nil && myCoord.coordinate.longitude != LocationHelper.DefaultLocation.longitude && myCoord.coordinate.latitude != LocationHelper.DefaultLocation.latitude {
let nodeCoord = CLLocation(latitude: lastPostion.coordinate!.latitude, longitude: lastPostion.coordinate!.longitude)
let metersAway = nodeCoord.distance(from: myCoord)
Image(systemName: "lines.measurement.horizontal")

View file

@ -177,15 +177,10 @@ struct Settings: View {
Text("admin.log")
}
}
Section(header: Text("about")) {
NavigationLink {
AboutMeshtastic()
} label: {
Image(systemName: "questionmark.app")
.symbolRenderingMode(.hierarchical)
@ -194,10 +189,8 @@ struct Settings: View {
}
}
.onAppear {
self.bleManager.context = context
self.bleManager.userSettings = userSettings
}
.listStyle(GroupedListStyle())
.navigationTitle("settings")

View file

@ -25,6 +25,7 @@
"ble.errorcode.14 %@"="%@ This error usually cannot be fixed without forgetting the device unders Settings > Bluetooth and re-connecting to the radio.";
"ble.errorcode.pin %@"="%@ Please try connecting again and check the PIN carefully.";
"bluetooth"="Bluetooth";
"bluetooth.off"="Bluetooth is off";
"bluetooth.config"="Bluetooth Konfiguration";
"bluetooth.mode.randompin"="Zufällige PIN";
"bluetooth.mode.fixedpin"="Feste PIN";
@ -45,6 +46,7 @@
"channel.utilization"="Channel Utilization";
"channels"="Kanäle";
"clear.app.data"="App Daten löschen";
"clear.log"="Clear Log";
"close"="Close";
"config.save.confirm"="After config values save the node will reboot.";
"connected.radio"="Verbundenes Gerät";
@ -58,6 +60,8 @@
"delete"="Löschen";
"device"="Gerät";
"device.config"="Gerätekonfiguration";
"device.metrics.delete"="Delete all device metrics?";
"device.metrics.log"="Device Metrics Log";
"device.role.client"="Client (Standard) - Mit App verbundener Client.";
"device.role.clientmute"="Client Leise - Das selbe wie Client, außer das die Pakete nicht über diesen Node weitergeleitet werden. Nimmt nicht am Mesh-Routing teil.";
"device.role.router"="Router - Mesh Pakete werden bevorzugt über diesen Node gerouted. Dieser Node wird nicht von einer Client App benutzt. WLAN, Bluetooth und Display sind aus.";

View file

@ -25,6 +25,7 @@
"ble.errorcode.14 %@"="%@ This error usually cannot be fixed without forgetting the device unders Settings > Bluetooth and re-connecting to the radio.";
"ble.errorcode.pin %@"="%@ Please try connecting again and check the PIN carefully.";
"bluetooth"="Bluetooth";
"bluetooth.off"="Bluetooth is off";
"bluetooth.config"="Bluetooth Config";
"bluetooth.mode.randompin"="Random PIN";
"bluetooth.mode.fixedpin"="Fixed PIN";
@ -45,6 +46,7 @@
"channel.utilization"="Channel Utilization";
"channels"="Channels";
"clear.app.data"="Clear App Data";
"clear.log"="Clear Log";
"close"="Close";
"config.save.confirm"="After config values save the node will reboot.";
"connected.radio"="Connected Radio";
@ -58,6 +60,8 @@
"delete"="Delete";
"device"="Device";
"device.config"="Device Config";
"device.metrics.delete"="Delete all device metrics?";
"device.metrics.log"="Device Metrics Log";
"device.role.client"="Client (default) - App connected client.";
"device.role.clientmute"="Client Mute - Same as a client except packets will not hop over this node, does not contribute to routing packets for mesh.";
"device.role.router"="Router - Mesh packets will prefer to be routed over this node. This node will not be used by client apps. The wifi/ble radios and the oled screen will be put to sleep.";