mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
commit
c3ebb2d625
19 changed files with 262 additions and 31 deletions
|
|
@ -64,6 +64,8 @@
|
|||
DD8ED9C8289CE4B900B3B0AB /* RoutingError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD8ED9C7289CE4B900B3B0AB /* RoutingError.swift */; };
|
||||
DD90860E26F69BAE00DC5189 /* NodeMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD90860D26F69BAE00DC5189 /* NodeMap.swift */; };
|
||||
DD913639270DFF4C00D7ACF3 /* LocalNotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */; };
|
||||
DD97E96628EFD9820056DDA4 /* MeshtasticLogo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */; };
|
||||
DD97E96828EFE9A00056DDA4 /* About.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD97E96728EFE9A00056DDA4 /* About.swift */; };
|
||||
DDA1C48E28DB49D3009933EC /* ChannelRoles.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */; };
|
||||
DDA6B2E928419CF2003E8C16 /* MeshPackets.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */; };
|
||||
DDA6B2EB28420A7B003E8C16 /* NodeAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA6B2EA28420A7B003E8C16 /* NodeAnnotation.swift */; };
|
||||
|
|
@ -176,6 +178,8 @@
|
|||
DD90860A26F645B700DC5189 /* Meshtastic.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Meshtastic.entitlements; sourceTree = "<group>"; };
|
||||
DD90860D26F69BAE00DC5189 /* NodeMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeMap.swift; sourceTree = "<group>"; };
|
||||
DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotificationManager.swift; sourceTree = "<group>"; };
|
||||
DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticLogo.swift; sourceTree = "<group>"; };
|
||||
DD97E96728EFE9A00056DDA4 /* About.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = About.swift; sourceTree = "<group>"; };
|
||||
DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelRoles.swift; sourceTree = "<group>"; };
|
||||
DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshPackets.swift; sourceTree = "<group>"; };
|
||||
DDA6B2EA28420A7B003E8C16 /* NodeAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeAnnotation.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -291,6 +295,7 @@
|
|||
DD4A911C2708C57100501B7E /* Settings */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DD97E96728EFE9A00056DDA4 /* About.swift */,
|
||||
DD3501882852FC3B000FC853 /* Settings.swift */,
|
||||
DD4A911D2708C65400501B7E /* AppSettings.swift */,
|
||||
DD8169FA271F1F3A00F4AB02 /* MeshLog.swift */,
|
||||
|
|
@ -508,6 +513,7 @@
|
|||
DDD94A4F2845C8F5004A87A0 /* DateTimeText.swift */,
|
||||
DDB6ABDA28B0AC6000384BA1 /* DistanceText.swift */,
|
||||
DD3CC6BD28E4CD9800FA9159 /* BatteryGauge.swift */,
|
||||
DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */,
|
||||
);
|
||||
path = Helpers;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -745,6 +751,7 @@
|
|||
DD2553592855B52700E55709 /* PositionConfig.swift in Sources */,
|
||||
DDB3107228A6224100F1DE3D /* device_metadata.pb.swift in Sources */,
|
||||
DDAF8C6326ED0A230058C060 /* admin.pb.swift in Sources */,
|
||||
DD97E96828EFE9A00056DDA4 /* About.swift in Sources */,
|
||||
DDB6ABE028B13AC700384BA1 /* DeviceRoles.swift in Sources */,
|
||||
DD86D40C287F401000BAEB7A /* SaveChannelQRCode.swift in Sources */,
|
||||
DDA1C48E28DB49D3009933EC /* ChannelRoles.swift in Sources */,
|
||||
|
|
@ -772,6 +779,7 @@
|
|||
DD415828285859C4009B0E59 /* TelemetryConfig.swift in Sources */,
|
||||
DD73FD1128750779000852D6 /* PositionLog.swift in Sources */,
|
||||
DD3CC6C028E7A60700FA9159 /* MessagingEnums.swift in Sources */,
|
||||
DD97E96628EFD9820056DDA4 /* MeshtasticLogo.swift in Sources */,
|
||||
C9697F9D279336B700250207 /* LocalMBTileOverlay.swift in Sources */,
|
||||
DD0F791B28713C8A00A6FDAD /* AdminMessageList.swift in Sources */,
|
||||
DD3CC6BC28E366DF00FA9159 /* Meshtastic.xcdatamodeld in Sources */,
|
||||
|
|
|
|||
23
Meshtastic/Assets.xcassets/logo-black.imageset/Contents.json
vendored
Normal file
23
Meshtastic/Assets.xcassets/logo-black.imageset/Contents.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Mesh_Logo_Black_Small.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Mesh_Logo_Black.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Mesh_Logo_Black_Large.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
12
Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black.svg
vendored
Normal file
12
Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black.svg
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 55" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(0.802386,0,0,0.460028,-421.748,-122.127)">
|
||||
<g transform="matrix(0.579082,0,0,1.01004,460.975,-39.6867)">
|
||||
<path d="M250.908,330.267L193.126,415.005L180.938,406.694L244.802,313.037C246.174,311.024 248.453,309.819 250.889,309.816C253.326,309.814 255.606,311.015 256.982,313.026L320.994,406.536L308.821,414.869L250.908,330.267Z"/>
|
||||
</g>
|
||||
<g transform="matrix(0.582378,0,0,1.01579,485.019,-211.182)">
|
||||
<path d="M87.642,581.398L154.757,482.977L142.638,474.713L75.523,573.134L87.642,581.398Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
12
Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Large.svg
vendored
Normal file
12
Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Large.svg
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 55" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(0.353462,0,0,0.202442,-296.058,-23.2047)">
|
||||
<g transform="matrix(1.40256,0,0,2.44636,669.626,-634.831)">
|
||||
<path d="M250.905,326.97L191.589,413.957L182.475,407.742L246.339,314.085C247.365,312.58 249.069,311.678 250.891,311.677C252.713,311.675 254.418,312.573 255.447,314.077L319.459,407.587L310.356,413.818L250.905,326.97Z"/>
|
||||
</g>
|
||||
<g transform="matrix(1.39424,0,0,2.43184,733.087,-1033.78)">
|
||||
<path d="M86.181,580.402L153.296,481.981L144.099,475.709L76.984,574.13L86.181,580.402Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
12
Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Small.svg
vendored
Normal file
12
Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Small.svg
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 50 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1.10116,0,0,0.631321,-207.228,-202.833)">
|
||||
<g transform="matrix(0.201804,0,0,0.351989,167.289,216.061)">
|
||||
<path d="M250.912,334.664L195.175,416.403L178.889,405.297L242.753,311.64C244.587,308.95 247.631,307.339 250.887,307.336C254.143,307.333 257.19,308.938 259.029,311.625L323.04,405.135L306.774,416.27L250.912,334.664Z"/>
|
||||
</g>
|
||||
<g transform="matrix(0.205009,0,0,0.357578,174.224,154.227)">
|
||||
<path d="M89.878,582.923L156.993,484.502L140.402,473.188L73.287,571.609L89.878,582.923Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
23
Meshtastic/Assets.xcassets/logo-white.imageset/Contents.json
vendored
Normal file
23
Meshtastic/Assets.xcassets/logo-white.imageset/Contents.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Mesh_Logo_White_Small.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Mesh_Logo_White.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Mesh_Logo_White_Large.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
12
Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White.svg
vendored
Normal file
12
Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White.svg
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 55" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(0.802386,0,0,0.460028,-421.748,-122.127)">
|
||||
<g transform="matrix(0.579082,0,0,1.01004,460.975,-39.6867)">
|
||||
<path d="M250.908,330.267L193.126,415.005L180.938,406.694L244.802,313.037C246.174,311.024 248.453,309.819 250.889,309.816C253.326,309.814 255.606,311.015 256.982,313.026L320.994,406.536L308.821,414.869L250.908,330.267Z" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(0.582378,0,0,1.01579,485.019,-211.182)">
|
||||
<path d="M87.642,581.398L154.757,482.977L142.638,474.713L75.523,573.134L87.642,581.398Z" style="fill:white;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
12
Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Large.svg
vendored
Normal file
12
Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Large.svg
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 55" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(0.353462,0,0,0.202442,-296.058,-23.2047)">
|
||||
<g transform="matrix(1.40256,0,0,2.44636,669.626,-634.831)">
|
||||
<path d="M250.905,326.97L191.589,413.957L182.475,407.742L246.339,314.085C247.365,312.58 249.069,311.678 250.891,311.677C252.713,311.675 254.418,312.573 255.447,314.077L319.459,407.587L310.356,413.818L250.905,326.97Z" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.39424,0,0,2.43184,733.087,-1033.78)">
|
||||
<path d="M86.181,580.402L153.296,481.981L144.099,475.709L76.984,574.13L86.181,580.402Z" style="fill:white;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
12
Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Small.svg
vendored
Normal file
12
Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Small.svg
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 50 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1.10116,0,0,0.631321,-207.228,-202.833)">
|
||||
<g transform="matrix(0.201804,0,0,0.351989,167.289,216.061)">
|
||||
<path d="M250.912,334.664L195.175,416.403L178.889,405.297L242.753,311.64C244.587,308.95 247.631,307.339 250.887,307.336C254.143,307.333 257.19,308.938 259.029,311.625L323.04,405.135L306.774,416.27L250.912,334.664Z" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(0.205009,0,0,0.357578,174.224,154.227)">
|
||||
<path d="M89.878,582.923L156.993,484.502L140.402,473.188L73.287,571.609L89.878,582.923Z" style="fill:white;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
|
|
@ -37,15 +37,20 @@ struct MeshtasticAppleApp: App {
|
|||
.sheet(isPresented: $saveQR) {
|
||||
|
||||
SaveChannelQRCode(channelHash: channelUrl?.absoluteString ?? "Empty Channel URL")
|
||||
.presentationDetents([.medium, .large])
|
||||
.presentationDragIndicator(.visible)
|
||||
}
|
||||
.onOpenURL(perform: { (url) in
|
||||
|
||||
print("QR Code URL received from the Camera \(url)")
|
||||
print("Some sort of URL was received \(url)")
|
||||
channelUrl = url
|
||||
print("User wants to open URL: \(channelUrl?.absoluteString ?? "No QR Code Link")")
|
||||
|
||||
|
||||
if url.absoluteString.lowercased().contains("https://meshtastic.org/e/#") {
|
||||
saveQR = true
|
||||
print("User wants to open a Channel Settings URL: \(channelUrl?.absoluteString ?? "No QR Code Link")")
|
||||
} else {
|
||||
print("User wants to import a MBTILES offline map file: \(channelUrl?.absoluteString ?? "No Tiles link")")
|
||||
}
|
||||
|
||||
//we are expecting a .mbtiles map file that contains raster data
|
||||
|
|
@ -60,7 +65,11 @@ struct MeshtasticAppleApp: App {
|
|||
try? fileManager.removeItem(atPath: destination.path)
|
||||
}
|
||||
|
||||
try? fileManager.copyItem(at: url, to: destination)
|
||||
do {
|
||||
try fileManager.copyItem(at: url, to: destination)
|
||||
} catch {
|
||||
print("Copy MB Tile file failed. Error: \(error)")
|
||||
}
|
||||
|
||||
if (fileManager.fileExists(atPath: destination.path)) {
|
||||
print("ℹ️ Saved the map file")
|
||||
|
|
|
|||
|
|
@ -253,24 +253,25 @@ struct Connect: View {
|
|||
|
||||
|
||||
}
|
||||
.navigationTitle("Bluetooth Radios")
|
||||
.navigationBarItems(trailing:
|
||||
.navigationTitle("Bluetooth")
|
||||
|
||||
.navigationBarItems(leading:
|
||||
MeshtasticLogo(),
|
||||
trailing:
|
||||
|
||||
ZStack {
|
||||
|
||||
ConnectedDevice(
|
||||
bluetoothOn: self.bleManager.isSwitchedOn,
|
||||
deviceConnected: self.bleManager.connectedPeripheral != nil,
|
||||
name: (bleManager.connectedPeripheral != nil) ? self.bleManager.connectedPeripheral.shortName :
|
||||
"????")
|
||||
}
|
||||
)
|
||||
ZStack {
|
||||
|
||||
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????")
|
||||
})
|
||||
}
|
||||
.navigationViewStyle(StackNavigationViewStyle())
|
||||
.sheet(isPresented: $invalidFirmwareVersion, onDismiss: didDismissSheet) {
|
||||
|
||||
InvalidVersion(minimumVersion: self.bleManager.minimumVersion, version: self.bleManager.connectedVersion)
|
||||
.presentationDetents([.large])
|
||||
.presentationDragIndicator(.automatic)
|
||||
}
|
||||
|
||||
|
||||
.onChange(of: (self.bleManager.invalidVersion)) { cv in
|
||||
|
||||
|
|
|
|||
22
Meshtastic/Views/Helpers/MeshtasticLogo.swift
Normal file
22
Meshtastic/Views/Helpers/MeshtasticLogo.swift
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// MeshtasticLogo.swift
|
||||
// Meshtastic
|
||||
//
|
||||
// Copyright(c) Garth Vander Houwen 10/6/22.
|
||||
//
|
||||
import SwiftUI
|
||||
|
||||
struct MeshtasticLogo: View {
|
||||
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image(colorScheme == .dark ? "logo-white" : "logo-black")
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
}
|
||||
.padding(.bottom, 5)
|
||||
.offset(x: -15)
|
||||
}
|
||||
}
|
||||
|
|
@ -133,6 +133,9 @@ struct Contacts: View {
|
|||
}
|
||||
.navigationTitle("Contacts")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarItems(leading:
|
||||
MeshtasticLogo()
|
||||
)
|
||||
}
|
||||
.listStyle(PlainListStyle())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,9 @@ struct NodeList: View {
|
|||
}
|
||||
}
|
||||
.navigationTitle("All Nodes")
|
||||
.navigationBarItems(leading:
|
||||
MeshtasticLogo()
|
||||
)
|
||||
.onAppear {
|
||||
|
||||
if initialLoad {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ struct NodeMap: View {
|
|||
.navigationTitle("Mesh Map")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
|
||||
.navigationBarItems(trailing:
|
||||
.navigationBarItems(leading:
|
||||
MeshtasticLogo(), trailing:
|
||||
|
||||
ZStack {
|
||||
|
||||
|
|
|
|||
56
Meshtastic/Views/Settings/About.swift
Normal file
56
Meshtastic/Views/Settings/About.swift
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// About.swift
|
||||
// Meshtastic
|
||||
//
|
||||
// Copyright(c) Garth Vander Houwen 10/6/22.
|
||||
//
|
||||
import SwiftUI
|
||||
import StoreKit
|
||||
|
||||
struct AboutMeshtastic: View {
|
||||
|
||||
let locale = Locale.current
|
||||
|
||||
var body: some View {
|
||||
|
||||
VStack{
|
||||
|
||||
List {
|
||||
Section(header: Text("What is Meshtastic?")) {
|
||||
Text("An open source, off-grid, decentralized, mesh network built to run on affordable, low-power devices.")
|
||||
.font(.title3)
|
||||
|
||||
}
|
||||
Section(header: Text("Apple Apps")) {
|
||||
Button("Review the app") {
|
||||
if let scene = UIApplication.shared.connectedScenes
|
||||
.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
|
||||
SKStoreReviewController.requestReview(in: scene)
|
||||
}
|
||||
}
|
||||
.font(.title2)
|
||||
Link("Sponsor App Development", destination: URL(string: "https://github.com/sponsors/garthvh")!)
|
||||
.font(.title2)
|
||||
Link("GitHub Repository", destination: URL(string: "https://github.com/meshtastic/Meshtastic-Apple")!)
|
||||
.font(.title2)
|
||||
}
|
||||
if locale.region?.identifier == "US" {
|
||||
Section(header: Text("Get Devices")) {
|
||||
Link("Buy Complete Radios", destination: URL(string: "https://www.etsy.com/shop/GarthVH")!)
|
||||
.font(.title2)
|
||||
}
|
||||
}
|
||||
Section(header: Text("Project information")) {
|
||||
Link("Website", destination: URL(string: "https://meshtastic.org")!)
|
||||
.font(.title2)
|
||||
Link("Documentation", destination: URL(string: "https://meshtastic.org/docs/getting-started")!)
|
||||
.font(.title2)
|
||||
}
|
||||
Text("Meshtastic Copyright(c) Meshtastic LLC")
|
||||
.font(.caption)
|
||||
}
|
||||
}
|
||||
.navigationTitle("About")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
}
|
||||
|
|
@ -75,12 +75,11 @@ struct DeviceConfig: View {
|
|||
titleVisibility: .visible
|
||||
) {
|
||||
Button("Erase all device and app data?", role: .destructive) {
|
||||
if !bleManager.sendNodeDBReset(destNum: bleManager.connectedPeripheral.num) {
|
||||
print("NodeDB Reset Failed")
|
||||
} else {
|
||||
// Disconnect from device as we are going to wipe the app database now
|
||||
bleManager.disconnectPeripheral()
|
||||
if bleManager.sendNodeDBReset(destNum: bleManager.connectedPeripheral.num) {
|
||||
bleManager.disconnectPeripheral()
|
||||
clearCoreDataDatabase(context: context)
|
||||
} else {
|
||||
print("NodeDB Reset Failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -99,13 +98,11 @@ struct DeviceConfig: View {
|
|||
) {
|
||||
Button("Factory reset your device and app? ", role: .destructive) {
|
||||
|
||||
if !bleManager.sendFactoryReset(destNum: bleManager.connectedPeripheral.num) {
|
||||
|
||||
print("Factory Reset Failed")
|
||||
} else {
|
||||
clearCoreDataDatabase(context: context)
|
||||
// Disconnect from device
|
||||
if bleManager.sendFactoryReset(destNum: bleManager.connectedPeripheral.num) {
|
||||
bleManager.disconnectPeripheral()
|
||||
clearCoreDataDatabase(context: context)
|
||||
} else {
|
||||
print("Factory Reset Failed")
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,8 +206,20 @@ struct Settings: View {
|
|||
}
|
||||
}
|
||||
|
||||
// Not Implemented:
|
||||
// Store Forward Config - Not Working, TBEAM Only
|
||||
Section(header: Text("About")) {
|
||||
|
||||
NavigationLink {
|
||||
|
||||
AboutMeshtastic()
|
||||
|
||||
} label: {
|
||||
|
||||
Image(systemName: "questionmark.app")
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
|
||||
Text("About Meshtastic")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.onAppear {
|
||||
|
|
@ -218,6 +230,9 @@ struct Settings: View {
|
|||
}
|
||||
.listStyle(GroupedListStyle())
|
||||
.navigationTitle("Settings")
|
||||
.navigationBarItems(leading:
|
||||
MeshtasticLogo()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,8 +136,6 @@ struct ShareChannels: View {
|
|||
let qrImage = qrCodeImage.generateQRCode(from: channelsUrl)
|
||||
|
||||
VStack {
|
||||
|
||||
Divider()
|
||||
|
||||
ShareLink("Share QR Code & Link",
|
||||
item: Image(uiImage: qrImage),
|
||||
|
|
@ -146,7 +144,7 @@ struct ShareChannels: View {
|
|||
preview: SharePreview("Meshtastic Node \(node?.user?.shortName ?? "????") has shared channels with you",
|
||||
image: Image(uiImage: qrImage))
|
||||
)
|
||||
.presentationDetents([.large, .large])
|
||||
|
||||
|
||||
Divider()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue