mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 20:16:54 +01:00
Implement more keyboard shortcuts
This commit is contained in:
parent
73828e5115
commit
7582ade6f5
@ -26,21 +26,29 @@ class RootSplitViewController: UISplitViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc func nextUnread(_ sender: Any?) {
|
@objc func nextUnread(_ sender: Any?) {
|
||||||
|
coordinator.selectNextUnread()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func markRead(_ sender: Any?) {
|
@objc func markRead(_ sender: Any?) {
|
||||||
|
coordinator.markAsReadForCurrentArticle()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func markUnreadAndGoToNextUnread(_ sender: Any?) {
|
@objc func markUnreadAndGoToNextUnread(_ sender: Any?) {
|
||||||
|
coordinator.markAsUnreadForCurrentArticle()
|
||||||
|
coordinator.selectNextUnread()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func markAllAsReadAndGoToNextUnread(_ sender: Any?) {
|
@objc func markAllAsReadAndGoToNextUnread(_ sender: Any?) {
|
||||||
|
coordinator.markAllAsReadInTimeline()
|
||||||
|
coordinator.selectNextUnread()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func markOlderArticlesAsRead(_ sender: Any?) {
|
@objc func markOlderArticlesAsRead(_ sender: Any?) {
|
||||||
|
coordinator.markAsReadOlderArticlesInTimeline()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func markUnread(_ sender: Any?) {
|
@objc func markUnread(_ sender: Any?) {
|
||||||
|
coordinator.markAsUnreadForCurrentArticle()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func goToPreviousSubscription(_ sender: Any?) {
|
@objc func goToPreviousSubscription(_ sender: Any?) {
|
||||||
|
@ -731,6 +731,11 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||||||
masterNavigationController.popViewController(animated: true)
|
masterNavigationController.popViewController(animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func markAsReadOlderArticlesInTimeline() {
|
||||||
|
if let indexPath = currentArticleIndexPath {
|
||||||
|
markAsReadOlderArticlesInTimeline(indexPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
func markAsReadOlderArticlesInTimeline(_ indexPath: IndexPath) {
|
func markAsReadOlderArticlesInTimeline(_ indexPath: IndexPath) {
|
||||||
let article = articles[indexPath.row]
|
let article = articles[indexPath.row]
|
||||||
let articlesToMark = articles.filter { $0.logicalDatePublished < article.logicalDatePublished }
|
let articlesToMark = articles.filter { $0.logicalDatePublished < article.logicalDatePublished }
|
||||||
@ -740,6 +745,18 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||||||
markAllAsRead(articlesToMark)
|
markAllAsRead(articlesToMark)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func markAsReadForCurrentArticle() {
|
||||||
|
if let article = currentArticle {
|
||||||
|
markArticles(Set([article]), statusKey: .read, flag: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func markAsUnreadForCurrentArticle() {
|
||||||
|
if let article = currentArticle {
|
||||||
|
markArticles(Set([article]), statusKey: .read, flag: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func toggleReadForCurrentArticle() {
|
func toggleReadForCurrentArticle() {
|
||||||
if let article = currentArticle {
|
if let article = currentArticle {
|
||||||
markArticles(Set([article]), statusKey: .read, flag: !article.status.read)
|
markArticles(Set([article]), statusKey: .read, flag: !article.status.read)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user