From 1064dfa5438d493f996d52fd9b1554d121b93214 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 23 Nov 2009 02:15:45 +0000 Subject: - 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 --- Source/SPHistoryController.m | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'Source/SPHistoryController.m') 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; } -- cgit v1.2.3