mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Validate the Mark Older Articles as Read command.
This commit is contained in:
@@ -127,6 +127,10 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
||||
return canMarkRead()
|
||||
}
|
||||
|
||||
if item.action == #selector(markOlderArticlesAsRead(_:)) {
|
||||
return canMarkOlderArticlesAsRead()
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -239,7 +243,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
||||
|
||||
@IBAction func markOlderArticlesAsRead(_ sender: Any?) {
|
||||
|
||||
timelineViewController?.markOlderArticlesAsRead(sender)
|
||||
timelineViewController?.markOlderArticlesAsRead()
|
||||
}
|
||||
|
||||
@IBAction func navigateToTimeline(_ sender: Any?) {
|
||||
@@ -339,7 +343,12 @@ private extension MainWindowController {
|
||||
|
||||
return timelineViewController?.canMarkSelectedArticlesAsRead() ?? false
|
||||
}
|
||||
|
||||
|
||||
func canMarkOlderArticlesAsRead() -> Bool {
|
||||
|
||||
return timelineViewController?.canMarkOlderArticlesAsRead() ?? false
|
||||
}
|
||||
|
||||
func updateWindowTitle() {
|
||||
|
||||
if unreadCount < 1 {
|
||||
|
||||
@@ -180,7 +180,7 @@ class TimelineViewController: NSViewController, UndoableCommandRunner {
|
||||
runCommand(markUnreadCommand)
|
||||
}
|
||||
|
||||
@IBAction func markOlderArticlesAsRead(_ sender: Any?) {
|
||||
func markOlderArticlesAsRead() {
|
||||
|
||||
// Mark articles the same age or older than the selected article(s) as read.
|
||||
|
||||
@@ -207,7 +207,12 @@ class TimelineViewController: NSViewController, UndoableCommandRunner {
|
||||
}
|
||||
runCommand(markReadCommand)
|
||||
}
|
||||
|
||||
|
||||
func canMarkOlderArticlesAsRead() -> Bool {
|
||||
|
||||
return !selectedArticles.isEmpty
|
||||
}
|
||||
|
||||
// MARK: - Navigation
|
||||
|
||||
func goToNextUnread() {
|
||||
|
||||
Reference in New Issue
Block a user