-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathItemPreferenceController.m
77 lines (64 loc) · 2.02 KB
/
ItemPreferenceController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// ItemPreferenceController.m
// CSV Touch
//
// Created by Simon Wigzell on 2018-01-14.
//
#import "ItemPreferenceController.h"
#import "CSVPreferencesController.h"
#import "CSSProvider.h"
@interface ItemPreferenceController ()
@end
@implementation ItemPreferenceController
- (void) viewWillAppear:(BOOL)animated
{
[self synchUI];
[super viewWillAppear:animated];
}
- (void) synchUI
{
showHidden.on = [CSVPreferencesController showDeletedColumns];
hideEmpty.on = [CSVPreferencesController hideEmptyColumns];
viewSelection.selectedSegmentIndex = [CSVPreferencesController selectedDetailsView];
increaseSize.enabled = [CSVPreferencesController canIncreaseDetailsFontSize];
decreaseSize.enabled = [CSVPreferencesController canDecreaseDetailsFontSize];
showImages.on = [CSVPreferencesController showInlineImages];
customCSSInfo.text = [CSSProvider customCSSExists] ? @"Custom CSS: Yes" : @"Custom CSS: No";
}
- (IBAction) showHiddenChanged:(id)sender
{
[CSVPreferencesController setShowDeletedColumns:showHidden.on];
[self.pageController refreshViewControllersData];
[self synchUI];
}
- (IBAction) hideEmptyChanged:(id)sender
{
[CSVPreferencesController setHideEmptyColumns:hideEmpty.on];
[self.pageController refreshViewControllersData];
[self synchUI];
}
- (IBAction) viewSelectionChanged:(id)sender
{
[CSVPreferencesController setSelectedDetailsView:viewSelection.selectedSegmentIndex];
[self.pageController refreshViewControllersData];
[self synchUI];
}
- (IBAction) increaseSize:(id)sender
{
[CSVPreferencesController increaseDetailsFontSize];
[self.pageController refreshViewControllersData];
[self synchUI];
}
- (IBAction) decreaseSize:(id)sender
{
[CSVPreferencesController decreaseDetailsFontSize];
[self.pageController refreshViewControllersData];
[self synchUI];
}
- (IBAction) showImages:(id)sender
{
[CSVPreferencesController setShowInlineImages:showImages.on];
[self.pageController refreshViewControllersData];
[self synchUI];
}
@end