From e91af289e51be1cc0f3dc83411df02740a19d60b Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 15 Apr 2010 16:34:10 +0200 Subject: [PATCH] put some nice error messages --- Classes/PhoneViewController.m | 17 ++++++++++++++--- Classes/linphoneAppDelegate.h | 2 +- Classes/linphoneAppDelegate.m | 21 ++++++++++++++++++--- PhoneMainView.xib | 2 +- linphone-Info.plist | 4 ++-- linphone.xcodeproj/project.pbxproj | 10 ++++++---- 6 files changed, 42 insertions(+), 14 deletions(-) diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index d32a299f3..9cd9ae6d0 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -324,18 +324,29 @@ } case GSTATE_CALL_ERROR: { + /* NSString* lTitle= state->message!=nil?[NSString stringWithCString:state->message length:strlen(state->message)]: @"Error"; NSString* lMessage=lTitle; + */ + NSString* lMessage; + NSString* lTitle; + const char *errormsg=state->message; + lMessage=@"Please make sure your device is connected to the internet and double check your SIP account configuration in the settings."; + + if (errormsg!=nil){ + lMessage=[NSString stringWithFormat : @"%@\nReason was: %s",lMessage, errormsg]; + } + lTitle=@"Call failed"; UIAlertView* error = [[UIAlertView alloc] initWithTitle:lTitle message:lMessage delegate:nil - cancelButtonTitle:nil + cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [error show]; - [self performSelector:@selector(dismissAlertDialog:) withObject:error afterDelay:1]; - [self performSelector:@selector(dismissIncallView) withObject:nil afterDelay:1]; + //[self performSelector:@selector(dismissAlertDialog:) withObject:error afterDelay:2]; + //[self performSelector:@selector(dismissIncallView) withObject:nil afterDelay:2]; } break; diff --git a/Classes/linphoneAppDelegate.h b/Classes/linphoneAppDelegate.h index a587e5d9a..177fea373 100644 --- a/Classes/linphoneAppDelegate.h +++ b/Classes/linphoneAppDelegate.h @@ -36,7 +36,7 @@ @class PhoneViewController; @class CallHistoryTableViewController; -@interface linphoneAppDelegate : NSObject { +@interface linphoneAppDelegate : NSObject { UIWindow *window; IBOutlet UITabBarController* myTabBarController; IBOutlet ABPeoplePickerNavigationController* myPeoplePickerController; diff --git a/Classes/linphoneAppDelegate.m b/Classes/linphoneAppDelegate.m index c370255ff..c6813d898 100644 --- a/Classes/linphoneAppDelegate.m +++ b/Classes/linphoneAppDelegate.m @@ -238,8 +238,9 @@ LinphoneCoreVTable linphonec_vtable = { NSString* username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"]; NSString* domain = [[NSUserDefaults standardUserDefaults] stringForKey:@"domain_preference"]; NSString* accountPassword = [[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"]; - - //clear auth info list + bool configCheckDisable = [[NSUserDefaults standardUserDefaults] boolForKey:@"check_config_disable_preference"]; + + //clear auth info list linphone_core_clear_all_auth_info(myLinphoneCore); //clear existing proxy config linphone_core_clear_proxy_config(myLinphoneCore); @@ -293,7 +294,14 @@ LinphoneCoreVTable linphonec_vtable = { bool result=SCNetworkReachabilitySetCallback(proxyReachability, (SCNetworkReachabilityCallBack)networkReachabilityCallBack,&proxyReachabilityContext); SCNetworkReachabilityScheduleWithRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); [self doRegister]; - } + } else if (configCheckDisable == false) { + UIAlertView* error = [[UIAlertView alloc] initWithTitle:@"Warning" + message:@"It seems you have not configured any proxy server from settings" + delegate:self + cancelButtonTitle:@"Continue" + otherButtonTitles:@"Never remind",nil]; + [error show]; + } //Configure Codecs PayloadType *pt; @@ -352,6 +360,13 @@ LinphoneCoreVTable linphonec_vtable = { repeats:YES]; } +// no proxy configured alert +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + if (buttonIndex == 1) { + [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"check_config_disable_preference"]; + } +} + -(void) newIncomingCall:(NSString*) from { //redirect audio to speaker diff --git a/PhoneMainView.xib b/PhoneMainView.xib index d894009cd..e2e8f4bab 100644 --- a/PhoneMainView.xib +++ b/PhoneMainView.xib @@ -51,8 +51,8 @@ History + History - 6 diff --git a/linphone-Info.plist b/linphone-Info.plist index 0f27e929c..32b3069cc 100644 --- a/linphone-Info.plist +++ b/linphone-Info.plist @@ -7,11 +7,11 @@ UIRequiresPersistentWiFi CFBundleDisplayName - ${PRODUCT_NAME} + Linphone CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile - linphone2-57x57.png + icone-linphone-57.png CFBundleIdentifier org.linphone.phone CFBundleInfoDictionaryVersion diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 9ff596930..27623377c 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 22058C71116E305000B08DDD /* icone-linphone-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 22058C70116E305000B08DDD /* icone-linphone-57.png */; }; 220FAD3110765B400068D98F /* libeXosip2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2810765B400068D98F /* libeXosip2.a */; }; 220FAD3210765B400068D98F /* libgsm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2910765B400068D98F /* libgsm.a */; }; 220FAD3310765B400068D98F /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2A10765B400068D98F /* liblinphone.a */; }; @@ -30,7 +31,6 @@ 2245671D107699F700F10948 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2245671C107699F700F10948 /* Settings.bundle */; }; 224567C2107B968500F10948 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 224567C1107B968500F10948 /* AVFoundation.framework */; }; 225862E21140F5D700C5A737 /* linphone-3-250x130.png in Resources */ = {isa = PBXBuildFile; fileRef = 225862E11140F5D700C5A737 /* linphone-3-250x130.png */; }; - 225862F21140FC4F00C5A737 /* linphone2-57x57.png in Resources */ = {isa = PBXBuildFile; fileRef = 225862F11140FC4F00C5A737 /* linphone2-57x57.png */; }; 2264B6D211200342002C2C53 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2264B6D111200342002C2C53 /* SystemConfiguration.framework */; }; 2273785E10A3703300526073 /* libmsiounit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2273785D10A3703300526073 /* libmsiounit.a */; }; 2274401A106F31BD006EC466 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22744019106F31BD006EC466 /* CoreAudio.framework */; }; @@ -62,6 +62,7 @@ 1D3623250D0F684500981E51 /* linphoneAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = linphoneAppDelegate.m; sourceTree = ""; }; 1D6058910D05DD3D006BFB54 /* linphone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = linphone.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 22058C70116E305000B08DDD /* icone-linphone-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icone-linphone-57.png"; path = "Resources/icone-linphone-57.png"; sourceTree = ""; }; 220FAC79107654FC0068D98F /* eX_call.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eX_call.h; sourceTree = ""; }; 220FAC7A107654FC0068D98F /* eX_message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eX_message.h; sourceTree = ""; }; 220FAC7B107654FC0068D98F /* eX_options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eX_options.h; sourceTree = ""; }; @@ -189,7 +190,6 @@ 2245671C107699F700F10948 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; 224567C1107B968500F10948 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 225862E11140F5D700C5A737 /* linphone-3-250x130.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "linphone-3-250x130.png"; path = "../liblinphone-sdk/apple-darwin/share/pixmaps/linphone/linphone-3-250x130.png"; sourceTree = SOURCE_ROOT; }; - 225862F11140FC4F00C5A737 /* linphone2-57x57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "linphone2-57x57.png"; path = "../liblinphone-sdk/apple-darwin/share/pixmaps/linphone/linphone2-57x57.png"; sourceTree = SOURCE_ROOT; }; 2258633C11410BAC00C5A737 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; 2264B6D111200342002C2C53 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 2273785D10A3703300526073 /* libmsiounit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsiounit.a; path = "../liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsiounit.a"; sourceTree = SOURCE_ROOT; }; @@ -522,8 +522,8 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 22058C70116E305000B08DDD /* icone-linphone-57.png */, 2237D4081084D7A9001383EE /* oldphone-mono.wav */, - 225862F11140FC4F00C5A737 /* linphone2-57x57.png */, 225862E11140F5D700C5A737 /* linphone-3-250x130.png */, 22E0A783111C1BA800B04932 /* Speaker-32-on.png */, 22E0A784111C1BA800B04932 /* Speaker-32-off.png */, @@ -612,7 +612,7 @@ 22E0A821111C44E100B04932 /* MoreViewController.xib in Resources */, 22E0A823111C44E100B04932 /* ConsoleViewController.xib in Resources */, 225862E21140F5D700C5A737 /* linphone-3-250x130.png in Resources */, - 225862F21140FC4F00C5A737 /* linphone2-57x57.png in Resources */, + 22058C71116E305000B08DDD /* icone-linphone-57.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -641,6 +641,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -650,6 +651,7 @@ INFOPLIST_FILE = "linphone-Info.plist"; LIBRARY_SEARCH_PATHS = "../liblinphone-sdk/apple-darwin/lib/**"; PRODUCT_NAME = linphone; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos3.0; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; };