1
0
mirror of https://github.com/lint/TFDidThatSay synced 2025-07-05 16:56:47 +00:00

Improve preferences

This commit is contained in:
lint
2020-06-02 16:12:41 -04:00
parent 92f992ec1c
commit 470c651166
26 changed files with 76 additions and 1 deletions

View File

@ -8,10 +8,32 @@
<key>cell</key>
<string>PSGroupCell</string>
<key>footerText</key>
<string>To enable/disable, restart the app.</string>
<string>Fully enable/disable the tweak.</string>
<key>label</key>
<string>Enabled</string>
</dict>
<dict>
<key>PostNotification</key>
<string>com.lint.undelete.prefs.changed</string>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.lint.undelete.prefs</string>
<key>key</key>
<string>isEnabled</string>
<key>label</key>
<string>Enabled</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Enabled Applications</string>
<key>footerText</key>
<string>To enable/disable, restart the app.</string>
</dict>
<dict>
<key>PostNotification</key>
<string>com.lint.undelete.prefs.changed</string>
@ -25,6 +47,10 @@
<string>isAlienBlueEnabled</string>
<key>label</key>
<string>Enable Alien Blue</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/AlienBlue.png</string>
</dict>
<dict>
<key>PostNotification</key>
@ -39,6 +65,10 @@
<string>isAntennaEnabled</string>
<key>label</key>
<string>Enable Antenna</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/Antenna.png</string>
</dict>
<dict>
<key>PostNotification</key>
@ -53,6 +83,10 @@
<string>isApolloEnabled</string>
<key>label</key>
<string>Enable Apollo</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/Apollo.png</string>
</dict>
<dict>
<key>PostNotification</key>
@ -67,6 +101,10 @@
<string>isBaconReaderEnabled</string>
<key>label</key>
<string>Enable BaconReader</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/BaconReader.png</string>
</dict>
<dict>
<key>PostNotification</key>
@ -81,6 +119,10 @@
<string>isBeamEnabled</string>
<key>label</key>
<string>Enable Beam</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/Beam.png</string>
</dict>
<dict>
<key>PostNotification</key>
@ -95,6 +137,10 @@
<string>isNarwhalEnabled</string>
<key>label</key>
<string>Enable Narwhal</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/Narwhal.png</string>
</dict>
<dict>
<key>PostNotification</key>
@ -109,6 +155,10 @@
<string>isRedditEnabled</string>
<key>label</key>
<string>Enable Reddit</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/Reddit.png</string>
</dict>
<dict>
<key>PostNotification</key>
@ -123,6 +173,10 @@
<string>isSlideEnabled</string>
<key>label</key>
<string>Enable Slide</string>
<key>hasIcon</key>
<true/>
<key>icon</key>
<string>app_icons/Slide.png</string>
</dict>
<dict>
<key>cell</key>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -1,4 +1,5 @@
#include "TFDTSRootListController.h"
#import <Preferences/PSSpecifier.h>
@implementation TFDTSRootListController
@ -10,4 +11,24 @@
return _specifiers;
}
- (id)readPreferenceValue:(PSSpecifier*)specifier {
NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]];
NSMutableDictionary *settings = [NSMutableDictionary dictionary];
[settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:path]];
return (settings[specifier.properties[@"key"]]) ?: specifier.properties[@"default"];
}
- (void)setPreferenceValue:(id)value specifier:(PSSpecifier*)specifier {
NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]];
NSMutableDictionary *settings = [NSMutableDictionary dictionary];
[settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:path]];
[settings setObject:value forKey:specifier.properties[@"key"]];
[settings writeToFile:path atomically:YES];
CFStringRef notificationName = (__bridge CFStringRef)specifier.properties[@"PostNotification"];
if (notificationName) {
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), notificationName, NULL, NULL, YES);
}
}
@end