diff options
author | rowanbeentje <rowan@beent.je> | 2013-04-02 00:05:14 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2013-04-02 00:05:14 +0000 |
commit | f2d7bfd3eec70fd38797806a95693a7ba3d4feb6 (patch) | |
tree | 215f9b50d25228b8359e7cd0006eb8a3d9382ebf /Source | |
parent | 177fa173dd397062e0a5bcc011edf2fcf8f171a7 (diff) | |
download | sequelpro-f2d7bfd3eec70fd38797806a95693a7ba3d4feb6.tar.gz sequelpro-f2d7bfd3eec70fd38797806a95693a7ba3d4feb6.tar.bz2 sequelpro-f2d7bfd3eec70fd38797806a95693a7ba3d4feb6.zip |
- Fix validation of the "Add to Favorites" File menu item when editing past favorites
- Fix the action of the "Add to Favorites" File menu item to correctly create the new favorite
These address Issue #1666.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPDatabaseDocument.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 2a48b221..ed739caf 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3661,7 +3661,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; #ifndef SP_CODA if ([menuItem action] == @selector(addConnectionToFavorites:)) { - return ![connectionController selectedFavorite]; + return ![connectionController selectedFavorite] || [connectionController isEditingConnection]; } // Backward in history menu item @@ -3725,10 +3725,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Obviously don't add if it already exists. We shouldn't really need this as the menu item validation // enables or disables the menu item based on the same method. Although to be safe do the check anyway // as we don't know what's calling this method. - if ([connectionController selectedFavorite]) return; + if ([connectionController selectedFavorite] && ![connectionController isEditingConnection]) return; // Request the connection controller to add its details to favorites - [connectionController addFavorite:self]; + [connectionController addFavoriteUsingCurrentDetails:self]; #endif } |