Skip to content

Commit 1a29647

Browse files
committed
Store last made choice for rule filter visibility across sessions (#3304)
1 parent 664a46c commit 1a29647

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Source/SPConstants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ extern NSString *SPResetAutoIncrementAfterDeletionOfAllRows;
392392
extern NSString *SPFavoriteColorList;
393393
extern NSString *SPDisplayBinaryDataAsHex;
394394
extern NSString *SPMonospacedFontSize;
395+
extern NSString *SPRuleFilterEditorLastVisibilityChoice;
395396

396397
// Hidden Prefs
397398
extern NSString *SPPrintWarningRowLimit;

Source/SPConstants.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
NSString *SPFavoriteColorList = @"FavoriteColorList";
178178
NSString *SPDisplayBinaryDataAsHex = @"DisplayBinaryDataAsHex";
179179
NSString *SPMonospacedFontSize = @"MonospacedFontSize";
180+
NSString *SPRuleFilterEditorLastVisibilityChoice = @"RuleFilterEditorLastVisibilityChoice";
180181

181182
// Hidden Prefs
182183
NSString *SPPrintWarningRowLimit = @"PrintWarningRowLimit";

Source/SPTableContent.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ - (id)init
175175
tableRowsSelectable = YES;
176176
isFirstChangeInView = YES;
177177

178-
showFilterRuleEditor = NO;
179-
180178
isFiltered = NO;
181179
isLimited = NO;
182180
isInterruptedLoad = NO;
183181

184182
prefs = [NSUserDefaults standardUserDefaults];
185183

184+
showFilterRuleEditor = [prefs boolForKey:SPRuleFilterEditorLastVisibilityChoice];
185+
186186
usedQuery = [[NSString alloc] initWithString:@""];
187187

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

0 commit comments

Comments
 (0)