forked from mirrors/linphone-iphone
Allow to clear the proxy config with a button in the settings.
This commit is contained in:
parent
d902a4e70a
commit
0fa635dc68
9 changed files with 47 additions and 8 deletions
|
|
@ -190,7 +190,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
,linphone_proxy_config_get_domain(proxyCfg));
|
||||
linphone_core_add_auth_info([LinphoneManager getLc], auth_info);
|
||||
linphone_core_add_proxy_config([LinphoneManager getLc], proxyCfg);
|
||||
linphone_core_set_default_proxy([LinphoneManager getLc], proxyCfg);
|
||||
linphone_core_set_default_proxy_config([LinphoneManager getLc], proxyCfg);
|
||||
[self.waitView setHidden:false];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
} else {
|
||||
// was a new proxy config, add it
|
||||
linphone_core_add_proxy_config(lc, proxyCfg);
|
||||
linphone_core_set_default_proxy(lc,proxyCfg);
|
||||
linphone_core_set_default_proxy_config(lc,proxyCfg);
|
||||
}
|
||||
|
||||
bad_proxy:
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#import "IASKTextField.h"
|
||||
#include "linphone/lpconfig.h"
|
||||
|
||||
#import "DTAlertView.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
@interface UIDevice (debug)
|
||||
|
||||
|
|
@ -686,6 +688,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForSpecifier:(IASKSpecifier*)specifier {
|
||||
NSString *key = [specifier.specifierDict objectForKey:kIASKKey];
|
||||
LinphoneCore* lc = [LinphoneManager getLc];
|
||||
#ifdef DEBUG
|
||||
if([key isEqual:@"release_button"]) {
|
||||
[UIApplication sharedApplication].keyWindow.rootViewController = nil;
|
||||
|
|
@ -701,9 +704,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
#endif
|
||||
if([key isEqual:@"wizard_button"]) {
|
||||
LinphoneProxyConfig* proxy = NULL;
|
||||
linphone_core_get_default_proxy([LinphoneManager getLc], &proxy);
|
||||
if (proxy == NULL ) {
|
||||
if (linphone_core_get_default_proxy_config(lc) == NULL ) {
|
||||
[self goToWizard];
|
||||
return;
|
||||
}
|
||||
|
|
@ -714,12 +715,30 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
otherButtonTitles:NSLocalizedString(@"Launch Wizard",nil), nil];
|
||||
[alert show];
|
||||
[alert release];
|
||||
} else if([key isEqual:@"about_button"]) {
|
||||
} else if ( [key isEqual:@"clear_proxy_button"] ) {
|
||||
if ( linphone_core_get_default_proxy_config(lc) == NULL ) {
|
||||
return;
|
||||
}
|
||||
|
||||
DTAlertView* alert = [[DTAlertView alloc] initWithTitle:NSLocalizedString(@"Warning", nil) message:NSLocalizedString(@"Are you sure to want to clear your proxy setup?",nil)];
|
||||
|
||||
[alert addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil) block:nil];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"Yes", nil)
|
||||
block:^{
|
||||
linphone_core_clear_proxy_config(lc);
|
||||
linphone_core_clear_all_auth_info(lc);
|
||||
[settingsStore transformLinphoneCoreToKeys];
|
||||
[settingsController.tableView reloadData];
|
||||
}];
|
||||
[alert show];
|
||||
[alert release];
|
||||
|
||||
} else if([key isEqual:@"about_button"]) {
|
||||
[[PhoneMainView instance] changeCurrentView:[AboutViewController compositeViewDescription] push:TRUE];
|
||||
} else if ([key isEqualToString:@"reset_logs_button"]) {
|
||||
linphone_core_reset_log_collection();
|
||||
} else if ([key isEqual:@"send_logs_button"]) {
|
||||
char * filepath = linphone_core_compress_log_collection([LinphoneManager getLc]);
|
||||
char * filepath = linphone_core_compress_log_collection(lc);
|
||||
if (filepath == NULL) {
|
||||
[LinphoneLogger log:LinphoneLoggerError format:@"Cannot sent logs: file is NULL"];
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
linphone_proxy_config_enable_register(proxyCfg, true);
|
||||
linphone_core_add_auth_info([LinphoneManager getLc], info);
|
||||
linphone_core_add_proxy_config([LinphoneManager getLc], proxyCfg);
|
||||
linphone_core_set_default_proxy([LinphoneManager getLc], proxyCfg);
|
||||
linphone_core_set_default_proxy_config([LinphoneManager getLc], proxyCfg);
|
||||
}
|
||||
|
||||
- (NSString*)identityFromUsername:(NSString*)username {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,14 @@
|
|||
<key>Type</key>
|
||||
<string>IASKButtonSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>clear_proxy_button</string>
|
||||
<key>Title</key>
|
||||
<string>Clear Account</string>
|
||||
<key>Type</key>
|
||||
<string>IASKButtonSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>AutocapitalizationType</key>
|
||||
<string>None</string>
|
||||
|
|
|
|||
|
|
@ -60,3 +60,6 @@
|
|||
|
||||
/* More options */
|
||||
"More options" = "الخيارات الأخرى";
|
||||
|
||||
/* Clear Account */
|
||||
"Clear Account" = "Clear Account";
|
||||
|
|
@ -60,3 +60,6 @@
|
|||
|
||||
/* More options */
|
||||
"More options" = "More options";
|
||||
|
||||
/* Clear Account */
|
||||
"Clear Account" = "Clear Account";
|
||||
|
|
@ -60,3 +60,6 @@
|
|||
|
||||
/* More options */
|
||||
"More options" = "Plus d'options";
|
||||
|
||||
/* Clear Account */
|
||||
"Clear Account" = "Effacer le compte";
|
||||
|
|
@ -60,3 +60,6 @@
|
|||
|
||||
/* More options */
|
||||
"More options" = "Дополнительный счет";
|
||||
|
||||
/* Clear Account */
|
||||
"Clear Account" = "Clear Account";
|
||||
Loading…
Add table
Reference in a new issue