ソースを参照

Improve preferences

master
lint 3年前
コミット
470c651166
26個のファイルの変更76行の追加1行の削除
  1. +55
    -1
      prefs/Resources/Root.plist
  2. バイナリ
      prefs/Resources/app_icons/AlienBlue.png
  3. バイナリ
      prefs/Resources/app_icons/AlienBlue@2x.png
  4. バイナリ
      prefs/Resources/app_icons/AlienBlue@3x.png
  5. バイナリ
      prefs/Resources/app_icons/Antenna.png
  6. バイナリ
      prefs/Resources/app_icons/Antenna@2x.png
  7. バイナリ
      prefs/Resources/app_icons/Antenna@3x.png
  8. バイナリ
      prefs/Resources/app_icons/Apollo.png
  9. バイナリ
      prefs/Resources/app_icons/Apollo@2x.png
  10. バイナリ
      prefs/Resources/app_icons/Apollo@3x.png
  11. バイナリ
      prefs/Resources/app_icons/BaconReader.png
  12. バイナリ
      prefs/Resources/app_icons/BaconReader@2x.png
  13. バイナリ
      prefs/Resources/app_icons/BaconReader@3x.png
  14. バイナリ
      prefs/Resources/app_icons/Beam.png
  15. バイナリ
      prefs/Resources/app_icons/Beam@2x.png
  16. バイナリ
      prefs/Resources/app_icons/Beam@3x.png
  17. バイナリ
      prefs/Resources/app_icons/Narwhal.png
  18. バイナリ
      prefs/Resources/app_icons/Narwhal@2x.png
  19. バイナリ
      prefs/Resources/app_icons/Narwhal@3x.png
  20. バイナリ
      prefs/Resources/app_icons/Reddit.png
  21. バイナリ
      prefs/Resources/app_icons/Reddit@2x.png
  22. バイナリ
      prefs/Resources/app_icons/Reddit@3x.png
  23. バイナリ
      prefs/Resources/app_icons/Slide.png
  24. バイナリ
      prefs/Resources/app_icons/Slide@2x.png
  25. バイナリ
      prefs/Resources/app_icons/Slide@3x.png
  26. +21
    -0
      prefs/TFDTSRootListController.m

+ 55
- 1
prefs/Resources/Root.plist ファイルの表示

@@ -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>

バイナリ
prefs/Resources/app_icons/AlienBlue.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.7KB

バイナリ
prefs/Resources/app_icons/AlienBlue@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 7.4KB

バイナリ
prefs/Resources/app_icons/AlienBlue@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 9.7KB

バイナリ
prefs/Resources/app_icons/Antenna.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.8KB

バイナリ
prefs/Resources/app_icons/Antenna@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 8.0KB

バイナリ
prefs/Resources/app_icons/Antenna@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 12KB

バイナリ
prefs/Resources/app_icons/Apollo.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.6KB

バイナリ
prefs/Resources/app_icons/Apollo@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 8.0KB

バイナリ
prefs/Resources/app_icons/Apollo@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 11KB

バイナリ
prefs/Resources/app_icons/BaconReader.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.5KB

バイナリ
prefs/Resources/app_icons/BaconReader@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 7.4KB

バイナリ
prefs/Resources/app_icons/BaconReader@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 10KB

バイナリ
prefs/Resources/app_icons/Beam.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.6KB

バイナリ
prefs/Resources/app_icons/Beam@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 8.0KB

バイナリ
prefs/Resources/app_icons/Beam@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 12KB

バイナリ
prefs/Resources/app_icons/Narwhal.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.4KB

バイナリ
prefs/Resources/app_icons/Narwhal@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 6.8KB

バイナリ
prefs/Resources/app_icons/Narwhal@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 8.7KB

バイナリ
prefs/Resources/app_icons/Reddit.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.3KB

バイナリ
prefs/Resources/app_icons/Reddit@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 6.5KB

バイナリ
prefs/Resources/app_icons/Reddit@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 8.5KB

バイナリ
prefs/Resources/app_icons/Slide.png ファイルの表示

変更前 変更後
幅: 29  |  高さ: 29  |  サイズ: 4.0KB

バイナリ
prefs/Resources/app_icons/Slide@2x.png ファイルの表示

変更前 変更後
幅: 58  |  高さ: 58  |  サイズ: 5.8KB

バイナリ
prefs/Resources/app_icons/Slide@3x.png ファイルの表示

変更前 変更後
幅: 87  |  高さ: 87  |  サイズ: 7.8KB

+ 21
- 0
prefs/TFDTSRootListController.m ファイルの表示

@@ -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

読み込み中…
キャンセル
保存