Fix first login view

Working Incoming call view
Fix some value with inappsettings
This commit is contained in:
Yann Diorcet 2012-06-26 18:13:43 +02:00
parent 15d394318f
commit c62dabc1bc
26 changed files with 912 additions and 653 deletions

View file

@ -22,7 +22,6 @@
enum CallDelegateType {
CD_UNDEFINED = 0,
CD_NEW_CALL,
CD_ZRTP,
CD_VIDEO_UPDATE,
CD_STOP_VIDEO_ON_LOW_BATTERY,

View file

@ -54,12 +54,6 @@
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
//TODO
/*if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enable_first_login_view_preference"] == true) {
myFirstLoginViewController = [[FirstLoginViewController alloc] initWithNibName:@"FirstLoginViewController"
bundle:[NSBundle mainBundle]];
[self presentModalViewController:myFirstLoginViewController animated:true];
}*/
// [[LinphoneManager instance] setRegistrationDelegate:self];
//TODO

View file

@ -19,19 +19,21 @@
#import <UIKit/UIKit.h>
@interface FirstLoginViewController : UIViewController <UITextFieldDelegate>{
UIButton* ok;
UIButton* site;
UITextField* username;
UIView* activityIndicator;
@interface FirstLoginViewController : UIViewController<UITextFieldDelegate>{
UIButton* loginButton;
UIButton* siteButton;
UITextField* usernameField;
UITextField* passwordField;
UIView* waitView;
}
-(void) doOk:(id)sender;
- (IBAction)onLoginClick:(id)sender;
- (IBAction)onSiteClick:(id)sender;
@property (nonatomic, retain) IBOutlet UIButton* ok;
@property (nonatomic, retain) IBOutlet UIButton* site;
@property (nonatomic, retain) IBOutlet UITextField* username;
@property (nonatomic, retain) IBOutlet UITextField* passwd;
@property (nonatomic, retain) IBOutlet UIView* activityIndicator;
@property (nonatomic, retain) IBOutlet UIButton* loginButton;
@property (nonatomic, retain) IBOutlet UIButton* siteButton;
@property (nonatomic, retain) IBOutlet UITextField* usernameField;
@property (nonatomic, retain) IBOutlet UITextField* passwordField;
@property (nonatomic, retain) IBOutlet UIView* waitView;
@end

View file

@ -23,28 +23,31 @@
@implementation FirstLoginViewController
@synthesize ok;
@synthesize username;
@synthesize passwd;
@synthesize activityIndicator;
@synthesize site;
@synthesize loginButton;
@synthesize siteButton;
@synthesize usernameField;
@synthesize passwordField;
@synthesize waitView;
- (id)init {
return [super initWithNibName:@"FirstLoginViewController" bundle:[NSBundle mainBundle]];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
//[username setText:[[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"]];
//[passwd setText:[[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"]];
[usernameField setText:[[LinphoneManager instance].settingsStore objectForKey:@"username_preference"]];
[passwordField setText:[[LinphoneManager instance].settingsStore objectForKey:@"password_preference"]];
}
-(void) viewDidLoad {
NSString* siteUrl = [[NSUserDefaults standardUserDefaults] stringForKey:@"firt_login_view_url"];
- (void)viewDidLoad {
NSString* siteUrl = [[LinphoneManager instance].settingsStore objectForKey:@"first_login_view_url"];
if (siteUrl==nil) {
siteUrl=@"http://www.linphone.org";
}
[site setTitle:siteUrl forState:UIControlStateNormal];
[siteButton setTitle:siteUrl forState:UIControlStateNormal];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdate:) name:@"LinphoneRegistrationUpdate" object:nil];
}
- (void)registrationUpdate: (NSNotification*) notif {
@ -52,36 +55,36 @@
switch (state) {
case LinphoneRegistrationOk:
{
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"enable_first_login_view_preference"];
[self.activityIndicator setHidden:true];
[self dismissModalViewControllerAnimated:YES];
[[LinphoneManager instance].settingsStore setBool:false forKey:@"enable_first_login_view_preference"];
[self.waitView setHidden:true];
[[LinphoneManager instance] changeView:PhoneView_Dialer];
break;
}
case LinphoneRegistrationNone:
case LinphoneRegistrationCleared:
{
[self.activityIndicator setHidden:true];
[self.waitView setHidden:true];
break;
}
case LinphoneRegistrationFailed:
{
[self.activityIndicator setHidden:true];
[self.waitView setHidden:true];
//default behavior if no registration delegates
//UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@",user]
// message:reason
// delegate:nil
// cancelButtonTitle:@"Continue"
// otherButtonTitles:nil ,nil];
//[error show];
//[error release];
/*UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@", usernameField.text]
message:[notif.userInfo objectForKey: @"message"]
delegate:nil
cancelButtonTitle:@"Continue"
otherButtonTitles:nil,nil];
[error show];
[error release];*/
//erase uername passwd
[[LinphoneManager instance].settingsStore setObject:Nil forKey:@"username_preference"];
[[LinphoneManager instance].settingsStore setObject:Nil forKey:@"password_preference"];
break;
}
case LinphoneRegistrationProgress: {
[self.activityIndicator setHidden:false];
[self.waitView setHidden:false];
break;
}
default: break;
@ -90,27 +93,29 @@
- (void)dealloc {
[super dealloc];
[ok dealloc];
[site dealloc];
[username dealloc];
[activityIndicator dealloc];
[loginButton dealloc];
[siteButton dealloc];
[usernameField dealloc];
[passwordField dealloc];
[waitView dealloc];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void) viewDidUnload {
- (void)viewDidUnload {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
-(void) doOk:(id)sender {
if (sender == site) {
NSURL *url = [NSURL URLWithString:site.titleLabel.text];
[[UIApplication sharedApplication] openURL:url];
return;
}
- (void)onSiteClick:(id)sender {
NSURL *url = [NSURL URLWithString:siteButton.titleLabel.text];
[[UIApplication sharedApplication] openURL:url];
return;
}
- (void)onLoginClick:(id)sender {
NSString* errorMessage=nil;
if ([username.text length]==0 ) {
if ([usernameField.text length]==0 ) {
errorMessage=NSLocalizedString(@"Enter your username",nil);
} else if ([passwd.text length]==0 ) {
} else if ([passwordField.text length]==0 ) {
errorMessage=NSLocalizedString(@"Enter your password",nil);
}
@ -124,12 +129,11 @@
[error show];
[error release];
} else {
[[LinphoneManager instance].settingsStore setObject:username.text forKey:@"username_preference"];
[[LinphoneManager instance].settingsStore setObject:passwd.text forKey:@"password_preference"];
[self.activityIndicator setHidden:false];
[[LinphoneManager instance].settingsStore setObject:usernameField.text forKey:@"username_preference"];
[[LinphoneManager instance].settingsStore setObject:passwordField.text forKey:@"password_preference"];
[self.waitView setHidden:false];
[[LinphoneManager instance].settingsStore synchronize];
};
}
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
@ -138,5 +142,4 @@
return YES;
}
@end

View file

@ -2,23 +2,22 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">784</int>
<string key="IBDocument.SystemVersion">10K549</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1038.36</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
<string key="NS.object.0">1181</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBUIView</string>
<string>IBUIImageView</string>
<string>IBUIViewController</string>
<string>IBProxyObject</string>
<string>IBUIActivityIndicatorView</string>
<string>IBUITextField</string>
<string>IBUIButton</string>
<string>IBUIImageView</string>
<string>IBUIView</string>
<string>IBUITextField</string>
<string>IBProxyObject</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -38,212 +37,210 @@
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIViewController" id="284579969">
<object class="IBUIView" key="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIImageView" id="427931982">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, -20}, {360, 480}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="210410556"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">9</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">wallpaper_iphone_320x480.png</string>
</object>
</object>
<object class="IBUIButton" id="731646357">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{60, 400}, {200, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="992101396">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="64173324">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUITextField" id="415396672">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 200}, {200, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="157624641"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Password</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="925734638">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocorrectionType">1</int>
<bool key="IBUISecureTextEntry">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="927759199">
<int key="type">1</int>
<double key="pointSize">12</double>
</object>
<object class="NSFont" key="IBUIFont" id="348267750">
<string key="NSName">Helvetica</string>
<double key="NSSize">12</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUITextField" id="300056741">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 150}, {200, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="415396672"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Username</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocorrectionType">1</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIFontDescription" ref="927759199"/>
<reference key="IBUIFont" ref="348267750"/>
</object>
<object class="IBUIButton" id="157624641">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 300}, {200, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="731646357"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Login</string>
<reference key="IBUIHighlightedTitleColor" ref="992101396"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">5</int>
<bytes key="NSCMYK">MSAwLjY2MDAwMDAyNjIgMCAwAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">3</int>
</object>
<characters key="NSComponents">1 0.66 0 0 1</characters>
</object>
<reference key="IBUINormalTitleShadowColor" ref="64173324"/>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<int key="size">2</int>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIView" id="210410556">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">-2147483356</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIActivityIndicatorView" id="871218378">
<reference key="NSNextResponder" ref="210410556"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{142, 211}, {37, 37}}</string>
<reference key="NSSuperview" ref="210410556"/>
<reference key="NSNextKeyView" ref="300056741"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHidesWhenStopped">NO</bool>
<bool key="IBUIAnimating">YES</bool>
<int key="IBUIStyle">0</int>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="871218378"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MSAwLjY2AA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="IBUIView" id="988679043">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIImageView" id="427931982">
<reference key="NSNextResponder" ref="988679043"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{360, 480}</string>
<reference key="NSSuperview" ref="988679043"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="210410556"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">9</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">wallpaper_iphone_320x480.png</string>
</object>
</object>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="427931982"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
<object class="IBUIButton" id="731646357">
<reference key="NSNextResponder" ref="988679043"/>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{60, 420}, {200, 37}}</string>
<reference key="NSSuperview" ref="988679043"/>
<reference key="NSWindow"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="992101396">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="64173324">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUITextField" id="415396672">
<reference key="NSNextResponder" ref="988679043"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 220}, {200, 31}}</string>
<reference key="NSSuperview" ref="988679043"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="157624641"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Password</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="925734638">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocorrectionType">1</int>
<bool key="IBUISecureTextEntry">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="927759199">
<int key="type">1</int>
<double key="pointSize">12</double>
</object>
<object class="NSFont" key="IBUIFont" id="348267750">
<string key="NSName">Helvetica</string>
<double key="NSSize">12</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUITextField" id="300056741">
<reference key="NSNextResponder" ref="988679043"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 170}, {200, 31}}</string>
<reference key="NSSuperview" ref="988679043"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="415396672"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Username</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocorrectionType">1</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIFontDescription" ref="927759199"/>
<reference key="IBUIFont" ref="348267750"/>
</object>
<object class="IBUIButton" id="157624641">
<reference key="NSNextResponder" ref="988679043"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 320}, {200, 37}}</string>
<reference key="NSSuperview" ref="988679043"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="731646357"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Login</string>
<reference key="IBUIHighlightedTitleColor" ref="992101396"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">5</int>
<bytes key="NSCMYK">MSAwLjY2MDAwMDAyNjIgMCAwAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">3</int>
</object>
<characters key="NSComponents">1 0.66 0 0 1</characters>
</object>
<reference key="IBUINormalTitleShadowColor" ref="64173324"/>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<int key="size">2</int>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIView" id="210410556">
<reference key="NSNextResponder" ref="988679043"/>
<int key="NSvFlags">-2147483356</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIActivityIndicatorView" id="871218378">
<reference key="NSNextResponder" ref="210410556"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{142, 211}, {37, 37}}</string>
<reference key="NSSuperview" ref="210410556"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="300056741"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHidesWhenStopped">NO</bool>
<bool key="IBUIAnimating">YES</bool>
<int key="IBUIStyle">0</int>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview" ref="988679043"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="871218378"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MSAwLjY2AA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="427931982"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@ -253,41 +250,49 @@
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
<reference key="destination" ref="988679043"/>
</object>
<int key="connectionID">3</int>
<int key="connectionID">56</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">passwd</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="415396672"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">activityIndicator</string>
<string key="label">waitView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="210410556"/>
</object>
<int key="connectionID">33</int>
<int key="connectionID">57</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">username</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="300056741"/>
</object>
<int key="connectionID">38</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">site</string>
<string key="label">siteButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="731646357"/>
</object>
<int key="connectionID">36</int>
<int key="connectionID">58</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">usernameField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="300056741"/>
</object>
<int key="connectionID">59</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">passwordField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="415396672"/>
</object>
<int key="connectionID">60</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">loginButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="157624641"/>
</object>
<int key="connectionID">61</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
@ -307,21 +312,21 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doOk:</string>
<string key="label">onLoginClick:</string>
<reference key="source" ref="157624641"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">20</int>
<int key="connectionID">62</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doOk:</string>
<string key="label">onSiteClick:</string>
<reference key="source" ref="731646357"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">37</int>
<int key="connectionID">63</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@ -347,49 +352,48 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="284579969"/>
<int key="objectID">55</int>
<reference key="object" ref="988679043"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="191373211"/>
<reference ref="210410556"/>
<reference ref="157624641"/>
<reference ref="300056741"/>
<reference ref="415396672"/>
<reference ref="731646357"/>
<reference ref="427931982"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="157624641"/>
<reference ref="300056741"/>
<reference ref="731646357"/>
<reference ref="415396672"/>
<reference ref="427931982"/>
<reference ref="210410556"/>
</object>
<reference key="parent" ref="284579969"/>
<int key="objectID">5</int>
<reference key="object" ref="427931982"/>
<reference key="parent" ref="988679043"/>
<string key="objectName">background</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="157624641"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="300056741"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">username</string>
<int key="objectID">35</int>
<reference key="object" ref="731646357"/>
<reference key="parent" ref="988679043"/>
<string key="objectName">siteButton</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="415396672"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">passwd</string>
<reference key="parent" ref="988679043"/>
<string key="objectName">passwordField</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="427931982"/>
<reference key="parent" ref="191373211"/>
<int key="objectID">6</int>
<reference key="object" ref="300056741"/>
<reference key="parent" ref="988679043"/>
<string key="objectName">usernameField</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="157624641"/>
<reference key="parent" ref="988679043"/>
<string key="objectName">loginButton</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">31</int>
@ -398,19 +402,14 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="871218378"/>
</object>
<reference key="parent" ref="191373211"/>
<string key="objectName">wait</string>
<reference key="parent" ref="988679043"/>
<string key="objectName">waitView</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">32</int>
<reference key="object" ref="871218378"/>
<reference key="parent" ref="210410556"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="731646357"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">site</string>
<string key="objectName">activityIndicator</string>
</object>
</object>
</object>
@ -422,34 +421,23 @@
<string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
<string>-2.IBPluginDependency</string>
<string>1.IBPluginDependency</string>
<string>1.IBUserGuides</string>
<string>12.IBPluginDependency</string>
<string>12.IBUIButtonInspectorSelectedStateConfigurationMetadataKey</string>
<string>31.IBPluginDependency</string>
<string>32.IBPluginDependency</string>
<string>35.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>55.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>FirstLoginViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSMutableArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUserGuide">
<reference key="view" ref="191373211"/>
<double key="location">104</double>
<int key="affinity">0</int>
</object>
</object>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0"/>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -472,9 +460,106 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">54</int>
<int key="maxID">63</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">FirstLoginViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>onLoginClick:</string>
<string>onSiteClick:</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>onLoginClick:</string>
<string>onSiteClick:</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">onLoginClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">onSiteClick:</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>loginButton</string>
<string>passwordField</string>
<string>siteButton</string>
<string>usernameField</string>
<string>waitView</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIButton</string>
<string>UITextField</string>
<string>UIButton</string>
<string>UITextField</string>
<string>UIView</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>loginButton</string>
<string>passwordField</string>
<string>siteButton</string>
<string>usernameField</string>
<string>waitView</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">loginButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">passwordField</string>
<string key="candidateClassName">UITextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">siteButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">usernameField</string>
<string key="candidateClassName">UITextField</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">waitView</string>
<string key="candidateClassName">UIView</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/FirstLoginViewController.h</string>
</object>
</object>
</object>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
@ -483,7 +568,7 @@
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1280" key="NS.object.0"/>
<real value="1296" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
@ -495,6 +580,6 @@
<string key="NS.key.0">wallpaper_iphone_320x480.png</string>
<string key="NS.object.0">{320, 480}</string>
</object>
<string key="IBCocoaTouchPluginVersion">933</string>
<string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>

