Skip to content
Permalink
Browse files

Store last made choice for rule filter visibility across sessions (#3304

)
  • Loading branch information...
dmoagx committed Jun 14, 2019
1 parent 664a46c commit 1a29647e407bb96ca31d4840e584f1fa54098481
Showing with 5 additions and 2 deletions.
  1. +1 −0 Source/SPConstants.h
  2. +1 −0 Source/SPConstants.m
  3. +3 −2 Source/SPTableContent.m
@@ -392,6 +392,7 @@ extern NSString *SPResetAutoIncrementAfterDeletionOfAllRows;
extern NSString *SPFavoriteColorList;
extern NSString *SPDisplayBinaryDataAsHex;
extern NSString *SPMonospacedFontSize;
extern NSString *SPRuleFilterEditorLastVisibilityChoice;

// Hidden Prefs
extern NSString *SPPrintWarningRowLimit;
@@ -177,6 +177,7 @@
NSString *SPFavoriteColorList = @"FavoriteColorList";
NSString *SPDisplayBinaryDataAsHex = @"DisplayBinaryDataAsHex";
NSString *SPMonospacedFontSize = @"MonospacedFontSize";
NSString *SPRuleFilterEditorLastVisibilityChoice = @"RuleFilterEditorLastVisibilityChoice";

// Hidden Prefs
NSString *SPPrintWarningRowLimit = @"PrintWarningRowLimit";
@@ -175,14 +175,14 @@ - (id)init
tableRowsSelectable = YES;
isFirstChangeInView = YES;

showFilterRuleEditor = NO;

isFiltered = NO;
isLimited = NO;
isInterruptedLoad = NO;

prefs = [NSUserDefaults standardUserDefaults];

showFilterRuleEditor = [prefs boolForKey:SPRuleFilterEditorLastVisibilityChoice];

usedQuery = [[NSString alloc] initWithString:@""];

tableLoadTimer = nil;
@@ -1350,6 +1350,7 @@ - (void)filterTableTask
- (IBAction)toggleRuleEditorVisible:(id)sender
{
BOOL shouldShow = !showFilterRuleEditor;
[prefs setBool:shouldShow forKey:SPRuleFilterEditorLastVisibilityChoice];
[self setRuleEditorVisible:shouldShow animate:YES];
// if this was the active filter before, it no longer can be the active filter when it is hidden
if(activeFilter == SPTableContentFilterSourceRuleFilter && !shouldShow) {

0 comments on commit 1a29647

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