Disable Reader View

This commit:
- adds a `isFeedProvider: Bool` property to `WebFeed`
- if `isFeedProvider` is `true`, the article extractor is disabled on the inspector, hidden from the context menu, and the toolbar button is disabled. Additionally, if `isFeedProvider` is `true`, `isArticleExtractorAlwaysOn` returns `false` and cannot be set to `true`.
This commit is contained in:
Stuart Breckenridge
2021-04-09 07:47:14 +08:00
parent aae5be9cd8
commit 4e517a6db4
4 changed files with 49 additions and 7 deletions

View File

@@ -240,15 +240,20 @@ private extension SidebarViewController {
}
menu.addItem(notificationMenuItem)
let articleExtractorText = NSLocalizedString("Always Use Reader View", comment: "Always Use Reader View")
let articleExtractorMenuItem = menuItem(articleExtractorText, #selector(toggleArticleExtractorFromContextMenu(_:)), webFeed)
if webFeed.isArticleExtractorAlwaysOn == nil || webFeed.isArticleExtractorAlwaysOn! == false {
articleExtractorMenuItem.state = .off
} else {
articleExtractorMenuItem.state = .on
if !webFeed.isFeedProvider {
let articleExtractorText = NSLocalizedString("Always Use Reader View", comment: "Always Use Reader View")
let articleExtractorMenuItem = menuItem(articleExtractorText, #selector(toggleArticleExtractorFromContextMenu(_:)), webFeed)
if webFeed.isArticleExtractorAlwaysOn == nil || webFeed.isArticleExtractorAlwaysOn! == false {
articleExtractorMenuItem.state = .off
} else {
articleExtractorMenuItem.state = .on
}
menu.addItem(articleExtractorMenuItem)
}
menu.addItem(articleExtractorMenuItem)
menu.addItem(NSMenuItem.separator())
menu.addItem(renameMenuItem(webFeed))