forked from mirrors/linphone-iphone
Settings: move account dependent options in Account view
This commit is contained in:
parent
43cda13f4c
commit
404f6e381a
10 changed files with 234 additions and 232 deletions
|
|
@ -49,7 +49,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
if (!call) {
|
||||
[PhoneMainView.instance popCurrentView];
|
||||
if (![PhoneMainView.instance popCurrentView]) {
|
||||
[PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription];
|
||||
}
|
||||
} else {
|
||||
const LinphoneAddress *addr = linphone_call_get_remote_address(call);
|
||||
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#import "LinphoneManager.h"
|
||||
|
||||
@interface LinphoneCoreSettingsStore : IASKAbstractSettingsStore {
|
||||
@private
|
||||
@public
|
||||
NSDictionary *dict;
|
||||
NSDictionary *changedDict;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
}
|
||||
|
||||
- (void)setCString:(const char *)value forKey:(NSString *)key {
|
||||
id obj = Nil;
|
||||
id obj = @"";
|
||||
if (value)
|
||||
obj = [[NSString alloc] initWithCString:value encoding:[NSString defaultCStringEncoding]];
|
||||
[self setObject:obj forKey:key];
|
||||
|
|
@ -119,63 +119,102 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
- (void)transformAccountToKeys:(NSString *)username {
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
const MSList *proxies = linphone_core_get_proxy_config_list(lc);
|
||||
while (proxies &&
|
||||
while (username && proxies &&
|
||||
strcmp(username.UTF8String,
|
||||
linphone_address_get_username(linphone_proxy_config_get_identity_address(proxies->data))) != 0) {
|
||||
proxies = proxies->next;
|
||||
}
|
||||
if (!proxies) {
|
||||
// we must always find associated proxy config.
|
||||
LOGF(@"Proxy not found for account with username %@. Please fix application.", username);
|
||||
LinphoneProxyConfig *proxy = NULL;
|
||||
|
||||
// default values
|
||||
{
|
||||
[self setObject:@"" forKey:@"account_mandatory_username_preference"];
|
||||
[self setObject:@"" forKey:@"account_mandatory_domain_preference"];
|
||||
[self setCString:"" forKey:@"account_display_name_preference"];
|
||||
[self setObject:@"" forKey:@"account_proxy_preference"];
|
||||
[self setObject:@"udp" forKey:@"account_transport_preference"];
|
||||
[self setBool:NO forKey:@"account_outbound_proxy_preference"];
|
||||
[self setBool:NO forKey:@"account_avpf_preference"];
|
||||
[self setBool:YES forKey:@"account_is_default_preference"];
|
||||
[self setBool:YES forKey:@"account_is_enabled_preference"];
|
||||
[self setCString:"" forKey:@"account_userid_preference"];
|
||||
[self setCString:"" forKey:@"account_mandatory_password_preference"];
|
||||
[self setCString:"" forKey:@"ha1_preference"];
|
||||
[self setInteger:-1 forKey:@"account_expire_preference"];
|
||||
[self setInteger:-1 forKey:@"current_proxy_config_preference"];
|
||||
[self setCString:"" forKey:@"account_prefix_preference"];
|
||||
[self setBool:NO forKey:@"account_substitute_+_by_00_preference"];
|
||||
}
|
||||
LinphoneProxyConfig *proxy = proxies->data;
|
||||
|
||||
[self setInteger:ms_list_index(linphone_core_get_proxy_config_list(lc), proxy)
|
||||
forKey:@"current_proxy_config_preference"];
|
||||
if (proxies) {
|
||||
proxy = proxies->data;
|
||||
// root section
|
||||
{
|
||||
const LinphoneAddress *identity_addr = linphone_proxy_config_get_identity_address(proxy);
|
||||
if (identity_addr) {
|
||||
const char *server_addr = linphone_proxy_config_get_server_addr(proxy);
|
||||
LinphoneAddress *proxy_addr = linphone_address_new(server_addr);
|
||||
int port = linphone_address_get_port(proxy_addr);
|
||||
|
||||
const LinphoneAddress *identity_addr = linphone_proxy_config_get_identity_address(proxy);
|
||||
if (identity_addr) {
|
||||
const char *server_addr = linphone_proxy_config_get_server_addr(proxy);
|
||||
LinphoneAddress *proxy_addr = linphone_address_new(server_addr);
|
||||
int port = linphone_address_get_port(proxy_addr);
|
||||
[self setCString:linphone_address_get_username(identity_addr)
|
||||
forKey:@"account_mandatory_username_preference"];
|
||||
[self setCString:linphone_address_get_display_name(identity_addr)
|
||||
forKey:@"account_display_name_preference"];
|
||||
[self setCString:linphone_address_get_domain(identity_addr)
|
||||
forKey:@"account_mandatory_domain_preference"];
|
||||
if (strcmp(linphone_address_get_domain(identity_addr), linphone_address_get_domain(proxy_addr)) != 0 ||
|
||||
port > 0) {
|
||||
char tmp[256] = {0};
|
||||
if (port > 0) {
|
||||
snprintf(tmp, sizeof(tmp) - 1, "%s:%i", linphone_address_get_domain(proxy_addr), port);
|
||||
} else
|
||||
snprintf(tmp, sizeof(tmp) - 1, "%s", linphone_address_get_domain(proxy_addr));
|
||||
[self setCString:tmp forKey:@"account_proxy_preference"];
|
||||
}
|
||||
const char *tname = "udp";
|
||||
switch (linphone_address_get_transport(proxy_addr)) {
|
||||
case LinphoneTransportTcp:
|
||||
tname = "tcp";
|
||||
break;
|
||||
case LinphoneTransportTls:
|
||||
tname = "tls";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
linphone_address_destroy(proxy_addr);
|
||||
[self setCString:tname forKey:@"account_transport_preference"];
|
||||
}
|
||||
|
||||
[self setCString:linphone_address_get_username(identity_addr) forKey:@"username_preference"];
|
||||
[self setCString:linphone_address_get_domain(identity_addr) forKey:@"domain_preference"];
|
||||
if (strcmp(linphone_address_get_domain(identity_addr), linphone_address_get_domain(proxy_addr)) != 0 ||
|
||||
port > 0) {
|
||||
char tmp[256] = {0};
|
||||
if (port > 0) {
|
||||
snprintf(tmp, sizeof(tmp) - 1, "%s:%i", linphone_address_get_domain(proxy_addr), port);
|
||||
} else
|
||||
snprintf(tmp, sizeof(tmp) - 1, "%s", linphone_address_get_domain(proxy_addr));
|
||||
[self setCString:tmp forKey:@"proxy_preference"];
|
||||
[self setBool:(linphone_proxy_config_get_route(proxy) != NULL) forKey:@"account_outbound_proxy_preference"];
|
||||
[self setBool:linphone_proxy_config_avpf_enabled(proxy) forKey:@"account_avpf_preference"];
|
||||
[self setBool:linphone_proxy_config_register_enabled(proxy) forKey:@"account_is_enabled_preference"];
|
||||
[self setBool:(linphone_core_get_default_proxy_config(lc) == proxy)
|
||||
forKey:@"account_is_default_preference"];
|
||||
|
||||
const LinphoneAuthInfo *ai = linphone_core_find_auth_info(
|
||||
lc, NULL, [self stringForKey:@"account_mandatory_username_preference"].UTF8String,
|
||||
[self stringForKey:@"account_mandatory_domain_preference"].UTF8String);
|
||||
if (ai) {
|
||||
[self setCString:linphone_auth_info_get_userid(ai) forKey:@"account_userid_preference"];
|
||||
[self setCString:linphone_auth_info_get_passwd(ai) forKey:@"account_mandatory_password_preference"];
|
||||
// hidden but useful if provisioned
|
||||
[self setCString:linphone_auth_info_get_ha1(ai) forKey:@"ha1_preference"];
|
||||
}
|
||||
|
||||
int idx = ms_list_index(linphone_core_get_proxy_config_list(lc), proxy);
|
||||
[self setInteger:idx forKey:@"current_proxy_config_preference"];
|
||||
|
||||
int expires = linphone_proxy_config_get_expires(proxy);
|
||||
[self setInteger:expires forKey:@"account_expire_preference"];
|
||||
}
|
||||
const char *tname = "udp";
|
||||
switch (linphone_address_get_transport(proxy_addr)) {
|
||||
case LinphoneTransportTcp:
|
||||
tname = "tcp";
|
||||
break;
|
||||
case LinphoneTransportTls:
|
||||
tname = "tls";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
linphone_address_destroy(proxy_addr);
|
||||
|
||||
[self setCString:tname forKey:@"transport_preference"];
|
||||
[self setBool:(linphone_proxy_config_get_route(proxy) != NULL) forKey:@"outbound_proxy_preference"];
|
||||
[self setBool:linphone_proxy_config_avpf_enabled(proxy) forKey:@"avpf_preference"];
|
||||
[self setBool:(linphone_core_get_default_proxy_config(lc) == proxy) forKey:@"is_default_preference"];
|
||||
|
||||
const LinphoneAuthInfo *ai =
|
||||
linphone_core_find_auth_info(lc, NULL, [self stringForKey:@"username_preference"].UTF8String,
|
||||
[self stringForKey:@"domain_preference"].UTF8String);
|
||||
if (ai) {
|
||||
[self setCString:linphone_auth_info_get_userid(ai) forKey:@"userid_preference"];
|
||||
[self setCString:linphone_auth_info_get_passwd(ai) forKey:@"password_preference"];
|
||||
// hidden but useful if provisioned
|
||||
[self setCString:linphone_auth_info_get_ha1(ai) forKey:@"ha1_preference"];
|
||||
// call section
|
||||
{
|
||||
const char *dial_prefix = linphone_proxy_config_get_dial_prefix(proxy);
|
||||
[self setCString:dial_prefix forKey:@"account_prefix_preference"];
|
||||
BOOL dial_escape_plus = linphone_proxy_config_get_dial_escape_plus(proxy);
|
||||
[self setBool:dial_escape_plus forKey:@"account_substitute_+_by_00_preference"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -183,14 +222,13 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
- (void)transformLinphoneCoreToKeys {
|
||||
LinphoneManager *lm = [LinphoneManager instance];
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
LinphoneProxyConfig *default_proxy = linphone_core_get_default_proxy_config(lc);
|
||||
|
||||
// root section
|
||||
{
|
||||
const MSList *accounts = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
|
||||
int count = ms_list_size(accounts);
|
||||
for (int i = 1; i <= count; i++, accounts = accounts->next) {
|
||||
NSString *key = [NSString stringWithFormat:@"account_%d_menu", i];
|
||||
NSString *key = [NSString stringWithFormat:@"menu_account_%d", i];
|
||||
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *)accounts->data;
|
||||
[self setCString:linphone_address_get_username(linphone_proxy_config_get_identity_address(proxy))
|
||||
forKey:key];
|
||||
|
|
@ -199,12 +237,12 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
[self setBool:linphone_core_video_display_enabled(lc) forKey:@"enable_video_preference"];
|
||||
[self setBool:[LinphoneManager.instance lpConfigBoolForKey:@"auto_answer"]
|
||||
forKey:@"enable_auto_answer_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"advanced_account_preference"] forKey:@"advanced_account_preference"];
|
||||
[self setBool:[lm lpConfigBoolForKey:@"account_mandatory_advanced_preference"]
|
||||
forKey:@"account_mandatory_advanced_preference"];
|
||||
}
|
||||
|
||||
// account section
|
||||
{
|
||||
// this is filled by [self transformAccountToKeys] automatically
|
||||
}
|
||||
{ [self transformAccountToKeys:nil]; }
|
||||
|
||||
// audio section
|
||||
{
|
||||
|
|
@ -257,13 +295,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
|
||||
[self setBool:[lm lpConfigBoolForKey:@"repeat_call_notification"]
|
||||
forKey:@"repeat_call_notification_preference"];
|
||||
|
||||
// actually in Call section but proxy config dependent
|
||||
const char *dial_prefix = default_proxy ? linphone_proxy_config_get_dial_prefix(default_proxy) : NULL;
|
||||
[self setCString:dial_prefix forKey:@"prefix_preference"];
|
||||
// actually in Call section but proxy config dependent
|
||||
BOOL dial_escape_plus = default_proxy ? linphone_proxy_config_get_dial_escape_plus(default_proxy) : NO;
|
||||
[self setBool:dial_escape_plus forKey:@"substitute_+_by_00_preference"];
|
||||
}
|
||||
|
||||
// network section
|
||||
|
|
@ -353,10 +384,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
}
|
||||
linphone_address_destroy(parsed);
|
||||
[self setCString:linphone_core_get_file_transfer_server(lc) forKey:@"file_transfer_server_url_preference"];
|
||||
|
||||
// actually in Advanced section but proxy config dependent
|
||||
int expires = default_proxy ? linphone_proxy_config_get_expires(default_proxy) : -1;
|
||||
[self setInteger:expires forKey:@"expire_preference"];
|
||||
}
|
||||
|
||||
changedDict = [[NSMutableDictionary alloc] init];
|
||||
|
|
@ -410,23 +437,24 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
// configure sip account
|
||||
|
||||
// mandatory parameters
|
||||
NSString *username = [self stringForKey:@"username_preference"];
|
||||
NSString *displayName = [self stringForKey:@"display_name_preference"];
|
||||
NSString *userID = [self stringForKey:@"userid_preference"];
|
||||
NSString *domain = [self stringForKey:@"domain_preference"];
|
||||
NSString *transport = [self stringForKey:@"transport_preference"];
|
||||
NSString *username = [self stringForKey:@"account_mandatory_username_preference"];
|
||||
NSString *displayName = [self stringForKey:@"account_display_name_preference"];
|
||||
NSString *userID = [self stringForKey:@"account_userid_preference"];
|
||||
NSString *domain = [self stringForKey:@"account_mandatory_domain_preference"];
|
||||
NSString *transport = [self stringForKey:@"account_transport_preference"];
|
||||
NSString *accountHa1 = [self stringForKey:@"ha1_preference"];
|
||||
NSString *accountPassword = [self stringForKey:@"password_preference"];
|
||||
BOOL isOutboundProxy = [self boolForKey:@"outbound_proxy_preference"];
|
||||
BOOL use_avpf = [self boolForKey:@"avpf_preference"];
|
||||
BOOL is_default = [self boolForKey:@"is_default_preference"];
|
||||
NSString *accountPassword = [self stringForKey:@"account_mandatory_password_preference"];
|
||||
BOOL isOutboundProxy = [self boolForKey:@"account_outbound_proxy_preference"];
|
||||
BOOL use_avpf = [self boolForKey:@"account_avpf_preference"];
|
||||
BOOL is_default = [self boolForKey:@"account_is_default_preference"];
|
||||
BOOL is_enabled = [self boolForKey:@"account_is_enabled_preference"];
|
||||
|
||||
if (username && [username length] > 0 && domain && [domain length] > 0) {
|
||||
int expire = [self integerForKey:@"expire_preference"];
|
||||
int expire = [self integerForKey:@"account_expire_preference"];
|
||||
BOOL isWifiOnly = [self boolForKey:@"wifi_only_preference"];
|
||||
BOOL pushnotification = [self boolForKey:@"pushnotification_preference"];
|
||||
NSString *prefix = [self stringForKey:@"prefix_preference"];
|
||||
NSString *proxyAddress = [self stringForKey:@"proxy_preference"];
|
||||
NSString *prefix = [self stringForKey:@"account_prefix_preference"];
|
||||
NSString *proxyAddress = [self stringForKey:@"account_proxy_preference"];
|
||||
|
||||
const char *route = NULL;
|
||||
|
||||
|
|
@ -494,15 +522,15 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
linphone_proxy_config_set_dial_prefix(proxyCfg, [prefix UTF8String]);
|
||||
}
|
||||
|
||||
if ([self objectForKey:@"substitute_+_by_00_preference"]) {
|
||||
bool substitute_plus_by_00 = [self boolForKey:@"substitute_+_by_00_preference"];
|
||||
if ([self objectForKey:@"account_substitute_+_by_00_preference"]) {
|
||||
bool substitute_plus_by_00 = [self boolForKey:@"account_substitute_+_by_00_preference"];
|
||||
linphone_proxy_config_set_dial_escape_plus(proxyCfg, substitute_plus_by_00);
|
||||
}
|
||||
|
||||
[lm lpConfigSetInt:pushnotification forKey:@"pushnotification_preference"];
|
||||
[[LinphoneManager instance] configurePushTokenForProxyConfig:proxyCfg];
|
||||
|
||||
linphone_proxy_config_enable_register(proxyCfg, true);
|
||||
linphone_proxy_config_enable_register(proxyCfg, is_enabled);
|
||||
linphone_proxy_config_enable_avpf(proxyCfg, use_avpf);
|
||||
linphone_proxy_config_set_expires(proxyCfg, expire);
|
||||
if (is_default) {
|
||||
|
|
@ -510,6 +538,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
} else if (linphone_core_get_default_proxy_config(lc) == proxyCfg) {
|
||||
linphone_core_set_default_proxy_config(lc, NULL);
|
||||
}
|
||||
|
||||
LinphoneAuthInfo *proxyAi = (LinphoneAuthInfo *)linphone_proxy_config_find_auth_info(proxyCfg);
|
||||
|
||||
// setup new proxycfg
|
||||
|
|
@ -569,16 +598,18 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
// root section
|
||||
{
|
||||
BOOL account_changed =
|
||||
[self valueChangedForKey:@"username_preference"] || [self valueChangedForKey:@"password_preference"] ||
|
||||
[self valueChangedForKey:@"display_name_preference"] ||
|
||||
[self valueChangedForKey:@"is_default_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"] || [self valueChangedForKey:@"use_ipv6"] ||
|
||||
[self valueChangedForKey:@"avpf_preference"] || [self valueChangedForKey:@"pushnotification_preference"];
|
||||
BOOL account_changed = NO;
|
||||
for (NSString *key in self->changedDict) {
|
||||
if ([key hasPrefix:@"account_"] && [self valueChangedForKey:key]) {
|
||||
account_changed = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
account_changed |= [self valueChangedForKey:@"port_preference"];
|
||||
account_changed |= [self valueChangedForKey:@"random_port_preference"];
|
||||
account_changed |= [self valueChangedForKey:@"use_ipv6"];
|
||||
account_changed |= [self valueChangedForKey:@"pushnotification_preference"];
|
||||
|
||||
if (account_changed)
|
||||
[self synchronizeAccounts];
|
||||
|
||||
|
|
@ -797,7 +828,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
linphone_address_destroy(parsed);
|
||||
}
|
||||
|
||||
[lm lpConfigSetInt:[self integerForKey:@"advanced_account_preference"] forKey:@"advanced_account_preference"];
|
||||
[lm lpConfigSetInt:[self integerForKey:@"account_mandatory_advanced_preference"]
|
||||
forKey:@"account_mandatory_advanced_preference"];
|
||||
|
||||
linphone_core_set_file_transfer_server(lc,
|
||||
[[self stringForKey:@"file_transfer_server_url_preference"] UTF8String]);
|
||||
|
|
|
|||
|
|
@ -247,39 +247,13 @@
|
|||
|
||||
#pragma mark - UINavigationBarEx Class
|
||||
|
||||
@interface UINavigationBarEx : UINavigationBar {
|
||||
}
|
||||
@interface UINavigationBarEx : UINavigationBar
|
||||
@end
|
||||
|
||||
@implementation UINavigationBarEx
|
||||
|
||||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (void)initUINavigationBarEx {
|
||||
INIT_WITH_COMMON {
|
||||
[self setTintColor:[LINPHONE_MAIN_COLOR adjustHue:5.0f / 180.0f saturation:0.0f brightness:0.0f alpha:0.0f]];
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self initUINavigationBarEx];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)aDecoder {
|
||||
self = [super initWithCoder:aDecoder];
|
||||
if (self) {
|
||||
[self initUINavigationBarEx];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initUINavigationBarEx];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -430,13 +404,14 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[keys addObject:@"send_logs_button"];
|
||||
[keys addObject:@"reset_logs_button"];
|
||||
[[LinphoneManager instance] setLogsEnabled:debugEnabled];
|
||||
} else if ([@"advanced_account_preference" compare:notif.object] == NSOrderedSame) {
|
||||
removeFromHiddenKeys = [[notif.userInfo objectForKey:@"advanced_account_preference"] boolValue];
|
||||
[keys addObject:@"userid_preference"];
|
||||
[keys addObject:@"display_name_preference"];
|
||||
[keys addObject:@"proxy_preference"];
|
||||
[keys addObject:@"outbound_proxy_preference"];
|
||||
[keys addObject:@"avpf_preference"];
|
||||
} else if ([@"account_mandatory_advanced_preference" compare:notif.object] == NSOrderedSame) {
|
||||
removeFromHiddenKeys = [[notif.userInfo objectForKey:@"account_mandatory_advanced_preference"] boolValue];
|
||||
for (NSString *key in settingsStore->dict) {
|
||||
if (([key hasPrefix:@"account_"]) && (![key hasPrefix:@"account_mandatory_"])) {
|
||||
[keys addObject:key];
|
||||
}
|
||||
}
|
||||
|
||||
} else if ([@"video_preset_preference" compare:notif.object] == NSOrderedSame) {
|
||||
NSString *video_preset = [notif.userInfo objectForKey:@"video_preset_preference"];
|
||||
removeFromHiddenKeys = [video_preset isEqualToString:@"custom"];
|
||||
|
|
@ -458,7 +433,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
+ (IASKSpecifier *)filterSpecifier:(IASKSpecifier *)specifier {
|
||||
if (!linphone_core_sip_transport_supported([LinphoneManager getLc], LinphoneTransportTls)) {
|
||||
if ([[specifier key] isEqualToString:@"transport_preference"]) {
|
||||
if ([[specifier key] isEqualToString:@"account_transport_preference"]) {
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
|
||||
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
|
||||
[titles removeObject:@"TLS"];
|
||||
|
|
@ -499,12 +474,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
}
|
||||
|
||||
if ([specifier.key hasPrefix:@"account_"] && [specifier.key hasSuffix:@"_menu"]) {
|
||||
if ([specifier.key hasPrefix:@"menu_account_"]) {
|
||||
const MSList *accounts = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
|
||||
int index = [[specifier.key substringFromIndex:@"account_".length] stringByReplacingOccurrencesOfString:@"_menu"
|
||||
withString:@""]
|
||||
.intValue -
|
||||
1;
|
||||
int index = [specifier.key substringFromIndex:@"menu_account_".length].intValue - 1;
|
||||
if (index < ms_list_size(accounts)) {
|
||||
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *)ms_list_nth_data(accounts, index);
|
||||
NSString *name = [NSString
|
||||
|
|
@ -522,7 +494,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
const MSList *accounts = linphone_core_get_proxy_config_list([LinphoneManager getLc]);
|
||||
for (int i = ms_list_size(accounts) + 1; i <= 5; i++) {
|
||||
[hiddenKeys addObject:[NSString stringWithFormat:@"account_%d_menu", i]];
|
||||
[hiddenKeys addObject:[NSString stringWithFormat:@"menu_account_%d", i]];
|
||||
}
|
||||
|
||||
if (!linphone_core_sip_transport_supported([LinphoneManager getLc], LinphoneTransportTls)) {
|
||||
|
|
@ -622,12 +594,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[hiddenKeys addObject:@"tunnel_menu"];
|
||||
}
|
||||
|
||||
if (![lm lpConfigBoolForKey:@"advanced_account_preference"]) {
|
||||
[hiddenKeys addObject:@"userid_preference"];
|
||||
[hiddenKeys addObject:@"display_name_preference"];
|
||||
[hiddenKeys addObject:@"proxy_preference"];
|
||||
[hiddenKeys addObject:@"outbound_proxy_preference"];
|
||||
[hiddenKeys addObject:@"avpf_preference"];
|
||||
if (![lm lpConfigBoolForKey:@"account_mandatory_advanced_preference"]) {
|
||||
for (NSString *key in settingsStore->dict) {
|
||||
if (([key hasPrefix:@"account_"]) && (![key hasPrefix:@"account_mandatory_"])) {
|
||||
[hiddenKeys addObject:key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (![[[LinphoneManager instance] iapManager] enabled]) {
|
||||
|
|
@ -644,11 +616,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (void)recomputeAccountLabelsAndSync {
|
||||
// it's a bit violent... but IASK is not designed to dynamically change subviews' name
|
||||
_settingsController.hiddenKeys = [self findHiddenKeys];
|
||||
[_settingsController.settingsReader indexPathForKey:@"account_1_menu"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"account_2_menu"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"account_3_menu"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"account_4_menu"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"account_5_menu"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"menu_account_1"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"menu_account_2"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"menu_account_3"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"menu_account_4"]; // force refresh username'
|
||||
[_settingsController.settingsReader indexPathForKey:@"menu_account_5"]; // force refresh username'
|
||||
[[_settingsController tableView] reloadData];
|
||||
}
|
||||
|
||||
|
|
@ -707,7 +679,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
if ([key isEqual:@"assistant_button"]) {
|
||||
[PhoneMainView.instance changeCurrentView:AssistantView.compositeViewDescription];
|
||||
return;
|
||||
} else if ([key isEqual:@"remove_proxy_button"]) {
|
||||
} else if ([key isEqual:@"account_mandatory_remove_button"]) {
|
||||
DTAlertView *alert = [[DTAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Warning", nil)
|
||||
message:NSLocalizedString(@"Are you sure to want to remove your proxy setup?", nil)];
|
||||
|
|
|
|||
|
|
@ -60,15 +60,7 @@ voiceproc_preference=1
|
|||
enable_log_collect=0
|
||||
|
||||
[default_values]
|
||||
reg_expires=600
|
||||
|
||||
[assistant]
|
||||
expires=1314000
|
||||
push_notification=1
|
||||
transport=tls
|
||||
ice=1
|
||||
stun=stun.linphone.org
|
||||
|
||||
reg_expires=1314000
|
||||
|
||||
[misc]
|
||||
max_calls=3
|
||||
|
|
|
|||
|
|
@ -60,14 +60,7 @@ voiceproc_preference=1
|
|||
enable_log_collect=0
|
||||
|
||||
[default_values]
|
||||
reg_expires=600
|
||||
|
||||
[assistant]
|
||||
expires=1314000
|
||||
push_notification=1
|
||||
transport=tls
|
||||
ice=1
|
||||
stun=stun.linphone.org
|
||||
reg_expires=1314000
|
||||
|
||||
|
||||
[misc]
|
||||
|
|
|
|||
|
|
@ -4,13 +4,16 @@
|
|||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>remove_proxy_button</string>
|
||||
<key>Title</key>
|
||||
<string>Remove Account</string>
|
||||
<key>Type</key>
|
||||
<string>IASKButtonSpecifier</string>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>More options</string>
|
||||
<key>Key</key>
|
||||
<string>account_mandatory_advanced_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
|
|
@ -18,7 +21,7 @@
|
|||
<key>Title</key>
|
||||
<string>Default account</string>
|
||||
<key>Key</key>
|
||||
<string>is_default_preference</string>
|
||||
<string>account_is_default_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
|
|
@ -32,7 +35,7 @@
|
|||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>username_preference</string>
|
||||
<string>account_mandatory_username_preference</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>Alphabet</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -50,7 +53,7 @@
|
|||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>display_name_preference</string>
|
||||
<string>account_display_name_preference</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>Alphabet</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -68,7 +71,7 @@
|
|||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>userid_preference</string>
|
||||
<string>account_userid_preference</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>Alphabet</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -86,7 +89,7 @@
|
|||
<key>IsSecure</key>
|
||||
<true/>
|
||||
<key>Key</key>
|
||||
<string>password_preference</string>
|
||||
<string>account_mandatory_password_preference</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>Alphabet</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -104,7 +107,7 @@
|
|||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>domain_preference</string>
|
||||
<string>account_mandatory_domain_preference</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>URL</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -122,7 +125,7 @@
|
|||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>proxy_preference</string>
|
||||
<string>account_proxy_preference</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>URL</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -134,7 +137,7 @@
|
|||
<key>DefaultValue</key>
|
||||
<string>udp</string>
|
||||
<key>Key</key>
|
||||
<string>transport_preference</string>
|
||||
<string>account_transport_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Transport</string>
|
||||
<key>Titles</key>
|
||||
|
|
@ -158,7 +161,7 @@
|
|||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>outbound_proxy_preference</string>
|
||||
<string>account_outbound_proxy_preference</string>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
|
|
@ -168,19 +171,73 @@
|
|||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
<key>Key</key>
|
||||
<string>avpf_preference</string>
|
||||
<string>account_avpf_preference</string>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>account_expire_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Expire</string>
|
||||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
<key>AutocorrectionType</key>
|
||||
<string>No</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>NumberPad</string>
|
||||
<key>DefaultValue</key>
|
||||
<integer>600</integer>
|
||||
<key>IASKTextAlignment</key>
|
||||
<string>IASKUITextAlignmentRight</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
<key>AutocorrectionType</key>
|
||||
<string>No</string>
|
||||
<key>DefaultValue</key>
|
||||
<string></string>
|
||||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>account_prefix_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Prefix</string>
|
||||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>IASKTextAlignment</key>
|
||||
<string>IASKUITextAlignmentRight</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>account_substitute_+_by_00_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Substitute + by 00</string>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>More options</string>
|
||||
<string>Account enabled</string>
|
||||
<key>Key</key>
|
||||
<string>advanced_account_preference</string>
|
||||
<string>account_is_enabled_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>account_mandatory_remove_button</string>
|
||||
<key>Title</key>
|
||||
<string>Remove Account</string>
|
||||
<key>Type</key>
|
||||
<string>IASKButtonSpecifier</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
|
|
|
|||
|
|
@ -92,24 +92,6 @@
|
|||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>expire_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Expire</string>
|
||||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
<key>AutocorrectionType</key>
|
||||
<string>No</string>
|
||||
<key>KeyboardType</key>
|
||||
<string>NumberPad</string>
|
||||
<key>DefaultValue</key>
|
||||
<integer>600</integer>
|
||||
<key>IASKTextAlignment</key>
|
||||
<string>IASKUITextAlignmentRight</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Title</key>
|
||||
<string>Primary account</string>
|
||||
|
|
|
|||
|
|
@ -4,34 +4,6 @@
|
|||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
<key>AutocorrectionType</key>
|
||||
<string>No</string>
|
||||
<key>DefaultValue</key>
|
||||
<string></string>
|
||||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>prefix_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Prefix</string>
|
||||
<key>Type</key>
|
||||
<string>PSTextFieldSpecifier</string>
|
||||
<key>IASKTextAlignment</key>
|
||||
<string>IASKUITextAlignmentRight</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>substitute_+_by_00_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Substitute + by 00</string>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>account_1_menu</string>
|
||||
<string>menu_account_1</string>
|
||||
<key>File</key>
|
||||
<string>Account</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>account_2_menu</string>
|
||||
<string>menu_account_2</string>
|
||||
<key>File</key>
|
||||
<string>Account</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>account_3_menu</string>
|
||||
<string>menu_account_3</string>
|
||||
<key>File</key>
|
||||
<string>Account</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>account_4_menu</string>
|
||||
<string>menu_account_4</string>
|
||||
<key>File</key>
|
||||
<string>Account</string>
|
||||
<key>Title</key>
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>account_5_menu</string>
|
||||
<string>menu_account_5</string>
|
||||
<key>File</key>
|
||||
<string>Account</string>
|
||||
<key>Title</key>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue