diff options
-rw-r--r-- | Source/SPConnectionControllerDelegate.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index f6923ec2..da16fd57 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -483,10 +483,17 @@ } // Duplicate and make the selected favorite the default - if ((action == @selector(duplicateFavorite:)) || (action == @selector(makeSelectedFavoriteDefault:))) { + if (action == @selector(duplicateFavorite:)) { return (([favoritesOutlineView numberOfSelectedRows] == 1) && (![node isGroup])); } + // Make selected favorite the default + if (action == @selector(makeSelectedFavoriteDefault:)) { + NSInteger favoriteID = [[[self selectedFavorite] objectForKey:SPFavoriteIDKey] integerValue]; + + return (([favoritesOutlineView numberOfSelectedRows] == 1) && (![node isGroup]) && (favoriteID != [prefs integerForKey:SPDefaultFavorite])); + } + // Rename selected favorite/group if (action == @selector(renameFavorite:)) { return ([favoritesOutlineView numberOfSelectedRows] == 1); |