aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-12-06 21:30:46 +0000
committerstuconnolly <stuart02@gmail.com>2010-12-06 21:30:46 +0000
commitfa8ef20485323e394af10cd3a9937b634d47b436 (patch)
treefb4250854eaec0d1dd6e5712cb5110f3c71d0c75
parent7597f69134b039851d5db659ca51ebc734eb5877 (diff)
downloadsequelpro-fa8ef20485323e394af10cd3a9937b634d47b436.tar.gz
sequelpro-fa8ef20485323e394af10cd3a9937b634d47b436.tar.bz2
sequelpro-fa8ef20485323e394af10cd3a9937b634d47b436.zip
When either more than one favorite or a favorite group is selected in the connection view, hide the connection details form.
-rw-r--r--Interfaces/English.lproj/ConnectionView.xib19
-rw-r--r--Source/SPConnectionController.h1
-rw-r--r--Source/SPConnectionControllerDelegate.m16
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 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="5266"/>
<integer value="5468"/>
+ <integer value="5344"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -4634,6 +4634,14 @@
</object>
<int key="connectionID">5832</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">connectionInstructionsTextField</string>
+ <reference key="source" ref="545410097"/>
+ <reference key="destination" ref="570492783"/>
+ </object>
+ <int key="connectionID">5833</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -7143,7 +7151,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">5832</int>
+ <int key="maxID">5833</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -7549,6 +7557,7 @@
<string>addToFavoritesButton</string>
<string>connectButton</string>
<string>connectionDetailsScrollView</string>
+ <string>connectionInstructionsTextField</string>
<string>connectionResizeContainer</string>
<string>connectionSplitView</string>
<string>connectionSplitViewButtonBar</string>
@@ -7595,6 +7604,7 @@
<string>NSButton</string>
<string>NSButton</string>
<string>NSScrollView</string>
+ <string>NSTextField</string>
<string>NSView</string>
<string>NSSplitView</string>
<string>BWAnchoredButtonBar</string>
@@ -7644,6 +7654,7 @@
<string>addToFavoritesButton</string>
<string>connectButton</string>
<string>connectionDetailsScrollView</string>
+ <string>connectionInstructionsTextField</string>
<string>connectionResizeContainer</string>
<string>connectionSplitView</string>
<string>connectionSplitViewButtonBar</string>
@@ -7700,6 +7711,10 @@
<string key="candidateClassName">NSScrollView</string>
</object>
<object class="IBToOneOutletInfo">
+ <string key="name">connectionInstructionsTextField</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
<string key="name">connectionResizeContainer</string>
<string key="candidateClassName">NSView</string>
</object>
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")];
}
}