diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-11 12:06:04 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-11 12:06:04 +0200 |
| commit | 0cc8ac9cc39ce3a1bcc9ea88345d18f17a46cb2a (patch) | |
| tree | 97b0f4e6a38040e73412a0981c43c29b473abcd9 /Map | |
| parent | 8c74a32ef5aade1960b056950e52f2f3273db8c7 (diff) | |
Add QuickLook plugin
Diffstat (limited to 'Map')
| -rw-r--r-- | Map/Business/Template.swift | 36 | ||||
| -rw-r--r-- | Map/Data/MapDocument.swift | 6 | ||||
| -rw-r--r-- | Map/Data/UTType+wmap.swift | 21 | ||||
| -rw-r--r-- | Map/Data/UserPreferencesJSON.swift | 0 | ||||
| -rw-r--r-- | Map/Localizable.xcstrings | 22 | ||||
| -rw-r--r-- | Map/Presentation/Preferences/TemplatesPreferencesView.swift | 21 |
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 |