Rename MarkArticlesReadAlertController to UndoAvailableAlertController to better reflect its new purpose

This commit is contained in:
Maurice Parker 2019-10-10 15:13:20 -05:00
parent f57d3f7df8
commit 8656753423
6 changed files with 31 additions and 23 deletions

View File

@ -407,7 +407,7 @@
FF3ABF13232599810074C542 /* ArticleSorterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF09232599450074C542 /* ArticleSorterTests.swift */; }; FF3ABF13232599810074C542 /* ArticleSorterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF09232599450074C542 /* ArticleSorterTests.swift */; };
FF3ABF1523259DDB0074C542 /* ArticleSorter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */; }; FF3ABF1523259DDB0074C542 /* ArticleSorter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */; };
FF3ABF162325AF5D0074C542 /* ArticleSorter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */; }; FF3ABF162325AF5D0074C542 /* ArticleSorter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */; };
FFD43E412340F488009E5CA3 /* MarkArticlesReadAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD43E372340F320009E5CA3 /* MarkArticlesReadAlertController.swift */; }; FFD43E412340F488009E5CA3 /* UndoAvailableAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD43E372340F320009E5CA3 /* UndoAvailableAlertController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -1041,7 +1041,7 @@
DF999FF622B5AEFA0064B687 /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = "<group>"; }; DF999FF622B5AEFA0064B687 /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = "<group>"; };
FF3ABF09232599450074C542 /* ArticleSorterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorterTests.swift; sourceTree = "<group>"; }; FF3ABF09232599450074C542 /* ArticleSorterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorterTests.swift; sourceTree = "<group>"; };
FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorter.swift; sourceTree = "<group>"; }; FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorter.swift; sourceTree = "<group>"; };
FFD43E372340F320009E5CA3 /* MarkArticlesReadAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkArticlesReadAlertController.swift; sourceTree = "<group>"; }; FFD43E372340F320009E5CA3 /* UndoAvailableAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UndoAvailableAlertController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -1289,7 +1289,7 @@
51C4525D226508F600C03939 /* MasterFeed */ = { 51C4525D226508F600C03939 /* MasterFeed */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
FFD43E372340F320009E5CA3 /* MarkArticlesReadAlertController.swift */, FFD43E372340F320009E5CA3 /* UndoAvailableAlertController.swift */,
51C45264226508F600C03939 /* MasterFeedViewController.swift */, 51C45264226508F600C03939 /* MasterFeedViewController.swift */,
51CC9B3D231720B2000E842F /* MasterFeedDataSource.swift */, 51CC9B3D231720B2000E842F /* MasterFeedDataSource.swift */,
51C45260226508F600C03939 /* Cell */, 51C45260226508F600C03939 /* Cell */,
@ -2215,11 +2215,17 @@
TargetAttributes = { TargetAttributes = {
513C5CE5232571C2003D4054 = { 513C5CE5232571C2003D4054 = {
CreatedOnToolsVersion = 11.0; CreatedOnToolsVersion = 11.0;
DevelopmentTeam = SHJK2V3AJG;
ProvisioningStyle = Automatic;
}; };
6581C73220CED60000F4AD34 = { 6581C73220CED60000F4AD34 = {
DevelopmentTeam = SHJK2V3AJG;
ProvisioningStyle = Automatic;
}; };
840D617B2029031C009BC708 = { 840D617B2029031C009BC708 = {
CreatedOnToolsVersion = 9.3; CreatedOnToolsVersion = 9.3;
DevelopmentTeam = SHJK2V3AJG;
ProvisioningStyle = Automatic;
SystemCapabilities = { SystemCapabilities = {
com.apple.BackgroundModes = { com.apple.BackgroundModes = {
enabled = 1; enabled = 1;
@ -2228,6 +2234,8 @@
}; };
849C645F1ED37A5D003D8FC0 = { 849C645F1ED37A5D003D8FC0 = {
CreatedOnToolsVersion = 8.2.1; CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = SHJK2V3AJG;
ProvisioningStyle = Automatic;
SystemCapabilities = { SystemCapabilities = {
com.apple.HardenedRuntime = { com.apple.HardenedRuntime = {
enabled = 1; enabled = 1;
@ -2236,7 +2244,7 @@
}; };
849C64701ED37A5D003D8FC0 = { 849C64701ED37A5D003D8FC0 = {
CreatedOnToolsVersion = 8.2.1; CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 9C84TZ7Q6Z; DevelopmentTeam = SHJK2V3AJG;
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
TestTargetID = 849C645F1ED37A5D003D8FC0; TestTargetID = 849C645F1ED37A5D003D8FC0;
}; };
@ -2819,7 +2827,7 @@
51C4529F22650A1900C03939 /* AuthorAvatarDownloader.swift in Sources */, 51C4529F22650A1900C03939 /* AuthorAvatarDownloader.swift in Sources */,
519E743D22C663F900A78E47 /* SceneDelegate.swift in Sources */, 519E743D22C663F900A78E47 /* SceneDelegate.swift in Sources */,
51CC9B3E231720B2000E842F /* MasterFeedDataSource.swift in Sources */, 51CC9B3E231720B2000E842F /* MasterFeedDataSource.swift in Sources */,
FFD43E412340F488009E5CA3 /* MarkArticlesReadAlertController.swift in Sources */, FFD43E412340F488009E5CA3 /* UndoAvailableAlertController.swift in Sources */,
51C452A322650A1E00C03939 /* HTMLMetadataDownloader.swift in Sources */, 51C452A322650A1E00C03939 /* HTMLMetadataDownloader.swift in Sources */,
51C4528D2265095F00C03939 /* AddFolderViewController.swift in Sources */, 51C4528D2265095F00C03939 /* AddFolderViewController.swift in Sources */,
51C452782265091600C03939 /* MasterTimelineCellData.swift in Sources */, 51C452782265091600C03939 /* MasterTimelineCellData.swift in Sources */,

View File

@ -22,7 +22,7 @@ struct AppDefaults {
static let timelineGroupByFeed = "timelineGroupByFeed" static let timelineGroupByFeed = "timelineGroupByFeed"
static let timelineNumberOfLines = "timelineNumberOfLines" static let timelineNumberOfLines = "timelineNumberOfLines"
static let timelineSortDirection = "timelineSortDirection" static let timelineSortDirection = "timelineSortDirection"
static let displayMarkAllAsReadUndoTip = "displayMarkAllAsReadUndoTip" static let displayUndoAvailableTip = "displayUndoAvailableTip"
static let refreshInterval = "refreshInterval" static let refreshInterval = "refreshInterval"
static let lastRefresh = "lastRefresh" static let lastRefresh = "lastRefresh"
} }
@ -72,12 +72,12 @@ struct AppDefaults {
} }
} }
static var displayMarkAllAsReadUndoTip: Bool { static var displayUndoAvailableTip: Bool {
get { get {
return bool(for: Key.displayMarkAllAsReadUndoTip) return bool(for: Key.displayUndoAvailableTip)
} }
set { set {
setBool(for: Key.displayMarkAllAsReadUndoTip, newValue) setBool(for: Key.displayUndoAvailableTip, newValue)
} }
} }
@ -105,7 +105,7 @@ struct AppDefaults {
Key.timelineGroupByFeed: false, Key.timelineGroupByFeed: false,
Key.timelineNumberOfLines: 3, Key.timelineNumberOfLines: 3,
Key.timelineSortDirection: ComparisonResult.orderedDescending.rawValue, Key.timelineSortDirection: ComparisonResult.orderedDescending.rawValue,
Key.displayMarkAllAsReadUndoTip: true] Key.displayUndoAvailableTip: true]
AppDefaults.shared.register(defaults: defaults) AppDefaults.shared.register(defaults: defaults)
} }

View File

@ -344,9 +344,9 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
} }
@IBAction func markAllAsRead(_ sender: Any) { @IBAction func markAllAsRead(_ sender: Any) {
if coordinator.displayMarkAllAsReadUndoTip { if coordinator.displayUndoAvailableTip {
let alertController = MarkArticlesReadAlertController.markAllAsReadAlert { [weak self] _ in let alertController = UndoAvailableAlertController.alert { [weak self] _ in
self?.coordinator.displayMarkAllAsReadUndoTip = false self?.coordinator.displayUndoAvailableTip = false
self?.coordinator.markAllAsRead() self?.coordinator.markAllAsRead()
} }

View File

@ -1,5 +1,5 @@
// //
// MarkArticlesReadAlertControllerr.swift // UndoAvailableAlertController.swift
// NetNewsWire // NetNewsWire
// //
// Created by Phil Viso on 9/29/19. // Created by Phil Viso on 9/29/19.
@ -9,10 +9,10 @@
import Foundation import Foundation
import UIKit import UIKit
struct MarkArticlesReadAlertController { struct UndoAvailableAlertController {
static func markAllAsReadAlert(handler: @escaping (UIAlertAction) -> Void) -> UIAlertController { static func alert(handler: @escaping (UIAlertAction) -> Void) -> UIAlertController {
let title = NSLocalizedString("Mark All Read", comment: "Mark All Read") let title = NSLocalizedString("Undo Available", comment: "Undo Available")
let message = NSLocalizedString("You can undo this and other actions with a three finger swipe to the left.", let message = NSLocalizedString("You can undo this and other actions with a three finger swipe to the left.",
comment: "Mark all articles") comment: "Mark all articles")
let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel") let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel")

View File

@ -89,9 +89,9 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
// MARK: Actions // MARK: Actions
@IBAction func markAllAsRead(_ sender: Any) { @IBAction func markAllAsRead(_ sender: Any) {
if coordinator.displayMarkAllAsReadUndoTip { if coordinator.displayUndoAvailableTip {
let alertController = MarkArticlesReadAlertController.markAllAsReadAlert { [weak self] _ in let alertController = UndoAvailableAlertController.alert { [weak self] _ in
self?.coordinator.displayMarkAllAsReadUndoTip = false self?.coordinator.displayUndoAvailableTip = false
self?.coordinator.markAllAsReadInTimeline() self?.coordinator.markAllAsReadInTimeline()
} }

View File

@ -83,9 +83,9 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
} }
} }
var displayMarkAllAsReadUndoTip: Bool { var displayUndoAvailableTip: Bool {
get { AppDefaults.displayMarkAllAsReadUndoTip } get { AppDefaults.displayUndoAvailableTip }
set { AppDefaults.displayMarkAllAsReadUndoTip = newValue } set { AppDefaults.displayUndoAvailableTip = newValue }
} }
private let treeControllerDelegate = FeedTreeControllerDelegate() private let treeControllerDelegate = FeedTreeControllerDelegate()