aboutsummaryrefslogtreecommitdiff
path: root/Map
diff options
context:
space:
mode:
Diffstat (limited to 'Map')
-rw-r--r--Map/Business/Template.swift36
-rw-r--r--Map/Data/MapDocument.swift6
-rw-r--r--Map/Data/UTType+wmap.swift21
-rw-r--r--Map/Data/UserPreferencesJSON.swift0
-rw-r--r--Map/Localizable.xcstrings22
-rw-r--r--Map/Presentation/Preferences/TemplatesPreferencesView.swift21
6 files changed, 79 insertions, 27 deletions
diff --git a/Map/Business/Template.swift b/Map/Business/Template.swift
new file mode 100644
index 0000000..0648d07
--- /dev/null
+++ b/Map/Business/Template.swift
@@ -0,0 +1,36 @@
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
+import Foundation
+
+struct Template: Identifiable, Codable, Hashable {
+ var id = UUID()
+ var name: String
+ var content: String
+ var isDefault: Bool = false
+
+ init(name: String, content: String, isDefault: Bool = false) {
+ self.name = name
+ self.content = content
+ self.isDefault = isDefault
+ }
+
+ func hash(into hasher: inout Hasher) {
+ hasher.combine(id)
+ }
+
+ static func == (lhs: Template, rhs: Template) -> Bool {
+ lhs.id == rhs.id
+ }
+}
diff --git a/Map/Data/MapDocument.swift b/Map/Data/MapDocument.swift
index b9ed33f..3c19ca1 100644
--- a/Map/Data/MapDocument.swift
+++ b/Map/Data/MapDocument.swift
@@ -15,12 +15,6 @@
import SwiftUI
import UniformTypeIdentifiers
-extension UTType {
- static var wmap: UTType {
- UTType(importedAs: "systems.tranquil.map.wmap")
- }
-}
-
struct MapDocument: FileDocument {
var text: String
diff --git a/Map/Data/UTType+wmap.swift b/Map/Data/UTType+wmap.swift
new file mode 100644
index 0000000..aa8b8fd
--- /dev/null
+++ b/Map/Data/UTType+wmap.swift
@@ -0,0 +1,21 @@
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
+import UniformTypeIdentifiers
+
+extension UTType {
+ static var wmap: UTType {
+ UTType(importedAs: "systems.tranquil.map.wmap")
+ }
+}
diff --git a/Map/Data/UserPreferencesJSON.swift b/Map/Data/UserPreferencesJSON.swift
deleted file mode 100644
index e69de29..0000000
--- a/Map/Data/UserPreferencesJSON.swift
+++ /dev/null
diff --git a/Map/Localizable.xcstrings b/Map/Localizable.xcstrings
index ec8ed46..13932a4 100644
--- a/Map/Localizable.xcstrings
+++ b/Map/Localizable.xcstrings
@@ -988,6 +988,28 @@
}
}
},
+ "quick_look.empty_map.description" : {
+ "extractionState" : "manual",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "This .wmap file contains no map elements"
+ }
+ }
+ }
+ },
+ "quick_look.empty_map.title" : {
+ "extractionState" : "manual",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Empty Map"
+ }
+ }
+ }
+ },
"search_bar.done" : {
"extractionState" : "manual",
"localizations" : {
diff --git a/Map/Presentation/Preferences/TemplatesPreferencesView.swift b/Map/Presentation/Preferences/TemplatesPreferencesView.swift
index 375ed68..51d1c5e 100644
--- a/Map/Presentation/Preferences/TemplatesPreferencesView.swift
+++ b/Map/Presentation/Preferences/TemplatesPreferencesView.swift
@@ -15,27 +15,6 @@
import SwiftUI
-struct Template: Identifiable, Codable, Hashable {
- var id = UUID()
- var name: String
- var content: String
- var isDefault: Bool = false
-
- init(name: String, content: String, isDefault: Bool = false) {
- self.name = name
- self.content = content
- self.isDefault = isDefault
- }
-
- func hash(into hasher: inout Hasher) {
- hasher.combine(id)
- }
-
- static func == (lhs: Template, rhs: Template) -> Bool {
- lhs.id == rhs.id
- }
-}
-
struct TemplatesPreferencesView: View {
@AppStorage("mapTemplates") private var templatesData: Data = UserPreferences.Defaults
.mapTemplates