diff options
author | Max <dmoagx@users.noreply.github.com> | 2018-05-13 01:50:58 +0200 |
---|---|---|
committer | Max <dmoagx@users.noreply.github.com> | 2018-05-13 01:50:58 +0200 |
commit | 375faa0de3189a380cc03b8f70df232ec8df7346 (patch) | |
tree | 3b9b126f37d63271bd14d6edf043e5c1840cfadb /Source/SPHistoryController.m | |
parent | 1ac52c38f1b819fa28610c74661a5fd4dbab21f9 (diff) | |
download | sequelpro-375faa0de3189a380cc03b8f70df232ec8df7346.tar.gz sequelpro-375faa0de3189a380cc03b8f70df232ec8df7346.tar.bz2 sequelpro-375faa0de3189a380cc03b8f70df232ec8df7346.zip |
#63: Behaviour changes
* Filter editor visibility state is now preserved when switching tables
* The previously active filter is reenabled when returning to a table
Diffstat (limited to 'Source/SPHistoryController.m')
-rw-r--r-- | Source/SPHistoryController.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m index 8a0554fe..31db15ee 100644 --- a/Source/SPHistoryController.m +++ b/Source/SPHistoryController.m @@ -251,6 +251,7 @@ NSRect contentViewport = [[tableContentInstance onMainThread] viewport]; NSDictionary *contentFilter = [[tableContentInstance onMainThread] filterSettings]; NSData *filterTableData = [[tableContentInstance onMainThread] filterTableData]; + SPTableContentFilterSource activeFilter = [[tableContentInstance onMainThread] activeFilter]; if (!theDatabase) return; // If a table is selected, save state information @@ -261,6 +262,7 @@ [NSNumber numberWithUnsignedInteger:contentPageNumber], @"page", [NSValue valueWithRect:contentViewport], @"viewport", [NSNumber numberWithBool:contentSortColIsAsc], @"sortIsAsc", + @(activeFilter), @"activeFilter", nil]; if (contentSortCol) [contentState setObject:contentSortCol forKey:@"sortCol"]; if (contentSelectedRows) [contentState setObject:contentSelectedRows forKey:@"selection"]; @@ -329,6 +331,7 @@ [NSNumber numberWithBool:contentSortColIsAsc], @"contentSortColIsAsc", [NSNumber numberWithInteger:contentPageNumber], @"contentPageNumber", [NSValue valueWithRect:contentViewport], @"contentViewport", + @(activeFilter), @"activeFilter", nil]; if (contentSortCol) [newEntry setObject:contentSortCol forKey:@"contentSortCol"]; if (contentSelectedRows) [newEntry setObject:contentSelectedRows forKey:@"contentSelection"]; @@ -387,6 +390,7 @@ [tableContentInstance setSelectionToRestore:[historyEntry objectForKey:@"contentSelection"]]; [tableContentInstance setViewportToRestore:[[historyEntry objectForKey:@"contentViewport"] rectValue]]; [tableContentInstance setFiltersToRestore:[historyEntry objectForKey:@"contentFilterV2"]]; + [tableContentInstance setActiveFilterToRestore:(SPTableContentFilterSource)[[historyEntry objectForKey:@"activeFilter"] integerValue]]; // If the database, table, and view are the same and content - just trigger a table reload (filters) if ( @@ -503,6 +507,7 @@ abort_entry_load: [tableContentInstance setSelectionToRestore:[contentState objectForKey:@"selection"]]; [tableContentInstance setViewportToRestore:[[contentState objectForKey:@"viewport"] rectValue]]; [tableContentInstance setFiltersToRestore:[contentState objectForKey:@"filterV2"]]; + [tableContentInstance setActiveFilterToRestore:(SPTableContentFilterSource)[[contentState objectForKey:@"activeFilter"] integerValue]]; } #pragma mark - |