diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-04-24 23:58:39 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2008-04-24 23:58:39 +0000 |
commit | d73cede290a1b1432804cb4596239275e623a7a9 (patch) | |
tree | 02efe2427d6ce45311b399605831fa4e014312a7 /Cydia.mm | |
parent | 36bb2ca28f46dfb1362e20da38cc51bac4ed821a (diff) |
Fixed keyboard click sound thingees.
Diffstat (limited to 'Cydia.mm')
-rw-r--r-- | Cydia.mm | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -424,6 +424,9 @@ static CGColor Clear_; static CGColor Red_; static CGColor White_; +static NSString *Home_; +static BOOL Sounds_Keyboard_; + const char *Firmware_ = NULL; const char *Machine_ = NULL; const char *SerialNumber_ = NULL; @@ -4243,6 +4246,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString CGSize keysize = [UIKeyboard defaultSize]; CGRect keyrect = {{0, [overlay_ bounds].size.height - keysize.height}, keysize}; keyboard_ = [[UIKeyboard alloc] initWithFrame:keyrect]; + [[UIKeyboardImpl sharedInstance] setSoundsEnabled:(Sounds_Keyboard_ ? YES : NO)]; [self reloadData]; [book_ update]; @@ -4324,8 +4328,19 @@ id Dealloc_(id self, SEL selector) { }*/ int main(int argc, char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + bootstrap_ = argc > 1 && strcmp(argv[1], "--bootstrap") == 0; + Home_ = NSHomeDirectory(); + + { + NSString *plist = [Home_ stringByAppendingString:@"/Library/Preferences/com.apple.preferences.sounds.plist"]; + if (NSDictionary *sounds = [NSDictionary dictionaryWithContentsOfFile:plist]) + if (NSNumber *keyboard = [sounds objectForKey:@"keyboard"]) + Sounds_Keyboard_ = [keyboard boolValue]; + } + setuid(0); setgid(0); @@ -4337,8 +4352,6 @@ int main(int argc, char *argv[]) { dealloc_ = dealloc->method_imp; dealloc->method_imp = (IMP) &Dealloc_;*/ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - if (NSDictionary *sysver = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]) { if (NSString *prover = [sysver valueForKey:@"ProductVersion"]) { Firmware_ = strdup([prover UTF8String]); |