From d236b8089002e0bad5ee547b8b81a881bb67180d Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 11 Mar 2012 20:49:08 +0000 Subject: [PATCH] Change the default SummerBoard setting to NO. --- Library.mm | 5 ++++- Settings.mm | 15 ++++++++++++++- WinterBoardSettings.bundle/WinterBoard.plist | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Library.mm b/Library.mm index c0b7284..814de11 100644 --- a/Library.mm +++ b/Library.mm @@ -200,7 +200,7 @@ static BOOL (*_GSFontGetUseLegacyFontMetrics)(); static bool Debug_ = false; static bool UIDebug_ = false; static bool Engineer_ = false; -static bool SummerBoard_ = true; +static bool SummerBoard_ = false; static bool SpringBoard_; static UIImage *(*_UIApplicationImageWithName)(NSString *name); @@ -1972,6 +1972,9 @@ MSInitialize { if (NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/User/Library/Preferences/com.saurik.WinterBoard.plist"]]) { if (NSNumber *value = [settings objectForKey:@"SummerBoard"]) SummerBoard_ = [value boolValue]; + else + SummerBoard_ = true; + if (NSNumber *value = [settings objectForKey:@"Debug"]) Debug_ = [value boolValue]; if (NSNumber *value = [settings objectForKey:@"RecordUI"]) diff --git a/Settings.mm b/Settings.mm index 442e97c..3a506d7 100644 --- a/Settings.mm +++ b/Settings.mm @@ -448,7 +448,20 @@ static NSString *_plist; - (id) initForContentSize:(CGSize)size { if ((self = [super initForContentSize:size]) != nil) { _plist = [[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist", NSHomeDirectory()] retain]; - _settings = [([NSMutableDictionary dictionaryWithContentsOfFile:_plist] ?: [NSMutableDictionary dictionary]) retain]; + _settings = [NSMutableDictionary dictionaryWithContentsOfFile:_plist]; + + bool set; + if (_settings != nil) + set = true; + else { + set = false; + _settings = [NSMutableDictionary dictionary]; + } + + _settings = [_settings retain]; + + if (set && [_settings objectForKey:@"SummerBoard"] == nil) + [_settings setObject:[NSNumber numberWithBool:YES] forKey:@"SummerBoard"]; [_settings setObject:[NSNumber numberWithBool:IsIconHiddenDisplayId(WinterBoardDisplayID)] forKey:@"IconHidden"]; } return self; diff --git a/WinterBoardSettings.bundle/WinterBoard.plist b/WinterBoardSettings.bundle/WinterBoard.plist index ae12724..6dad33a 100644 --- a/WinterBoardSettings.bundle/WinterBoard.plist +++ b/WinterBoardSettings.bundle/WinterBoard.plist @@ -60,7 +60,7 @@ cell PSSwitchCell default - + key SummerBoard label -- 2.45.2