View file

@ -19,13 +19,31 @@
#import <UIKit/UIKit.h>
@interface IncomingCallViewController : UIViewController {
#import "UIModalViewController.h"
#include "linphonecore.h"
typedef enum _IncomingCallStates {
IncomingCall_Accepted,
IncomingCall_Decline,
IncomingCall_Aborted
} IncomingCallStats;
@interface IncomingCallViewController : UIModalViewController {
@private
UILabel* addressLabel;
UIImageView* avatarImage;
LinphoneCall *call;
}
@property (nonatomic, retain) IBOutlet UILabel* addressLabel;
@property (nonatomic, retain) IBOutlet UIImageView* avatarImage;
- (IBAction)onAcceptClick:(id) event;
- (IBAction)onDeclineClick:(id) event;
- (void)update:(LinphoneCall*)call;
- (LinphoneCall*) getCall;
@end

View file

@ -18,21 +18,62 @@
*/
#import "IncomingCallViewController.h"
#import "LinphoneManager.h"
@implementation IncomingCallViewController
@synthesize addressLabel;
@synthesize avatarImage;
- (id)init {
return [super initWithNibName:@"IncomingCallViewController" bundle:[NSBundle mainBundle]];
self = [super initWithNibName:@"IncomingCallViewController" bundle:[NSBundle mainBundle]];
if(self) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdate:)
name:@"LinphoneCallUpdate"
object:nil];
}
return self;
}
- (IBAction)onAcceptClick:(id) event {
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
- (IBAction)onDeclineClick:(id) event {
- (void)callUpdate:(NSNotification*)notif {
LinphoneCall *acall = [[notif.userInfo objectForKey: @"call"] pointerValue];
LinphoneCallState astate = [[notif.userInfo objectForKey: @"state"] intValue];
if(call == acall && (astate == LinphoneCallEnd || astate == LinphoneCallError)) {
[self dismiss: IncomingCall_Aborted];
}
}
- (IBAction)onAcceptClick:(id)event {
linphone_core_accept_call([LinphoneManager getLc], call);
[self dismiss: IncomingCall_Accepted];
}
- (IBAction)onDeclineClick:(id)event {
linphone_core_terminate_call([LinphoneManager getLc], call);
[self dismiss: IncomingCall_Decline];
}
- (void)update:(LinphoneCall*)acall {
[self view]; //Force view load
call = acall;
const char* userNameChars=linphone_address_get_username(linphone_call_get_remote_address(call));
NSString* userName = userNameChars?[[[NSString alloc] initWithUTF8String:userNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
const char* displayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call));
NSString* displayName = [displayNameChars?[[NSString alloc] initWithUTF8String:displayNameChars]:@"" autorelease];
[addressLabel setText:([displayName length]>0)?displayName:userName];
}
- (LinphoneCall*) getCall {
return call;
}
@end

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
@ -39,7 +39,7 @@
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIView" id="735497316">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">288</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIImageView" id="1023112121">
<reference key="NSNextResponder" ref="735497316"/>
@ -62,7 +62,7 @@
<string key="NSFrame">{{0, 47}, {320, 63}}</string>
<reference key="NSSuperview" ref="735497316"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="402572557"/>
<reference key="NSNextKeyView" ref="651495339"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@ -93,7 +93,7 @@
<string key="NSFrame">{{10, 53}, {300, 51}}</string>
<reference key="NSSuperview" ref="735497316"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="442322210"/>
<reference key="NSNextKeyView" ref="632401698"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIAutoresizesSubviews">NO</bool>
@ -4488,7 +4488,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
</object>
</array>
</array>
<object class="NSColor" key="NSColor">
<object class="NSColor" key="NSColor" id="84179139">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
@ -4508,24 +4508,48 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIImageView" id="651495339">
<reference key="NSNextResponder" ref="735497316"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, 96}, {320, 262}}</string>
<reference key="NSSuperview" ref="735497316"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="402572557"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">ombre-cotes-avatar.png</string>
</object>
</object>
<object class="IBUIImageView" id="632401698">
<reference key="NSNextResponder" ref="735497316"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{80, 113}, {160, 170}}</string>
<reference key="NSSuperview" ref="735497316"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="442322210"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">avatar-inconnu.png</string>
</object>
</object>
</array>
<string key="NSFrameSize">{320, 110}</string>
<string key="NSFrameSize">{320, 395}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1023112121"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="259295852">
<int key="NSID">2</int>
</object>
</object>
<reference key="IBUIBackgroundColor" ref="84179139"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="442322210">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">264</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIView" id="299451957">
<reference key="NSNextResponder" ref="442322210"/>
@ -4538,7 +4562,9 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="259295852"/>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<int key="IBUITag">-1</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
@ -4629,10 +4655,10 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="735497316"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="259295852"/>
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEgMC45Njg2Mjc0NTEAA</bytes>
</object>
<bool key="IBUIAutoresizesSubviews">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
@ -4655,6 +4681,14 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">avatarImage</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="632401698"/>
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">onDeclineClick:</string>
@ -4738,6 +4772,8 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<reference ref="1023112121"/>
<reference ref="151647739"/>
<reference ref="402572557"/>
<reference ref="651495339"/>
<reference ref="632401698"/>
</array>
<reference key="parent" ref="191373211"/>
</object>
@ -4759,6 +4795,18 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<reference key="parent" ref="735497316"/>
<string key="objectName">otherBackground</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="651495339"/>
<reference key="parent" ref="735497316"/>
<string key="objectName">avatarShadowImage</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="632401698"/>
<reference key="parent" ref="735497316"/>
<string key="objectName">avatarImage</string>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@ -4770,6 +4818,8 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0" key="10.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -4783,7 +4833,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">16</int>
<int key="maxID">20</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -4804,17 +4854,20 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">addressLabel</string>
<string key="NS.object.0">UILabel</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">addressLabel</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<dictionary class="NSMutableDictionary" key="outlets">
<string key="addressLabel">UILabel</string>
<string key="avatarImage">UIImageView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="addressLabel">
<string key="name">addressLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
</object>
<object class="IBToOneOutletInfo" key="avatarImage">
<string key="name">avatarImage</string>
<string key="candidateClassName">UIImageView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/IncomingCallViewController.h</string>
@ -4824,13 +4877,19 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="avatar-inconnu.png">{320, 339}</string>
<string key="champ-courbe-autres-numeros.png">{640, 125}</string>
<string key="champ-titre-incoming.png">{640, 135}</string>
<string key="decrocher-actif.png">{320, 154}</string>
<string key="decrocher-over.png">{320, 154}</string>
<string key="ombre-cotes-avatar.png">{640, 523}</string>
<string key="refuser-actif.png">{320, 154}</string>
<string key="refuser-over.png">{320, 154}</string>
</dictionary>

