Skip to content
Permalink
Browse files

Changed a method to match other classes implementation

  • Loading branch information...
dmoagx committed May 9, 2018
1 parent 1838bb5 commit 523a40c4a1297c318a9632b1ab31dee2d2de1b00
Showing with 19 additions and 19 deletions.
  1. +2 −2 Source/SPTableContent.m
  2. +1 −1 Source/SPTableContentFilterController.h
  3. +16 −16 Source/SPTableContentFilterController.m
@@ -361,7 +361,7 @@ - (void)_setViewBlankState
[filterButton setEnabled:NO];
[toggleRuleFilterButton setEnabled:NO];
[toggleRuleFilterButton setState:NSOffState];
[filterControllerInstance updateFiltersFrom:self];
[filterControllerInstance setColumns:nil];

// Disable pagination
[paginationPreviousButton setEnabled:NO];
@@ -636,7 +636,7 @@ - (void) setTableDetails:(NSDictionary *)tableDetails

[filterTableController setColumns:dataColumns];
// Enable and initialize filter fields (with tags for position of menu item and field position)
[filterControllerInstance updateFiltersFrom:self];
[filterControllerInstance setColumns:dataColumns];
// Restore preserved filter settings if appropriate and valid
[filterControllerInstance restoreSerializedFilters:filtersToRestore];
//if we did restore some filters, set filtering enabled
@@ -65,7 +65,7 @@ NSString * const SPTableContentFilterHeightChangedNotification;
*/
- (void)focusFirstInputField;

- (void)updateFiltersFrom:(SPTableContent *)tableContent;
- (void)setColumns:(NSArray *)dataColumns;

- (void)openContentFilterManagerForFilterType:(NSString *)filterType;

@@ -437,7 +437,7 @@ - (BOOL)_focusOnFieldInSubtree:(NSDictionary *)dict
return NO;
}

- (void)updateFiltersFrom:(SPTableContent *)tableContent
- (void)setColumns:(NSArray *)dataColumns;
{
[self willChangeValueForKey:@"model"]; // manual KVO is needed for filter rule editor to notice change
[model removeAllObjects];
@@ -446,22 +446,22 @@ - (void)updateFiltersFrom:(SPTableContent *)tableContent
[columns removeAllObjects];

//without a table there is nothing to filter
if(![tableContent selectedTable]) return;

//sort column names if enabled
NSArray *columnDefinitions = [tableContent dataColumnDefinitions];
if([[NSUserDefaults standardUserDefaults] boolForKey:SPAlphabeticalTableSorting]) {
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
columnDefinitions = [columnDefinitions sortedArrayUsingDescriptors:@[sortDescriptor]];
}
if(dataColumns) {
//sort column names if enabled
NSArray *columnDefinitions = dataColumns;
if ([[NSUserDefaults standardUserDefaults] boolForKey:SPAlphabeticalTableSorting]) {
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
columnDefinitions = [columnDefinitions sortedArrayUsingDescriptors:@[sortDescriptor]];
}

// get the columns
for(NSDictionary *colDef in columnDefinitions) {
ColumnNode *node = [[ColumnNode alloc] init];
[node setName:[colDef objectForKey:@"name"]];
[node setTypegrouping:[colDef objectForKey:@"typegrouping"]];
[columns addObject:node];
[node release];
// get the columns
for (NSDictionary *colDef in columnDefinitions) {
ColumnNode *node = [[ColumnNode alloc] init];
[node setName:[colDef objectForKey:@"name"]];
[node setTypegrouping:[colDef objectForKey:@"typegrouping"]];
[columns addObject:node];
[node release];
}
}

// make the rule editor reload the criteria

0 comments on commit 523a40c

Please sign in to comment.
You can’t perform that action at this time.