aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-12-16 01:01:34 +0000
committerrowanbeentje <rowan@beent.je>2009-12-16 01:01:34 +0000
commitd915e45bc51b59618a054ececa38d46898603a3b (patch)
tree3280e9b03e7afa38f06d50baada86eeef49409bd
parent03ac736b6aac57d700a43184a062cf5e29a50d9e (diff)
downloadsequelpro-d915e45bc51b59618a054ececa38d46898603a3b.tar.gz
sequelpro-d915e45bc51b59618a054ececa38d46898603a3b.tar.bz2
sequelpro-d915e45bc51b59618a054ececa38d46898603a3b.zip
- Merge in r1608 (SPF saving of custom SSH ports), r1610 (Fix multi-line favourite titles), r1619 (History navigation task not closed) and r1622 (Pagination interface clarification) to the 0.9.7 branchrelease-0.9.7
-rw-r--r--Interfaces/English.lproj/DBView.xib8
-rw-r--r--Interfaces/English.lproj/QueryFavoriteManager.xib20
-rw-r--r--Resources/Images/button_pagination.pngbin311 -> 717 bytes
-rw-r--r--Source/SPHistoryController.h2
-rw-r--r--Source/SPHistoryController.m14
-rw-r--r--Source/SPPreferenceController.m26
-rw-r--r--Source/TableContent.m15
-rw-r--r--Source/TableDocument.m2
8 files changed, 45 insertions, 42 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index 0ef9900c..dc251b32 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -2448,7 +2448,7 @@
<object class="NSTextField" id="262235013">
<reference key="NSNextResponder" ref="1013108064"/>
<int key="NSvFlags">290</int>
- <string key="NSFrame">{{166, 6}, {327, 22}}</string>
+ <string key="NSFrame">{{166, 6}, {415, 22}}</string>
<reference key="NSSuperview" ref="1013108064"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="665575636">
@@ -2833,7 +2833,7 @@
<object class="NSButton" id="434675603">
<reference key="NSNextResponder" ref="1013108064"/>
<int key="NSvFlags">289</int>
- <string key="NSFrame">{{493, 9}, {32, 25}}</string>
+ <string key="NSFrame">{{586, 9}, {32, 25}}</string>
<reference key="NSSuperview" ref="1013108064"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="105847394">
@@ -2857,7 +2857,7 @@
<object class="NSButton" id="429029434">
<reference key="NSNextResponder" ref="1013108064"/>
<int key="NSvFlags">289</int>
- <string key="NSFrame">{{524, 9}, {125, 25}}</string>
+ <string key="NSFrame">{{617, 9}, {32, 25}}</string>
<reference key="NSSuperview" ref="1013108064"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="843215079">
@@ -17956,9 +17956,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference ref="231622333"/>
<reference ref="33038697"/>
<reference ref="924091760"/>
- <reference ref="434675603"/>
<reference ref="429029434"/>
<reference ref="983589239"/>
+ <reference ref="434675603"/>
</object>
<reference key="parent" ref="624106058"/>
</object>
diff --git a/Interfaces/English.lproj/QueryFavoriteManager.xib b/Interfaces/English.lproj/QueryFavoriteManager.xib
index f45e707e..0c0f0371 100644
--- a/Interfaces/English.lproj/QueryFavoriteManager.xib
+++ b/Interfaces/English.lproj/QueryFavoriteManager.xib
@@ -25,8 +25,8 @@
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.brandonwalkin.BWToolkit</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.brandonwalkin.BWToolkit</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -56,7 +56,7 @@
<string key="NSWindowTitle">Query Favorite Manager</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
- <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{500, 371}</string>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
@@ -383,7 +383,7 @@
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="56401947">
<int key="NSCellFlags">337772097</int>
- <int key="NSCellFlags2">133120</int>
+ <int key="NSCellFlags2">133184</int>
<string key="NSContents">Text Cell</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="522643855"/>
@@ -393,7 +393,7 @@
<string key="NSColorName">controlBackgroundColor</string>
<object class="NSColor" key="NSColor" id="276872502">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="810868150">
@@ -535,7 +535,7 @@
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="474077606">
<int key="NSCellFlags">-1804468671</int>
- <int key="NSCellFlags2">272761856</int>
+ <int key="NSCellFlags2">272761920</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="26"/>
<string key="NSPlaceholderString">[no selection]</string>
@@ -696,7 +696,7 @@
<string key="NSFrame">{{20, 54}, {250, 266}}</string>
<reference key="NSSuperview" ref="954707656"/>
<reference key="NSNextKeyView" ref="221447089"/>
- <int key="NSsFlags">514</int>
+ <int key="NSsFlags">530</int>
<reference key="NSVScroller" ref="978638217"/>
<reference key="NSHScroller" ref="1008017707"/>
<reference key="NSContentView" ref="221447089"/>
@@ -761,7 +761,7 @@
<string key="NSAutosaveName">SPQueryFavoriteSplitView</string>
<object class="NSColor" key="BWSVColor">
<int key="NSColorSpace">1</int>
- <bytes key="NSRGB">MC42NjY2NjY2ODY1IDAuNjY2NjY2Njg2NSAwLjY2NjY2NjY4NjUAA</bytes>
+ <bytes key="NSRGB">MC42NjY2NjY2NjY3IDAuNjY2NjY2NjY2NyAwLjY2NjY2NjY2NjcAA</bytes>
</object>
<bool key="BWSVColorIsEnabled">YES</bool>
<object class="NSMutableDictionary" key="BWSVMinValues">
@@ -819,7 +819,7 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{500, 393}</string>
- <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSFrameAutosaveName">SPQueryFavoriteManagerWindow</string>
</object>
<object class="NSUserDefaultsController" id="592597522">
@@ -1676,9 +1676,9 @@
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{417, 428}, {500, 371}}</string>
+ <string>{{323, 319}, {500, 371}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{417, 428}, {500, 371}}</string>
+ <string>{{323, 319}, {500, 371}}</string>
<boolean value="NO"/>
<string>{196, 240}</string>
<string>{{357, 418}, {480, 270}}</string>
diff --git a/Resources/Images/button_pagination.png b/Resources/Images/button_pagination.png
index 89c612df..ed61c791 100644
--- a/Resources/Images/button_pagination.png
+++ b/Resources/Images/button_pagination.png
Binary files differ
diff --git a/Source/SPHistoryController.h b/Source/SPHistoryController.h
index 56303807..1b5ecaf3 100644
--- a/Source/SPHistoryController.h
+++ b/Source/SPHistoryController.h
@@ -64,7 +64,7 @@ enum sphistory_view_types
// Loading history entries
- (void) loadEntryAtPosition:(unsigned int)position;
- (void) loadEntryTaskWithPosition:(NSNumber *)positionNumber;
-- (void) abortEntryLoad;
+- (void) abortEntryLoadWithPool:(NSAutoreleasePool *)pool;
- (void) loadEntryFromMenuItem:(id)theMenuItem;
// History entry details and description
diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m
index 7644f97f..17f2d3d7 100644
--- a/Source/SPHistoryController.m
+++ b/Source/SPHistoryController.m
@@ -301,6 +301,8 @@
[tableContentInstance loadTable:[historyEntry objectForKey:@"table"]];
modifyingHistoryState = NO;
[self updateToolbarItem];
+ [theDocument endTask];
+ [loadPool drain];
return;
}
@@ -314,7 +316,7 @@
[chooseDatabaseButton selectItemWithTitle:[historyEntry objectForKey:@"database"]];
[theDocument chooseDatabase:self];
if (![[theDocument database] isEqualToString:[historyEntry objectForKey:@"database"]]) {
- return [self abortEntryLoad];
+ return [self abortEntryLoadWithPool:loadPool];
}
}
@@ -322,11 +324,11 @@
if ([historyEntry objectForKey:@"table"] && ![[theDocument table] isEqualToString:[historyEntry objectForKey:@"table"]]) {
NSArray *tables = [tablesListInstance tables];
if ([tables indexOfObject:[historyEntry objectForKey:@"table"]] == NSNotFound) {
- return [self abortEntryLoad];
+ return [self abortEntryLoadWithPool:loadPool];
}
[[tablesListInstance valueForKey:@"tablesListView"] selectRowIndexes:[NSIndexSet indexSetWithIndex:[tables indexOfObject:[historyEntry objectForKey:@"table"]]] byExtendingSelection:NO];
if (![[theDocument table] isEqualToString:[historyEntry objectForKey:@"table"]]) {
- return [self abortEntryLoad];
+ return [self abortEntryLoadWithPool:loadPool];
}
} else if (![historyEntry objectForKey:@"table"] && [theDocument table]) {
[tablesListInstance setTableListSelectability:YES];
@@ -355,7 +357,7 @@
break;
}
if ([self currentlySelectedView] != [[historyEntry objectForKey:@"view"] intValue]) {
- return [self abortEntryLoad];
+ return [self abortEntryLoadWithPool:loadPool];
}
}
@@ -371,10 +373,12 @@
* Convenience method for aborting history load - could at some point
* clean up the history list, show an alert, etc
*/
-- (void) abortEntryLoad
+- (void) abortEntryLoadWithPool:(NSAutoreleasePool *)pool
{
NSBeep();
modifyingHistoryState = NO;
+ [theDocument endTask];
+ if (pool) [pool drain];
}
/**
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m
index 38c76f9e..ce7c7424 100644
--- a/Source/SPPreferenceController.m
+++ b/Source/SPPreferenceController.m
@@ -267,21 +267,31 @@
[prefs setObject:[NSDictionary dictionaryWithDictionary:toolbarDict] forKey:@"NSToolbar Configuration TableWindowToolbar"];
}
- // For versions prior to r1598 (~0.9.7), convert the query favorites array to an array of dictionaries
- if (recordedVersionNumber < 1598 && [prefs objectForKey:SPQueryFavorites]) {
+ // For versions prior to r1609 (~0.9.7), convert the query favorites array to an array of dictionaries
+ if (recordedVersionNumber < 1609 && [prefs objectForKey:SPQueryFavorites]) {
NSMutableArray *queryFavoritesArray = [NSMutableArray arrayWithArray:[prefs objectForKey:SPQueryFavorites]];
for (i = 0; i < [queryFavoritesArray count]; i++)
{
id favorite = [queryFavoritesArray objectAtIndex:i];
- if (([favorite isKindOfClass:[NSDictionary class]]) && ([favorite objectForKey:@"name"]) && ([favorite objectForKey:@"query"])) continue;
+ // If the favorite is already a dictionary, just make sure there's no newlines in the title
+ if (([favorite isKindOfClass:[NSDictionary class]]) && ([favorite objectForKey:@"name"]) && ([favorite objectForKey:@"query"])) {
+ NSMutableString *favoriteName = [NSMutableString stringWithString:[favorite objectForKey:@"name"]];
+ [favoriteName replaceOccurrencesOfString:@"\n" withString:@" " options:NSLiteralSearch range:NSMakeRange(0, [favoriteName length])];
+ [queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithString:favoriteName], [favorite objectForKey:@"query"], nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]];
+ continue;
+ }
- // By default make the query's name the first 32 characters of the query with '...' appended
- int idx = ( [favorite length] > 32 ) ? 32 : [favorite length]-1;
- NSString *favoriteName = [[[favorite stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]] substringToIndex:idx] stringByAppendingString:@"..."];
-
- [queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:favoriteName, favorite, nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]];
+ // By default make the query's name the first 32 characters of the query with '...' appended, stripping newlines
+ NSMutableString *favoriteName = [NSMutableString stringWithString:[favorite stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]];
+ [favoriteName replaceOccurrencesOfString:@"\n" withString:@" " options:NSLiteralSearch range:NSMakeRange(0, [favoriteName length])];
+ if ([favoriteName length] > 32) {
+ [favoriteName deleteCharactersInRange:NSMakeRange(32, [favoriteName length] - 32)];
+ [favoriteName appendString:@"..."];
+ }
+
+ [queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithString:favoriteName], favorite, nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]];
}
[prefs setObject:queryFavoritesArray forKey:SPQueryFavorites];
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 98de0278..e1954627 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -1149,11 +1149,13 @@
if (paginationViewFrame.size.height == paginationViewHeight) return;
paginationViewFrame.size.height = paginationViewHeight;
[paginationButton setState:NSOnState];
+ [paginationButton setImage:[NSImage imageNamed:@"button_action"]];
[tableWindow makeFirstResponder:paginationPageField];
} else {
if (paginationViewFrame.size.height == 0) return;
paginationViewFrame.size.height = 0;
[paginationButton setState:NSOffState];
+ [paginationButton setImage:[NSImage imageNamed:@"button_pagination"]];
if ([tableWindow firstResponder] == paginationPageField
|| ([[tableWindow firstResponder] respondsToSelector:@selector(superview)]
&& [(id)[tableWindow firstResponder] superview]
@@ -1196,19 +1198,6 @@
// As long as a table is selected (which it will be if this is called), enable pagination detail button
[paginationButton setEnabled:enabledMode];
- // Update the pagination button text
- if ([prefs boolForKey:SPLimitResults]) {
- if (maxPage <= 1) {
- [paginationButton setTitle:@""];
- } else if (isFiltered) {
- [paginationButton setTitle:[NSString stringWithFormat:NSLocalizedString(@"Page %@", @"Filtered pagination button status text"), [numberFormatter stringFromNumber:[NSNumber numberWithUnsignedInteger:contentPage]]]];
- } else {
- [paginationButton setTitle:[NSString stringWithFormat:NSLocalizedString(@"Page %@ of %@", @"Pagination button status text"), [numberFormatter stringFromNumber:[NSNumber numberWithUnsignedInteger:contentPage]], [numberFormatter stringFromNumber:[NSNumber numberWithUnsignedInteger:maxPage]]]];
- }
- } else {
- [paginationButton setTitle:NSLocalizedString(@"Pagination disabled", @"Pagination text shown when LIMIT is off")];
- }
-
// Set the values and maximums for the text field and associated pager
[paginationPageField setStringValue:[numberFormatter stringFromNumber:[NSNumber numberWithUnsignedInteger:contentPage]]];
[[paginationPageField formatter] setMaximum:[NSNumber numberWithUnsignedInteger:maxPage]];
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 06066be3..6d34b7f5 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -2640,7 +2640,7 @@
aString = @"SPSSHTunnelConnection";
[connection setObject:[connectionController sshHost] forKey:@"ssh_host"];
[connection setObject:[connectionController sshUser] forKey:@"ssh_user"];
- if([connectionController port] && [[connectionController port] length])
+ if([connectionController sshPort] && [[connectionController sshPort] length])
[connection setObject:[NSNumber numberWithInt:[[connectionController sshPort] intValue]] forKey:@"ssh_port"];
break;
default: