mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-23 15:50:26 +01:00
Disable adding a new folder if there are no active accounts
This commit is contained in:
parent
5ded56fc28
commit
eb5c1a49f7
@ -231,6 +231,10 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
|||||||
if item.action == #selector(showAddFeedWindow(_:)) {
|
if item.action == #selector(showAddFeedWindow(_:)) {
|
||||||
return canAddNewFeed()
|
return canAddNewFeed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if item.action == #selector(showAddFolderWindow(_:)) {
|
||||||
|
return canAddNewFolder()
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -599,6 +603,10 @@ private extension MainWindowController {
|
|||||||
func canAddNewFeed() -> Bool {
|
func canAddNewFeed() -> Bool {
|
||||||
return sidebarViewController?.canAddNewFeed() ?? false
|
return sidebarViewController?.canAddNewFeed() ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func canAddNewFolder() -> Bool {
|
||||||
|
return sidebarViewController?.canAddNewFolder() ?? false
|
||||||
|
}
|
||||||
|
|
||||||
func validateToggleRead(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
func validateToggleRead(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
||||||
|
|
||||||
|
@ -365,6 +365,10 @@ protocol SidebarDelegate: class {
|
|||||||
return !accountNodes.isEmpty
|
return !accountNodes.isEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func canAddNewFolder() -> Bool {
|
||||||
|
return !accountNodes.isEmpty
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - NSUserInterfaceValidations
|
// MARK: - NSUserInterfaceValidations
|
||||||
|
Loading…
Reference in New Issue
Block a user