View file

@ -54,6 +54,7 @@
<bool key="IBUIResizesToFullScreen">YES</bool>
</object>
<object class="IBUIViewController" id="110348778">
<string key="IBUINibName">PhoneMainView</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
@ -148,77 +149,57 @@
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">IASKAbstractSettingsStore</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/IASKAbstractSettingsStore.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">LinphoneAppDelegate</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="settings">LinphoneCoreSettingsStore</string>
<string key="window">UIWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="settings">
<string key="name">settings</string>
<string key="candidateClassName">LinphoneCoreSettingsStore</string>
</object>
<object class="IBToOneOutletInfo" key="window">
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">window</string>
<string key="NS.object.0">UIWindow</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">window</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">window</string>
<string key="candidateClassName">UIWindow</string>
</object>
</dictionary>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/LinphoneAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">LinphoneCoreSettingsStore</string>
<string key="superclassName">IASKAbstractSettingsStore</string>
<string key="className">PhoneMainView</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">mainViewController</string>
<string key="NS.object.0">UICompositeViewController</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">mainViewController</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">mainViewController</string>
<string key="candidateClassName">UICompositeViewController</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/LinphoneCoreSettingsStore.h</string>
<string key="minorKey">./Classes/PhoneMainView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PhoneMainView</string>
<string key="className">UICompositeViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="callTabBarController">UIViewController</string>
<string key="contentView">UIView</string>
<string key="incomingCallTabBarController">UIViewController</string>
<string key="mainTabBarController">UIViewController</string>
<string key="stateBarController">UIViewController</string>
<string key="stateBarView">UIView</string>
<string key="tabBarView">UIView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="callTabBarController">
<string key="name">callTabBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo" key="contentView">
<string key="name">contentView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="incomingCallTabBarController">
<string key="name">incomingCallTabBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo" key="mainTabBarController">
<string key="name">mainTabBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo" key="stateBarController">
<string key="name">stateBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo" key="stateBarView">
<string key="name">stateBarView</string>
<string key="candidateClassName">UIView</string>
@ -230,7 +211,7 @@
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/PhoneMainView.h</string>
<string key="minorKey">./Classes/UICompositeViewController.h</string>
</object>
</object>
</array>

