diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConnectionController.m | 6 | ||||
-rw-r--r-- | Source/SPConnectionControllerDelegate.m | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 258d442a..d3c75e16 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1021,7 +1021,7 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v */ - (void)sheetDidEnd:(id)sheet returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo { - // Remove the current favorite/group + // Remove the current favorite/group node if ([contextInfo isEqualToString:SPRemoveNode]) { if (returnCode == NSAlertDefaultReturn) { @@ -1052,7 +1052,7 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v [prefs setInteger:0 forKey:SPLastFavoriteID]; } - // Reset default favorite + // If required, reset the default favorite if ([[favorite objectForKey:SPFavoriteIDKey] integerValue] == [prefs integerForKey:SPDefaultFavorite]) { [prefs setInteger:[prefs integerForKey:SPLastFavoriteID] forKey:SPDefaultFavorite]; } @@ -1272,7 +1272,7 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v [self setHost:@""]; } - // Update the name for newly added favorites if not already touched by the user, by trigger a KVO update + // Update the name for newly added favorites if not already touched by the user, by triggering a KVO update if (!favoriteNameFieldWasTouched) { [self setName:[NSString stringWithFormat:@"%@@%@", ([favorite objectForKey:SPFavoriteUserKey]) ? [favorite objectForKey:SPFavoriteUserKey] : @"", diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 897c86ff..4bff297a 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -30,6 +30,8 @@ #define CELL(cell) (SPTableTextFieldCell *)cell +static const NSString *SPDatabaseImage = @"database-small"; + @implementation SPConnectionController (SPConnectionControllerDelegate) #pragma mark - @@ -98,7 +100,7 @@ [CELL(cell) setImage:nil]; } else { - [CELL(cell) setImage:(![node isGroup]) ? [NSImage imageNamed:@"database-small"] : folderImage]; + [CELL(cell) setImage:(![node isGroup]) ? [NSImage imageNamed:SPDatabaseImage] : folderImage]; } } @@ -277,7 +279,7 @@ if (nameFieldIsEmpty || (!favoriteNameFieldWasTouched && field == socketUserField)) { [socketNameField setStringValue:[NSString stringWithFormat:@"%@@localhost", [socketUserField stringValue]]]; - + // Trigger KVO update [self setName:[socketNameField stringValue]]; |