mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 09:50:16 +00:00
Rename some instances of webfeed as feed.
This commit is contained in:
1 parent
9991df2077
commit
faba422eca
20 files changed
+117
-117
No files matched your search
@@ -92,7 +92,7 @@ final class AppDefaults {
|
||||
}
|
||||
}
|
||||
|
||||
var addWebFeedAccountID: String? {
|
||||
var addFeedAccountID: String? {
|
||||
get {
|
||||
return AppDefaults.string(for: Key.addFeedAccountID)
|
||||
}
|
||||
@@ -101,7 +101,7 @@ final class AppDefaults {
|
||||
}
|
||||
}
|
||||
|
||||
var addWebFeedFolderName: String? {
|
||||
var addFeedFolderName: String? {
|
||||
get {
|
||||
return AppDefaults.string(for: Key.addFeedFolderName)
|
||||
}
|
||||
|
||||
@@ -451,8 +451,8 @@ extension WebViewController: WKScriptMessageHandler {
|
||||
case MessageName.imageWasClicked:
|
||||
imageWasClicked(body: message.body as? String)
|
||||
case MessageName.showFeedInspector:
|
||||
if let webFeed = article?.feed {
|
||||
coordinator.showFeedInspector(for: webFeed)
|
||||
if let feed = article?.feed {
|
||||
coordinator.showFeedInspector(for: feed)
|
||||
}
|
||||
default:
|
||||
return
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// WebFeedInspectorViewController.swift
|
||||
// FeedInspectorViewController.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 11/6/19.
|
||||
@@ -15,7 +15,7 @@ final class FeedInspectorViewController: UITableViewController {
|
||||
|
||||
static let preferredContentSizeForFormSheetDisplay = CGSize(width: 460.0, height: 500.0)
|
||||
|
||||
var webFeed: Feed!
|
||||
var feed: Feed!
|
||||
@IBOutlet weak var nameTextField: UITextField!
|
||||
@IBOutlet weak var notifyAboutNewArticlesSwitch: UISwitch!
|
||||
@IBOutlet weak var alwaysShowReaderViewSwitch: UISwitch!
|
||||
@@ -24,13 +24,13 @@ final class FeedInspectorViewController: UITableViewController {
|
||||
|
||||
private var headerView: InspectorIconHeaderView?
|
||||
private var iconImage: IconImage? {
|
||||
return IconImageCache.shared.imageForFeed(webFeed)
|
||||
return IconImageCache.shared.imageForFeed(feed)
|
||||
}
|
||||
|
||||
private let homePageIndexPath = IndexPath(row: 0, section: 1)
|
||||
|
||||
private var shouldHideHomePageSection: Bool {
|
||||
return webFeed.homePageURL == nil
|
||||
return feed.homePageURL == nil
|
||||
}
|
||||
|
||||
private var userNotificationSettings: UNNotificationSettings?
|
||||
@@ -38,15 +38,15 @@ final class FeedInspectorViewController: UITableViewController {
|
||||
override func viewDidLoad() {
|
||||
tableView.register(InspectorIconHeaderView.self, forHeaderFooterViewReuseIdentifier: "SectionHeader")
|
||||
|
||||
navigationItem.title = webFeed.nameForDisplay
|
||||
nameTextField.text = webFeed.nameForDisplay
|
||||
navigationItem.title = feed.nameForDisplay
|
||||
nameTextField.text = feed.nameForDisplay
|
||||
|
||||
notifyAboutNewArticlesSwitch.setOn(webFeed.isNotifyAboutNewArticles ?? false, animated: false)
|
||||
notifyAboutNewArticlesSwitch.setOn(feed.isNotifyAboutNewArticles ?? false, animated: false)
|
||||
|
||||
alwaysShowReaderViewSwitch.setOn(webFeed.isArticleExtractorAlwaysOn ?? false, animated: false)
|
||||
alwaysShowReaderViewSwitch.setOn(feed.isArticleExtractorAlwaysOn ?? false, animated: false)
|
||||
|
||||
homePageLabel.text = webFeed.homePageURL
|
||||
feedURLLabel.text = webFeed.url
|
||||
homePageLabel.text = feed.homePageURL
|
||||
feedURLLabel.text = feed.url
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(feedIconDidBecomeAvailable(_:)), name: .feedIconDidBecomeAvailable, object: nil)
|
||||
|
||||
@@ -59,10 +59,10 @@ final class FeedInspectorViewController: UITableViewController {
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
if nameTextField.text != webFeed.nameForDisplay {
|
||||
if nameTextField.text != feed.nameForDisplay {
|
||||
let nameText = nameTextField.text ?? ""
|
||||
let newName = nameText.isEmpty ? (webFeed.name ?? NSLocalizedString("Untitled", comment: "Feed name")) : nameText
|
||||
webFeed.rename(to: newName) { _ in }
|
||||
let newName = nameText.isEmpty ? (feed.name ?? NSLocalizedString("Untitled", comment: "Feed name")) : nameText
|
||||
feed.rename(to: newName) { _ in }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,13 +80,13 @@ final class FeedInspectorViewController: UITableViewController {
|
||||
notifyAboutNewArticlesSwitch.isOn = !notifyAboutNewArticlesSwitch.isOn
|
||||
present(notificationUpdateErrorAlert(), animated: true, completion: nil)
|
||||
} else if settings.authorizationStatus == .authorized {
|
||||
webFeed.isNotifyAboutNewArticles = notifyAboutNewArticlesSwitch.isOn
|
||||
feed.isNotifyAboutNewArticles = notifyAboutNewArticlesSwitch.isOn
|
||||
} else {
|
||||
UNUserNotificationCenter.current().requestAuthorization(options:[.badge, .sound, .alert]) { (granted, error) in
|
||||
self.updateNotificationSettings()
|
||||
if granted {
|
||||
DispatchQueue.main.async {
|
||||
self.webFeed.isNotifyAboutNewArticles = self.notifyAboutNewArticlesSwitch.isOn
|
||||
self.feed.isNotifyAboutNewArticles = self.notifyAboutNewArticlesSwitch.isOn
|
||||
UIApplication.shared.registerForRemoteNotifications()
|
||||
}
|
||||
} else {
|
||||
@@ -99,7 +99,7 @@ final class FeedInspectorViewController: UITableViewController {
|
||||
}
|
||||
|
||||
@IBAction func alwaysShowReaderViewChanged(_ sender: Any) {
|
||||
webFeed.isArticleExtractorAlwaysOn = alwaysShowReaderViewSwitch.isOn
|
||||
feed.isArticleExtractorAlwaysOn = alwaysShowReaderViewSwitch.isOn
|
||||
}
|
||||
|
||||
@IBAction func done(_ sender: Any) {
|
||||
@@ -150,7 +150,7 @@ extension FeedInspectorViewController {
|
||||
return cell
|
||||
}
|
||||
label.numberOfLines = 2
|
||||
label.text = webFeed.notificationDisplayName.capitalized
|
||||
label.text = feed.notificationDisplayName.capitalized
|
||||
}
|
||||
return cell
|
||||
}
|
||||
@@ -171,7 +171,7 @@ extension FeedInspectorViewController {
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
if shift(indexPath) == homePageIndexPath,
|
||||
let homePageUrlString = webFeed.homePageURL,
|
||||
let homePageUrlString = feed.homePageURL,
|
||||
let homePageUrl = URL(string: homePageUrlString) {
|
||||
|
||||
let safari = SFSafariViewController(url: homePageUrl)
|
||||
|
||||
@@ -153,13 +153,13 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm
|
||||
renameAction.accessibilityLabel = renameTitle
|
||||
actions.append(renameAction)
|
||||
|
||||
if let webFeed = coordinator.nodeFor(indexPath)?.representedObject as? Feed {
|
||||
if let feed = coordinator.nodeFor(indexPath)?.representedObject as? Feed {
|
||||
let moreTitle = NSLocalizedString("More", comment: "More")
|
||||
let moreAction = UIContextualAction(style: .normal, title: nil) { [weak self] (action, view, completion) in
|
||||
|
||||
if let self = self {
|
||||
|
||||
let alert = UIAlertController(title: webFeed.nameForDisplay, message: nil, preferredStyle: .actionSheet)
|
||||
let alert = UIAlertController(title: feed.nameForDisplay, message: nil, preferredStyle: .actionSheet)
|
||||
if let popoverController = alert.popoverPresentationController {
|
||||
popoverController.sourceView = view
|
||||
popoverController.sourceRect = CGRect(x: view.frame.size.width/2, y: view.frame.size.height/2, width: 1, height: 1)
|
||||
@@ -329,7 +329,7 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm
|
||||
return nil
|
||||
}
|
||||
if sidebarItem is Feed {
|
||||
return makeWebFeedContextMenu(indexPath: indexPath, includeDeleteRename: true)
|
||||
return makeFeedContextMenu(indexPath: indexPath, includeDeleteRename: true)
|
||||
} else if sidebarItem is Folder {
|
||||
return makeFolderContextMenu(indexPath: indexPath)
|
||||
} else if sidebarItem is PseudoFeed {
|
||||
@@ -657,11 +657,11 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm
|
||||
}
|
||||
|
||||
@objc func feedSettingDidChange(_ note: Notification) {
|
||||
guard let webFeed = note.object as? Feed, let key = note.userInfo?[Feed.SettingUserInfoKey] as? String else {
|
||||
guard let feed = note.object as? Feed, let key = note.userInfo?[Feed.SettingUserInfoKey] as? String else {
|
||||
return
|
||||
}
|
||||
if key == Feed.SettingKey.homePageURL || key == Feed.SettingKey.faviconURL {
|
||||
configureCellsForRepresentedObject(webFeed)
|
||||
configureCellsForRepresentedObject(feed)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -689,7 +689,7 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm
|
||||
|
||||
let addFeedActionTitle = NSLocalizedString("Add Feed", comment: "Add Feed")
|
||||
let addFeedAction = UIAction(title: addFeedActionTitle, image: AppAssets.plus) { _ in
|
||||
self.coordinator.showAddWebFeed()
|
||||
self.coordinator.showAddFeed()
|
||||
}
|
||||
menuItems.append(addFeedAction)
|
||||
|
||||
@@ -724,7 +724,7 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm
|
||||
|
||||
let addWebFeedActionTitle = NSLocalizedString("Add Web Feed", comment: "Add Web Feed")
|
||||
let addWebFeedAction = UIAlertAction(title: addWebFeedActionTitle, style: .default) { _ in
|
||||
self.coordinator.showAddWebFeed()
|
||||
self.coordinator.showAddFeed()
|
||||
}
|
||||
|
||||
let addWebFolderdActionTitle = NSLocalizedString("Add Folder", comment: "Add Folder")
|
||||
@@ -841,7 +841,7 @@ extension MainFeedCollectionViewController: UIContextMenuInteractionDelegate {
|
||||
}
|
||||
|
||||
extension MainFeedCollectionViewController {
|
||||
func makeWebFeedContextMenu(indexPath: IndexPath, includeDeleteRename: Bool) -> UIContextMenuConfiguration {
|
||||
func makeFeedContextMenu(indexPath: IndexPath, includeDeleteRename: Bool) -> UIContextMenuConfiguration {
|
||||
return UIContextMenuConfiguration(identifier: MainFeedRowIdentifier(indexPath: indexPath), previewProvider: nil, actionProvider: { [ weak self] suggestedActions in
|
||||
|
||||
guard let self = self else { return nil }
|
||||
|
||||
@@ -96,7 +96,7 @@ final class RootSplitViewController: UISplitViewController {
|
||||
}
|
||||
|
||||
@objc func addNewFeed(_ sender: Any?) {
|
||||
coordinator.showAddWebFeed()
|
||||
coordinator.showAddFeed()
|
||||
}
|
||||
|
||||
@objc func addNewFolder(_ sender: Any?) {
|
||||
|
||||
@@ -379,7 +379,7 @@ final class SceneCoordinator: NSObject, UndoableCommandRunner {
|
||||
case .readArticle:
|
||||
self.handleReadArticle(activity.userInfo)
|
||||
case .addFeedIntent:
|
||||
self.showAddWebFeed()
|
||||
self.showAddFeed()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1266,11 +1266,11 @@ final class SceneCoordinator: NSObject, UndoableCommandRunner {
|
||||
let feedInspectorController = feedInspectorNavController.topViewController as! FeedInspectorViewController
|
||||
feedInspectorNavController.modalPresentationStyle = .formSheet
|
||||
feedInspectorNavController.preferredContentSize = FeedInspectorViewController.preferredContentSizeForFormSheetDisplay
|
||||
feedInspectorController.webFeed = feed
|
||||
feedInspectorController.feed = feed
|
||||
rootSplitViewController.present(feedInspectorNavController, animated: true)
|
||||
}
|
||||
|
||||
func showAddWebFeed(initialFeed: String? = nil, initialFeedName: String? = nil) {
|
||||
func showAddFeed(initialFeed: String? = nil, initialFeedName: String? = nil) {
|
||||
|
||||
// Since Add Feed can be opened from anywhere with a keyboard shortcut, we have to deselect any currently selected feeds
|
||||
selectFeed(nil)
|
||||
|
||||
@@ -122,7 +122,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
if urlString.starts(with: "feed:") || urlString.starts(with: "feeds:") {
|
||||
let normalizedURLString = urlString.normalizedURL
|
||||
if normalizedURLString.mayBeURL {
|
||||
self.coordinator.showAddWebFeed(initialFeed: normalizedURLString, initialFeedName: nil)
|
||||
self.coordinator.showAddFeed(initialFeed: normalizedURLString, initialFeedName: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ private extension SceneDelegate {
|
||||
case "com.ranchero.NetNewsWire.ShowSearch":
|
||||
coordinator.showSearch()
|
||||
case "com.ranchero.NetNewsWire.ShowAdd":
|
||||
coordinator.showAddWebFeed()
|
||||
coordinator.showAddFeed()
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user