From 4143623d4fdf19c2669c53f404c2785eb9cded16 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Fri, 20 Jul 2012 15:56:16 +0200 Subject: [PATCH] Improve settings --- Classes/InCallViewController.m | 9 +- Classes/LinphoneCoreSettingsStore.m | 89 ++++- Classes/LinphoneManager.h | 2 +- Classes/LinphoneManager.m | 19 +- Classes/SettingsViewController.h | 2 +- Classes/SettingsViewController.m | 110 +++-- Classes/SettingsViewController.xib | 13 +- .../IASKAppSettingsViewController.h | 15 +- .../IASKAppSettingsViewController.m | 251 ++++++++---- .../IASKAppSettingsWebViewController.h | 2 +- .../IASKAppSettingsWebViewController.m | 34 +- .../IASKSpecifierValuesViewController.h | 4 +- .../IASKSpecifierValuesViewController.m | 16 + .../Controllers/IASKViewController.h | 0 InAppSettingsKit/Models/IASKSettingsReader.h | 19 +- InAppSettingsKit/Models/IASKSettingsReader.m | 38 +- InAppSettingsKit/Models/IASKSettingsStore.h | 0 InAppSettingsKit/Models/IASKSettingsStore.m | 2 +- .../Models/IASKSettingsStoreFile.h | 0 .../Models/IASKSettingsStoreFile.m | 0 .../Models/IASKSettingsStoreUserDefaults.h | 0 .../Models/IASKSettingsStoreUserDefaults.m | 0 InAppSettingsKit/Models/IASKSpecifier.h | 5 +- InAppSettingsKit/Models/IASKSpecifier.m | 31 ++ .../Views/IASKPSSliderSpecifierViewCell.h | 6 +- .../Views/IASKPSSliderSpecifierViewCell.m | 50 ++- .../Views/IASKPSTextFieldSpecifierViewCell.h | 4 +- .../Views/IASKPSTextFieldSpecifierViewCell.m | 55 ++- .../Views/IASKPSTitleValueSpecifierViewCell.h | 0 .../Views/IASKPSTitleValueSpecifierViewCell.m | 28 +- .../IASKPSToggleSwitchSpecifierViewCell.h | 29 -- .../IASKPSToggleSwitchSpecifierViewCell.m | 62 --- InAppSettingsKit/Views/IASKSlider.h | 0 InAppSettingsKit/Views/IASKSlider.m | 0 InAppSettingsKit/Views/IASKSwitch.h | 0 InAppSettingsKit/Views/IASKSwitch.m | 0 InAppSettingsKit/Views/IASKTextField.h | 0 InAppSettingsKit/Views/IASKTextField.m | 0 InAppSettingsKit/Xibs/IASKAppSettingsView.xib | 222 ---------- .../Xibs/IASKAppSettingsWebView.xib | 378 ------------------ .../Xibs/IASKPSSliderSpecifierViewCell.xib | 251 ------------ .../Xibs/IASKPSTextFieldSpecifierViewCell.xib | 254 ------------ .../IASKPSToggleSwitchSpecifierViewCell.xib | 237 ----------- .../Xibs/IASKSpecifierValuesView.xib | 255 ------------ Settings/InAppSettings.bundle/Advanced.plist | 174 ++++---- Settings/InAppSettings.bundle/Call.plist | 57 +++ Settings/InAppSettings.bundle/Network.plist | 103 +++++ Settings/InAppSettings.bundle/Root.plist | 76 +++- Settings/InAppSettings.bundle/Video.plist | 18 + linphone.xcodeproj/project.pbxproj | 53 --- linphonerc | 2 +- 51 files changed, 864 insertions(+), 2111 deletions(-) mode change 100644 => 100755 InAppSettingsKit/Controllers/IASKAppSettingsViewController.h mode change 100644 => 100755 InAppSettingsKit/Controllers/IASKAppSettingsViewController.m mode change 100644 => 100755 InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h mode change 100644 => 100755 InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m mode change 100644 => 100755 InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h mode change 100644 => 100755 InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m mode change 100644 => 100755 InAppSettingsKit/Controllers/IASKViewController.h mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsReader.h mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsReader.m mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsStore.h mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsStore.m mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsStoreFile.h mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsStoreFile.m mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsStoreUserDefaults.h mode change 100644 => 100755 InAppSettingsKit/Models/IASKSettingsStoreUserDefaults.m mode change 100644 => 100755 InAppSettingsKit/Models/IASKSpecifier.h mode change 100644 => 100755 InAppSettingsKit/Models/IASKSpecifier.m mode change 100644 => 100755 InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h mode change 100644 => 100755 InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m mode change 100644 => 100755 InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h mode change 100644 => 100755 InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m mode change 100644 => 100755 InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h mode change 100644 => 100755 InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m delete mode 100644 InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.h delete mode 100644 InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.m mode change 100644 => 100755 InAppSettingsKit/Views/IASKSlider.h mode change 100644 => 100755 InAppSettingsKit/Views/IASKSlider.m mode change 100644 => 100755 InAppSettingsKit/Views/IASKSwitch.h mode change 100644 => 100755 InAppSettingsKit/Views/IASKSwitch.m mode change 100644 => 100755 InAppSettingsKit/Views/IASKTextField.h mode change 100644 => 100755 InAppSettingsKit/Views/IASKTextField.m delete mode 100644 InAppSettingsKit/Xibs/IASKAppSettingsView.xib delete mode 100644 InAppSettingsKit/Xibs/IASKAppSettingsWebView.xib delete mode 100644 InAppSettingsKit/Xibs/IASKPSSliderSpecifierViewCell.xib delete mode 100644 InAppSettingsKit/Xibs/IASKPSTextFieldSpecifierViewCell.xib delete mode 100644 InAppSettingsKit/Xibs/IASKPSToggleSwitchSpecifierViewCell.xib delete mode 100644 InAppSettingsKit/Xibs/IASKSpecifierValuesView.xib create mode 100644 Settings/InAppSettings.bundle/Call.plist create mode 100644 Settings/InAppSettings.bundle/Network.plist diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index e83afaf97..3a17abc5e 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -326,8 +326,11 @@ static UICompositeViewDescription *compositeDescription = nil; [UIView commitAnimations]; } - [videoView setAlpha: 1.0]; - [videoView setHidden: FALSE]; + if([[[LinphoneManager instance] settingsStore] boolForKey:@"self_video_preference"]) { + [videoPreview setHidden:FALSE]; + } else { + [videoPreview setHidden:TRUE]; + } if ([LinphoneManager instance].frontCamId !=nil) { // only show camera switch button if we have more than 1 camera @@ -343,7 +346,7 @@ static UICompositeViewDescription *compositeDescription = nil; #endif // [self batteryLevelChanged:nil]; - videoWaitingForFirstImage.hidden = NO; + [videoWaitingForFirstImage setHidden: NO]; [videoWaitingForFirstImage startAnimating]; LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]); diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index a26823e82..68b3a7e35 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -102,6 +102,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setString: linphone_address_get_username(addr) forKey:@"username_preference"]; [self setString: linphone_address_get_domain(addr) forKey:@"domain_preference"]; + [self setInteger: linphone_proxy_config_get_expires(cfg) forKey:@"expire_preference"]; if (strcmp(linphone_address_get_domain(addr),linphone_address_get_domain(proxy_addr))!=0 || port!=NULL){ char tmp[256]={0}; @@ -117,14 +118,32 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } } + { + LinphoneAddress *parsed=linphone_core_get_primary_contact_parsed(lc); + if(parsed != NULL) { + [self setString: linphone_address_get_display_name(parsed) forKey:@"primary_displayname_preference"]; + [self setString: linphone_address_get_username(parsed) forKey:@"primary_username_preference"]; + } + } { LCSipTransports tp; - const char *tname="udp"; + const char *tname = "udp"; + int port = 5060; linphone_core_get_sip_transports(lc, &tp); - if (tp.udp_port>0) tname="udp"; - else if (tp.tcp_port>0) tname="tcp"; - else if (tp.tls_port>0) tname="tls"; - [self setString: tname forKey:@"transport_preference"]; + if (tp.udp_port>0) { + tname = "udp"; + port = tp.udp_port; + } else if (tp.tcp_port>0) { + tname = "tcp"; + port = tp.tcp_port; + } else if (tp.tls_port>0) { + tname = "tls"; + port = tp.tls_port; + } + [self setString:tname forKey:@"transport_preference"]; + [self setInteger:port forKey:@"port_preference"]; + + [self setInteger:lp_config_get_int(linphone_core_get_config(lc),"app","random_port_preference", 1) forKey:@"random_port_preference"]; } { LinphoneAuthInfo *ai; @@ -163,10 +182,9 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","wifi_only_preference", 0) forKey:@"wifi_only_preference"]; [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","backgroundmode_preference", TRUE) forKey:@"backgroundmode_preference"]; /*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/ - BOOL start_at_boot; - if ([[NSUserDefaults standardUserDefaults] objectForKey:@"start_at_boot_preference"]==Nil) - start_at_boot=TRUE; - else start_at_boot=[[NSUserDefaults standardUserDefaults] boolForKey:@"start_at_boot_preference"]; + BOOL start_at_boot = TRUE; + if ([[NSUserDefaults standardUserDefaults] objectForKey:@"start_at_boot_preference"]!=Nil) + start_at_boot=[[NSUserDefaults standardUserDefaults] boolForKey:@"start_at_boot_preference"]; [self setBool: start_at_boot forKey:@"start_at_boot_preference"]; if (linphone_core_tunnel_available()){ @@ -180,8 +198,15 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); const LinphoneVideoPolicy *pol; [self setBool: linphone_core_video_enabled(lc) forKey:@"enable_video_preference"]; pol=linphone_core_get_video_policy(lc); - [self setBool:(pol->automatically_accept && pol->automatically_initiate) forKey:@"start_video_preference"]; + [self setBool:(pol->automatically_initiate) forKey:@"start_video_preference"]; + [self setBool:(pol->automatically_accept) forKey:@"accept_video_preference"]; + [self setBool:lp_config_get_int(linphone_core_get_config(lc),"app","self_video_preference", 1) forKey:@"self_video_preference"]; } + { + [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","sipinfo_dtmf_preference", 0) forKey:@"sipinfo_dtmf_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","rfc_dtmf_preference", 1) forKey:@"rfc_dtmf_preference"]; + } + if (lp_config_get_int(linphone_core_get_config(lc),"app","debugenable_preference",0)) linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler); @@ -226,7 +251,11 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } NSString* transport = [self stringForKey:@"transport_preference"]; - + int port_preference = [self integerForKey:@"port_preference"]; + BOOL random_port_preference = [self boolForKey:@"random_port_preference"]; + if(random_port_preference) { + port_preference = (0xDFFF&random())+1024; + } LCSipTransports transportValue={0}; if (transport!=nil) { if (linphone_core_get_sip_transports(lc, &transportValue)) { @@ -234,15 +263,15 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } // Only one port can be set at one time, the others's value is 0 if ([transport isEqualToString:@"tcp"]) { - if (transportValue.tcp_port == 0) transportValue.tcp_port=transportValue.udp_port + transportValue.tls_port; + transportValue.tcp_port=port_preference; transportValue.udp_port=0; transportValue.tls_port=0; } else if ([transport isEqualToString:@"udp"]){ - if (transportValue.udp_port == 0) transportValue.udp_port=transportValue.tcp_port + transportValue.tls_port; + transportValue.udp_port=port_preference; transportValue.tcp_port=0; transportValue.tls_port=0; } else if ([transport isEqualToString:@"tls"]){ - if (transportValue.tls_port == 0) transportValue.tls_port=transportValue.udp_port + transportValue.tcp_port; + transportValue.tls_port=port_preference; transportValue.tcp_port=0; transportValue.udp_port=0; } else { @@ -252,12 +281,12 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [LinphoneLogger logc:LinphoneLoggerError format:"cannot set transport"]; } } + lp_config_set_int(linphone_core_get_config(lc),"app","random_port_preference",random_port_preference); //configure sip account //mandatory parameters - NSString* username = [self stringForKey:@"username_preference"]; NSString* domain = [self stringForKey:@"domain_preference"]; NSString* accountPassword = [self stringForKey:@"password_preference"]; @@ -305,7 +334,10 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); if (isWifiOnly && lLinphoneMgr.connectivity == wwan) { linphone_proxy_config_expires(proxyCfg, 0); } else { - linphone_proxy_config_expires(proxyCfg, lLinphoneMgr.defaultExpires); + int expire = [self integerForKey:@"expire_preference"]; + if(expire < lLinphoneMgr.defaultExpires) + expire = lLinphoneMgr.defaultExpires; + linphone_proxy_config_expires(proxyCfg, expire); } if (isOutboundProxy) @@ -332,9 +364,12 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); account_changed=[self valueChangedForKey:@"username_preference"] || [self valueChangedForKey:@"password_preference"] || [self valueChangedForKey:@"domain_preference"] + || [self valueChangedForKey:@"expire_preference"] || [self valueChangedForKey:@"proxy_preference"] || [self valueChangedForKey:@"outbound_proxy_preference"] || [self valueChangedForKey:@"transport_preference"] + || [self valueChangedForKey:@"port_preference"] + || [self valueChangedForKey:@"random_port_preference"] || [self valueChangedForKey:@"prefix_preference"] || [self valueChangedForKey:@"substitute_+_by_00_preference"]; @@ -357,6 +392,9 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); linphone_core_enable_payload_type(lc,pt,[self boolForKey: pref]); } + linphone_core_set_use_info_for_dtmf(lc, [self boolForKey:@"sipinfo_dtmf_preference"]); + linphone_core_set_use_rfc2833_for_dtmf(lc, [self boolForKey:@"rfc_dtmf_preference"]); + bool enableVideo = [self boolForKey:@"enable_video_preference"]; linphone_core_enable_video(lc, enableVideo, enableVideo); @@ -377,9 +415,23 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } LinphoneVideoPolicy policy; - policy.automatically_accept = [self boolForKey:@"start_video_preference"]; + policy.automatically_accept = [self boolForKey:@"accept_video_preference"]; policy.automatically_initiate = [self boolForKey:@"start_video_preference"]; linphone_core_set_video_policy(lc, &policy); + lp_config_set_int(linphone_core_get_config(lc),"app","self_video_preference", [self boolForKey:@"self_video_preference"]); + + + // Primary contact + NSString* displayname = [self stringForKey:@"primary_displayname_preference"]; + NSString* username = [self stringForKey:@"primary_username_preference"]; + LinphoneAddress *parsed=linphone_core_get_primary_contact_parsed(lc); + if(parsed != NULL) { + linphone_address_set_display_name(parsed,[displayname cStringUsingEncoding:[NSString defaultCStringEncoding]]); + linphone_address_set_username(parsed,[username cStringUsingEncoding:[NSString defaultCStringEncoding]]); + char *contact = linphone_address_as_string(parsed); + linphone_core_set_primary_contact(lc, contact); + } + UIDevice* device = [UIDevice currentDevice]; bool backgroundSupported = false; @@ -405,6 +457,9 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); BOOL start_at_boot = [self boolForKey:@"start_at_boot_preference"]; [[NSUserDefaults standardUserDefaults] setBool: start_at_boot forKey:@"start_at_boot_preference"]; + // Force synchronize + [[NSUserDefaults standardUserDefaults] synchronize]; + [changedDict release]; changedDict = [[NSMutableDictionary alloc] init]; return YES; diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 1f3c456ae..6dcb8fe49 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -81,7 +81,7 @@ typedef struct _LinphoneCallAppData { + (BOOL)runningOnIpad; + (BOOL)isNotIphone3G; + (NSString *)getPreferenceForCodec: (const char*) name withRate: (int) rate; -+ (BOOL)codecIsSupported:(NSString *) prefName; ++ (NSSet *)unsupportedCodecs; - (void)startLibLinphone; - (void)destroyLibLinphone; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index e190be907..0ff853b5b 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -100,14 +100,14 @@ struct codec_name_pref_table codec_pref_table[]={ return Nil; } -+ (BOOL)codecIsSupported:(NSString *) prefName{ - int i; - for(i=0;codec_pref_table[i].name!=NULL;++i){ - if ([prefName compare:codec_pref_table[i].prefname]==0){ - return linphone_core_find_payload_type([LinphoneManager getLc],codec_pref_table[i].name, codec_pref_table[i].rate)!=NULL; ++ (NSSet *)unsupportedCodecs { + NSMutableSet *set = [NSMutableSet set]; + for(int i=0;codec_pref_table[i].name!=NULL;++i) { + if(linphone_core_find_payload_type([LinphoneManager getLc],codec_pref_table[i].name, codec_pref_table[i].rate) == NULL) { + [set addObject:codec_pref_table[i].prefname]; } } - return TRUE; + return set; } + (BOOL)runningOnIpad { @@ -151,6 +151,7 @@ struct codec_name_pref_table codec_pref_table[]={ fastAddressBook = [[FastAddressBook alloc] init]; database = NULL; theLinphoneManager = self; + settingsStore = nil; self.defaultExpires = 600; [self openDatabase]; } @@ -530,7 +531,7 @@ static LinphoneCoreVTable linphonec_vtable = { , [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]] , [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]] ,self); - + linphone_core_set_root_ca(theLinphoneCore, lRootCa); // Set audio assets const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; @@ -635,6 +636,10 @@ static LinphoneCoreVTable linphonec_vtable = { } + if(settingsStore != nil) { + [settingsStore release]; + } + } - (BOOL)enterBackgroundMode { diff --git a/Classes/SettingsViewController.h b/Classes/SettingsViewController.h index 7bc3df627..b85da7838 100644 --- a/Classes/SettingsViewController.h +++ b/Classes/SettingsViewController.h @@ -22,7 +22,7 @@ #import "UICompositeViewController.h" #import "IASKAppSettingsViewController.h" -@interface SettingsViewController: UIViewController { +@interface SettingsViewController: UIViewController { IASKAppSettingsViewController *settingsController; UINavigationController *navigationController; } diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 29690c4e4..c2d268efb 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -32,6 +32,13 @@ } +- (void)dealloc { + // Remove all observer + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [super dealloc]; +} + #pragma mark - UICompositeViewDelegate Functions static UICompositeViewDescription *compositeDescription = nil; @@ -67,9 +74,9 @@ static UICompositeViewDescription *compositeDescription = nil; [super viewDidLoad]; settingsController.delegate = self; - settingsController.settingsReaderDelegate = self; - settingsController.settingsStore=[[LinphoneManager instance] settingsStore]; settingsController.showCreditsFooter = FALSE; + settingsController.hiddenKeys = [self findHiddenKeys]; + settingsController.settingsStore = [[LinphoneManager instance] settingsStore]; navigationController.view.frame = self.view.frame; [SettingsViewController removeBackground:navigationController.view]; @@ -82,6 +89,11 @@ static UICompositeViewDescription *compositeDescription = nil; if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [settingsController viewWillDisappear:animated]; } + [settingsController dismiss:self]; + // Set observer + [[NSNotificationCenter defaultCenter] removeObserver:self + name:kIASKAppSettingChanged + object:nil]; } - (void)viewWillAppear:(BOOL)animated { @@ -89,6 +101,11 @@ static UICompositeViewDescription *compositeDescription = nil; if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [settingsController viewWillAppear:animated]; } + // Set observer + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(appSettingChanged:) + name:kIASKAppSettingChanged + object:nil]; } - (void)viewDidAppear:(BOOL)animated { @@ -106,48 +123,63 @@ static UICompositeViewDescription *compositeDescription = nil; } -#pragma mark - IASKSettingsReaderFilterDelegate Functions +#pragma mark - Event Functions -- (NSDictionary*)filterPreferenceSpecifier:(NSDictionary *)specifier { - if (![LinphoneManager isLcReady]) { - // LinphoneCore not ready: do not filter - return specifier; - } - NSString* identifier = [specifier objectForKey:@"Identifier"]; - if (identifier == nil) { - identifier = [specifier objectForKey:@"Key"]; - } - if (!identifier) { - // child pane maybe - NSString* title = [specifier objectForKey:@"Title"]; - if ([title isEqualToString:@"Video"]) { - if (!linphone_core_video_supported([LinphoneManager getLc])) - return nil; +- (void)appSettingChanged:(NSNotification*) notif { + if([@"enable_video_preference" compare: notif.object] == NSOrderedSame) { + BOOL enable = [[notif.userInfo objectForKey:@"enable_video_preference"] boolValue]; + NSMutableSet *hiddenKeys = [NSMutableSet setWithSet:[settingsController hiddenKeys]]; + if(!enable) { + [hiddenKeys addObject:@"video_menu"]; + } else { + [hiddenKeys removeObject:@"video_menu"]; } - return specifier; - } - // NSLog(@"Specifier received: %@", identifier); - if ([identifier isEqualToString:@"silk_24k_preference"]) { - if (![LinphoneManager isNotIphone3G]) - return nil; - } - if ([identifier isEqualToString:@"backgroundmode_preference"]) { - UIDevice* device = [UIDevice currentDevice]; - if ([device respondsToSelector:@selector(isMultitaskingSupported)]) { - if ([device isMultitaskingSupported]) { - return specifier; - } + [settingsController setHiddenKeys:hiddenKeys animated:TRUE]; + }else if([@"random_port_preference" compare: notif.object] == NSOrderedSame) { + BOOL enable = [[notif.userInfo objectForKey:@"random_port_preference"] boolValue]; + NSMutableSet *hiddenKeys = [NSMutableSet setWithSet:[settingsController hiddenKeys]]; + if(enable) { + [hiddenKeys addObject:@"port_preference"]; + } else { + [hiddenKeys removeObject:@"port_preference"]; } - // hide setting if bg mode not supported - return nil; + [settingsController setHiddenKeys:hiddenKeys animated:TRUE]; } - if ([identifier isEqualToString:@"enable_first_login_view_preference"]) { - // hide first login view preference - return nil; +} + + +#pragma mark - + +- (NSSet*)findHiddenKeys { + if(![LinphoneManager isLcReady]) { + [LinphoneLogger log:LinphoneLoggerWarning format:@"Can't filter settings: Linphone core not read"]; } - if (![LinphoneManager codecIsSupported:identifier]) - return Nil; - return specifier; + NSMutableSet *hiddenKeys = [NSMutableSet set]; + + if (!linphone_core_video_supported([LinphoneManager getLc])) + [hiddenKeys addObject:@"video_menu"]; + + if (![LinphoneManager isNotIphone3G]) + [hiddenKeys addObject:@"silk_24k_preference"]; + + UIDevice* device = [UIDevice currentDevice]; + if (![device respondsToSelector:@selector(isMultitaskingSupported)] || ![device isMultitaskingSupported]) { + [hiddenKeys addObject:@"backgroundmode_preference"]; + } + + [hiddenKeys addObject:@"enable_first_login_view_preference"]; + + if (!linphone_core_video_enabled([LinphoneManager getLc])) { + [hiddenKeys addObject:@"video_menu"]; + } + + [hiddenKeys addObjectsFromArray:[[LinphoneManager unsupportedCodecs] allObjects]]; + + if([[[[LinphoneManager instance] settingsStore] objectForKey:@"random_port_preference"] boolValue]) { + [hiddenKeys addObject:@"port_preference"]; + } + + return hiddenKeys; } diff --git a/Classes/SettingsViewController.xib b/Classes/SettingsViewController.xib index bdc898967..4d1cbfb30 100644 --- a/Classes/SettingsViewController.xib +++ b/Classes/SettingsViewController.xib @@ -40,6 +40,7 @@ {320, 460} + _NS:9 3 @@ -75,7 +76,6 @@ IBCocoaTouchFramework - IASKAppSettingsView 1 @@ -195,17 +195,6 @@ IASKAppSettingsViewController UITableViewController - - dismiss: - id - - - dismiss: - - dismiss: - id - - delegate id diff --git a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h old mode 100644 new mode 100755 index f98f3b494..780a084f1 --- a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h +++ b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h @@ -17,7 +17,6 @@ #import #import -#import "IASKSettingsReader.h" #import "IASKSettingsStore.h" #import "IASKViewController.h" @@ -54,18 +53,18 @@ error:(NSError*)error; #pragma mark - respond to button taps -- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForKey:(NSString*)key; +- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForKey:(NSString*)key __attribute__((deprecated)); // use the method below with specifier instead +- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForSpecifier:(IASKSpecifier*)specifier; - (void)settingsViewController:(IASKAppSettingsViewController*)sender tableView:(UITableView *)tableView didSelectCustomViewSpecifier:(IASKSpecifier*)specifier; @end -@interface IASKAppSettingsViewController : UITableViewController { +@interface IASKAppSettingsViewController : UITableViewController { id _delegate; NSMutableArray *_viewList; IASKSettingsReader *_settingsReader; - id _settingsReaderDelegate; id _settingsStore; NSString *_file; @@ -73,15 +72,17 @@ BOOL _showCreditsFooter; BOOL _showDoneButton; + + NSSet *_hiddenKeys; } @property (nonatomic, assign) IBOutlet id delegate; @property (nonatomic, copy) NSString *file; -@property (nonatomic, assign) id settingsReaderDelegate; @property (nonatomic, assign) BOOL showCreditsFooter; @property (nonatomic, assign) BOOL showDoneButton; +@property (nonatomic, retain) NSSet *hiddenKeys; - (void)synchronizeSettings; -- (IBAction)dismiss:(id)sender; - +- (void)dismiss:(id)sender; +- (void)setHiddenKeys:(NSSet*)hiddenKeys animated:(BOOL)animated; @end diff --git a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m old mode 100644 new mode 100755 index 557c33730..a6c143136 --- a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m +++ b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m @@ -18,7 +18,6 @@ #import "IASKAppSettingsViewController.h" #import "IASKSettingsReader.h" #import "IASKSettingsStoreUserDefaults.h" -#import "IASKPSToggleSwitchSpecifierViewCell.h" #import "IASKPSSliderSpecifierViewCell.h" #import "IASKPSTextFieldSpecifierViewCell.h" #import "IASKPSTitleValueSpecifierViewCell.h" @@ -45,8 +44,6 @@ CGRect IASKCGRectSwap(CGRect rect); @property (nonatomic, retain) NSMutableArray *viewList; @property (nonatomic, retain) id currentFirstResponder; -- (void) setup; - - (void)_textChanged:(id)sender; - (void)synchronizeSettings; - (void)userDefaultsDidChange; @@ -63,12 +60,12 @@ CGRect IASKCGRectSwap(CGRect rect); @synthesize showCreditsFooter = _showCreditsFooter; @synthesize showDoneButton = _showDoneButton; @synthesize settingsStore = _settingsStore; -@synthesize settingsReaderDelegate = _settingsReaderDelegate; +@synthesize hiddenKeys = _hiddenKeys; #pragma mark accessors - (IASKSettingsReader*)settingsReader { if (!_settingsReader) { - _settingsReader = [[IASKSettingsReader alloc] initWithFile:self.file andDelegate:self.settingsReaderDelegate]; + _settingsReader = [[IASKSettingsReader alloc] initWithFile:self.file]; } return _settingsReader; } @@ -96,6 +93,7 @@ CGRect IASKCGRectSwap(CGRect rect); self.tableView.contentOffset = CGPointMake(0, 0); self.settingsReader = nil; // automatically initializes itself + [_hiddenKeys release], _hiddenKeys = nil; [self.tableView reloadData]; } @@ -109,32 +107,40 @@ CGRect IASKCGRectSwap(CGRect rect); #pragma mark standard view controller methods - (id)init { - return [self initWithNibName:@"IASKAppSettingsView" bundle:nil]; + return [self initWithStyle:UITableViewStyleGrouped]; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // If set to YES, will add a DONE button at the right of the navigation bar - _showDoneButton = YES; - - [self setup]; +- (id)initWithStyle:(UITableViewStyle)style +{ + if (style != UITableViewStyleGrouped) { + NSLog(@"only UITableViewStyleGrouped style is supported, forcing it."); + } + self = [super initWithStyle:UITableViewStyleGrouped]; + if (self) { + self.tableView.delegate = self; + self.tableView.dataSource = self; + _showDoneButton = YES; + // If set to YES, will display credits for InAppSettingsKit creators + _showCreditsFooter = YES; } return self; } -- (void)awakeFromNib { - // If set to YES, will add a DONE button at the right of the navigation bar - // if loaded via NIB, it's likely we sit in a TabBar- or NavigationController - // and thus don't need the Done button - _showDoneButton = NO; - - [self setup]; +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if (!nibNameOrNil) { + return [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + } + NSLog (@"%@ is now deprecated, we are moving away from nibs.", NSStringFromSelector(_cmd)); + return [self initWithStyle:UITableViewStyleGrouped]; } -//common (NIB & code based) initialization -- (void) setup { - // If set to YES, will display credits for InAppSettingsKit creators - _showCreditsFooter = YES; +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + [self initWithStyle:UITableViewStyleGrouped]; + } + return self; } - (NSMutableArray *)viewList { @@ -151,6 +157,10 @@ CGRect IASKCGRectSwap(CGRect rect); if ([self isPad]) { self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched; } + UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapToEndEdit:)]; + tapGesture.cancelsTouchesInView = NO; + [self.tableView addGestureRecognizer:tapGesture]; + [tapGesture release]; } - (void)viewDidUnload { @@ -174,7 +184,6 @@ CGRect IASKCGRectSwap(CGRect rect); } self.navigationItem.rightBarButtonItem = nil; - self.navigationController.delegate = self; if (_showDoneButton) { UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self @@ -217,11 +226,9 @@ CGRect IASKCGRectSwap(CGRect rect); - (void)viewDidDisappear:(BOOL)animated { [[NSNotificationCenter defaultCenter] removeObserver:self]; - if (!self.navigationController.delegate) { - // hide the keyboard when we're popping from the navigation controller - [self.currentFirstResponder resignFirstResponder]; - } - [self dismiss:nil]; + // hide the keyboard + [self.currentFirstResponder resignFirstResponder]; + [super viewDidDisappear:animated]; } @@ -236,12 +243,95 @@ CGRect IASKCGRectSwap(CGRect rect); // Release any cached data, images, etc that aren't in use. } -- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { - if (![viewController isKindOfClass:[IASKAppSettingsViewController class]] && ![viewController isKindOfClass:[IASKSpecifierValuesViewController class]]) { - [self dismiss:nil]; - } +- (void)setHiddenKeys:(NSSet *)theHiddenKeys { + [self setHiddenKeys:theHiddenKeys animated:NO]; } + +- (void)setHiddenKeys:(NSSet*)theHiddenKeys animated:(BOOL)animated { + if (_hiddenKeys != theHiddenKeys) { + NSSet *oldHiddenKeys = _hiddenKeys; + _hiddenKeys = [theHiddenKeys retain]; + + if (animated) { + [self.tableView beginUpdates]; + + NSMutableSet *showKeys = [NSMutableSet setWithSet:oldHiddenKeys]; + [showKeys minusSet:theHiddenKeys]; + + NSMutableSet *hideKeys = [NSMutableSet setWithSet:theHiddenKeys]; + [hideKeys minusSet:oldHiddenKeys]; + + // calculate rows to be deleted + NSMutableArray *hideIndexPaths = [NSMutableArray array]; + for (NSString *key in hideKeys) { + NSIndexPath *indexPath = [self.settingsReader indexPathForKey:key]; + if (indexPath) { + [hideIndexPaths addObject:indexPath]; + } + } + + // calculate sections to be deleted + NSMutableIndexSet *hideSections = [NSMutableIndexSet indexSet]; + for (NSInteger section = 0; section < [self numberOfSectionsInTableView:self.tableView ]; section++) { + NSUInteger rowsInSection = 0; + for (NSIndexPath *indexPath in hideIndexPaths) { + if (indexPath.section == section) { + rowsInSection++; + } + } + if (rowsInSection >= [self.settingsReader numberOfRowsForSection:section]) { + [hideSections addIndex:section]; + } + } + + // set the datasource + self.settingsReader.hiddenKeys = theHiddenKeys; + + + // calculate rows to be inserted + NSMutableArray *showIndexPaths = [NSMutableArray array]; + for (NSString *key in showKeys) { + NSIndexPath *indexPath = [self.settingsReader indexPathForKey:key]; + if (indexPath) { + [showIndexPaths addObject:indexPath]; + } + } + + // calculate sections to be inserted + NSMutableIndexSet *showSections = [NSMutableIndexSet indexSet]; + for (NSInteger section = 0; section < [self.settingsReader numberOfSections]; section++) { + NSUInteger rowsInSection = 0; + for (NSIndexPath *indexPath in showIndexPaths) { + if (indexPath.section == section) { + rowsInSection++; + } + } + if (rowsInSection >= [self.settingsReader numberOfRowsForSection:section]) { + [showSections addIndex:section]; + } + } + + UITableViewRowAnimation animation = animated ? UITableViewRowAnimationTop : UITableViewRowAnimationNone; + [self.tableView deleteSections:hideSections withRowAnimation:animation]; + [self.tableView deleteRowsAtIndexPaths:hideIndexPaths withRowAnimation:animation]; + [self.tableView insertSections:showSections withRowAnimation:animation]; + [self.tableView insertRowsAtIndexPaths:showIndexPaths withRowAnimation:animation]; + [self.tableView endUpdates]; + } else { + self.settingsReader.hiddenKeys = theHiddenKeys; + [self.tableView reloadData]; + } + [oldHiddenKeys release]; + + IASKAppSettingsViewController *targetViewController = [[self.viewList objectAtIndex:kIASKSpecifierChildViewControllerIndex] objectForKey:@"viewController"]; + if(targetViewController != nil) { + [targetViewController setHiddenKeys:theHiddenKeys animated:animated]; + } + } +} + + - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -250,6 +340,7 @@ CGRect IASKCGRectSwap(CGRect rect); [_currentFirstResponder release], _currentFirstResponder = nil; [_settingsReader release], _settingsReader = nil; [_settingsStore release], _settingsStore = nil; + [_hiddenKeys release], _hiddenKeys = nil; _delegate = nil; @@ -260,20 +351,16 @@ CGRect IASKCGRectSwap(CGRect rect); #pragma mark - #pragma mark Actions -- (IBAction)dismiss:(id)sender { +- (void)dismiss:(id)sender { [self.settingsStore synchronize]; - self.navigationController.delegate = nil; if (self.delegate && [self.delegate conformsToProtocol:@protocol(IASKSettingsDelegate)]) { [self.delegate settingsViewControllerDidEnd:self]; } - // reload - [self.settingsReader initWithFile:self.file andDelegate:self.settingsReaderDelegate]; - [self.tableView reloadData]; } - (void)toggledValue:(id)sender { - IASKSwitch *toggle = (IASKSwitch*)sender; + IASKSwitch *toggle = [[(IASKSwitch*)sender retain] autorelease]; IASKSpecifier *spec = [_settingsReader specifierForKey:[toggle key]]; if ([toggle isOn]) { @@ -299,7 +386,7 @@ CGRect IASKCGRectSwap(CGRect rect); } - (void)sliderChangedValue:(id)sender { - IASKSlider *slider = (IASKSlider*)sender; + IASKSlider *slider = [[(IASKSlider*)sender retain] autorelease]; [self.settingsStore setFloat:[slider value] forKey:[slider key]]; [[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:[slider key] @@ -385,37 +472,35 @@ CGRect IASKCGRectSwap(CGRect rect); } } -- (UITableViewCell*)dequeueReusableCellWithIdentifier:(NSString*)identifier { +- (UITableViewCell*)newCellForIdentifier:(NSString*)identifier { UITableViewCell *cell = nil; if ([identifier isEqualToString:kIASKPSToggleSwitchSpecifier]) { - cell = [[[NSBundle mainBundle] loadNibNamed:@"IASKPSToggleSwitchSpecifierViewCell" - owner:self - options:nil] objectAtIndex:0]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kIASKPSToggleSwitchSpecifier]; + cell.accessoryView = [[[IASKSwitch alloc] initWithFrame:CGRectMake(0, 0, 79, 27)] autorelease]; + [((IASKSwitch*)cell.accessoryView) addTarget:self action:@selector(toggledValue:) forControlEvents:UIControlEventValueChanged]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; } else if ([identifier isEqualToString:kIASKPSMultiValueSpecifier] || [identifier isEqualToString:kIASKPSTitleValueSpecifier]) { - cell = [[[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier] autorelease]; + cell = [[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; cell.accessoryType = [identifier isEqualToString:kIASKPSMultiValueSpecifier] ? UITableViewCellAccessoryDisclosureIndicator : UITableViewCellAccessoryNone; } else if ([identifier isEqualToString:kIASKPSTextFieldSpecifier]) { - cell = (IASKPSTextFieldSpecifierViewCell*) [[[NSBundle mainBundle] loadNibNamed:@"IASKPSTextFieldSpecifierViewCell" - owner:self - options:nil] objectAtIndex:0]; + cell = [[IASKPSTextFieldSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kIASKPSTextFieldSpecifier]; + [((IASKPSTextFieldSpecifierViewCell*)cell).textField addTarget:self action:@selector(_textChanged:) forControlEvents:UIControlEventEditingChanged]; } else if ([identifier isEqualToString:kIASKPSSliderSpecifier]) { - cell = (IASKPSSliderSpecifierViewCell*) [[[NSBundle mainBundle] loadNibNamed:@"IASKPSSliderSpecifierViewCell" - owner:self - options:nil] objectAtIndex:0]; + cell = [[IASKPSSliderSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kIASKPSSliderSpecifier]; } else if ([identifier isEqualToString:kIASKPSChildPaneSpecifier]) { - cell = [[[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier] autorelease]; + cell = [[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - } else if ([identifier isEqualToString:kIASKButtonSpecifier]) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease]; } else if ([identifier isEqualToString:kIASKMailComposeSpecifier]) { - cell = [[[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier] autorelease]; + cell = [[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; } else { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; } + cell.textLabel.minimumFontSize = kIASKMinimumFontSize; + cell.detailTextLabel.minimumFontSize = kIASKMinimumFontSize; return cell; } @@ -427,10 +512,13 @@ CGRect IASKCGRectSwap(CGRect rect); return cell; } - UITableViewCell *cell = [self dequeueReusableCellWithIdentifier:specifier.type]; + UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:specifier.type]; + if(nil == cell) { + cell = [[self newCellForIdentifier:specifier.type] autorelease]; + } if ([specifier.type isEqualToString:kIASKPSToggleSwitchSpecifier]) { - ((IASKPSToggleSwitchSpecifierViewCell*)cell).label.text = specifier.title; + cell.textLabel.text = specifier.title; id currentValue = [self.settingsStore objectForKey:specifier.key]; BOOL toggleState; @@ -445,10 +533,9 @@ CGRect IASKCGRectSwap(CGRect rect); } else { toggleState = specifier.defaultBoolValue; } - ((IASKPSToggleSwitchSpecifierViewCell*)cell).toggle.on = toggleState; - - [((IASKPSToggleSwitchSpecifierViewCell*)cell).toggle addTarget:self action:@selector(toggledValue:) forControlEvents:UIControlEventValueChanged]; - ((IASKPSToggleSwitchSpecifierViewCell*)cell).toggle.key = specifier.key; + IASKSwitch *toggle = (IASKSwitch*)cell.accessoryView; + toggle.on = toggleState; + toggle.key = specifier.key; } else if ([specifier.type isEqualToString:kIASKPSMultiValueSpecifier]) { cell.textLabel.text = specifier.title; @@ -470,7 +557,7 @@ CGRect IASKCGRectSwap(CGRect rect); cell.userInteractionEnabled = NO; } else if ([specifier.type isEqualToString:kIASKPSTextFieldSpecifier]) { - ((IASKPSTextFieldSpecifierViewCell*)cell).label.text = specifier.title; + cell.textLabel.text = specifier.title; NSString *textValue = [self.settingsStore objectForKey:specifier.key] != nil ? [self.settingsStore objectForKey:specifier.key] : specifier.defaultStringValue; if (textValue && ![textValue isMemberOfClass:[NSString class]]) { @@ -483,13 +570,13 @@ CGRect IASKCGRectSwap(CGRect rect); textField.secureTextEntry = [specifier isSecure]; textField.keyboardType = specifier.keyboardType; textField.autocapitalizationType = specifier.autocapitalizationType; - [textField addTarget:self action:@selector(_textChanged:) forControlEvents:UIControlEventEditingChanged]; if([specifier isSecure]){ textField.autocorrectionType = UITextAutocorrectionTypeNo; } else { textField.autocorrectionType = specifier.autoCorrectionType; } - [cell setNeedsLayout]; + textField.textAlignment = specifier.textAlignment; + textField.adjustsFontSizeToFitWidth = specifier.adjustsFontSizeToFitWidth; } else if ([specifier.type isEqualToString:kIASKPSSliderSpecifier]) { if (specifier.minimumValueImage.length > 0) { @@ -516,11 +603,20 @@ CGRect IASKCGRectSwap(CGRect rect); } else if ([specifier.type isEqualToString:kIASKButtonSpecifier]) { NSString *value = [self.settingsStore objectForKey:specifier.key]; cell.textLabel.text = [value isKindOfClass:[NSString class]] ? [self.settingsReader titleForStringId:value] : specifier.title; - cell.textLabel.textAlignment = UITextAlignmentCenter; } else { cell.textLabel.text = specifier.title; } - return cell; + + cell.imageView.image = specifier.cellImage; + cell.imageView.highlightedImage = specifier.highlightedCellImage; + + if (![specifier.type isEqualToString:kIASKPSMultiValueSpecifier] && ![specifier.type isEqualToString:kIASKPSTitleValueSpecifier] && ![specifier.type isEqualToString:kIASKPSTextFieldSpecifier]) { + cell.textLabel.textAlignment = specifier.textAlignment; + } + cell.detailTextLabel.textAlignment = specifier.textAlignment; + cell.textLabel.adjustsFontSizeToFitWidth = specifier.adjustsFontSizeToFitWidth; + cell.detailTextLabel.adjustsFontSizeToFitWidth = specifier.adjustsFontSizeToFitWidth; + return cell; } - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { @@ -554,7 +650,7 @@ CGRect IASKCGRectSwap(CGRect rect); NSMutableDictionary *newItemDict = [NSMutableDictionary dictionaryWithCapacity:3]; [newItemDict addEntriesFromDictionary: [self.viewList objectAtIndex:kIASKSpecifierValuesViewControllerIndex]]; // copy the title and explain strings - targetViewController = [[IASKSpecifierValuesViewController alloc] initWithNibName:@"IASKSpecifierValuesView" bundle:nil]; + targetViewController = [[IASKSpecifierValuesViewController alloc] init]; // add the new view controller to the dictionary and then to the 'viewList' array [newItemDict setObject:targetViewController forKey:@"viewController"]; [self.viewList replaceObjectAtIndex:kIASKSpecifierValuesViewControllerIndex withObject:newItemDict]; @@ -589,7 +685,6 @@ CGRect IASKCGRectSwap(CGRect rect); if ([vc respondsToSelector:@selector(setSettingsStore:)]) { [vc performSelector:@selector(setSettingsStore:) withObject:self.settingsStore]; } - self.navigationController.delegate = nil; [self.navigationController pushViewController:vc animated:YES]; [vc performSelector:@selector(release)]; return; @@ -608,7 +703,7 @@ CGRect IASKCGRectSwap(CGRect rect); NSMutableDictionary *newItemDict = [NSMutableDictionary dictionaryWithCapacity:3]; [newItemDict addEntriesFromDictionary: [self.viewList objectAtIndex:kIASKSpecifierChildViewControllerIndex]]; // copy the title and explain strings - targetViewController = [[[self class] alloc] initWithNibName:@"IASKAppSettingsView" bundle:nil]; + targetViewController = [[[self class] alloc] init]; targetViewController.showDoneButton = NO; targetViewController.settingsStore = self.settingsStore; targetViewController.delegate = self.delegate; @@ -621,9 +716,8 @@ CGRect IASKCGRectSwap(CGRect rect); // load the view controll back in to push it targetViewController = [[self.viewList objectAtIndex:kIASKSpecifierChildViewControllerIndex] objectForKey:@"viewController"]; } - targetViewController.settingsReaderDelegate = self.settingsReaderDelegate; - targetViewController.file = specifier.file; // changes settingsReader - + targetViewController.file = specifier.file; + targetViewController.hiddenKeys = self.hiddenKeys; targetViewController.title = specifier.title; targetViewController.showCreditsFooter = NO; [[self navigationController] pushViewController:targetViewController animated:YES]; @@ -632,7 +726,11 @@ CGRect IASKCGRectSwap(CGRect rect); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:specifier.file]]; } else if ([[specifier type] isEqualToString:kIASKButtonSpecifier]) { [tableView deselectRowAtIndexPath:indexPath animated:YES]; - if ([self.delegate respondsToSelector:@selector(settingsViewController:buttonTappedForKey:)]) { + if ([self.delegate respondsToSelector:@selector(settingsViewController:buttonTappedForSpecifier:)]) { + [self.delegate settingsViewController:self buttonTappedForSpecifier:specifier]; + } else if ([self.delegate respondsToSelector:@selector(settingsViewController:buttonTappedForKey:)]) { + // deprecated, provided for backward compatibility + NSLog(@"InAppSettingsKit Warning: -settingsViewController:buttonTappedForKey: is deprecated. Please use -settingsViewController:buttonTappedForSpecifier:"); [self.delegate settingsViewController:self buttonTappedForKey:[specifier key]]; } else { // legacy code, provided for backward compatibility @@ -736,7 +834,7 @@ CGRect IASKCGRectSwap(CGRect rect); } - (void)_textChanged:(id)sender { - IASKTextField *text = (IASKTextField*)sender; + IASKTextField *text = [[(IASKTextField*)sender retain] autorelease]; [_settingsStore setObject:[text text] forKey:[text key]]; [[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:[text key] @@ -750,6 +848,9 @@ CGRect IASKCGRectSwap(CGRect rect); return YES; } +- (void)singleTapToEndEdit:(UIGestureRecognizer *)sender { + [self.tableView endEditing:NO]; +} #pragma mark Notifications diff --git a/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h b/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h old mode 100644 new mode 100755 index 08b6ceb27..4805ddf3c --- a/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h +++ b/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h @@ -24,7 +24,7 @@ - (id)initWithFile:(NSString*)htmlFileName key:(NSString*)key; -@property (nonatomic, retain) IBOutlet UIWebView *webView; +@property (nonatomic, retain) UIWebView *webView; @property (nonatomic, retain) NSURL *url; @end diff --git a/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m b/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m old mode 100644 new mode 100755 index 46429b3ce..feb95ddc9 --- a/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m +++ b/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m @@ -22,21 +22,29 @@ @synthesize webView; - (id)initWithFile:(NSString*)urlString key:(NSString*)key { - if (!(self = [super initWithNibName:nil bundle:nil])) { - return nil; - } - - self.url = [NSURL URLWithString:urlString]; - if (!self.url || ![self.url scheme]) { - NSString *path = [[NSBundle mainBundle] pathForResource:[urlString stringByDeletingPathExtension] ofType:[urlString pathExtension]]; - if(path) - self.url = [NSURL fileURLWithPath:path]; - else - self.url = nil; - } - return self; + self = [super init]; + if (self) { + self.url = [NSURL URLWithString:urlString]; + if (!self.url || ![self.url scheme]) { + NSString *path = [[NSBundle mainBundle] pathForResource:[urlString stringByDeletingPathExtension] ofType:[urlString pathExtension]]; + if(path) + self.url = [NSURL fileURLWithPath:path]; + else + self.url = nil; + } + } + return self; } +- (void)loadView +{ + webView = [[UIWebView alloc] init]; + webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | + UIViewAutoresizingFlexibleHeight; + webView.delegate = self; + + self.view = webView; +} - (void)dealloc { [webView release], webView = nil; diff --git a/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h b/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h old mode 100644 new mode 100755 index d2810d368..85f6d9fc2 --- a/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h +++ b/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.h @@ -20,7 +20,7 @@ @class IASKSpecifier; @class IASKSettingsReader; -@interface IASKSpecifierValuesViewController : UIViewController { +@interface IASKSpecifierValuesViewController : UIViewController { UITableView *_tableView; IASKSpecifier *_currentSpecifier; @@ -29,7 +29,7 @@ id _settingsStore; } -@property (nonatomic, retain) IBOutlet UITableView *tableView; +@property (nonatomic, retain) UITableView *tableView; @property (nonatomic, retain) NSIndexPath *checkedItem; @property (nonatomic, retain) IASKSpecifier *currentSpecifier; diff --git a/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m b/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m old mode 100644 new mode 100755 index 84236a755..bd0b82ac6 --- a/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m +++ b/InAppSettingsKit/Controllers/IASKSpecifierValuesViewController.m @@ -52,6 +52,17 @@ return _settingsStore; } +- (void)loadView +{ + _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + _tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | + UIViewAutoresizingFlexibleHeight; + _tableView.delegate = self; + _tableView.dataSource = self; + + self.view = _tableView; +} + - (void)viewWillAppear:(BOOL)animated { if (_currentSpecifier) { [self setTitle:[_currentSpecifier title]]; @@ -178,6 +189,11 @@ forKey:[_currentSpecifier key]]]; } +- (CGSize)contentSizeForViewInPopover { + return [[self view] sizeThatFits:CGSizeMake(320, 2000)]; +} + + #pragma mark Notifications - (void)userDefaultsDidChange { diff --git a/InAppSettingsKit/Controllers/IASKViewController.h b/InAppSettingsKit/Controllers/IASKViewController.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Models/IASKSettingsReader.h b/InAppSettingsKit/Models/IASKSettingsReader.h old mode 100644 new mode 100755 index c66156d8b..761de7546 --- a/InAppSettingsKit/Models/IASKSettingsReader.h +++ b/InAppSettingsKit/Models/IASKSettingsReader.h @@ -17,6 +17,8 @@ #import #define kIASKPreferenceSpecifiers @"PreferenceSpecifiers" +#define kIASKCellImage @"IASKCellImage" + #define kIASKType @"Type" #define kIASKTitle @"Title" #define kIASKFooterText @"FooterText" @@ -59,6 +61,11 @@ #define kIASKAutoCorrYes @"Yes" #define kIASKMinimumValueImage @"MinimumValueImage" #define kIASKMaximumValueImage @"MaximumValueImage" +#define kIASKAdjustsFontSizeToFitWidth @"IASKAdjustsFontSizeToFitWidth" +#define kIASKTextLabelAlignment @"IASKTextAlignment" +#define kIASKTextLabelAlignmentLeft @"IASKUITextAlignmentLeft" +#define kIASKTextLabelAlignmentCenter @"IASKUITextAlignmentCenter" +#define kIASKTextLabelAlignmentRight @"IASKUITextAlignmentRight" #define kIASKPSGroupSpecifier @"PSGroupSpecifier" #define kIASKPSToggleSwitchSpecifier @"PSToggleSwitchSpecifier" @@ -88,6 +95,7 @@ #define kIASKTableWidth 320 #define kIASKSpacing 5 #define kIASKMinLabelWidth 97 +#define kIASKMaxLabelWidth 240 #define kIASKMinValueWidth 35 #define kIASKPaddingLeft 9 #define kIASKPaddingRight 10 @@ -97,6 +105,8 @@ #define kIASKLabelFontSize 17 #define kIASKgrayBlueColor [UIColor colorWithRed:0.318 green:0.4 blue:0.569 alpha:1.0] +#define kIASKMinimumFontSize 12.0f + #ifndef kCFCoreFoundationVersionNumber_iPhoneOS_4_0 #define kCFCoreFoundationVersionNumber_iPhoneOS_4_0 550.32 #endif @@ -114,10 +124,6 @@ __VA_ARGS__ \ @class IASKSpecifier; -@protocol IASKSettingsReaderFilterDelegate -- (NSDictionary*) filterPreferenceSpecifier:(NSDictionary*)specifier; -@end - @interface IASKSettingsReader : NSObject { NSString *_path; NSString *_localizationTable; @@ -125,10 +131,10 @@ __VA_ARGS__ \ NSDictionary *_settingsBundle; NSArray *_dataSource; NSBundle *_bundle; - id _delegate; + NSSet *_hiddenKeys; } -- (id)initWithFile:(NSString*)file andDelegate:(id)delegate; +- (id)initWithFile:(NSString*)file; - (NSInteger)numberOfSections; - (NSInteger)numberOfRowsForSection:(NSInteger)section; - (IASKSpecifier*)specifierForIndexPath:(NSIndexPath*)indexPath; @@ -145,5 +151,6 @@ __VA_ARGS__ \ @property (nonatomic, retain) NSString *bundlePath; @property (nonatomic, retain) NSDictionary *settingsBundle; @property (nonatomic, retain) NSArray *dataSource; +@property (nonatomic, retain) NSSet *hiddenKeys; @end diff --git a/InAppSettingsKit/Models/IASKSettingsReader.m b/InAppSettingsKit/Models/IASKSettingsReader.m old mode 100644 new mode 100755 index 7e53458ec..7e15fce1e --- a/InAppSettingsKit/Models/IASKSettingsReader.m +++ b/InAppSettingsKit/Models/IASKSettingsReader.m @@ -31,14 +31,14 @@ localizationTable=_localizationTable, bundlePath=_bundlePath, settingsBundle=_settingsBundle, -dataSource=_dataSource; - +dataSource=_dataSource, +hiddenKeys = _hiddenKeys; - (id)init { - return [self initWithFile:@"Root" andDelegate:nil]; + return [self initWithFile:@"Root"]; } -- (id)initWithFile:(NSString*)file andDelegate:(id)delegate{ +- (id)initWithFile:(NSString*)file { if ((self=[super init])) { @@ -61,7 +61,7 @@ dataSource=_dataSource; self.localizationTable = @"Root"; } } - _delegate=delegate; + if (_settingsBundle) { [self _reinterpretBundle:_settingsBundle]; } @@ -76,23 +76,34 @@ dataSource=_dataSource; [_settingsBundle release], _settingsBundle = nil; [_dataSource release], _dataSource = nil; [_bundle release], _bundle = nil; + [_hiddenKeys release], _hiddenKeys = nil; [super dealloc]; } + +- (void)setHiddenKeys:(NSSet *)anHiddenKeys { + if (_hiddenKeys != anHiddenKeys) { + id old = _hiddenKeys; + _hiddenKeys = [anHiddenKeys retain]; + [old release]; + + if (_settingsBundle) { + [self _reinterpretBundle:_settingsBundle]; + } + } +} + + - (void)_reinterpretBundle:(NSDictionary*)settingsBundle { NSArray *preferenceSpecifiers = [settingsBundle objectForKey:kIASKPreferenceSpecifiers]; NSInteger sectionCount = -1; NSMutableArray *dataSource = [[[NSMutableArray alloc] init] autorelease]; for (NSDictionary *specifier in preferenceSpecifiers) { - if (_delegate != nil) { - specifier = [_delegate filterPreferenceSpecifier:specifier]; - if (specifier == nil) { - // skip - continue; - } - } + if ([self.hiddenKeys containsObject:[specifier objectForKey:kIASKKey]]) { + continue; + } if ([(NSString*)[specifier objectForKey:kIASKType] isEqualToString:kIASKPSGroupSpecifier]) { NSMutableArray *newArray = [[NSMutableArray alloc] init]; @@ -127,8 +138,7 @@ dataSource=_dataSource; - (NSInteger)numberOfRowsForSection:(NSInteger)section { int headingCorrection = [self _sectionHasHeading:section] ? 1 : 0; - NSInteger ret= [(NSArray*)[[self dataSource] objectAtIndex:section] count] - headingCorrection; - return ret; + return [(NSArray*)[[self dataSource] objectAtIndex:section] count] - headingCorrection; } - (IASKSpecifier*)specifierForIndexPath:(NSIndexPath*)indexPath { diff --git a/InAppSettingsKit/Models/IASKSettingsStore.h b/InAppSettingsKit/Models/IASKSettingsStore.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Models/IASKSettingsStore.m b/InAppSettingsKit/Models/IASKSettingsStore.m old mode 100644 new mode 100755 index 8efbe7da2..db858fa7c --- a/InAppSettingsKit/Models/IASKSettingsStore.m +++ b/InAppSettingsKit/Models/IASKSettingsStore.m @@ -65,4 +65,4 @@ return NO; } -@end \ No newline at end of file +@end diff --git a/InAppSettingsKit/Models/IASKSettingsStoreFile.h b/InAppSettingsKit/Models/IASKSettingsStoreFile.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Models/IASKSettingsStoreFile.m b/InAppSettingsKit/Models/IASKSettingsStoreFile.m old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Models/IASKSettingsStoreUserDefaults.h b/InAppSettingsKit/Models/IASKSettingsStoreUserDefaults.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Models/IASKSettingsStoreUserDefaults.m b/InAppSettingsKit/Models/IASKSettingsStoreUserDefaults.m old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Models/IASKSpecifier.h b/InAppSettingsKit/Models/IASKSpecifier.h old mode 100644 new mode 100755 index 1e47d1ec8..5eeec3596 --- a/InAppSettingsKit/Models/IASKSpecifier.h +++ b/InAppSettingsKit/Models/IASKSpecifier.h @@ -55,5 +55,8 @@ - (SEL)viewControllerSelector; -(Class)buttonClass; -(SEL)buttonAction; - +- (UIImage *)cellImage; +- (UIImage *)highlightedCellImage; +- (BOOL)adjustsFontSizeToFitWidth; +- (UITextAlignment)textAlignment; @end diff --git a/InAppSettingsKit/Models/IASKSpecifier.m b/InAppSettingsKit/Models/IASKSpecifier.m old mode 100644 new mode 100755 index ebb38ac01..d76beb4ab --- a/InAppSettingsKit/Models/IASKSpecifier.m +++ b/InAppSettingsKit/Models/IASKSpecifier.m @@ -237,4 +237,35 @@ return UITextAutocorrectionTypeDefault; } +- (UIImage *)cellImage +{ + return [UIImage imageNamed:[_specifierDict objectForKey:kIASKCellImage]]; +} + +- (UIImage *)highlightedCellImage +{ + return [UIImage imageNamed:[[_specifierDict objectForKey:kIASKCellImage ] stringByAppendingString:@"Highlighted"]]; +} + +- (BOOL)adjustsFontSizeToFitWidth { + NSNumber *boxedResult = [_specifierDict objectForKey:kIASKAdjustsFontSizeToFitWidth]; + return !boxedResult || [boxedResult boolValue]; +} + +- (UITextAlignment)textAlignment +{ + if ([[_specifierDict objectForKey:kIASKTextLabelAlignment] isEqualToString:kIASKTextLabelAlignmentLeft]) { + return UITextAlignmentLeft; + } else if ([[_specifierDict objectForKey:kIASKTextLabelAlignment] isEqualToString:kIASKTextLabelAlignmentCenter]) { + return UITextAlignmentCenter; + } else if ([[_specifierDict objectForKey:kIASKTextLabelAlignment] isEqualToString:kIASKTextLabelAlignmentRight]) { + return UITextAlignmentRight; + } + if ([self.type isEqualToString:kIASKButtonSpecifier] && !self.cellImage) { + return UITextAlignmentCenter; + } else if ([self.type isEqualToString:kIASKPSMultiValueSpecifier] || [self.type isEqualToString:kIASKPSTitleValueSpecifier]) { + return UITextAlignmentRight; + } + return UITextAlignmentLeft; +} @end diff --git a/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h b/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h old mode 100644 new mode 100755 index 7cc943b0a..1aca0cfe1 --- a/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h +++ b/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.h @@ -24,8 +24,8 @@ UIImageView *_maxImage; } -@property (nonatomic, assign) IBOutlet IASKSlider *slider; -@property (nonatomic, assign) IBOutlet UIImageView *minImage; -@property (nonatomic, assign) IBOutlet UIImageView *maxImage; +@property (nonatomic, assign) IASKSlider *slider; +@property (nonatomic, assign) UIImageView *minImage; +@property (nonatomic, assign) UIImageView *maxImage; @end diff --git a/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m b/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m old mode 100644 new mode 100755 index cbdca0279..dc2130d85 --- a/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m +++ b/InAppSettingsKit/Views/IASKPSSliderSpecifierViewCell.m @@ -24,6 +24,35 @@ minImage=_minImage, maxImage=_maxImage; +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Setting only frame data that will not be overwritten by layoutSubviews + // Slider + _slider = [[[IASKSlider alloc] initWithFrame:CGRectMake(0, 0, 0, 23)] autorelease]; + _slider.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | + UIViewAutoresizingFlexibleWidth; + _slider.continuous = NO; + [self.contentView addSubview:_slider]; + + // MinImage + _minImage = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 21, 21)] autorelease]; + _minImage.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | + UIViewAutoresizingFlexibleBottomMargin; + [self.contentView addSubview:_minImage]; + + // MaxImage + _maxImage = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 21, 21)] autorelease]; + _maxImage.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | + UIViewAutoresizingFlexibleBottomMargin; + [self.contentView addSubview:_maxImage]; + + self.selectionStyle = UITableViewCellSelectionStyleNone; + } + return self; +} + - (void)layoutSubviews { [super layoutSubviews]; CGRect sliderBounds = _slider.bounds; @@ -31,28 +60,27 @@ const double superViewWidth = _slider.superview.frame.size.width; sliderCenter.x = superViewWidth / 2; + sliderCenter.y = self.contentView.center.y; sliderBounds.size.width = superViewWidth - kIASKSliderNoImagesPadding * 2; _minImage.hidden = YES; _maxImage.hidden = YES; // Check if there are min and max images. If so, change the layout accordingly. - if (_minImage.image && _maxImage.image) { - // Both images - _minImage.hidden = NO; - _maxImage.hidden = NO; - sliderBounds.size.width = superViewWidth - kIASKSliderImagesPadding * 2; - } - else if (_minImage.image) { + if (_minImage.image) { // Min image _minImage.hidden = NO; sliderCenter.x += (kIASKSliderImagesPadding - kIASKSliderNoImagesPadding) / 2; - sliderBounds.size.width = superViewWidth - kIASKSliderNoImagesPadding - kIASKSliderImagesPadding; - } - else if (_maxImage.image) { + sliderBounds.size.width -= (kIASKSliderImagesPadding - kIASKSliderNoImagesPadding); + _minImage.center = CGPointMake(_minImage.frame.size.width / 2 + kIASKPaddingLeft, + self.contentView.center.y); + } + if (_maxImage.image) { // Max image _maxImage.hidden = NO; sliderCenter.x -= (kIASKSliderImagesPadding - kIASKSliderNoImagesPadding) / 2; - sliderBounds.size.width = superViewWidth - kIASKSliderNoImagesPadding - kIASKSliderImagesPadding; + sliderBounds.size.width -= (kIASKSliderImagesPadding - kIASKSliderNoImagesPadding); + _maxImage.center = CGPointMake(self.contentView.bounds.size.width - _maxImage.frame.size.width / 2 - kIASKPaddingRight, + self.contentView.center.y); } _slider.bounds = sliderBounds; diff --git a/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h b/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h old mode 100644 new mode 100755 index b4d70c8ad..16b90ed94 --- a/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h +++ b/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.h @@ -19,11 +19,9 @@ @class IASKTextField; @interface IASKPSTextFieldSpecifierViewCell : UITableViewCell { - UILabel *_label; IASKTextField *_textField; } -@property (nonatomic, assign) IBOutlet UILabel *label; -@property (nonatomic, assign) IBOutlet IASKTextField *textField; +@property (nonatomic, assign) IASKTextField *textField; @end diff --git a/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m b/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m old mode 100644 new mode 100755 index cf7486eea..e2db77660 --- a/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m +++ b/InAppSettingsKit/Views/IASKPSTextFieldSpecifierViewCell.m @@ -20,29 +20,54 @@ @implementation IASKPSTextFieldSpecifierViewCell -@synthesize label=_label, - textField=_textField; +@synthesize textField=_textField; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + self.textLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin; + + // TextField + _textField = [[[IASKTextField alloc] initWithFrame:CGRectMake(0, 0, 200, 21)] autorelease]; + _textField.autoresizingMask = UIViewAutoresizingFlexibleWidth | + UIViewAutoresizingFlexibleBottomMargin | + UIViewAutoresizingFlexibleLeftMargin; + _textField.font = [UIFont systemFontOfSize:17.0f]; + _textField.minimumFontSize = kIASKMinimumFontSize; + _textField.textColor = [UIColor colorWithRed:0.275 green:0.376 blue:0.522 alpha:1.000]; + [self.contentView addSubview:_textField]; + + self.selectionStyle = UITableViewCellSelectionStyleNone; + } + return self; +} - (void)layoutSubviews { [super layoutSubviews]; - CGSize labelSize = [_label sizeThatFits:CGSizeZero]; - labelSize.width = MIN(labelSize.width, _label.bounds.size.width); + + // Label + CGFloat imageOffset = self.imageView.image ? self.imageView.bounds.size.width + kIASKPaddingLeft : 0; + CGSize labelSize = [self.textLabel sizeThatFits:CGSizeZero]; + labelSize.width = MAX(labelSize.width, kIASKMinLabelWidth - imageOffset); + self.textLabel.frame = (CGRect){self.textLabel.frame.origin, {MIN(kIASKMaxLabelWidth, labelSize.width), self.textLabel.frame.size.height}} ; + // TextField + _textField.center = CGPointMake(_textField.center.x, self.contentView.center.y); CGRect textFieldFrame = _textField.frame; - textFieldFrame.origin.x = _label.frame.origin.x + MAX(kIASKMinLabelWidth, labelSize.width) + kIASKSpacing; - if (!_label.text.length) - textFieldFrame.origin.x = _label.frame.origin.x; - textFieldFrame.size.width = _textField.superview.frame.size.width - textFieldFrame.origin.x - _label.frame.origin.x; + textFieldFrame.origin.x = self.textLabel.frame.origin.x + MAX(kIASKMinLabelWidth - imageOffset, self.textLabel.frame.size.width) + kIASKSpacing; + textFieldFrame.size.width = _textField.superview.frame.size.width - textFieldFrame.origin.x - kIASKPaddingRight; + + if (!self.textLabel.text.length) { + textFieldFrame.origin.x = kIASKPaddingLeft + imageOffset; + textFieldFrame.size.width = self.contentView.bounds.size.width - 2* kIASKPaddingLeft - imageOffset; + } else if (_textField.textAlignment == UITextAlignmentRight) { + textFieldFrame.origin.x = self.textLabel.frame.origin.x + labelSize.width + kIASKSpacing; + textFieldFrame.size.width = _textField.superview.frame.size.width - textFieldFrame.origin.x - kIASKPaddingRight; + } _textField.frame = textFieldFrame; } -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - - (void)dealloc { [super dealloc]; diff --git a/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h b/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m b/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m old mode 100644 new mode 100755 index c1d5aaa55..1b7cd98a3 --- a/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m +++ b/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m @@ -21,35 +21,31 @@ @implementation IASKPSTitleValueSpecifierViewCell - (void)layoutSubviews { - // left align the value if the title is empty - if (!self.textLabel.text.length) { - self.textLabel.text = self.detailTextLabel.text; - self.detailTextLabel.text = nil; - if ([self.reuseIdentifier isEqualToString:kIASKPSMultiValueSpecifier]) { - self.textLabel.font = [UIFont systemFontOfSize:[UIFont labelFontSize]]; - self.textLabel.textColor = self.detailTextLabel.textColor; - } - } [super layoutSubviews]; CGSize viewSize = [self.textLabel superview].frame.size; - //if there's an image, make room for it - CGFloat imageOffset = self.imageView.image ? self.imageView.bounds.size.width + self.imageView.frame.origin.x : 0; + // if there's an image, make room for it + CGFloat imageOffset = floor(self.imageView.image ? self.imageView.bounds.size.width + self.imageView.frame.origin.x : 0); // set the left title label frame CGFloat labelWidth = [self.textLabel sizeThatFits:CGSizeZero].width; CGFloat minValueWidth = (self.detailTextLabel.text.length) ? kIASKMinValueWidth + kIASKSpacing : 0; labelWidth = MIN(labelWidth, viewSize.width - minValueWidth - kIASKPaddingLeft -kIASKPaddingRight - imageOffset); CGRect labelFrame = CGRectMake(kIASKPaddingLeft + imageOffset, 0, labelWidth, viewSize.height -2); + if (!self.detailTextLabel.text.length) { + labelFrame = CGRectMake(kIASKPaddingLeft + imageOffset, 0, viewSize.width - kIASKPaddingLeft - kIASKPaddingRight - imageOffset, viewSize.height -2); + } self.textLabel.frame = labelFrame; // set the right value label frame - if (self.detailTextLabel.text.length) { - CGRect valueFrame = CGRectMake(kIASKPaddingLeft + labelWidth + kIASKSpacing + imageOffset, - 0, - viewSize.width - (kIASKPaddingLeft + labelWidth + kIASKSpacing + imageOffset) - kIASKPaddingRight, - viewSize.height -2); + if (!self.textLabel.text.length) { + viewSize = [self.detailTextLabel superview].frame.size; + self.detailTextLabel.frame = CGRectMake(kIASKPaddingLeft + imageOffset, 0, viewSize.width - kIASKPaddingLeft - kIASKPaddingRight - imageOffset, viewSize.height -2); + } else if (self.detailTextLabel.textAlignment == UITextAlignmentLeft) { + CGRect valueFrame = self.detailTextLabel.frame; + valueFrame.origin.x = labelFrame.origin.x + MAX(kIASKMinLabelWidth - imageOffset, labelWidth) + kIASKSpacing; + valueFrame.size.width = self.detailTextLabel.superview.frame.size.width - valueFrame.origin.x - kIASKPaddingRight; self.detailTextLabel.frame = valueFrame; } } diff --git a/InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.h b/InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.h deleted file mode 100644 index a6d2864bc..000000000 --- a/InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// IASKPSToggleSwitchSpecifierViewCell.h -// http://www.inappsettingskit.com -// -// Copyright (c) 2009: -// Luc Vandal, Edovia Inc., http://www.edovia.com -// Ortwin Gentz, FutureTap GmbH, http://www.futuretap.com -// All rights reserved. -// -// It is appreciated but not required that you give credit to Luc Vandal and Ortwin Gentz, -// as the original authors of this code. You can give credit in a blog post, a tweet or on -// a info page of your app. Also, the original authors appreciate letting them know if you use this code. -// -// This code is licensed under the BSD license that is available at: http://www.opensource.org/licenses/bsd-license.php -// - -#import - -@class IASKSwitch; - -@interface IASKPSToggleSwitchSpecifierViewCell : UITableViewCell { - UILabel *_label; - IASKSwitch *_toggle; -} - -@property (nonatomic, assign) IBOutlet UILabel *label; -@property (nonatomic, assign) IBOutlet IASKSwitch *toggle; - -@end diff --git a/InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.m b/InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.m deleted file mode 100644 index 13c66e285..000000000 --- a/InAppSettingsKit/Views/IASKPSToggleSwitchSpecifierViewCell.m +++ /dev/null @@ -1,62 +0,0 @@ -// -// IASKPSToggleSwitchSpecifierViewCell.m -// http://www.inappsettingskit.com -// -// Copyright (c) 2009: -// Luc Vandal, Edovia Inc., http://www.edovia.com -// Ortwin Gentz, FutureTap GmbH, http://www.futuretap.com -// All rights reserved. -// -// It is appreciated but not required that you give credit to Luc Vandal and Ortwin Gentz, -// as the original authors of this code. You can give credit in a blog post, a tweet or on -// a info page of your app. Also, the original authors appreciate letting them know if you use this code. -// -// This code is licensed under the BSD license that is available at: http://www.opensource.org/licenses/bsd-license.php -// - -#import "IASKPSToggleSwitchSpecifierViewCell.h" -#import "IASKSwitch.h" -#import "IASKSettingsReader.h" - -@implementation IASKPSToggleSwitchSpecifierViewCell - -@synthesize label=_label, - toggle=_toggle; - -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { - // Initialization code - } - return self; -} - - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - - -- (void)dealloc { - [super dealloc]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - if(self.imageView.image) { - //resize the label to make room for the image - self.label.frame = CGRectMake(CGRectGetWidth(self.imageView.bounds) + self.imageView.frame.origin.x + kIASKSpacing, - self.label.frame.origin.y, - self.toggle.frame.origin.x - CGRectGetWidth(self.imageView.bounds) - 2.f * kIASKSpacing, - self.label.frame.size.height); - } else { - self.label.frame = CGRectMake(kIASKPaddingLeft, - self.label.frame.origin.y, - self.toggle.frame.origin.x - kIASKSpacing - kIASKPaddingLeft, - self.label.frame.size.height); - } -} - -@end diff --git a/InAppSettingsKit/Views/IASKSlider.h b/InAppSettingsKit/Views/IASKSlider.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Views/IASKSlider.m b/InAppSettingsKit/Views/IASKSlider.m old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Views/IASKSwitch.h b/InAppSettingsKit/Views/IASKSwitch.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Views/IASKSwitch.m b/InAppSettingsKit/Views/IASKSwitch.m old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Views/IASKTextField.h b/InAppSettingsKit/Views/IASKTextField.h old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Views/IASKTextField.m b/InAppSettingsKit/Views/IASKTextField.m old mode 100644 new mode 100755 diff --git a/InAppSettingsKit/Xibs/IASKAppSettingsView.xib b/InAppSettingsKit/Xibs/IASKAppSettingsView.xib deleted file mode 100644 index 74720fae3..000000000 --- a/InAppSettingsKit/Xibs/IASKAppSettingsView.xib +++ /dev/null @@ -1,222 +0,0 @@ - - - - 1280 - 11B26 - 1934 - 1138 - 566.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 931 - - - YES - IBProxyObject - IBUITableView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 460} - - - - 10 - - 549453824 - {512, 1} - - YES - - YES - - - - TU0AKgAACAjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ -y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ -xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ -xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ -xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ -xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ -y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ -y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ -xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ -xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ -xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ -xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ -y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ -y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ -xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ -xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ -xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ -xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ -y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ -y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ -xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ -xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ -xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ -xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ -y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ -y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ -xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ -xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ -xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ -xczS/8vS2P/L0tj/xczU/wANAQAAAwAAAAECAAAAAQEAAwAAAAEAAQAAAQIAAwAAAAQAAAiqAQMAAwAA -AAEAAQAAAQYAAwAAAAEAAgAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEABAAAARYAAwAA -AAEAAQAAARcABAAAAAEAAAgAARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAQAAAiyAAAAAAAI -AAgACAAIAAEAAQABAAE - - - - - - 3 - MCAwAA - - - groupTableViewBackgroundColor - - NO - YES - NO - IBCocoaTouchFramework - NO - 1 - 1 - 0 - YES - 44 - 10 - 10 - - - - - YES - - - view - - - - 10 - - - - dataSource - - - - 6 - - - - delegate - - - - 7 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 4.IBPluginDependency - - - YES - IASKAppSettingsViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 10 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 931 - - diff --git a/InAppSettingsKit/Xibs/IASKAppSettingsWebView.xib b/InAppSettingsKit/Xibs/IASKAppSettingsWebView.xib deleted file mode 100644 index b814f05fc..000000000 --- a/InAppSettingsKit/Xibs/IASKAppSettingsWebView.xib +++ /dev/null @@ -1,378 +0,0 @@ - - - - 1024 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - YES - - - 274 - {320, 460} - - - 3 - MQA - - IBCocoaTouchFramework - - - {320, 460} - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - webView - - - - 5 - - - - delegate - - - - 6 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 4.IBPluginDependency - - - YES - IASKAppSettingsWebViewController - UIResponder - {{354, 412}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 6 - - - - YES - - IASKAppSettingsWebViewController - UIViewController - - webView - UIWebView - - - webView - - webView - UIWebView - - - - IBProjectSource - ../InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWebView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWebView.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../InAppSettingsKitSampleApp.xcodeproj - 3 - 123 - - diff --git a/InAppSettingsKit/Xibs/IASKPSSliderSpecifierViewCell.xib b/InAppSettingsKit/Xibs/IASKPSSliderSpecifierViewCell.xib deleted file mode 100644 index 67750384e..000000000 --- a/InAppSettingsKit/Xibs/IASKPSSliderSpecifierViewCell.xib +++ /dev/null @@ -1,251 +0,0 @@ - - - - 1296 - 11D50 - 2182 - 1138.32 - 568.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1179 - - - YES - IBUISlider - IBUITableViewCell - IBUIImageView - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 290 - - YES - - - 256 - - YES - - - 290 - {{52, 12}, {216, 23}} - - - NO - YES - YES - IBCocoaTouchFramework - 0 - 0 - 0.5 - NO - - - - 289 - {{289, 13}, {21, 21}} - - - NO - NO - 8 - NO - IBCocoaTouchFramework - - - - 292 - {{10, 13}, {21, 21}} - - - NO - NO - 7 - NO - IBCocoaTouchFramework - - - {320, 43} - - - - 3 - MCAwAA - - NO - YES - 4 - YES - IBCocoaTouchFramework - - - {320, 44} - - - - 1 - MC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEAA - - YES - NO - IBCocoaTouchFramework - 0 - - PSSliderSpecifier - - - - - YES - - - slider - - - - 12 - - - - maxImage - - - - 13 - - - - minImage - - - - 14 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - - - - 3 - - - - - 6 - - - - - 9 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 2.CustomClassName - 2.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - 6.IBPluginDependency - 9.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - IASKPSSliderSpecifierViewCell - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - IASKSlider - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 14 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 1179 - - diff --git a/InAppSettingsKit/Xibs/IASKPSTextFieldSpecifierViewCell.xib b/InAppSettingsKit/Xibs/IASKPSTextFieldSpecifierViewCell.xib deleted file mode 100644 index 43a553b9c..000000000 --- a/InAppSettingsKit/Xibs/IASKPSTextFieldSpecifierViewCell.xib +++ /dev/null @@ -1,254 +0,0 @@ - - - - 1296 - 11D50 - 2182 - 1138.32 - 568.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1179 - - - YES - IBUITableViewCell - IBUILabel - IBUITextField - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 290 - - YES - - - 256 - - YES - - - 294 - {{9, 11}, {240, 21}} - - NO - YES - NO - IBCocoaTouchFramework - Label - - 1 - MCAwIDAAA - - - 1 - 10 - - Helvetica-Bold - Helvetica - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - - - - 291 - {{100, 11}, {201, 21}} - - NO - NO - IBCocoaTouchFramework - hello - - 1 - MC4yNzQ1MDk4MiAwLjM3NjQ3MDYgMC41MjE1Njg2NgA - - YES - 10 - - 9 - IBCocoaTouchFramework - - - Helvetica - Helvetica - 0 - 17 - - - Helvetica - 17 - 16 - - - - {320, 43} - - - 3 - MCAwAA - - NO - YES - 4 - YES - IBCocoaTouchFramework - - - {320, 44} - - - 1 - MC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEAA - - YES - NO - IBCocoaTouchFramework - 0 - - PSTextFieldSpecifier - - - - - YES - - - label - - - - 8 - - - - textField - - - - 9 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - - - 3 - - - - - 4 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 2.CustomClassName - 2.IBPluginDependency - 3.IBPluginDependency - 4.CustomClassName - 4.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - IASKPSTextFieldSpecifierViewCell - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - IASKTextField - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 9 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 1179 - - diff --git a/InAppSettingsKit/Xibs/IASKPSToggleSwitchSpecifierViewCell.xib b/InAppSettingsKit/Xibs/IASKPSToggleSwitchSpecifierViewCell.xib deleted file mode 100644 index 2e5803f2e..000000000 --- a/InAppSettingsKit/Xibs/IASKPSToggleSwitchSpecifierViewCell.xib +++ /dev/null @@ -1,237 +0,0 @@ - - - - 1296 - 11D50 - 2182 - 1138.32 - 568.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1179 - - - YES - IBUITableViewCell - IBUISwitch - IBUILabel - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 290 - - YES - - - 256 - - YES - - - 294 - {{9, 10}, {200, 21}} - - NO - YES - NO - IBCocoaTouchFramework - Label - - 1 - MCAwIDAAA - - - 1 - 10 - - Helvetica-Bold - Helvetica - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - - - - 289 - {{218, 8}, {94, 27}} - - NO - YES - YES - IBCocoaTouchFramework - 0 - 0 - YES - - - {320, 43} - - - 3 - MCAwAA - - NO - YES - 4 - YES - IBCocoaTouchFramework - - - {320, 44} - - - 1 - MC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEAA - - YES - NO - IBCocoaTouchFramework - 0 - - PSToggleSwitchSpecifier - - - - - YES - - - toggle - - - - 8 - - - - label - - - - 9 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - Toggle Switch Specifier View Cell - PSToggleSwitchSpecifier - - - 3 - - - - - 4 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 2.CustomClassName - 2.IBPluginDependency - 3.IBPluginDependency - 4.CustomClassName - 4.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - IASKPSToggleSwitchSpecifierViewCell - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - IASKSwitch - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 9 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 1179 - - diff --git a/InAppSettingsKit/Xibs/IASKSpecifierValuesView.xib b/InAppSettingsKit/Xibs/IASKSpecifierValuesView.xib deleted file mode 100644 index 9c7ff86e6..000000000 --- a/InAppSettingsKit/Xibs/IASKSpecifierValuesView.xib +++ /dev/null @@ -1,255 +0,0 @@ - - - - 768 - 10J567 - 1294 - 1038.35 - 462.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 294 - - - YES - IBProxyObject - IBUIView - IBUITableView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 292 - - YES - - - 274 - {320, 460} - - - - - 10 - - 549453824 - {84, 1} - - YES - - YES - - - - TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ -y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ -xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ -xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ -xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB -AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES -AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS -AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA - - - - - - 3 - MCAwAA - - - groupTableViewBackgroundColor - - NO - YES - NO - IBCocoaTouchFramework - NO - 1 - 1 - 0 - YES - 44 - 10 - 10 - - - {320, 460} - - - - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - dataSource - - - - 5 - - - - delegate - - - - 6 - - - - _tableView - - - - 7 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 4.IBPluginDependency - - - YES - IASKSpecifierValuesViewController - UIResponder - {{556, 432}, {320, 460}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 7 - - - - YES - - IASKSpecifierValuesViewController - UIViewController - - _tableView - UITableView - - - _tableView - - _tableView - UITableView - - - - IBProjectSource - ./Classes/IASKSpecifierValuesViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 294 - - diff --git a/Settings/InAppSettings.bundle/Advanced.plist b/Settings/InAppSettings.bundle/Advanced.plist index fa4638291..787a4bbc0 100644 --- a/Settings/InAppSettings.bundle/Advanced.plist +++ b/Settings/InAppSettings.bundle/Advanced.plist @@ -4,20 +4,6 @@ PreferenceSpecifiers - - Key - stun_preference - Title - Stun server - Type - PSTextFieldSpecifier - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - DefaultValue @@ -28,88 +14,6 @@ Type PSToggleSwitchSpecifier - - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - IsSecure - - Key - prefix_preference - KeyboardType - NumberPad - Title - Prefix - Type - PSTextFieldSpecifier - - - DefaultValue - - Key - substitute_+_by_00_preference - Title - Substitue + by 00 - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - wifi_only_preference - Title - Wifi only - Type - PSToggleSwitchSpecifier - - - DefaultValue - udp - Key - transport_preference - Title - Transport - Titles - - udp - tcp - tls - - Type - PSMultiValueSpecifier - Values - - udp - tcp - tls - - - - DefaultValue - None - Key - media_encryption_preference - Title - Media Encryption - Titles - - None - SRTP - ZRTP - - Type - PSMultiValueSpecifier - Values - - None - SRTP - ZRTP - - DefaultValue @@ -131,15 +35,75 @@ PSToggleSwitchSpecifier - DefaultValue - - Key - enable_first_login_view_preference - Title - First login view - Type - PSToggleSwitchSpecifier - + DefaultValue + + Key + enable_first_login_view_preference + Title + First login view + Type + PSToggleSwitchSpecifier + + + Key + expire_preference + Title + Expire + Type + PSTextFieldSpecifier + AutocapitalizationType + None + AutocorrectionType + No + KeyboardType + NumberPad + DefaultValue + 600 + + + Title + Primary account + Type + PSGroupSpecifier + + + AutocapitalizationType + None + AutocorrectionType + No + DefaultValue + + IsSecure + + Key + primary_displayname_preference + New item + + KeyboardType + Alphabet + Title + Display name + Type + PSTextFieldSpecifier + + + AutocapitalizationType + None + AutocorrectionType + No + DefaultValue + + IsSecure + + Key + primary_username_preference + KeyboardType + Alphabet + Title + Username + Type + PSTextFieldSpecifier + diff --git a/Settings/InAppSettings.bundle/Call.plist b/Settings/InAppSettings.bundle/Call.plist new file mode 100644 index 000000000..8e0cb92ca --- /dev/null +++ b/Settings/InAppSettings.bundle/Call.plist @@ -0,0 +1,57 @@ + + + + + PreferenceSpecifiers + + + AutocapitalizationType + None + AutocorrectionType + No + DefaultValue + + IsSecure + + Key + prefix_preference + KeyboardType + NumberPad + Title + Prefix + Type + PSTextFieldSpecifier + + + DefaultValue + + Key + substitute_+_by_00_preference + Title + Substitue + by 00 + Type + PSToggleSwitchSpecifier + + + Type + PSToggleSwitchSpecifier + Title + Enable RFC DTMF + Key + rfc_dtmf_preference + DefaultValue + + + + Type + PSToggleSwitchSpecifier + Title + Enable SIPINFO DTMF + Key + sipinfo_dtmf_preference + DefaultValue + + + + + diff --git a/Settings/InAppSettings.bundle/Network.plist b/Settings/InAppSettings.bundle/Network.plist new file mode 100644 index 000000000..0f067d74f --- /dev/null +++ b/Settings/InAppSettings.bundle/Network.plist @@ -0,0 +1,103 @@ + + + + + PreferenceSpecifiers + + + DefaultValue + + Key + wifi_only_preference + Title + Wifi only + Type + PSToggleSwitchSpecifier + + + Key + stun_preference + Title + Stun server + Type + PSTextFieldSpecifier + AutocapitalizationType + None + AutocorrectionType + No + DefaultValue + + + + Type + PSToggleSwitchSpecifier + Title + Random Port + Key + random_port_preference + DefaultValue + + + + Key + port_preference + Title + Port + Type + PSTextFieldSpecifier + AutocapitalizationType + None + AutocorrectionType + No + KeyboardType + NumberPad + DefaultValue + 5060 + + + DefaultValue + udp + Key + transport_preference + Title + Transport + Titles + + udp + tcp + tls + + Type + PSMultiValueSpecifier + Values + + udp + tcp + tls + + + + DefaultValue + None + Key + media_encryption_preference + Title + Media Encryption + Titles + + None + SRTP + ZRTP + + Type + PSMultiValueSpecifier + Values + + None + SRTP + ZRTP + + + + + diff --git a/Settings/InAppSettings.bundle/Root.plist b/Settings/InAppSettings.bundle/Root.plist index ae95540e2..894289cae 100644 --- a/Settings/InAppSettings.bundle/Root.plist +++ b/Settings/InAppSettings.bundle/Root.plist @@ -92,6 +92,12 @@ Type PSToggleSwitchSpecifier + + Title + Settings + Type + PSGroupSpecifier + Type PSToggleSwitchSpecifier @@ -102,6 +108,52 @@ DefaultValue + + Key + audio_menu + File + Audio + Title + Audio + Type + PSChildPaneSpecifier + + + Key + video_menu + File + Video + Title + Video + Type + PSChildPaneSpecifier + + + File + Call + Title + Call + Type + PSChildPaneSpecifier + + + File + Network + Title + Network + Type + PSChildPaneSpecifier + + + Key + advanced_menu + File + Advanced + Title + Advanced + Type + PSChildPaneSpecifier + Title @@ -109,28 +161,20 @@ PSGroupSpecifier - File - Audio + Key + about_button Title - Audio Codecs + About Type - PSChildPaneSpecifier + IASKButtonSpecifier - File - Video + Key + quit_button Title - Video + Quit Type - PSChildPaneSpecifier - - - File - Advanced - Title - Advanced - Type - PSChildPaneSpecifier + IASKButtonSpecifier StringsTable diff --git a/Settings/InAppSettings.bundle/Video.plist b/Settings/InAppSettings.bundle/Video.plist index 56af43866..3cc5566b7 100644 --- a/Settings/InAppSettings.bundle/Video.plist +++ b/Settings/InAppSettings.bundle/Video.plist @@ -14,6 +14,24 @@ DefaultValue + + Type + PSToggleSwitchSpecifier + Title + Automatically accept video + Key + accept_video_preference + DefaultValue + + + + Type + PSToggleSwitchSpecifier + Title + Show self view + Key + self_video_preference + Title Codecs diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index d4a3740c7..a82fa9517 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -448,26 +448,12 @@ D37DC7001594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6DB1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.m */; }; D37DC7011594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6DD1594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m */; }; D37DC7021594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6DD1594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m */; }; - D37DC7031594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6DF1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m */; }; - D37DC7041594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6DF1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m */; }; D37DC7051594AE6F00B2A5EB /* IASKSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6E11594AE6F00B2A5EB /* IASKSlider.m */; }; D37DC7061594AE6F00B2A5EB /* IASKSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6E11594AE6F00B2A5EB /* IASKSlider.m */; }; D37DC7071594AE6F00B2A5EB /* IASKSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6E31594AE6F00B2A5EB /* IASKSwitch.m */; }; D37DC7081594AE6F00B2A5EB /* IASKSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6E31594AE6F00B2A5EB /* IASKSwitch.m */; }; D37DC7091594AE6F00B2A5EB /* IASKTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6E51594AE6F00B2A5EB /* IASKTextField.m */; }; D37DC70A1594AE6F00B2A5EB /* IASKTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6E51594AE6F00B2A5EB /* IASKTextField.m */; }; - D37DC70B1594AE6F00B2A5EB /* IASKAppSettingsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6E71594AE6F00B2A5EB /* IASKAppSettingsView.xib */; }; - D37DC70C1594AE6F00B2A5EB /* IASKAppSettingsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6E71594AE6F00B2A5EB /* IASKAppSettingsView.xib */; }; - D37DC70D1594AE6F00B2A5EB /* IASKAppSettingsWebView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6E81594AE6F00B2A5EB /* IASKAppSettingsWebView.xib */; }; - D37DC70E1594AE6F00B2A5EB /* IASKAppSettingsWebView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6E81594AE6F00B2A5EB /* IASKAppSettingsWebView.xib */; }; - D37DC70F1594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6E91594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib */; }; - D37DC7101594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6E91594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib */; }; - D37DC7111594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6EA1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib */; }; - D37DC7121594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6EA1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib */; }; - D37DC7131594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6EB1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib */; }; - D37DC7141594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6EB1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib */; }; - D37DC7151594AE6F00B2A5EB /* IASKSpecifierValuesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6EC1594AE6F00B2A5EB /* IASKSpecifierValuesView.xib */; }; - D37DC7161594AE6F00B2A5EB /* IASKSpecifierValuesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37DC6EC1594AE6F00B2A5EB /* IASKSpecifierValuesView.xib */; }; D37DC7181594AF3400B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; D37DC7191594AF3F00B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; D38327F31580FE3A00FA0D23 /* contacts_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327EB1580FE3A00FA0D23 /* contacts_default.png */; }; @@ -1277,20 +1263,12 @@ D37DC6DB1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKPSTextFieldSpecifierViewCell.m; sourceTree = ""; }; D37DC6DC1594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKPSTitleValueSpecifierViewCell.h; sourceTree = ""; }; D37DC6DD1594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKPSTitleValueSpecifierViewCell.m; sourceTree = ""; }; - D37DC6DE1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKPSToggleSwitchSpecifierViewCell.h; sourceTree = ""; }; - D37DC6DF1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IASKPSToggleSwitchSpecifierViewCell.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; D37DC6E01594AE6F00B2A5EB /* IASKSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKSlider.h; sourceTree = ""; }; D37DC6E11594AE6F00B2A5EB /* IASKSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKSlider.m; sourceTree = ""; }; D37DC6E21594AE6F00B2A5EB /* IASKSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKSwitch.h; sourceTree = ""; }; D37DC6E31594AE6F00B2A5EB /* IASKSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKSwitch.m; sourceTree = ""; }; D37DC6E41594AE6F00B2A5EB /* IASKTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKTextField.h; sourceTree = ""; }; D37DC6E51594AE6F00B2A5EB /* IASKTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKTextField.m; sourceTree = ""; }; - D37DC6E71594AE6F00B2A5EB /* IASKAppSettingsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKAppSettingsView.xib; sourceTree = ""; }; - D37DC6E81594AE6F00B2A5EB /* IASKAppSettingsWebView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKAppSettingsWebView.xib; sourceTree = ""; }; - D37DC6E91594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKPSSliderSpecifierViewCell.xib; sourceTree = ""; }; - D37DC6EA1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKPSTextFieldSpecifierViewCell.xib; sourceTree = ""; }; - D37DC6EB1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKPSToggleSwitchSpecifierViewCell.xib; sourceTree = ""; }; - D37DC6EC1594AE6F00B2A5EB /* IASKSpecifierValuesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IASKSpecifierValuesView.xib; sourceTree = ""; }; D37DC7171594AF3400B2A5EB /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; D38327EB1580FE3A00FA0D23 /* contacts_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contacts_default.png; path = Resources/contacts_default.png; sourceTree = ""; }; D38327EC1580FE3A00FA0D23 /* contacts_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contacts_selected.png; path = Resources/contacts_selected.png; sourceTree = ""; }; @@ -2361,7 +2339,6 @@ D37DC6C41594AE6F00B2A5EB /* Controllers */, D37DC6CC1594AE6F00B2A5EB /* Models */, D37DC6D71594AE6F00B2A5EB /* Views */, - D37DC6E61594AE6F00B2A5EB /* Xibs */, ); name = InAppSettingsKit; sourceTree = ""; @@ -2408,8 +2385,6 @@ D37DC6DB1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.m */, D37DC6DC1594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.h */, D37DC6DD1594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m */, - D37DC6DE1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.h */, - D37DC6DF1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m */, D37DC6E01594AE6F00B2A5EB /* IASKSlider.h */, D37DC6E11594AE6F00B2A5EB /* IASKSlider.m */, D37DC6E21594AE6F00B2A5EB /* IASKSwitch.h */, @@ -2421,20 +2396,6 @@ path = InAppSettingsKit/Views; sourceTree = ""; }; - D37DC6E61594AE6F00B2A5EB /* Xibs */ = { - isa = PBXGroup; - children = ( - D37DC6E71594AE6F00B2A5EB /* IASKAppSettingsView.xib */, - D37DC6E81594AE6F00B2A5EB /* IASKAppSettingsWebView.xib */, - D37DC6E91594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib */, - D37DC6EA1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib */, - D37DC6EB1594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib */, - D37DC6EC1594AE6F00B2A5EB /* IASKSpecifierValuesView.xib */, - ); - name = Xibs; - path = InAppSettingsKit/Xibs; - sourceTree = ""; - }; D38935F715A6D06800A3A3AA /* CPAnimation */ = { isa = PBXGroup; children = ( @@ -2709,12 +2670,6 @@ D35E758915932DE60066B1C1 /* backspace_disabled.png in Resources */, D35E758D15934F360066B1C1 /* call_disabled.png in Resources */, D35E7599159460580066B1C1 /* ChatViewController.xib in Resources */, - D37DC70B1594AE6F00B2A5EB /* IASKAppSettingsView.xib in Resources */, - D37DC70D1594AE6F00B2A5EB /* IASKAppSettingsWebView.xib in Resources */, - D37DC70F1594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib in Resources */, - D37DC7111594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib in Resources */, - D37DC7131594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */, - D37DC7151594AE6F00B2A5EB /* IASKSpecifierValuesView.xib in Resources */, D32942A41594C94300556A1C /* SettingsViewController.xib in Resources */, D34F6F9E1594D3FB0095705B /* InAppSettings.bundle in Resources */, D3EA5403159852080037DC6B /* chat_edit_default.png in Resources */, @@ -2962,12 +2917,6 @@ D35E758A15932DE60066B1C1 /* backspace_disabled.png in Resources */, D35E758E15934F360066B1C1 /* call_disabled.png in Resources */, D35E759A159460580066B1C1 /* ChatViewController.xib in Resources */, - D37DC70C1594AE6F00B2A5EB /* IASKAppSettingsView.xib in Resources */, - D37DC70E1594AE6F00B2A5EB /* IASKAppSettingsWebView.xib in Resources */, - D37DC7101594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.xib in Resources */, - D37DC7121594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.xib in Resources */, - D37DC7141594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */, - D37DC7161594AE6F00B2A5EB /* IASKSpecifierValuesView.xib in Resources */, D32942A51594C94300556A1C /* SettingsViewController.xib in Resources */, D34F6F9F1594D3FB0095705B /* InAppSettings.bundle in Resources */, D3EA5404159852080037DC6B /* chat_edit_default.png in Resources */, @@ -3143,7 +3092,6 @@ D37DC6FD1594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.m in Sources */, D37DC6FF1594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.m in Sources */, D37DC7011594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m in Sources */, - D37DC7031594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */, D37DC7051594AE6F00B2A5EB /* IASKSlider.m in Sources */, D37DC7071594AE6F00B2A5EB /* IASKSwitch.m in Sources */, D37DC7091594AE6F00B2A5EB /* IASKTextField.m in Sources */, @@ -3232,7 +3180,6 @@ D37DC6FE1594AE6F00B2A5EB /* IASKPSSliderSpecifierViewCell.m in Sources */, D37DC7001594AE6F00B2A5EB /* IASKPSTextFieldSpecifierViewCell.m in Sources */, D37DC7021594AE6F00B2A5EB /* IASKPSTitleValueSpecifierViewCell.m in Sources */, - D37DC7041594AE6F00B2A5EB /* IASKPSToggleSwitchSpecifierViewCell.m in Sources */, D37DC7061594AE6F00B2A5EB /* IASKSlider.m in Sources */, D37DC7081594AE6F00B2A5EB /* IASKSwitch.m in Sources */, D37DC70A1594AE6F00B2A5EB /* IASKTextField.m in Sources */, diff --git a/linphonerc b/linphonerc index 8eede1cd0..0a774e77a 100644 --- a/linphonerc +++ b/linphonerc @@ -17,7 +17,6 @@ register_only_when_network_is_up=1 auto_net_state_mon=0 keepalive_period=30000 - [rtp] audio_rtp_port=7076 video_rtp_port=9078 @@ -42,3 +41,4 @@ show_local=0 enabled=1 size=qvga display_filter_auto_rotate=1 +