View file

@ -94,7 +94,7 @@ int __aeabi_idiv(int a, int b) {
- (void)applicationDidBecomeActive:(UIApplication *)application {
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
&& [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_autoboot_preference"]) {
&& ![[NSUserDefaults standardUserDefaults] boolForKey:@"start_at_boot_preference"]) {
// autoboot disabled, doing nothing
return;
} else if ([LinphoneManager instance] == nil) {
@ -133,13 +133,21 @@ int __aeabi_idiv(int a, int b) {
}
- (void)loadDefaultSettings:(NSDictionary *) appDefaults {
for(NSString* key in appDefaults){
NSLog(@"Overload %@ to in app settings.", key);
[[[LinphoneManager instance] settingsStore] setObject:[appDefaults objectForKey:key] forKey:key];
}
[[[LinphoneManager instance] settingsStore] synchronize];
}
- (void)setupUI {
// Change to default view
[[LinphoneManager instance] changeView: PhoneView_Dialer];
if ([[LinphoneManager instance].settingsStore boolForKey:@"enable_first_login_view_preference"] == true) {
// Change to fist login view
[[LinphoneManager instance] changeView: PhoneView_FirstLoginView];
} else {
// Change to default view
[[LinphoneManager instance] changeView: PhoneView_Dialer];
}
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
}
@ -174,11 +182,11 @@ int __aeabi_idiv(int a, int b) {
/* explicitely instanciate LinphoneManager */
LinphoneManager* lm = [[LinphoneManager alloc] init];
assert(lm == [LinphoneManager instance]);
[self setupUI];
[[LinphoneManager instance] startLibLinphone];
[self setupUI];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
[self setupGSMInteraction];
@ -200,7 +208,7 @@ int __aeabi_idiv(int a, int b) {
ms_warning("Local notification received with nil call");
return;
}
linphone_core_accept_call([LinphoneManager getLc], call);
linphone_core_accept_call([LinphoneManager getLc], call);
}
@end

View file

@ -25,62 +25,62 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
@implementation LinphoneCoreSettingsStore
- (void)handleMigration{
- (void)handleMigration {
NSUserDefaults *oldconfig=[NSUserDefaults standardUserDefaults];
NSArray *allkeys=[[oldconfig dictionaryRepresentation] allKeys];
for(NSString* key in allkeys){
NSLog(@"Migrating old config item %@ to in app settings.",key);
[self setObject:[oldconfig objectForKey:key] forKey:key];
}
[self synchronize];
NSLog(@"Migration done");
for(NSString* key in allkeys){
NSLog(@"Migrating old config item %@ to in app settings.",key);
[self setObject:[oldconfig objectForKey:key] forKey:key];
}
[self synchronize];
NSLog(@"Migration done");
}
- (id)init{
- (id)init {
self = [super init];
if (self){
dict=[[NSMutableDictionary alloc] init];
changedDict=[[NSMutableDictionary alloc] init];
LinphoneCore *lc=[LinphoneManager getLc];
if (lp_config_get_int(linphone_core_get_config(lc),"app","config_migrated",0)==0){
[self transformLinphoneCoreToKeys];
LinphoneCore *lc=[LinphoneManager getLc];
if (lp_config_get_int(linphone_core_get_config(lc),"app","config_migrated",0) == 0) {
[self handleMigration];
lp_config_set_int(linphone_core_get_config(lc),"app","config_migrated",1);
}
[self transformLinphoneCoreToKeys];
}
return self;
}
- (void)dealloc{
[super dealloc];
- (void)dealloc {
[dict release];
[changedDict release];
[super dealloc];
}
- (void)transformKeysToLinphoneCore{
- (void)transformKeysToLinphoneCore {
//LinphoneCore *lc=[LinphoneManager getLc];
}
- (void)setString:(const char*)value forKey:(NSString*)key{
- (void)setString:(const char*)value forKey:(NSString*)key {
id obj=Nil;
if (value) obj=[[NSString alloc] initWithCString:value encoding:[NSString defaultCStringEncoding] ];
[self setObject: obj forKey:key];
}
- (NSString*)stringForKey:(NSString*) key{
- (NSString*)stringForKey:(NSString*) key {
return [self objectForKey: key];
}
- (void)transformCodecsToKeys: (const MSList *)codecs{
- (void)transformCodecsToKeys: (const MSList *)codecs {
LinphoneCore *lc=[LinphoneManager getLc];
const MSList *elem=codecs;
for(;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
NSString *pref=[LinphoneManager getPreferenceForCodec:pt->mime_type withRate:pt->clock_rate];
if (pref){
[self setBool: linphone_core_payload_type_enabled(lc,pt) forKey: pref];
bool_t value = linphone_core_payload_type_enabled(lc,pt);
[self setBool:value forKey: pref];
}else{
ms_warning("Codec %s/%i supported by core is not shown in iOS app config view.",
pt->mime_type,pt->clock_rate);
@ -88,7 +88,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
}
}
- (void)transformLinphoneCoreToKeys{
- (void)transformLinphoneCoreToKeys {
LinphoneCore *lc=[LinphoneManager getLc];
LinphoneProxyConfig *cfg=NULL;
linphone_core_get_default_proxy(lc,&cfg);
@ -157,11 +157,11 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
}
[self setString:val forKey:@"media_encryption_preference"];
}
[self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","debugenable_preference",0) forKey:@"debugenable_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","check_config_disable_preference",0) forKey:@"check_config_disable_preference"];
[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"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","enable_first_login_view_preference", 0) forKey:@"enable_first_login_view_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","debugenable_preference", 0) forKey:@"debugenable_preference"];
[self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","check_config_disable_preference", 0) forKey:@"check_config_disable_preference"];
[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)
@ -169,8 +169,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
else 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()){
/*FIXME: enhance linphonecore API to handle tunnel more easily in applications */
//LinphoneTunnel *tun=linphone_core_get_tunnel(lc);
@ -200,14 +198,14 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
return [dict valueForKey:key];
}
- (BOOL)valueChangedForKey:(NSString*)key{
- (BOOL)valueChangedForKey:(NSString*)key {
return [ [changedDict valueForKey:key] boolValue];
}
- (void)synchronizeAccount{
LinphoneCore *lc=[LinphoneManager getLc];
- (void)synchronizeAccount {
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneManager* lLinphoneMgr = [LinphoneManager instance];
LinphoneProxyConfig* proxyCfg=NULL;
LinphoneProxyConfig* proxyCfg = NULL;
/* unregister before modifying any settings */
{
linphone_core_get_default_proxy(lc, &proxyCfg);
@ -370,16 +368,16 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
else linphone_core_set_media_encryption(lc, LinphoneMediaEncryptionNone);
NSString* stun_server = [self stringForKey:@"stun_preference"];
if ([stun_server length]>0){
if ([stun_server length] > 0){
linphone_core_set_stun_server(lc,[stun_server cStringUsingEncoding:[NSString defaultCStringEncoding]]);
linphone_core_set_firewall_policy(lc, LinphonePolicyUseStun);
}else{
} else {
linphone_core_set_stun_server(lc, NULL);
linphone_core_set_firewall_policy(lc, LinphonePolicyNoFirewall);
}
LinphoneVideoPolicy policy;
policy.automatically_accept = [self boolForKey:@"start_video_preference"];;
policy.automatically_accept = [self boolForKey:@"start_video_preference"];
policy.automatically_initiate = [self boolForKey:@"start_video_preference"];
linphone_core_set_video_policy(lc, &policy);
@ -391,21 +389,24 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
if (backgroundSupported) {
isbackgroundModeEnabled = [self boolForKey:@"backgroundmode_preference"];
} else {
isbackgroundModeEnabled=false;
isbackgroundModeEnabled = false;
}
lp_config_set_int(linphone_core_get_config(lc),"app","backgroundmode_preference",isbackgroundModeEnabled);
lp_config_set_int(linphone_core_get_config(lc),"app","backgroundmode_preference", isbackgroundModeEnabled);
BOOL debugmode=[self boolForKey:@"debugenable_preference"];
lp_config_set_int(linphone_core_get_config(lc),"app","debugenable_preference",debugmode);
BOOL firstloginview = [self boolForKey:@"enable_first_login_view_preference"];
lp_config_set_int(linphone_core_get_config(lc),"app","enable_first_login_view_preference", firstloginview);
BOOL debugmode = [self boolForKey:@"debugenable_preference"];
lp_config_set_int(linphone_core_get_config(lc),"app","debugenable_preference", debugmode);
if (debugmode) linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler);
else linphone_core_disable_logs();
/*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/
BOOL start_at_boot=[self boolForKey:@"start_at_boot_preference"];
BOOL start_at_boot = [self boolForKey:@"start_at_boot_preference"];
[[NSUserDefaults standardUserDefaults] setBool: start_at_boot forKey:@"start_at_boot_preference"];
[changedDict release];
changedDict=[[NSMutableDictionary alloc] init];
changedDict = [[NSMutableDictionary alloc] init];
return YES;
}

View file

@ -29,6 +29,7 @@
#include "linphonecore.h"
typedef enum _PhoneView {
PhoneView_FirstLoginView,
PhoneView_Dialer,
PhoneView_History,
PhoneView_Settings,

View file

@ -352,16 +352,6 @@ static LinphoneCoreVTable linphonec_vtable = {
.transfer_state_changed=linphone_iphone_transfer_state_changed
};
- (void)configurePayloadType:(const char*) type fromPrefKey: (NSString*)key withRate:(int)rate {
if ([[NSUserDefaults standardUserDefaults] boolForKey:key]) {
PayloadType* pt;
if((pt = linphone_core_find_payload_type(theLinphoneCore,type,rate))) {
linphone_core_enable_payload_type(theLinphoneCore,pt, TRUE);
}
}
}
- (void)kickOffNetworkConnection {
/*start a new thread to avoid blocking the main ui in case of peer host failure*/
[NSThread detachNewThreadSelector:@selector(runNetworkConnection) toTarget:self withObject:nil];
@ -471,7 +461,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
// no proxy configured alert
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"check_config_disable_preference"];
[[[LinphoneManager instance] settingsStore] setBool:true forKey:@"check_config_disable_preference"];
}
}
@ -498,7 +488,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg);
linphone_core_stop_dtmf_stream(theLinphoneCore);
if (proxyCfg && lp_config_get_int(linphone_core_get_config(theLinphoneCore),"app","backgroundmode_preference",0)) {
if (proxyCfg && [settingsStore boolForKey:@"backgroundmode_preference"]) {
//For registration register
linphone_core_refresh_registers(theLinphoneCore);

View file

@ -18,6 +18,8 @@
*/
#import "FastAddressBook.h"
#import "LinphoneManager.h"
@implementation FastAddressBook
@synthesize addressBook;
@ -30,7 +32,7 @@
+(NSString*) appendCountryCodeIfPossible:(NSString*) number {
if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) {
NSString* lCountryCode = [[NSUserDefaults standardUserDefaults] stringForKey:@"countrycode_preference"];
NSString* lCountryCode = [[LinphoneManager instance].settingsStore objectForKey:@"countrycode_preference"];
if (lCountryCode && [lCountryCode length]>0) {
//append country code
return [lCountryCode stringByAppendingString:number];

View file

@ -130,6 +130,8 @@
return controller;
}
#define IPHONE_STATUSBAR_HEIGHT 20
- (void)update: (UICompositeViewDescription*) description tabBar:(NSNumber*)tabBar fullscreen:(NSNumber*)fullscreen {
// Copy view description
@ -198,25 +200,22 @@
// Resize StateBar
CGRect stateBarFrame = stateBarView.frame;
int origin = 0;
if(currentViewDescription->fullscreen)
stateBarFrame.origin.y = -20;
else
stateBarFrame.origin.y = 0;
origin = -IPHONE_STATUSBAR_HEIGHT;
if(stateBarViewController != nil && currentViewDescription->stateBarEnabled) {
stateBarView.hidden = false;
[stateBarView setFrame: stateBarFrame];
contentFrame.origin.y = stateBarFrame.size.height + stateBarFrame.origin.y;
contentFrame.origin.y = origin + stateBarFrame.size.height;
stateBarFrame.origin.y = origin;
} else {
stateBarView.hidden = true;
contentFrame.origin.y = stateBarFrame.origin.y;
contentFrame.origin.y = origin;
stateBarFrame.origin.y = origin - stateBarFrame.size.height;
}
// Resize TabBar
CGRect tabFrame = tabBarView.frame;
if(tabBarViewController != nil && currentViewDescription->tabBarEnabled) {
tabBarView.hidden = false;
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - 20;
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - IPHONE_STATUSBAR_HEIGHT;
tabFrame.origin.x = [[UIScreen mainScreen] bounds].size.width;
tabFrame.size.height = tabBarViewController.view.frame.size.height;
tabFrame.size.width = tabBarViewController.view.frame.size.width;
@ -230,11 +229,10 @@
}
}
} else {
tabBarView.hidden = true;
contentFrame.size.height = tabFrame.origin.y + tabFrame.size.height;
if(currentViewDescription->fullscreen)
contentFrame.size.height += 20;
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - 20;
contentFrame.size.height += IPHONE_STATUSBAR_HEIGHT;
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - IPHONE_STATUSBAR_HEIGHT;
}
// Resize innerView
@ -246,6 +244,7 @@
[contentView setFrame: contentFrame];
[innerView setFrame: innerContentFrame];
[tabBarView setFrame: tabFrame];
[stateBarView setFrame: stateBarFrame];
// Commit animation
if(tabBar != nil || fullscreen != nil) {

View file

@ -0,0 +1,38 @@
/* UIModalViewController.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
@class UIModalViewController;
@protocol UIModalViewDelegate <NSObject>
- (void)modalViewDismiss:(UIModalViewController*)controller value:(int)value;
@end
@interface UIModalViewController : UIViewController {
id<UIModalViewDelegate> modalDelegate;
}
- (void)setModalDelegate:(id<UIModalViewDelegate>)delegate;
- (void)dismiss:(int)value;
- (void)dismiss;
@end

View file

@ -0,0 +1,38 @@
/* UIModalViewController.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIModalViewController.h"
@implementation UIModalViewController
- (void)dismiss:(int)value {
if(modalDelegate != nil)
[modalDelegate modalViewDismiss:self value:value];
}
- (void)dismiss{
if(modalDelegate != nil)
[modalDelegate modalViewDismiss:self value:0];
}
- (void)setModalDelegate:(id<UIModalViewDelegate>)delegate {
modalDelegate = delegate;
}
@end

View file

@ -22,20 +22,23 @@
#import "LinphoneManager.h"
#import "CallDelegate.h"
#import "UICompositeViewController.h"
#import "UIModalViewController.h"
@interface PhoneMainView : UIViewController<CallActionSheetDelegate> {
UICompositeViewController *mainViewController;
UICompositeViewController *modalViewController;
@interface PhoneMainView : UIViewController<CallActionSheetDelegate,UIModalViewDelegate> {
@private
UICompositeViewController *mainViewController;
NSMutableArray *modalControllers;
NSMutableDictionary *viewDescriptions;
PhoneView currentPhoneView;
UIActionSheet *incomingCallActionSheet;
UIActionSheet *batteryActionSheet;
int loadCount;
}
@property (nonatomic, retain) IBOutlet UICompositeViewController *mainViewController;
@property (nonatomic, retain) IBOutlet UICompositeViewController *modalViewController;
@end

View file

@ -20,23 +20,23 @@
#import <QuartzCore/QuartzCore.h>
#import "PhoneMainView.h"
#import "DialerViewController.h"
#import "HistoryViewController.h"
#import "ContactsViewController.h"
#import "FirstLoginViewController.h"
#import "IncomingCallViewController.h"
#import "InCallViewController.h"
#import "SettingsViewController.h"
#import "ChatViewController.h"
#import "AbstractCall.h"
@implementation PhoneMainView
@synthesize mainViewController;
@synthesize modalViewController;
- (void)myInit {
self->currentPhoneView = -1;
currentPhoneView = -1;
loadCount = 0; // For avoiding IOS 4 bug
// Init view descriptions
viewDescriptions = [[NSMutableDictionary alloc] init];
modalControllers = [[NSMutableArray alloc] init];
}
- (id)init {
@ -95,13 +95,13 @@
}
- (void)viewDidLoad {
// Avoid IOS 4 bug
if(self->loadCount++ > 0)
return;
[super viewDidLoad];
[[self view] addSubview: mainViewController.view];
// Init view descriptions
viewDescriptions = [[NSMutableDictionary alloc] init];
//
// Main View
//
@ -140,18 +140,6 @@
historyDescription->fullscreen = false;
[viewDescriptions setObject:historyDescription forKey:[NSNumber numberWithInt: PhoneView_History]];
//
// IncomingCall View
//
UICompositeViewDescription *incomingCallDescription = [UICompositeViewDescription alloc];
incomingCallDescription->content = @"IncomingCallViewController";
incomingCallDescription->tabBar = nil;
incomingCallDescription->tabBarEnabled = false;
incomingCallDescription->stateBar = @"UIStateBar";
incomingCallDescription->stateBarEnabled = true;
incomingCallDescription->fullscreen = false;
[viewDescriptions setObject:incomingCallDescription forKey:[NSNumber numberWithInt: PhoneView_IncomingCall]];
//
// InCall View
//
@ -188,6 +176,18 @@
chatDescription->stateBarEnabled = false;
chatDescription->fullscreen = false;
[viewDescriptions setObject:chatDescription forKey:[NSNumber numberWithInt: PhoneView_Chat]];
//
// IncomingCall View
//
UICompositeViewDescription *incomingCallDescription = [UICompositeViewDescription alloc];
incomingCallDescription->content = @"FirstLoginViewController";
incomingCallDescription->tabBar = nil;
incomingCallDescription->tabBarEnabled = false;
incomingCallDescription->stateBar = nil;
incomingCallDescription->stateBarEnabled = false;
incomingCallDescription->fullscreen = false;
[viewDescriptions setObject:incomingCallDescription forKey:[NSNumber numberWithInt: PhoneView_FirstLoginView]];
// Set observers
[[NSNotificationCenter defaultCenter] addObserver:self
@ -208,12 +208,16 @@
name:UIDeviceBatteryLevelDidChangeNotification
object:nil];
}
- (void)viewDidUnload {
[super viewDidUnload];
[[NSNotificationCenter defaultCenter] removeObserver:self];
// Avoid IOS 4 bug
self->loadCount--;
}
- (void)registrationUpdate: (NSNotification*) notif {
- (void)registrationUpdate:(NSNotification*)notif {
LinphoneRegistrationState state = [[notif.userInfo objectForKey: @"state"] intValue];
LinphoneProxyConfig *cfg = [[notif.userInfo objectForKey: @"cfg"] pointerValue];
// Show error
@ -236,7 +240,7 @@
message:lErrorMessage
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil ,nil];
otherButtonTitles:nil,nil];
[error show];
[error release];
}
@ -245,7 +249,7 @@
}
}
- (void)callUpdate:(NSNotification*) notif {
- (void)callUpdate:(NSNotification*)notif {
LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue];
LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue];
NSString *message = [notif.userInfo objectForKey: @"message"];
@ -286,7 +290,7 @@
}
case LinphoneCallEnd:
{
[self dismissIncomingCall];
[self dismissIncomingCall:call];
if (canHideInCallView) {
if ([[LinphoneManager instance] currentView] != PhoneView_Dialer) {
// Go to dialer view
@ -348,30 +352,18 @@
[error release];
}
- (void)dismissIncomingCall {
- (void)dismissIncomingCall:(LinphoneCall*)call {
//cancel local notification, just in case
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground ) {
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
// cancel local notif if needed
[[UIApplication sharedApplication] cancelAllLocalNotifications];
} else {
if (incomingCallActionSheet) {
[incomingCallActionSheet dismissWithClickedButtonIndex:1 animated:true];
incomingCallActionSheet = nil;
}
}
//TODO
/*
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstlogindone_preference" ] == true) {
//first login case, dismmis first login view
[self dismissModalViewControllerAnimated:true];
}; */
}
- (void)displayIncomingCall:(LinphoneCall*) call{
#if 0
const char* userNameChars=linphone_address_get_username(linphone_call_get_remote_address(call));
NSString* userName = userNameChars?[[[NSString alloc] initWithUTF8String:userNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
const char* displayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call));
@ -394,37 +386,14 @@
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
}
} else {
CallDelegate* cd = [[CallDelegate alloc] init];
cd.eventType = CD_NEW_CALL;
cd.delegate = self;
cd.call = call;
incomingCallActionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:userName]
delegate:cd
cancelButtonTitle:nil
destructiveButtonTitle:NSLocalizedString(@"Answer",nil)
otherButtonTitles:NSLocalizedString(@"Decline",nil),nil];
incomingCallActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
//TODO
/*if ([LinphoneManager runningOnIpad]) {
if (self.modalViewController != nil)
[incomingCallActionSheet showInView:[self.modalViewController view]];
else
[incomingCallActionSheet showInView:self.parentViewController.view];
} else */{
[incomingCallActionSheet showInView: self.view];
}
[incomingCallActionSheet release];
} else {
IncomingCallViewController *controller = [[IncomingCallViewController alloc] init];
[controller update:call];
[self addModalViewController:controller];
}
#endif
//UICompositeViewController *controller = [[UICompositeViewController alloc] initWithNibName:@"UICompositeViewController" bundle:[NSBundle mainBundle]];
[modalViewController changeView:[viewDescriptions objectForKey:[NSNumber numberWithInt:PhoneView_IncomingCall]]];
[self presentModalViewController:modalViewController animated:false];
}
- (void)batteryLevelChanged: (NSNotification*) notif {
- (void)batteryLevelChanged:(NSNotification*)notif {
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (!call || !linphone_call_params_video_enabled(linphone_call_get_current_params(call)))
return;
@ -460,28 +429,17 @@
- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type
clickedButtonAtIndex:(NSInteger)buttonIndex
withUserDatas:(void *)datas {
switch(type) {
case CD_NEW_CALL:
{
LinphoneCall* call = (LinphoneCall*)datas;
if (buttonIndex == actionSheet.destructiveButtonIndex) {
linphone_core_accept_call([LinphoneManager getLc], call);
} else {
linphone_core_terminate_call([LinphoneManager getLc], call);
}
incomingCallActionSheet = nil;
break;
}
case CD_STOP_VIDEO_ON_LOW_BATTERY:
{
LinphoneCall* call = (LinphoneCall*)datas;
LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
if ([batteryActionSheet destructiveButtonIndex] == buttonIndex) {
if (buttonIndex == [batteryActionSheet destructiveButtonIndex]) {
// stop video
linphone_call_params_enable_video(paramsCopy, FALSE);
linphone_core_update_call([LinphoneManager getLc], call, paramsCopy);
}
batteryActionSheet = nil;
break;
}
default:
@ -489,12 +447,50 @@
}
}
- (void)modalViewDismiss:(UIModalViewController*)controller value:(int)value {
[self removeModalViewController:controller];
}
- (void)addModalViewController:(UIModalViewController*)controller {
[controller setModalDelegate:self];
[modalControllers insertObject:controller atIndex:0];
CATransition* trans = [CATransition animation];
[trans setType:kCATransitionFade];
[trans setDuration:0.35];
[trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[trans setSubtype:kCATransitionFromRight];
[[self view].layer addAnimation:trans forKey:@"Appear"];
[[self view] addSubview:[controller view]];
[[self view] bringSubviewToFront:[controller view]];
}
- (void)removeModalViewController:(UIModalViewController*)controller {
[controller setModalDelegate:nil];
[modalControllers removeObject:controller];
CATransition* trans = [CATransition animation];
[trans setType:kCATransitionFade];
[trans setDuration:0.35];
[trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[trans setSubtype:kCATransitionFromRight];
[[self view].layer addAnimation:trans forKey:@"Disappear"];
[[controller view] removeFromSuperview];
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[mainViewController release];
[viewDescriptions removeAllObjects];
[viewDescriptions release];
[modalControllers removeAllObjects];
[modalControllers release];
[super dealloc];
}

View file

@ -41,7 +41,6 @@
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@ -125,7 +124,6 @@
<string key="NSFrame">{{192, 0}, {128, 72}}</string>
<reference key="NSSuperview" ref="909644813"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
@ -208,17 +206,6 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="285037805">
<bool key="IBUIAutoresizesArchivedViewToFullSize">NO</bool>
<string key="IBUINibName">UICompositeViewController</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@ -239,14 +226,6 @@
</object>
<int key="connectionID">209</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">modalViewController</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="285037805"/>
</object>
<int key="connectionID">211</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -322,12 +301,6 @@
<reference key="parent" ref="0"/>
<string key="objectName">mainViewController</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">210</int>
<reference key="object" ref="285037805"/>
<reference key="parent" ref="0"/>
<string key="objectName">modalViewController</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@ -349,8 +322,6 @@
<string>169.IBPluginDependency</string>
<string>208.CustomClassName</string>
<string>208.IBPluginDependency</string>
<string>210.CustomClassName</string>
<string>210.IBPluginDependency</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -369,8 +340,6 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UICompositeViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UICompositeViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@ -394,35 +363,14 @@
<string key="className">PhoneMainView</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>mainViewController</string>
<string>modalViewController</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UICompositeViewController</string>
<string>UICompositeViewController</string>
</object>
<string key="NS.key.0">mainViewController</string>
<string key="NS.object.0">UICompositeViewController</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>mainViewController</string>
<string>modalViewController</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">mainViewController</string>
<string key="candidateClassName">UICompositeViewController</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">modalViewController</string>
<string key="candidateClassName">UICompositeViewController</string>
</object>
<string key="NS.key.0">mainViewController</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">mainViewController</string>
<string key="candidateClassName">UICompositeViewController</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">

View file

@ -30,7 +30,7 @@
}
- (void)viewDidLoad {
settingsController.delegate = [LinphoneManager instance];
settingsController.delegate = self;
settingsController.settingsReaderDelegate = self;
settingsController.settingsStore=[[LinphoneManager instance] settingsStore];
settingsController.showCreditsFooter = FALSE;
@ -71,6 +71,10 @@
}
// hide setting if bg mode not supported
return nil;
}
if ([identifier isEqualToString:@"enable_first_login_view_preference"]) {
// hide first login view preference
return nil;
}
if (![LinphoneManager codecIsSupported:identifier])
return Nil;
@ -78,8 +82,34 @@
}
- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController *)sender {
ms_message("Synchronize settings");
[[[LinphoneManager instance] settingsStore] synchronize];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[settingsController viewWillDisappear:NO];
}
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[settingsController viewWillAppear:NO];
}
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[settingsController viewDidAppear:NO];
}
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[settingsController viewDidDisappear:NO];
}
}
@end

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -130,6 +130,16 @@
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>enable_first_login_view_preference</string>
<key>Title</key>
<string>First login view</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
</array>
</dict>
</plist>

View file

@ -110,7 +110,7 @@
</dict>
<dict>
<key>File</key>
<string>audio</string>
<string>Audio</string>
<key>Title</key>
<string>Audio Codecs</string>
<key>Type</key>
@ -118,7 +118,7 @@
</dict>
<dict>
<key>File</key>
<string>video</string>
<string>Video</string>
<key>Title</key>
<string>Video</string>
<key>Type</key>

View file

@ -444,6 +444,10 @@
D3F26BFA15986DAD005F9CAB /* ok-edit-list-history-over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F26BF615986DAD005F9CAB /* ok-edit-list-history-over.png */; };
D3F26BFC15987083005F9CAB /* champ-titre-incoming.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F26BFB15987083005F9CAB /* champ-titre-incoming.png */; };
D3F26BFD15987083005F9CAB /* champ-titre-incoming.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F26BFB15987083005F9CAB /* champ-titre-incoming.png */; };
D3F34F301599B008005BE94F /* ombre-cotes-avatar.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F34F2F1599B008005BE94F /* ombre-cotes-avatar.png */; };
D3F34F311599B008005BE94F /* ombre-cotes-avatar.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F34F2F1599B008005BE94F /* ombre-cotes-avatar.png */; };
D3F34F351599C354005BE94F /* UIModalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F34F341599C354005BE94F /* UIModalViewController.m */; };
D3F34F361599C354005BE94F /* UIModalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F34F341599C354005BE94F /* UIModalViewController.m */; };
D3F83EEC1582021700336684 /* InCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F83EEA1582021700336684 /* InCallViewController.m */; };
D3F83EED1582021700336684 /* InCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F83EEA1582021700336684 /* InCallViewController.m */; };
D3F83EEE1582021700336684 /* InCallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3F83EEB1582021700336684 /* InCallViewController.xib */; };
@ -1063,6 +1067,9 @@
D3F26BF515986DAD005F9CAB /* ok-edit-list-history-actif.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ok-edit-list-history-actif.png"; path = "Resources/ok-edit-list-history-actif.png"; sourceTree = "<group>"; };
D3F26BF615986DAD005F9CAB /* ok-edit-list-history-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ok-edit-list-history-over.png"; path = "Resources/ok-edit-list-history-over.png"; sourceTree = "<group>"; };
D3F26BFB15987083005F9CAB /* champ-titre-incoming.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "champ-titre-incoming.png"; path = "Resources/champ-titre-incoming.png"; sourceTree = "<group>"; };
D3F34F2F1599B008005BE94F /* ombre-cotes-avatar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ombre-cotes-avatar.png"; path = "Resources/ombre-cotes-avatar.png"; sourceTree = "<group>"; };
D3F34F331599C354005BE94F /* UIModalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIModalViewController.h; sourceTree = "<group>"; };
D3F34F341599C354005BE94F /* UIModalViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIModalViewController.m; sourceTree = "<group>"; };
D3F83EE91582021700336684 /* InCallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InCallViewController.h; sourceTree = "<group>"; };
D3F83EEA1582021700336684 /* InCallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InCallViewController.m; sourceTree = "<group>"; };
D3F83EEB1582021700336684 /* InCallViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InCallViewController.xib; sourceTree = "<group>"; };
@ -1545,6 +1552,8 @@
D3ED3E861586291C006C0DE4 /* UIMainBar.xib */,
2214EBF112F86360002A5394 /* UIMicroButton.h */,
2214EBF212F86360002A5394 /* UIMicroButton.m */,
D3F34F331599C354005BE94F /* UIModalViewController.h */,
D3F34F341599C354005BE94F /* UIModalViewController.m */,
D36FB2D31589EF7C0036F6F2 /* UIPauseButton.h */,
D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */,
22968A5D12F875C600588287 /* UISpeakerButton.h */,
@ -1815,6 +1824,7 @@
D3F26BF615986DAD005F9CAB /* ok-edit-list-history-over.png */,
2242E312125235120061DDCE /* oldphone-mono-30s.caf */,
2237D4081084D7A9001383EE /* oldphone-mono.wav */,
D3F34F2F1599B008005BE94F /* ombre-cotes-avatar.png */,
D3F83EF8158205A100336684 /* pause-actif.png */,
D36C43ED158F61EA0048BA40 /* pause-champ-numero-actif.png */,
D36C43EE158F61EA0048BA40 /* pause-champ-numero-over.png */,
@ -2227,6 +2237,7 @@
D31B4B23159876C0002E6C72 /* UICompositeViewController.xib in Resources */,
D31B4B281598A390002E6C72 /* avatar-inconnu.png in Resources */,
D31B4B2A1598A390002E6C72 /* avatar-small.png in Resources */,
D3F34F301599B008005BE94F /* ombre-cotes-avatar.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2399,6 +2410,7 @@
D31B4B24159876C0002E6C72 /* UICompositeViewController.xib in Resources */,
D31B4B291598A390002E6C72 /* avatar-inconnu.png in Resources */,
D31B4B2B1598A390002E6C72 /* avatar-small.png in Resources */,
D3F34F311599B008005BE94F /* ombre-cotes-avatar.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2471,6 +2483,7 @@
D3F26BEC159869A6005F9CAB /* AbstractCall.m in Sources */,
D3F26BF115986B73005F9CAB /* IncomingCallViewController.m in Sources */,
D31B4B21159876C0002E6C72 /* UICompositeViewController.m in Sources */,
D3F34F351599C354005BE94F /* UIModalViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2540,6 +2553,7 @@
D3F26BED159869A6005F9CAB /* AbstractCall.m in Sources */,
D3F26BF215986B73005F9CAB /* IncomingCallViewController.m in Sources */,
D31B4B22159876C0002E6C72 /* UICompositeViewController.m in Sources */,
D3F34F361599C354005BE94F /* UIModalViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -42,4 +42,3 @@ show_local=0
enabled=1
size=qvga
display_filter_auto_rotate=1