From fa8ef20485323e394af10cd3a9937b634d47b436 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Mon, 6 Dec 2010 21:30:46 +0000 Subject: When either more than one favorite or a favorite group is selected in the connection view, hide the connection details form. --- Interfaces/English.lproj/ConnectionView.xib | 19 +++++++++++++++++-- Source/SPConnectionController.h | 1 + Source/SPConnectionControllerDelegate.m | 16 ++++++++++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Interfaces/English.lproj/ConnectionView.xib b/Interfaces/English.lproj/ConnectionView.xib index d6de5a4d..a0c61b52 100644 --- a/Interfaces/English.lproj/ConnectionView.xib +++ b/Interfaces/English.lproj/ConnectionView.xib @@ -21,8 +21,8 @@ YES - + YES @@ -4634,6 +4634,14 @@ 5832 + + + connectionInstructionsTextField + + + + 5833 + @@ -7143,7 +7151,7 @@ - 5832 + 5833 @@ -7549,6 +7557,7 @@ addToFavoritesButton connectButton connectionDetailsScrollView + connectionInstructionsTextField connectionResizeContainer connectionSplitView connectionSplitViewButtonBar @@ -7595,6 +7604,7 @@ NSButton NSButton NSScrollView + NSTextField NSView NSSplitView BWAnchoredButtonBar @@ -7644,6 +7654,7 @@ addToFavoritesButton connectButton connectionDetailsScrollView + connectionInstructionsTextField connectionResizeContainer connectionSplitView connectionSplitViewButtonBar @@ -7699,6 +7710,10 @@ connectionDetailsScrollView NSScrollView + + connectionInstructionsTextField + NSTextField + connectionResizeContainer NSView diff --git a/Source/SPConnectionController.h b/Source/SPConnectionController.h index 5dd19c4d..2cd4d170 100644 --- a/Source/SPConnectionController.h +++ b/Source/SPConnectionController.h @@ -93,6 +93,7 @@ IBOutlet NSView *connectionView; IBOutlet NSSplitView *connectionSplitView; IBOutlet NSScrollView *connectionDetailsScrollView; + IBOutlet NSTextField *connectionInstructionsTextField; IBOutlet BWAnchoredButtonBar *connectionSplitViewButtonBar; IBOutlet SPFavoritesOutlineView *favoritesOutlineView; diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 9094c6cc..65804eff 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -127,9 +127,9 @@ } - (void)outlineViewSelectionDidChange:(NSNotification *)notification -{ +{ if ([favoritesOutlineView numberOfSelectedRows] == 1) { - + SPTreeNode *node = [self selectedFavoriteNode]; if (![node isGroup]) { @@ -138,10 +138,18 @@ [addToFavoritesButton setEnabled:NO]; favoriteNameFieldWasTouched = YES; + + [connectionResizeContainer setHidden:NO]; + [connectionInstructionsTextField setStringValue:NSLocalizedString(@"Enter connection details below, or choose a favorite", @"enter connection details label")]; } - } + else { + [connectionResizeContainer setHidden:YES]; + [connectionInstructionsTextField setStringValue:NSLocalizedString(@"Please choose a favorite", @"please choose a favorite connection view label")]; + } + } else { - [addToFavoritesButton setEnabled:YES]; + [connectionResizeContainer setHidden:YES]; + [connectionInstructionsTextField setStringValue:NSLocalizedString(@"Please choose a favorite", @"please choose a favorite connection view label")]; } } -- cgit v1.2.3