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