Improve preferences
@ -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>
|
||||
|
BIN
prefs/Resources/app_icons/AlienBlue.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
prefs/Resources/app_icons/AlienBlue@2x.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
prefs/Resources/app_icons/AlienBlue@3x.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
prefs/Resources/app_icons/Antenna.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
prefs/Resources/app_icons/Antenna@2x.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
prefs/Resources/app_icons/Antenna@3x.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
prefs/Resources/app_icons/Apollo.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
prefs/Resources/app_icons/Apollo@2x.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
prefs/Resources/app_icons/Apollo@3x.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
prefs/Resources/app_icons/BaconReader.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
prefs/Resources/app_icons/BaconReader@2x.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
prefs/Resources/app_icons/BaconReader@3x.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
prefs/Resources/app_icons/Beam.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
prefs/Resources/app_icons/Beam@2x.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
prefs/Resources/app_icons/Beam@3x.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
prefs/Resources/app_icons/Narwhal.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
prefs/Resources/app_icons/Narwhal@2x.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
prefs/Resources/app_icons/Narwhal@3x.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
prefs/Resources/app_icons/Reddit.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
prefs/Resources/app_icons/Reddit@2x.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
prefs/Resources/app_icons/Reddit@3x.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
prefs/Resources/app_icons/Slide.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
prefs/Resources/app_icons/Slide@2x.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
prefs/Resources/app_icons/Slide@3x.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
@ -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
|
||||
|