aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPHistoryController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-11-23 02:15:45 +0000
committerrowanbeentje <rowan@beent.je>2009-11-23 02:15:45 +0000
commit1064dfa5438d493f996d52fd9b1554d121b93214 (patch)
treeb41093f58a98ff63607ea6268e1d8bee13ad07a4 /Source/SPHistoryController.m
parent3c52d5ea78847330f86bad7548a8d1a9bd2f0df6 (diff)
downloadsequelpro-1064dfa5438d493f996d52fd9b1554d121b93214.tar.gz
sequelpro-1064dfa5438d493f996d52fd9b1554d121b93214.tar.bz2
sequelpro-1064dfa5438d493f996d52fd9b1554d121b93214.zip
- Replace the LIMIT interface on the content view with a pagination control at the bottom. This addresses the last of Issue #49 and implements Issue #133; jump-to and two prefs affecting loading are available in a popup when clicking the pagination interface.
- Format row counts at the bottom of the content pane - Increase the MCPStreamingResult buffer for a stronger workaround for #463
Diffstat (limited to 'Source/SPHistoryController.m')
-rw-r--r--Source/SPHistoryController.m28
1 files changed, 19 insertions, 9 deletions
diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m
index 6c2683d0..7644f97f 100644
--- a/Source/SPHistoryController.m
+++ b/Source/SPHistoryController.m
@@ -188,7 +188,7 @@
unsigned int theView = [self currentlySelectedView];
NSString *contentSortCol = [tableContentInstance sortColumnName];
BOOL contentSortColIsAsc = [tableContentInstance sortColumnIsAscending];
- unsigned int contentLimitStartPosition = [tableContentInstance limitStart];
+ unsigned int contentPageNumber = [tableContentInstance pageNumber];
NSIndexSet *contentSelectedIndexSet = [tableContentInstance selectedRowIndexes];
NSRect contentViewport = [tableContentInstance viewport];
NSDictionary *contentFilter = [tableContentInstance filterSettings];
@@ -232,7 +232,7 @@
theTable, @"table",
[NSNumber numberWithInt:theView], @"view",
[NSNumber numberWithBool:contentSortColIsAsc], @"contentSortColIsAsc",
- [NSNumber numberWithInt:contentLimitStartPosition], @"contentLimitStartPosition",
+ [NSNumber numberWithInt:contentPageNumber], @"contentPageNumber",
[NSValue valueWithRect:contentViewport], @"contentViewport",
nil];
if (contentSortCol) [newEntry setObject:contentSortCol forKey:@"contentSortCol"];
@@ -288,7 +288,7 @@
// Set table content details for restore
[tableContentInstance setSortColumnNameToRestore:[historyEntry objectForKey:@"contentSortCol"] isAscending:[[historyEntry objectForKey:@"contentSortCol"] boolValue]];
- [tableContentInstance setLimitStartToRestore:[[historyEntry objectForKey:@"contentLimitStartPosition"] intValue]];
+ [tableContentInstance setPageToRestore:[[historyEntry objectForKey:@"contentPageNumber"] intValue]];
[tableContentInstance setSelectedRowIndexesToRestore:[historyEntry objectForKey:@"contentSelectedIndexSet"]];
[tableContentInstance setViewportToRestore:[[historyEntry objectForKey:@"contentViewport"] rectValue]];
[tableContentInstance setFiltersToRestore:[historyEntry objectForKey:@"contentFilter"]];
@@ -415,14 +415,24 @@
if (![theEntry objectForKey:@"table"] || ![[theEntry objectForKey:@"table"] length]) return theName;
[theName appendFormat:@"/%@", [theEntry objectForKey:@"table"]];
- if (![theEntry objectForKey:@"contentFilter"]) return theName;
- NSDictionary *filterSettings = [theEntry objectForKey:@"contentFilter"];
- if (![filterSettings objectForKey:@"filterField"]) return theName;
+ if ([theEntry objectForKey:@"contentFilter"]) {
+ NSDictionary *filterSettings = [theEntry objectForKey:@"contentFilter"];
+ if ([filterSettings objectForKey:@"filterField"]) {
+ if([filterSettings objectForKey:@"menuLabel"]) {
+ theName = [NSString stringWithFormat:NSLocalizedString(@"%@ (Filtered by %@)", @"History item filtered by values label"),
+ theName, [filterSettings objectForKey:@"menuLabel"]];
+ }
+ }
+ }
- if([filterSettings objectForKey:@"menuLabel"])
- return [NSString stringWithFormat:NSLocalizedString(@"%@ (Filtered by %@)", @"History item filtered by values label"),
- theName, [filterSettings objectForKey:@"menuLabel"]];
+ if ([theEntry objectForKey:@"contentPageNumber"]) {
+ NSUInteger pageNumber = [[theEntry objectForKey:@"contentPageNumber"] unsignedIntValue];
+ if (pageNumber > 1) {
+ theName = [NSString stringWithFormat:NSLocalizedString(@"%@ (Page %i)", @"History item with page number label"),
+ theName, pageNumber];
+ }
+ }
return theName;
}