Display a warning when entering the wizard.

This commit is contained in:
Guillaume BIENKOWSKI 2014-05-23 16:07:14 +02:00
parent 8e0bc46556
commit ca5c5c5d8e
5 changed files with 35 additions and 5 deletions

View file

@ -23,7 +23,7 @@
#import "IASKAppSettingsViewController.h"
#import "LinphoneCoreSettingsStore.h"
@interface SettingsViewController: UIViewController<IASKSettingsDelegate, UICompositeViewDelegate> {
@interface SettingsViewController: UIViewController<IASKSettingsDelegate, UICompositeViewDelegate, UIAlertViewDelegate> {
@private
LinphoneCoreSettingsStore* settingsStore;
}

View file

@ -719,13 +719,28 @@ static UICompositeViewDescription *compositeDescription = nil;
if([key isEqual:@"console_button"]) {
[[PhoneMainView instance] changeCurrentView:[ConsoleViewController compositeViewDescription] push:TRUE];
} else if([key isEqual:@"wizard_button"]) {
WizardViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]], WizardViewController);
if(controller != nil) {
[controller reset];
}
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Warning",nil)
message:NSLocalizedString(@"Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?",nil)
delegate:self
cancelButtonTitle:NSLocalizedString(@"Cancel",nil)
otherButtonTitles:NSLocalizedString(@"Launch Wizard",nil), nil];
[alert show];
[alert release];
} else if([key isEqual:@"about_button"]) {
[[PhoneMainView instance] changeCurrentView:[AboutViewController compositeViewDescription] push:TRUE];
}
}
#pragma mark - UIAlertView delegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if( buttonIndex != 1 ) return;
WizardViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]], WizardViewController);
if(controller != nil) {
[controller reset];
}
}
@end

View file

@ -302,3 +302,8 @@
"Enter an address" = "Enter SIP address or phone number...";
"%@ is composing..." = "%@ is composing...";
"Resend" = "Resend";
/* Alert view for Wizard in Settings */
"Warning" = "Warning";
"Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?" = "Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?";
"Launch Wizard" = "Launch Wizard";

View file

@ -302,3 +302,8 @@
"Enter an address" = "Entrez une addresse SIP ou un numéro de téléphone...";
"%@ is composing..." = "%@ rédige un message...";
"Resend" = "Renvoyer";
/* Alert view for Wizard in Settings */
"Warning" = "Attention";
"Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?" = "Lancer l'Assistant va effacer vos réglages. Êtes-vous sûr de vouloir cela?";
"Launch Wizard" = "Lancer l'assistant";

View file

@ -302,3 +302,8 @@
"Enter an address" = "Введите адрес SIP или номер телефона...";
"%@ is composing..." = "%@ is composing...";
"Resend" = "Resend";
/* Alert view for Wizard in Settings */
"Warning" = "Warning";
"Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?" = "Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?";
"Launch Wizard" = "Launch Wizard";