diff --git a/Shared/AppDefaults.swift b/Shared/AppDefaults.swift index b45d7341..bec8b86e 100644 --- a/Shared/AppDefaults.swift +++ b/Shared/AppDefaults.swift @@ -15,11 +15,11 @@ enum DefaultsSize: Int, CustomStringConvertible, CaseIterable { var description: String { switch self { case .small: - return NSLocalizedString("Small", comment: "Small") + return AppStringAssets.smallControlLabel case .medium: - return NSLocalizedString("Medium", comment: "Medium") + return AppStringAssets.mediumControlLabel case .large: - return NSLocalizedString("Large", comment: "Large") + return AppStringAssets.largeControlLabel } } } diff --git a/Shared/AppStringAssets.swift b/Shared/AppStringAssets.swift index b79005bc..7a7afbfd 100644 --- a/Shared/AppStringAssets.swift +++ b/Shared/AppStringAssets.swift @@ -33,6 +33,8 @@ struct AppStringAssets { // MARK: Localizable Variables + static var aboutZavala = String(localized: "About Zavala", comment: "Control Label: About Zavala") + static var accountsControlLabel = String(localized: "Accounts", comment: "Control Label: Accounts") static var acknowledgementsControlLabel = String(localized: "Acknowledgements", comment: "Control Label: Acknowledgements") static var addControlLabel = String(localized: "Add", comment: "Control Label: Add") static var addNoteControlLabel = String(localized: "Add Note", comment: "Control Label: Add Note.") @@ -46,7 +48,7 @@ struct AppStringAssets { static var addTagControlLabel = String(localized: "Add Tag", comment: "Control Label: Add Tag.") static var addTopicLevelControlLabel = String(localized: "Add Topic Level", comment: "Control Label: The menu option to add a new Topic Level.") static var appearanceControlLabel = String(localized: "Appearance", comment: "Control Label: Appearance") - static var autoLinkingLabel = String(localized: "Automatically Change Link Titles", comment: "Control Label: Auto Linking") + static var autoLinkingControlLabel = String(localized: "Automatically Change Link Titles", comment: "Control Label: Auto Linking") static var backControlLabel = String(localized: "Back", comment: "Control Label: Back") static var backlinksLabel = String(localized: "Backlinks", comment: "Font Label: Backlinks") @@ -61,11 +63,13 @@ struct AppStringAssets { static var collapseAllInRowControlLabel = String(localized: "Collapse All in Row", comment: "Control Label: Collapse All in Row") static var collapseControlLabel = String(localized: "Collapse", comment: "Control Label: Collapse") static var collapseParentRowControlLabel = String(localized: "Collapse Parent Row", comment: "Control Label: Collapse Parent Row") + static var colorPalettControlLabel = String(localized: "Color Palette", comment: "Control Label: Color Palette") static var completeAccessibilityLabel = String(localized: "Complete", comment: "Accessibility Label: Complete") static var completeControlLabel = String(localized: "Complete", comment: "Control Label: Complete") static var copyControlLabel = String(localized: "Copy", comment: "Control Label: Copy") static var copyDocumentLinkControlLabel = String(localized: "Copy Document Link", comment: "Control Label: Copy Document Link") static var copyDocumentLinksControlLabel = String(localized: "Copy Document Links", comment: "Control Label: Copy Document Links") + static var createdControlLabel = String(localized: "Created", comment: "Control Label: Created") static var cutControlLabel = String(localized: "Cut", comment: "Control Label: Cut") static var deleteAlwaysControlLabel = String(localized: "Always Delete Without Asking", comment: "Control Label: Always Delete Without Asking") @@ -86,8 +90,11 @@ struct AppStringAssets { static var doneControlLabel = String(localized: "Done", comment: "Control Label: Done") static var duplicateControlLabel = String(localized: "Duplicate", comment: "Control Label: Duplicate") - static var enableOnMyIPhoneLabel = String(localized: "Enable On My iPhone", comment: "Label: Enable On My iPhone") - static var enableOnMyIPadLabel = String(localized: "Enable On My iPad", comment: "Label: Enable On My iPad") + static var emailControlLabel = String(localized: "Email", comment: "Control Label: Email") + static var enableCloudKitControlLabel = String(localized: "Enable iCloud", comment: "Control Label: Enable iCloud") + static var enableOnMyIPhoneControlLabel = String(localized: "Enable On My iPhone", comment: "Control Label: Enable On My iPhone") + static var enableOnMyIPadControlLabel = String(localized: "Enable On My iPad", comment: "Control Label: Enable On My iPad") + static var enableOnMyMacControlLabel = String(localized: "Enable On My Mac", comment: "Control Label: Enable On My Mac") static var errorAlertTitle = String(localized: "Error", comment: "Alert Title: Error") static var exportControlLabel = String(localized: "Export", comment: "Control Label: Export") static var exportMarkdownDocEllipsisControlLabel = String(localized: "Export Markdown Doc…", comment: "Control Label: Export Markdown Doc…") @@ -100,6 +107,7 @@ struct AppStringAssets { static var expandAllInRowControlLabel = String(localized: "Expand All in Row", comment: "Control Label: Expand All in Row") static var expandControlLabel = String(localized: "Expand", comment: "Control Label: Expand") + static var feedbackControlLabel = String(localized: "Provide Feedback", comment: "Control Label: Provide Feedback") static var filterControlLabel = String(localized: "Filter", comment: "Control Label: Filter") static var filterCompletedControlLabel = String(localized: "Filter Completed", comment: "Control Label: Filter Completed") static var filterNotesControlLabel = String(localized: "Filter Notes", comment: "Control Label: Filter Notes") @@ -107,6 +115,7 @@ struct AppStringAssets { static var findEllipsisControlLabel = String(localized: "Find…", comment: "Control Label: Find…") static var findNextControlLabel = String(localized: "Find Next", comment: "Control Label: Find Next") static var findPreviousControlLabel = String(localized: "Find Previous", comment: "Control Label: Find Previous") + static var fontsControlLabel = String(localized: "Fonts", comment: "Control Label: Fonts") static var formatControlLabel = String(localized: "Format", comment: "Control Label: Format") static var forwardControlLabel = String(localized: "Forward", comment: "Control Label: Forward") @@ -116,6 +125,7 @@ struct AppStringAssets { static var goBackwardControlLabel = String(localized: "Go Backward", comment: "Control Label: Go Backward") static var goForwardControlLabel = String(localized: "Go Forward", comment: "Control Label: Go Forward") + static var helpControlLabel = String(localized: "Zavala Help", comment: "Control Label: Zavala Help") static var hideKeyboardControlLabel = String(localized: "Hide Keyboard", comment: "Control Label: Hide Keyboard") static var historyControlLabel = String(localized: "History", comment: "Control Label: History") @@ -127,9 +137,11 @@ struct AppStringAssets { static var insertImageEllipsisControlLabel = String(localized: "Insert Image…", comment: "Control Label: Insert Image…") static var italicControlLabel = String(localized: "Italic", comment: "Control Label: Italic") + static var largeControlLabel = String(localized: "Large", comment: "Control Label: Large") static var linkControlLabel = String(localized: "Link", comment: "Control Label: Link") static var linkEllipsisControlLabel = String(localized: "Link…", comment: "Control Label: Link…") + static var mediumControlLabel = String(localized: "Medium", comment: "Control Label: Medium") static var moreControlLabel = String(localized: "More", comment: "Control Label: More") static var moveControlLabel = String(localized: "Move", comment: "Control Label: Move") static var moveRightControlLabel = String(localized: "Move Right", comment: "Control Label: Move Right") @@ -138,6 +150,7 @@ struct AppStringAssets { static var moveDownControlLabel = String(localized: "Move Down", comment: "Control Label: Move Down") static var multipleSelectionsLabel = String(localized: "Multiple Selections", comment: "Large Label: Multiple Selections") + static var nameControlLabel = String(localized: "Name", comment: "Control Label: Name") static var navigationControlLabel = String(localized: "Navigation", comment: "Control Label: Navigation") static var newMainWindowControlLabel = String(localized: "New Main Window", comment: "Control Label: New Main Window") static var newOutlineControlLabel = String(localized: "New New Outline", comment: "Control Label: New New Outline") @@ -149,8 +162,11 @@ struct AppStringAssets { static var openQuicklySearchPlaceholder = String(localized: "Open Quickly", comment: "Search Field Placeholder: Open Quickly") static var openQuicklyWindowTitle = String(localized: "Open Quickly", comment: "Window Title: Open Quickly") static var outlineControlLabel = String(localized: "Outline", comment: "Control Label: Outline") + static var outlineOwnerControlLabel = String(localized: "Outline Owner", comment: "Control Label: Outline Owner") + static var outlineDefaultsControlLabel = String(localized: "Outline Defaults", comment: "Control Label: Outline Defaults") static var opmlOwnerFieldNote = String(localized: "This information is included in OPML documents to attribute ownership.", comment: "Note: OPML Ownership.") - + static var ownerControlLabel = String(localized: "Owner", comment: "Control Label: Owner") + static var pasteControlLabel = String(localized: "Paste", comment: "Control Label: Paste") static var preferencesEllipsisControlLabel = String(localized: "Preferences…", comment: "Control Label: Preferences…") static var previousResultControlLabel = String(localized: "Previous Result", comment: "Control Label: Previous Result") @@ -176,13 +192,18 @@ struct AppStringAssets { static var restoreDefaultsMessage = String(localized: "Restore Defaults", comment: "Alert: message for restoring font defaults") static var restoreDefaultsInformative = String(localized: "Are you sure you want to restore the defaults? All your font customizations will be lost.", comment: "Alert: information for restoring font defaults") - + static var rowIndentControlLabel = String(localized: "Row Indent", comment: "Control Label: Row Indent") + static var rowSpacingControlLabel = String(localized: "Row Spacing", comment: "Control Label: Row Spacing") + static var searchPlaceholder = String(localized: "Search", comment: "Field Placeholder: Search") static var selectControlLabel = String(localized: "Select", comment: "Control Label: Select") + static var settingsControlLabel = String(localized: "Settings", comment: "Control Label: Settings") static var settingsEllipsisControlLabel = String(localized: "Settings…", comment: "Control Label: Settings…") static var shareControlLabel = String(localized: "Share", comment: "Control Label: Share") static var shareEllipsisControlLabel = String(localized: "Share…", comment: "Control Label: Share…") + static var smallControlLabel = String(localized: "Small", comment: "Control Label: Small") static var splitRowControlLabel = String(localized: "Split Row", comment: "Control Label: Split Row") + static var statisticsControlLabel = String(localized: "Statistics", comment: "Control Label: Statistics") static var syncControlLabel = String(localized: "Sync", comment: "Control Label: Sync") static var tagsLabel = String(localized: "Tags", comment: "Font Label: Tags") @@ -193,10 +214,12 @@ struct AppStringAssets { static var turnFilterOnControlLabel = String(localized: "Turn Filter On", comment: "Control Label: Turn Filter On") static var typingControlLabel = String(localized: "Typing", comment: "Control Label: Typing") - static var useSelectionForFindControlLabel = String(localized: "Use Selection For Find", comment: "Control Label: Use Selection For Find") static var uncompleteControlLabel = String(localized: "Uncomplete", comment: "Control Label: Uncomplete") static var undoControlLabel = String(localized: "Undo", comment: "Control Label: Undo") static var undoMenuControlLabel = String(localized: "Undo Menu", comment: "Control Label: Undo Menu") + static var updatedControlLabel = String(localized: "Updated", comment: "Control Label: Updated") + static var urlControlLabel = String(localized: "URL", comment: "Control Label: URL") + static var useSelectionForFindControlLabel = String(localized: "Use Selection For Find", comment: "Control Label: Use Selection For Find") static var websiteControlLabel = String(localized: "Website", comment: "Control Label: Website") diff --git a/Zavala.xcodeproj/project.pbxproj b/Zavala.xcodeproj/project.pbxproj index 55e2b5dd..c19ae201 100644 --- a/Zavala.xcodeproj/project.pbxproj +++ b/Zavala.xcodeproj/project.pbxproj @@ -92,8 +92,6 @@ 517AF6A025E08A6B0044DBAB /* Settings.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 517AF69F25E08A6B0044DBAB /* Settings.storyboard */; }; 517AF6A425E08B7F0044DBAB /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517AF6A325E08B7F0044DBAB /* SettingsViewController.swift */; }; 517AF6A725E08CB80044DBAB /* NonIntrinsicLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517AF6A625E08CB80044DBAB /* NonIntrinsicLabel.swift */; }; - 517B41D32B26738C001EC361 /* RowIndentTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517B41D22B26738C001EC361 /* RowIndentTableViewController.swift */; }; - 517B41D52B267424001EC361 /* RowSpacingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 517B41D42B267424001EC361 /* RowSpacingTableViewController.swift */; }; 5181A9382554D92000C153E8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5181A9372554D92000C153E8 /* AppDelegate.swift */; }; 5181A93A2554D92000C153E8 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5181A9392554D92000C153E8 /* SceneDelegate.swift */; }; 5181A93C2554D92000C153E8 /* CollectionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5181A93B2554D92000C153E8 /* CollectionsViewController.swift */; }; @@ -163,7 +161,6 @@ 51DEE80C26FB4488006DAA56 /* UserInterfaceColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51DEE80B26FB4488006DAA56 /* UserInterfaceColorPalette.swift */; }; 51DEE80D26FB4488006DAA56 /* UserInterfaceColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51DEE80B26FB4488006DAA56 /* UserInterfaceColorPalette.swift */; }; 51DEE80E26FB4550006DAA56 /* UserInterfaceColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51DEE80B26FB4488006DAA56 /* UserInterfaceColorPalette.swift */; }; - 51DEE81026FB8D89006DAA56 /* ColorPaletteTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51DEE80F26FB8D89006DAA56 /* ColorPaletteTableViewController.swift */; }; 51DEE82226FE37F9006DAA56 /* UIPrintPageRenderer+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51DEE82126FE37F9006DAA56 /* UIPrintPageRenderer+.swift */; }; 51DEE82826FF951E006DAA56 /* UIWindowSceneDelegate+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51DEE82726FF951E006DAA56 /* UIWindowSceneDelegate+.swift */; }; 51DFDC18259EA8D300C068C6 /* Selector+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51DFDC17259EA8D300C068C6 /* Selector+.swift */; }; @@ -187,6 +184,13 @@ 51F2859B25AD12800019C573 /* CollectionsSearchContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F2859A25AD12800019C573 /* CollectionsSearchContentView.swift */; }; 51F2DC7B2586E101003BD5CE /* EditorRowNoteTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F2DC7A2586E101003BD5CE /* EditorRowNoteTextView.swift */; }; 51F83B862725BFF30015FC06 /* ReloadVisibleItemsOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F83B852725BFF30015FC06 /* ReloadVisibleItemsOperation.swift */; }; + 51FA273A2B3B6493008B665E /* AccountsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FA27392B3B6493008B665E /* AccountsView.swift */; }; + 51FA273C2B3B68DE008B665E /* OutlineOwnerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FA273B2B3B68DE008B665E /* OutlineOwnerView.swift */; }; + 51FA273E2B3B6A12008B665E /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FA273D2B3B6A12008B665E /* SettingsView.swift */; }; + 51FA27402B3B718B008B665E /* OutlineDefaultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FA273F2B3B718B008B665E /* OutlineDefaultsView.swift */; }; + 51FA27422B3B748C008B665E /* AppearanceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FA27412B3B748C008B665E /* AppearanceView.swift */; }; + 51FA27442B3B8F2B008B665E /* FontsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FA27432B3B8F2B008B665E /* FontsView.swift */; }; + 51FA27462B3B9337008B665E /* HelpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FA27452B3B9337008B665E /* HelpView.swift */; }; 51FF2A6B2732B97800208A75 /* ValidatingMenuToolbarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FF2A6A2732B97800208A75 /* ValidatingMenuToolbarItem.swift */; }; /* End PBXBuildFile section */ @@ -330,8 +334,6 @@ 517AF69F25E08A6B0044DBAB /* Settings.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Settings.storyboard; sourceTree = ""; }; 517AF6A325E08B7F0044DBAB /* SettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = ""; }; 517AF6A625E08CB80044DBAB /* NonIntrinsicLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NonIntrinsicLabel.swift; sourceTree = ""; }; - 517B41D22B26738C001EC361 /* RowIndentTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RowIndentTableViewController.swift; sourceTree = ""; }; - 517B41D42B267424001EC361 /* RowSpacingTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RowSpacingTableViewController.swift; sourceTree = ""; }; 5181A9342554D92000C153E8 /* Zavala.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Zavala.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5181A9372554D92000C153E8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 5181A9392554D92000C153E8 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -405,7 +407,6 @@ 51DB0DCA2748101B008312EC /* EditorCollectionViewCompositionalLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorCollectionViewCompositionalLayout.swift; sourceTree = ""; }; 51DB0DCC27496CBE008312EC /* EditorTagInputPill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorTagInputPill.swift; sourceTree = ""; }; 51DEE80B26FB4488006DAA56 /* UserInterfaceColorPalette.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserInterfaceColorPalette.swift; sourceTree = ""; }; - 51DEE80F26FB8D89006DAA56 /* ColorPaletteTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorPaletteTableViewController.swift; sourceTree = ""; }; 51DEE82126FE37F9006DAA56 /* UIPrintPageRenderer+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIPrintPageRenderer+.swift"; sourceTree = ""; }; 51DEE82726FF951E006DAA56 /* UIWindowSceneDelegate+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIWindowSceneDelegate+.swift"; sourceTree = ""; }; 51DFDC17259EA8D300C068C6 /* Selector+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Selector+.swift"; sourceTree = ""; }; @@ -431,6 +432,13 @@ 51F2859A25AD12800019C573 /* CollectionsSearchContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionsSearchContentView.swift; sourceTree = ""; }; 51F2DC7A2586E101003BD5CE /* EditorRowNoteTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorRowNoteTextView.swift; sourceTree = ""; }; 51F83B852725BFF30015FC06 /* ReloadVisibleItemsOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReloadVisibleItemsOperation.swift; sourceTree = ""; }; + 51FA27392B3B6493008B665E /* AccountsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountsView.swift; sourceTree = ""; }; + 51FA273B2B3B68DE008B665E /* OutlineOwnerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutlineOwnerView.swift; sourceTree = ""; }; + 51FA273D2B3B6A12008B665E /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; + 51FA273F2B3B718B008B665E /* OutlineDefaultsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutlineDefaultsView.swift; sourceTree = ""; }; + 51FA27412B3B748C008B665E /* AppearanceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceView.swift; sourceTree = ""; }; + 51FA27432B3B8F2B008B665E /* FontsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontsView.swift; sourceTree = ""; }; + 51FA27452B3B9337008B665E /* HelpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpView.swift; sourceTree = ""; }; 51FF2A6A2732B97800208A75 /* ValidatingMenuToolbarItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidatingMenuToolbarItem.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -619,9 +627,13 @@ 517AF69E25E08A350044DBAB /* Settings */ = { isa = PBXGroup; children = ( - 51DEE80F26FB8D89006DAA56 /* ColorPaletteTableViewController.swift */, - 517B41D22B26738C001EC361 /* RowIndentTableViewController.swift */, - 517B41D42B267424001EC361 /* RowSpacingTableViewController.swift */, + 51FA273D2B3B6A12008B665E /* SettingsView.swift */, + 51FA27392B3B6493008B665E /* AccountsView.swift */, + 51FA273F2B3B718B008B665E /* OutlineDefaultsView.swift */, + 51FA273B2B3B68DE008B665E /* OutlineOwnerView.swift */, + 51FA27412B3B748C008B665E /* AppearanceView.swift */, + 51FA27432B3B8F2B008B665E /* FontsView.swift */, + 51FA27452B3B9337008B665E /* HelpView.swift */, 517AF69F25E08A6B0044DBAB /* Settings.storyboard */, 5113B094260E638400DBD11B /* SettingsFontConfigViewController.swift */, 5113B091260E45B400DBD11B /* SettingsFontViewController.swift */, @@ -1124,17 +1136,20 @@ 517AF6A725E08CB80044DBAB /* NonIntrinsicLabel.swift in Sources */, 5116894029BD72DE00318832 /* AttributedLabelView.swift in Sources */, 5147D0AD25CB6F2D004673C3 /* KeyboardTableView.swift in Sources */, + 51FA27422B3B748C008B665E /* AppearanceView.swift in Sources */, 5147D0B825CCAB2A004673C3 /* DocumentsViewController+Drop.swift in Sources */, 51C030AC257E0A7200609262 /* ReloadItemsOperation.swift in Sources */, 514F222A25C4FF02004E02CD /* EditorTagInputTextField.swift in Sources */, 5147D0B525CB95B4004673C3 /* DocumentsViewController+Drag.swift in Sources */, 51077C5227A752DF000C71DB /* UIFont+.swift in Sources */, + 51FA273A2B3B6493008B665E /* AccountsView.swift in Sources */, 51D977FA257A2E4F00D98490 /* EditorRowPreviewParameters.swift in Sources */, 5191850927137DFD00B7E177 /* GetCurrentTagsIntentHandler.swift in Sources */, 517AF69C25E0862E0044DBAB /* AppDefaults.swift in Sources */, 51FF2A6B2732B97800208A75 /* ValidatingMenuToolbarItem.swift in Sources */, 517A9E1B2602ACE000EF346A /* OutlineEditorSceneDelegate.swift in Sources */, 51F2859B25AD12800019C573 /* CollectionsSearchContentView.swift in Sources */, + 51FA27462B3B9337008B665E /* HelpView.swift in Sources */, 51C030B8257E198B00609262 /* EditorTitleTextView.swift in Sources */, 51F13EFE255E13A9004B85CA /* ZavalaImageAssets.swift in Sources */, 510471BD2719AEFA001DEFD5 /* RemoveRowsIntentHandler.swift in Sources */, @@ -1151,7 +1166,6 @@ 51F2DC7B2586E101003BD5CE /* EditorRowNoteTextView.swift in Sources */, 514F221425C4CD00004E02CD /* EditorTagContentView.swift in Sources */, 51C568D9258C1CD200AA7B93 /* MacLinkViewController.swift in Sources */, - 517B41D52B267424001EC361 /* RowSpacingTableViewController.swift in Sources */, 51C568CE258B028700AA7B93 /* OutlineTextDropDelegate.swift in Sources */, 51DB0DCD27496CBE008312EC /* EditorTagInputPill.swift in Sources */, 51C4C449255AA215004E0206 /* MainSplitViewController.swift in Sources */, @@ -1159,7 +1173,6 @@ 5169928A25AE4F5C00760C9D /* UICollectionView+.swift in Sources */, 5116894729BDA60E00318832 /* AboutViewController.swift in Sources */, 51B9D51725A9080A00579D19 /* EditorDisclosureButton.swift in Sources */, - 517B41D32B26738C001EC361 /* RowIndentTableViewController.swift in Sources */, 51C71C6D273F087000F6C779 /* ImageScrollView.swift in Sources */, 514F221825C4D076004E02CD /* EditorTagInputViewCell.swift in Sources */, 511B2AC826028EE800C04239 /* MainCoordinator.swift in Sources */, @@ -1189,6 +1202,7 @@ 5116894529BDA0E500318832 /* AboutSceneDelegate.swift in Sources */, 511B29FD2601901C00C04239 /* EditorBacklinkViewCell.swift in Sources */, 51B2B2CE2563AAF60090C56B /* EditorRowContentConfiguration.swift in Sources */, + 51FA273C2B3B68DE008B665E /* OutlineOwnerView.swift in Sources */, 51C030BE257E1B9400609262 /* EditorRowTextView.swift in Sources */, 51F83B862725BFF30015FC06 /* ReloadVisibleItemsOperation.swift in Sources */, 514F221B25C4D08D004E02CD /* EditorTagInputContentConfiguration.swift in Sources */, @@ -1207,7 +1221,6 @@ 5113B092260E45B400DBD11B /* SettingsFontViewController.swift in Sources */, 51922212271E4AE9000CDC1F /* CopyRowsIntentHandler.swift in Sources */, 51341E06272B564A0005425B /* MetadataView.swift in Sources */, - 51DEE81026FB8D89006DAA56 /* ColorPaletteTableViewController.swift in Sources */, 5113B095260E638400DBD11B /* SettingsFontConfigViewController.swift in Sources */, 512229682563507E008041AF /* EditorRowViewCell.swift in Sources */, 51C71C6F273F088D00F6C779 /* ImageViewController.swift in Sources */, @@ -1217,6 +1230,7 @@ 519184F327107FDA00B7E177 /* UITextView+.swift in Sources */, 51E14F23255F2D7F00320EDB /* ActivityManager.swift in Sources */, 5181A93A2554D92000C153E8 /* SceneDelegate.swift in Sources */, + 51FA273E2B3B6A12008B665E /* SettingsView.swift in Sources */, 51DEE80C26FB4488006DAA56 /* UserInterfaceColorPalette.swift in Sources */, 519185072713453700B7E177 /* MacRenameTagViewController.swift in Sources */, 519184F52710F93700B7E177 /* ImportIntentHandler.swift in Sources */, @@ -1224,6 +1238,7 @@ 51C030A6257E084E00609262 /* EditorTitleContentView.swift in Sources */, 519897C42ADE13F3008A6FA4 /* ButtonGroup.swift in Sources */, 51E5C49127221F6F00A38983 /* IntentRow+.swift in Sources */, + 51FA27402B3B718B008B665E /* OutlineDefaultsView.swift in Sources */, 5109BC52293445EB0022E90B /* DocumentsActivityItemsConfiguration.swift in Sources */, 51C71C74273F264600F6C779 /* ImageSceneDelegate.swift in Sources */, 511A99F727B9B596001BD443 /* ToolbarButton.swift in Sources */, @@ -1256,6 +1271,7 @@ 519184EE270FAFE100B7E177 /* GetImagesForOutlineIntentHandler.swift in Sources */, 51C4C45B255ACA1B004E0206 /* EditorViewController.swift in Sources */, 514F220D25C4CCA7004E02CD /* EditorTagViewCell.swift in Sources */, + 51FA27442B3B8F2B008B665E /* FontsView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Zavala/Dialogs/GetInfoView.swift b/Zavala/Dialogs/GetInfoView.swift index 80e50bb9..1a96c1d6 100644 --- a/Zavala/Dialogs/GetInfoView.swift +++ b/Zavala/Dialogs/GetInfoView.swift @@ -20,40 +20,41 @@ struct GetInfoView: View { .font(.title) #endif Form { - Section(header: Text("Settings")) { + Section(AppStringAssets.settingsControlLabel) { Toggle(isOn: $getInfoViewModel.autoLinkingEnabled) { - Text(AppStringAssets.autoLinkingLabel) + Text(AppStringAssets.autoLinkingControlLabel) } } - Section(header: Text("Owner")) { + Section(AppStringAssets.ownerControlLabel) { TextField(text: $getInfoViewModel.ownerName) { - Text("Name") + Text(AppStringAssets.nameControlLabel) } TextField(text: $getInfoViewModel.ownerEmail) { - Text("Email") + Text(AppStringAssets.emailControlLabel) } TextField(text: $getInfoViewModel.ownerURL) { - Text("URL") + Text(AppStringAssets.urlControlLabel) } Text(AppStringAssets.opmlOwnerFieldNote) .font(.footnote) .foregroundStyle(.secondary) } - Section(header: Text("Statistics")) { + Section(AppStringAssets.statisticsControlLabel) { HStack { - Text("Created") + Text(AppStringAssets.createdControlLabel) Spacer() Text(getInfoViewModel.createdLabel) .foregroundStyle(.secondary) } HStack { - Text("Updated") + Text(AppStringAssets.updatedControlLabel) Spacer() Text(getInfoViewModel.updatedLabel) .foregroundStyle(.secondary) } } } + .formStyle(.grouped) } } diff --git a/Zavala/MainCoordinator.swift b/Zavala/MainCoordinator.swift index b339159f..5e1e6c8c 100644 --- a/Zavala/MainCoordinator.swift +++ b/Zavala/MainCoordinator.swift @@ -6,6 +6,7 @@ // import UIKit +import SwiftUI import VinOutlineKit import SafariServices @@ -298,9 +299,9 @@ extension MainCoordinator { } func showSettings() { - let settingsNavController = UIStoryboard.settings.instantiateInitialViewController() as! UINavigationController - settingsNavController.modalPresentationStyle = .formSheet - present(settingsNavController, animated: true) + let settingsViewController = UIHostingController(rootView: SettingsView()) + settingsViewController.modalPresentationStyle = .formSheet + present(settingsViewController, animated: true) } func showGetInfo() { diff --git a/Zavala/Settings/AccountsView.swift b/Zavala/Settings/AccountsView.swift new file mode 100644 index 00000000..7a4da228 --- /dev/null +++ b/Zavala/Settings/AccountsView.swift @@ -0,0 +1,59 @@ +// +// AccountsView.swift +// Zavala +// +// Created by Maurice Parker on 12/26/23. +// + +import SwiftUI +import UIKit + +struct AccountsView: View { + + @State var enableLocalAccount = AppDefaults.shared.enableLocalAccount + @State var enableCloudKit = AppDefaults.shared.enableCloudKit + @State var cloudKitAlertIsPresenting = false + + var body: some View { + Section(AppStringAssets.accountsControlLabel) { + Toggle(isOn: $enableLocalAccount) { + switch UIDevice.current.userInterfaceIdiom { + case .phone: + Text(AppStringAssets.enableOnMyIPhoneControlLabel) + case .pad: + Text(AppStringAssets.enableOnMyIPadControlLabel) + default: + Text(AppStringAssets.enableOnMyMacControlLabel) + } + } + .onChange(of: enableLocalAccount) { + AppDefaults.shared.enableLocalAccount = $0 + } + Toggle(isOn: $enableCloudKit) { + Text(AppStringAssets.enableCloudKitControlLabel) + } + .onChange(of: enableCloudKit) { + if $0 { + AppDefaults.shared.enableCloudKit = true + } else { + cloudKitAlertIsPresenting = true + } + } + } + .alert(AppStringAssets.removeICloudAccountTitle, isPresented: $cloudKitAlertIsPresenting) { + Button(AppStringAssets.cancelControlLabel, role: .cancel) { + enableCloudKit = true + } + Button(AppStringAssets.removeControlLabel, role: .destructive) { + AppDefaults.shared.enableCloudKit = false + } + } message: { + Text(AppStringAssets.removeICloudAccountMessage) + } + + } +} + +#Preview { + AccountsView() +} diff --git a/Zavala/Settings/AppearanceView.swift b/Zavala/Settings/AppearanceView.swift new file mode 100644 index 00000000..d2787272 --- /dev/null +++ b/Zavala/Settings/AppearanceView.swift @@ -0,0 +1,66 @@ +// +// AppearanceView.swift +// Zavala +// +// Created by Maurice Parker on 12/26/23. +// + +import UIKit +import SwiftUI + +struct AppearanceView: View { + + @State var rowIndent = AppDefaults.shared.rowIndentSize + @State var rowSpacing = AppDefaults.shared.rowSpacingSize + @State var colorPalette = AppDefaults.shared.userInterfaceColorPalette + + var body: some View { + Section(AppStringAssets.appearanceControlLabel) { + Picker(selection: $rowIndent) { + ForEach(DefaultsSize.allCases, id: \.self) { + Text($0.description) + } + } label: { + Text(AppStringAssets.rowIndentControlLabel) + } + .pickerStyle(.menu) + .onChange(of: rowIndent) { + AppDefaults.shared.rowIndentSize = $0 + } + + Picker(selection: $rowSpacing) { + ForEach(DefaultsSize.allCases, id: \.self) { + Text($0.description) + } + } label: { + Text(AppStringAssets.rowSpacingControlLabel) + } + .pickerStyle(.menu) + .onChange(of: rowSpacing) { + AppDefaults.shared.rowSpacingSize = $0 + } + + Picker(selection: $colorPalette) { + ForEach(UserInterfaceColorPalette.allCases, id: \.self) { + Text($0.description) + } + } label: { + Text(AppStringAssets.colorPalettControlLabel) + } + .pickerStyle(.menu) + .onChange(of: colorPalette) { + AppDefaults.shared.userInterfaceColorPalette = $0 + } + + if UIDevice.current.userInterfaceIdiom != .mac { + NavigationLink(AppStringAssets.fontsControlLabel) { + FontsView() + } + } + } + } +} + +#Preview { + AppearanceView() +} diff --git a/Zavala/Settings/FontsView.swift b/Zavala/Settings/FontsView.swift new file mode 100644 index 00000000..355e38c4 --- /dev/null +++ b/Zavala/Settings/FontsView.swift @@ -0,0 +1,23 @@ +// +// FontsView.swift +// Zavala +// +// Created by Maurice Parker on 12/26/23. +// + +import SwiftUI + +struct FontsView: UIViewControllerRepresentable { + + func makeUIViewController(context: Context) -> SettingsFontViewController { + return UIStoryboard.settings.instantiateInitialViewController() as! SettingsFontViewController + } + + func updateUIViewController(_ uiViewController: SettingsFontViewController, context: Context) { + + } +} + +#Preview { + FontsView() +} diff --git a/Zavala/Settings/HelpView.swift b/Zavala/Settings/HelpView.swift new file mode 100644 index 00000000..d37deb99 --- /dev/null +++ b/Zavala/Settings/HelpView.swift @@ -0,0 +1,47 @@ +// +// HelpView.swift +// Zavala +// +// Created by Maurice Parker on 12/26/23. +// + +import SwiftUI + +struct HelpView: View { + + @Environment(\.openURL) private var openURL + @State var isPresentingAbout = false + + var body: some View { + Section() { + Button { + isPresentingAbout = true + } label: { + Text(AppStringAssets.aboutZavala) + } + .foregroundStyle(.primary) + .sheet(isPresented: $isPresentingAbout) { + AboutView() + } + + Button { + openURL(URL(string: AppStringAssets.helpURL)!) + } label: { + Text(AppStringAssets.helpControlLabel) + } + .foregroundStyle(.primary) + + Button { + openURL(URL(string: AppStringAssets.reportAnIssueURL)!) + } label: { + Text(AppStringAssets.feedbackControlLabel) + } + .foregroundStyle(.primary) + + } + } +} + +#Preview { + HelpView() +} diff --git a/Zavala/Settings/OutlineDefaultsView.swift b/Zavala/Settings/OutlineDefaultsView.swift new file mode 100644 index 00000000..8e168900 --- /dev/null +++ b/Zavala/Settings/OutlineDefaultsView.swift @@ -0,0 +1,29 @@ +// +// OutlineDefaultsView.swift +// Zavala +// +// Created by Maurice Parker on 12/26/23. +// + +import SwiftUI + +struct OutlineDefaultsView: View { + + @State var autoLinking = AppDefaults.shared.autoLinkingEnabled + + var body: some View { + Section(AppStringAssets.outlineDefaultsControlLabel) { + Toggle(isOn: $autoLinking) { + Text(AppStringAssets.autoLinkingControlLabel) + } + .onChange(of: autoLinking) { + AppDefaults.shared.autoLinkingEnabled = $0 + } + } + } + +} + +#Preview { + OutlineDefaultsView() +} diff --git a/Zavala/Settings/OutlineOwnerView.swift b/Zavala/Settings/OutlineOwnerView.swift new file mode 100644 index 00000000..33a2d606 --- /dev/null +++ b/Zavala/Settings/OutlineOwnerView.swift @@ -0,0 +1,44 @@ +// +// OutlineOwnerView.swift +// Zavala +// +// Created by Maurice Parker on 12/26/23. +// + +import SwiftUI + +struct OutlineOwnerView: View { + + @State var name = AppDefaults.shared.ownerName ?? "" + @State var email = AppDefaults.shared.ownerEmail ?? "" + @State var url = AppDefaults.shared.ownerURL ?? "" + + var body: some View { + Section(AppStringAssets.outlineOwnerControlLabel) { + TextField(text: $name) { + Text(AppStringAssets.nameControlLabel) + .onChange(of: name) { + AppDefaults.shared.ownerName = $0 + } + } + TextField(text: $email) { + Text(AppStringAssets.emailControlLabel) + .onChange(of: email) { + AppDefaults.shared.ownerEmail = $0 + } + } + TextField(text: $url) { + Text(AppStringAssets.urlControlLabel) + .onChange(of: url) { + AppDefaults.shared.ownerURL = $0 + } + } + Text(AppStringAssets.opmlOwnerFieldNote) + .font(.footnote) + .foregroundStyle(.secondary) + } } +} + +#Preview { + OutlineOwnerView() +} diff --git a/Zavala/Settings/Settings.storyboard b/Zavala/Settings/Settings.storyboard index 7b487e60..9642abfb 100644 --- a/Zavala/Settings/Settings.storyboard +++ b/Zavala/Settings/Settings.storyboard @@ -1,331 +1,28 @@ - + - - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - + - - + + - + @@ -476,148 +173,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Zavala/Settings/SettingsView.swift b/Zavala/Settings/SettingsView.swift new file mode 100644 index 00000000..251bd420 --- /dev/null +++ b/Zavala/Settings/SettingsView.swift @@ -0,0 +1,36 @@ +// +// SettingsView.swift +// Zavala +// +// Created by Maurice Parker on 12/26/23. +// + +import SwiftUI + +struct SettingsView: View { + + @Environment(\.dismiss) var dismiss + + var body: some View { + NavigationStack { + Form { + AccountsView() + OutlineDefaultsView() + OutlineOwnerView() + AppearanceView() + HelpView() + } + .navigationTitle(AppStringAssets.settingsControlLabel) + .navigationBarTitleDisplayMode(.inline) + .toolbar { + Button(AppStringAssets.doneControlLabel) { + dismiss() + } + } + } + } +} + +#Preview { + SettingsView() +} diff --git a/Zavala/Settings/SettingsViewController.swift b/Zavala/Settings/SettingsViewController.swift index faeeda54..f0bc67be 100644 --- a/Zavala/Settings/SettingsViewController.swift +++ b/Zavala/Settings/SettingsViewController.swift @@ -71,9 +71,9 @@ class SettingsViewController: UITableViewController { switch (indexPath.section, indexPath.row) { case (0, 0): if traitCollection.userInterfaceIdiom == .phone { - cell.textLabel?.text = AppStringAssets.enableOnMyIPhoneLabel + cell.textLabel?.text = AppStringAssets.enableOnMyIPhoneControlLabel } else { - cell.textLabel?.text = AppStringAssets.enableOnMyIPadLabel + cell.textLabel?.text = AppStringAssets.enableOnMyIPadControlLabel } case (2, 0): cell.detailTextLabel?.text = AppDefaults.shared.rowIndentSize.description