Disable adding a new folder if there are no active accounts

This commit is contained in:
Phil Viso 2019-05-19 09:14:40 -05:00
parent 5ded56fc28
commit eb5c1a49f7
2 changed files with 12 additions and 0 deletions

View File

@ -231,6 +231,10 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
if item.action == #selector(showAddFeedWindow(_:)) {
return canAddNewFeed()
}
if item.action == #selector(showAddFolderWindow(_:)) {
return canAddNewFolder()
}
return true
}
@ -599,6 +603,10 @@ private extension MainWindowController {
func canAddNewFeed() -> Bool {
return sidebarViewController?.canAddNewFeed() ?? false
}
func canAddNewFolder() -> Bool {
return sidebarViewController?.canAddNewFolder() ?? false
}
func validateToggleRead(_ item: NSValidatedUserInterfaceItem) -> Bool {

View File

@ -365,6 +365,10 @@ protocol SidebarDelegate: class {
return !accountNodes.isEmpty
}
func canAddNewFolder() -> Bool {
return !accountNodes.isEmpty
}
}
// MARK: - NSUserInterfaceValidations