forked from mirrors/linphone-iphone
Merge branch 'new_ui' of git://git.linphone.org/linphone-iphone into castel
Conflicts: Classes/LinphoneUI/UIMainBar.m
This commit is contained in:
commit
2ff36a2442
18 changed files with 185 additions and 123 deletions
|
|
@ -56,9 +56,7 @@
|
|||
- (void)dealloc {
|
||||
ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self);
|
||||
CFRelease(addressBook);
|
||||
[addressBookMap removeAllObjects];
|
||||
[addressBookMap release];
|
||||
[avatarMap removeAllObjects];
|
||||
[avatarMap release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
@ -72,7 +70,6 @@
|
|||
|
||||
// Reset Address book
|
||||
[addressBookMap removeAllObjects];
|
||||
[avatarMap removeAllObjects];
|
||||
|
||||
NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
|
||||
for (id lPerson in lContacts) {
|
||||
|
|
@ -142,6 +139,7 @@
|
|||
static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
|
||||
ContactsTableViewController* controller = (ContactsTableViewController*)context;
|
||||
ABAddressBookRevert(addressBook);
|
||||
[controller->avatarMap removeAllObjects];
|
||||
[controller loadData];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -220,6 +220,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
#pragma mark - UITextFieldDelegate Functions
|
||||
|
||||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
|
||||
//[textField performSelector:@selector() withObject:nil afterDelay:0];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||
if (textField == addressField) {
|
||||
[addressField resignFirstResponder];
|
||||
|
|
|
|||
|
|
@ -606,7 +606,6 @@
|
|||
<string key="NSFrame">{{214, 0}, {106, 69}}</string>
|
||||
<reference key="NSSuperview" ref="32193173"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
UITapGestureRecognizer* singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showControls:)];
|
||||
[singleFingerTap setNumberOfTapsRequired:1];
|
||||
[singleFingerTap setCancelsTouchesInView: FALSE];
|
||||
[[[UIApplication sharedApplication].delegate window] addGestureRecognizer:singleFingerTap];
|
||||
[[PhoneMainView instance].view addGestureRecognizer:singleFingerTap];
|
||||
[singleFingerTap release];
|
||||
|
||||
videoZoomHandler = [[VideoZoomHandler alloc] init];
|
||||
|
|
@ -535,7 +535,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) {
|
|||
otherButtonTitles:nil];
|
||||
|
||||
visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
|
||||
[visibleActionSheet showInView:[[UIApplication sharedApplication].delegate window]];
|
||||
[visibleActionSheet showInView:[PhoneMainView instance].view];
|
||||
|
||||
/* start cancel timer */
|
||||
cd.timeout = [NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(dismissActionSheet:) userInfo:nil repeats:NO];
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1296</int>
|
||||
<string key="IBDocument.SystemVersion">11E53</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2549</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.47</string>
|
||||
<string key="IBDocument.HIToolboxVersion">569.00</string>
|
||||
<string key="IBDocument.SystemVersion">11D50</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.32</string>
|
||||
<string key="IBDocument.HIToolboxVersion">568.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1498</string>
|
||||
<string key="NS.object.0">1181</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIWindow</string>
|
||||
<string>IBUICustomObject</string>
|
||||
<string>IBUIViewController</string>
|
||||
<string>IBUIWindow</string>
|
||||
<string>IBProxyObject</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
|
|
@ -83,14 +83,6 @@
|
|||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="465836664"/>
|
||||
<reference key="destination" ref="380026005"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
|
|
@ -104,6 +96,7 @@
|
|||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="380026005"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">LinphoneWindow</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
|
|
@ -154,17 +147,6 @@
|
|||
<object class="IBPartialClassDescription">
|
||||
<string key="className">LinphoneAppDelegate</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<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>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/LinphoneAppDelegate.h</string>
|
||||
|
|
@ -256,6 +238,6 @@
|
|||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1498</string>
|
||||
<string key="IBCocoaTouchPluginVersion">1181</string>
|
||||
</data>
|
||||
</archive>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
BOOL started;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIWindow *window;
|
||||
@property (assign) BOOL started;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ int __aeabi_idiv(int a, int b) {
|
|||
|
||||
@implementation LinphoneAppDelegate
|
||||
|
||||
@synthesize window;
|
||||
@synthesize started;
|
||||
|
||||
|
||||
|
|
@ -58,7 +57,6 @@ int __aeabi_idiv(int a, int b) {
|
|||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[window release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
@ -85,6 +83,7 @@ int __aeabi_idiv(int a, int b) {
|
|||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
if(![LinphoneManager isLcReady]) return;
|
||||
LinphoneCore* lc = [LinphoneManager getLc];
|
||||
LinphoneCall* call = linphone_core_get_current_call(lc);
|
||||
if (call == NULL)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,10 @@ typedef struct _LinphoneCallAppData {
|
|||
@public
|
||||
CallContext currentCallContextBeforeGoingBackground;
|
||||
}
|
||||
+ (LinphoneManager*) instance;
|
||||
+ (LinphoneManager*)instance;
|
||||
#ifdef DEBUG
|
||||
+ (void)instanceRelease;
|
||||
#endif
|
||||
+ (LinphoneCore*) getLc;
|
||||
+ (BOOL)isLcReady;
|
||||
+ (BOOL)runningOnIpad;
|
||||
|
|
@ -90,7 +93,7 @@ typedef struct _LinphoneCallAppData {
|
|||
- (BOOL)resignActive;
|
||||
- (void)becomeActive;
|
||||
|
||||
- (void)kickOffNetworkConnection;
|
||||
+ (void)kickOffNetworkConnection;
|
||||
- (void)setupNetworkReachabilityCallback;
|
||||
|
||||
- (void)refreshRegisters;
|
||||
|
|
|
|||
|
|
@ -159,6 +159,14 @@ struct codec_name_pref_table codec_pref_table[]={
|
|||
return theLinphoneManager;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
+ (void)instanceRelease {
|
||||
if(theLinphoneManager != nil) {
|
||||
[theLinphoneManager release];
|
||||
theLinphoneManager = nil;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark - Lifecycle Functions
|
||||
|
||||
|
|
@ -420,18 +428,17 @@ static void linphone_iphone_text_received(LinphoneCore *lc, LinphoneChatRoom *ro
|
|||
|
||||
#pragma mark - Network Functions
|
||||
|
||||
- (void)kickOffNetworkConnection {
|
||||
+ (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];
|
||||
}
|
||||
|
||||
- (void)runNetworkConnection {
|
||||
CFWriteStreamRef writeStream;
|
||||
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"192.168.0.200"/*"linphone.org"*/, 15000, nil, &writeStream);
|
||||
CFWriteStreamOpen (writeStream);
|
||||
const char* buff="hello";
|
||||
CFWriteStreamWrite (writeStream,(const UInt8*)buff,strlen(buff));
|
||||
CFWriteStreamClose (writeStream);
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
CFWriteStreamRef writeStream;
|
||||
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"192.168.0.200"/*"linphone.org"*/, 15000, nil, &writeStream);
|
||||
CFWriteStreamOpen (writeStream);
|
||||
const char* buff="hello";
|
||||
CFWriteStreamWrite (writeStream,(const UInt8*)buff,strlen(buff));
|
||||
CFWriteStreamClose (writeStream);
|
||||
CFRelease(writeStream);
|
||||
});
|
||||
}
|
||||
|
||||
static void showNetworkFlags(SCNetworkReachabilityFlags flags){
|
||||
|
|
@ -468,7 +475,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
if ((flags == 0) || (flags & networkDownFlags)) {
|
||||
linphone_core_set_network_reachable([LinphoneManager getLc],false);
|
||||
lLinphoneMgr.connectivity = none;
|
||||
[[LinphoneManager instance] kickOffNetworkConnection];
|
||||
[LinphoneManager kickOffNetworkConnection];
|
||||
} else {
|
||||
Connectivity newConnectivity;
|
||||
BOOL isWifiOnly = lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]),"app","wifi_only_preference",FALSE);
|
||||
|
|
@ -689,6 +696,10 @@ static LinphoneCoreVTable linphonec_vtable = {
|
|||
[mIterateTimer invalidate];
|
||||
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
|
||||
[audioSession setDelegate:nil];
|
||||
if (settingsStore != nil) {
|
||||
[settingsStore release];
|
||||
settingsStore = nil;
|
||||
}
|
||||
if (theLinphoneCore != nil) { //just in case application terminate before linphone core initialization
|
||||
[LinphoneLogger logc:LinphoneLoggerLog format:"Destroy linphonecore"];
|
||||
linphone_core_destroy(theLinphoneCore);
|
||||
|
|
@ -732,7 +743,7 @@ static LinphoneCoreVTable linphonec_vtable = {
|
|||
return;
|
||||
}
|
||||
//kick up network cnx, just in case
|
||||
[self kickOffNetworkConnection];
|
||||
[LinphoneManager kickOffNetworkConnection];
|
||||
[self refreshRegisters];
|
||||
linphone_core_iterate(theLinphoneCore);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,11 +66,8 @@
|
|||
@interface UICompositeViewController : TPMultiLayoutViewController {
|
||||
@private
|
||||
UIView *stateBarView;
|
||||
UIViewController *stateBarViewController;
|
||||
UIView *contentView;
|
||||
UIViewController *contentViewController;
|
||||
UIView *tabBarView;
|
||||
UIViewController *tabBarViewController;
|
||||
|
||||
NSMutableDictionary *viewControllerCache;
|
||||
|
||||
|
|
@ -91,5 +88,8 @@
|
|||
- (void)setToolBarHidden:(BOOL) hidden;
|
||||
- (UIViewController *)getCurrentViewController;
|
||||
- (UIInterfaceOrientation)currentOrientation;
|
||||
#ifdef DEBUG
|
||||
- (void)clearCache;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -78,6 +78,13 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@interface UICompositeViewController ()
|
||||
|
||||
@property (nonatomic, retain) UIViewController *stateBarViewController;
|
||||
@property (nonatomic, retain) UIViewController *tabBarViewController;
|
||||
@property (nonatomic, retain) UIViewController *contentViewController;
|
||||
|
||||
@end
|
||||
|
||||
@implementation UICompositeViewController
|
||||
|
|
@ -85,6 +92,9 @@
|
|||
@synthesize stateBarView;
|
||||
@synthesize contentView;
|
||||
@synthesize tabBarView;
|
||||
@synthesize tabBarViewController = _tabBarViewController;
|
||||
@synthesize stateBarViewController = _stateBarViewController;
|
||||
@synthesize contentViewController = _contentViewController;
|
||||
|
||||
@synthesize viewTransition;
|
||||
|
||||
|
|
@ -123,16 +133,36 @@
|
|||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
[self.stateBarViewController release];
|
||||
[self.tabBarViewController release];
|
||||
[self.contentViewController release];
|
||||
|
||||
[contentView release];
|
||||
[stateBarView release];
|
||||
[tabBarView release];
|
||||
[viewControllerCache removeAllObjects];
|
||||
[viewControllerCache release];
|
||||
[viewTransition release];
|
||||
[currentViewDescription release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Property Functions
|
||||
|
||||
- (UIViewController*)stateBarViewController {
|
||||
return _stateBarViewController;
|
||||
}
|
||||
|
||||
- (UIViewController*)contentViewController {
|
||||
return _contentViewController;
|
||||
}
|
||||
|
||||
- (UIViewController*)tabBarViewController {
|
||||
return _tabBarViewController;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
|
@ -147,56 +177,56 @@
|
|||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[contentViewController viewWillAppear:animated];
|
||||
[tabBarViewController viewWillAppear:animated];
|
||||
[stateBarViewController viewWillAppear:animated];
|
||||
[self.contentViewController viewWillAppear:animated];
|
||||
[self.tabBarViewController viewWillAppear:animated];
|
||||
[self.stateBarViewController viewWillAppear:animated];
|
||||
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
[contentViewController viewDidAppear:animated];
|
||||
[tabBarViewController viewDidAppear:animated];
|
||||
[stateBarViewController viewDidAppear:animated];
|
||||
[self.contentViewController viewDidAppear:animated];
|
||||
[self.tabBarViewController viewDidAppear:animated];
|
||||
[self.stateBarViewController viewDidAppear:animated];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
[contentViewController viewWillDisappear:animated];
|
||||
[tabBarViewController viewWillDisappear:animated];
|
||||
[stateBarViewController viewWillDisappear:animated];
|
||||
[self.contentViewController viewWillDisappear:animated];
|
||||
[self.tabBarViewController viewWillDisappear:animated];
|
||||
[self.stateBarViewController viewWillDisappear:animated];
|
||||
|
||||
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[contentViewController viewDidDisappear:animated];
|
||||
[tabBarViewController viewDidDisappear:animated];
|
||||
[stateBarViewController viewDidDisappear:animated];
|
||||
[self.contentViewController viewDidDisappear:animated];
|
||||
[self.tabBarViewController viewDidDisappear:animated];
|
||||
[self.stateBarViewController viewDidDisappear:animated];
|
||||
}
|
||||
|
||||
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
||||
currentOrientation = [self getCorrectInterfaceOrientation:toInterfaceOrientation];
|
||||
[super willRotateToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[contentViewController willRotateToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[tabBarViewController willRotateToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[stateBarViewController willRotateToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[self.contentViewController willRotateToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[self.tabBarViewController willRotateToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[self.stateBarViewController willRotateToInterfaceOrientation:currentOrientation duration:duration];
|
||||
}
|
||||
|
||||
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
||||
[super willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[contentViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[tabBarViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[stateBarViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[self.contentViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[self.tabBarViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration];
|
||||
[self update:nil tabBar:nil stateBar:nil fullscreen:nil];
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
|
||||
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
[contentViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
[tabBarViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
[stateBarViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
[self.contentViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
[self.tabBarViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
[self.stateBarViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
|
|
@ -218,6 +248,10 @@
|
|||
|
||||
#pragma mark -
|
||||
|
||||
- (void)clearCache {
|
||||
[viewControllerCache removeAllObjects];
|
||||
}
|
||||
|
||||
- (UIInterfaceOrientation)currentOrientation {
|
||||
return currentOrientation;
|
||||
}
|
||||
|
|
@ -251,7 +285,7 @@
|
|||
if(name != nil) {
|
||||
controller = [viewControllerCache objectForKey:name];
|
||||
if(controller == nil) {
|
||||
controller = [[NSClassFromString(name) alloc] init];
|
||||
controller = [[[NSClassFromString(name) alloc] init] autorelease];
|
||||
[viewControllerCache setValue:controller forKey:name];
|
||||
[controller view]; // Load the view
|
||||
}
|
||||
|
|
@ -327,26 +361,29 @@
|
|||
[super willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[super didRotateFromInterfaceOrientation:orientation];
|
||||
|
||||
orientation = contentViewController.interfaceOrientation;
|
||||
[contentViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
|
||||
[contentViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[contentViewController didRotateFromInterfaceOrientation:orientation];
|
||||
orientation = self.contentViewController.interfaceOrientation;
|
||||
[self.contentViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
|
||||
[self.contentViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[self.contentViewController didRotateFromInterfaceOrientation:orientation];
|
||||
|
||||
orientation = tabBarViewController.interfaceOrientation;
|
||||
[tabBarViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
|
||||
[tabBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[tabBarViewController didRotateFromInterfaceOrientation:orientation];
|
||||
orientation = self.tabBarViewController.interfaceOrientation;
|
||||
[self.tabBarViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
|
||||
[self.tabBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[self.tabBarViewController didRotateFromInterfaceOrientation:orientation];
|
||||
|
||||
orientation = stateBarViewController.interfaceOrientation;
|
||||
[stateBarViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
|
||||
[stateBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[stateBarViewController didRotateFromInterfaceOrientation:orientation];
|
||||
orientation = self.stateBarViewController.interfaceOrientation;
|
||||
[self.stateBarViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
|
||||
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[self.stateBarViewController didRotateFromInterfaceOrientation:orientation];
|
||||
}
|
||||
|
||||
#define IPHONE_STATUSBAR_HEIGHT 20
|
||||
|
||||
- (void)update: (UICompositeViewDescription*) description tabBar:(NSNumber*)tabBar stateBar:(NSNumber*)stateBar fullscreen:(NSNumber*)fullscreen {
|
||||
|
||||
UIViewController *oldContentViewController = self.contentViewController;
|
||||
UIViewController *oldStateBarViewController = self.stateBarViewController;
|
||||
UIViewController *oldTabBarViewController = self.tabBarViewController;
|
||||
// Copy view description
|
||||
UICompositeViewDescription *oldViewDescription = nil;
|
||||
|
||||
|
|
@ -369,18 +406,22 @@
|
|||
[tabBarView.layer addAnimation:viewTransition forKey:@"transition"];
|
||||
}
|
||||
}
|
||||
|
||||
[UICompositeViewController removeSubView: contentViewController];
|
||||
if(oldViewDescription != nil && tabBarViewController != nil && oldViewDescription.tabBar != currentViewDescription.tabBar) {
|
||||
[UICompositeViewController removeSubView: tabBarViewController];
|
||||
}
|
||||
if(oldViewDescription != nil && stateBarViewController != nil && oldViewDescription.stateBar != currentViewDescription.stateBar) {
|
||||
[UICompositeViewController removeSubView: stateBarViewController];
|
||||
}
|
||||
|
||||
stateBarViewController = [self getCachedController:description.stateBar];
|
||||
contentViewController = [self getCachedController:description.content];
|
||||
tabBarViewController = [self getCachedController:description.tabBar];
|
||||
UIViewController *newContentViewController = [self getCachedController:description.content];
|
||||
UIViewController *newStateBarViewController = [self getCachedController:description.stateBar];
|
||||
UIViewController *newTabBarViewController = [self getCachedController:description.tabBar];
|
||||
|
||||
[UICompositeViewController removeSubView: oldContentViewController];
|
||||
if(oldTabBarViewController != nil && oldTabBarViewController != newTabBarViewController) {
|
||||
[UICompositeViewController removeSubView:oldTabBarViewController];
|
||||
}
|
||||
if(oldStateBarViewController != nil && oldStateBarViewController != newStateBarViewController) {
|
||||
[UICompositeViewController removeSubView:oldStateBarViewController];
|
||||
}
|
||||
|
||||
self.stateBarViewController = newStateBarViewController;
|
||||
self.contentViewController = newContentViewController;
|
||||
self.tabBarViewController = newTabBarViewController;
|
||||
|
||||
// Update rotation
|
||||
UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]];
|
||||
|
|
@ -441,7 +482,7 @@
|
|||
if(currentViewDescription.fullscreen)
|
||||
origin = 0;
|
||||
|
||||
if(stateBarViewController != nil && currentViewDescription.stateBarEnabled) {
|
||||
if(self.stateBarViewController != nil && currentViewDescription.stateBarEnabled) {
|
||||
contentFrame.origin.y = origin + stateBarFrame.size.height;
|
||||
stateBarFrame.origin.y = origin;
|
||||
} else {
|
||||
|
|
@ -451,15 +492,15 @@
|
|||
|
||||
// Resize TabBar
|
||||
CGRect tabFrame = tabBarView.frame;
|
||||
if(tabBarViewController != nil && currentViewDescription.tabBarEnabled) {
|
||||
if(self.tabBarViewController != nil && currentViewDescription.tabBarEnabled) {
|
||||
tabFrame.origin.y = viewFrame.size.height;
|
||||
tabFrame.origin.x = viewFrame.size.width;
|
||||
tabFrame.size.height = tabBarViewController.view.frame.size.height;
|
||||
tabFrame.size.width = tabBarViewController.view.frame.size.width;
|
||||
tabFrame.size.height = self.tabBarViewController.view.frame.size.height;
|
||||
tabFrame.size.width = self.tabBarViewController.view.frame.size.width;
|
||||
tabFrame.origin.y -= tabFrame.size.height;
|
||||
tabFrame.origin.x -= tabFrame.size.width;
|
||||
contentFrame.size.height = tabFrame.origin.y - contentFrame.origin.y;
|
||||
for (UIView *view in tabBarViewController.view.subviews) {
|
||||
for (UIView *view in self.tabBarViewController.view.subviews) {
|
||||
if(view.tag == -1) {
|
||||
contentFrame.size.height += view.frame.origin.y;
|
||||
break;
|
||||
|
|
@ -477,15 +518,15 @@
|
|||
|
||||
// Set frames
|
||||
[contentView setFrame: contentFrame];
|
||||
[contentViewController.view setFrame: [contentView bounds]];
|
||||
[self.contentViewController.view setFrame: [contentView bounds]];
|
||||
[tabBarView setFrame: tabFrame];
|
||||
CGRect frame = [tabBarViewController.view frame];
|
||||
CGRect frame = [self.tabBarViewController.view frame];
|
||||
frame.size.width = [tabBarView bounds].size.width;
|
||||
[tabBarViewController.view setFrame:frame];
|
||||
[self.tabBarViewController.view setFrame:frame];
|
||||
[stateBarView setFrame: stateBarFrame];
|
||||
frame = [stateBarViewController.view frame];
|
||||
frame = [self.stateBarViewController.view frame];
|
||||
frame.size.width = [stateBarView bounds].size.width;
|
||||
[stateBarViewController.view setFrame:frame];
|
||||
[self.stateBarViewController.view setFrame:frame];
|
||||
|
||||
// Commit animation
|
||||
if(tabBar != nil || stateBar != nil || fullscreen != nil) {
|
||||
|
|
@ -494,12 +535,12 @@
|
|||
|
||||
// Change view
|
||||
if(description != nil) {
|
||||
[UICompositeViewController addSubView: contentViewController view:contentView];
|
||||
if(oldViewDescription == nil || oldViewDescription.tabBar != currentViewDescription.tabBar) {
|
||||
[UICompositeViewController addSubView: tabBarViewController view:tabBarView];
|
||||
[UICompositeViewController addSubView: self.contentViewController view:contentView];
|
||||
if(oldTabBarViewController == nil || oldTabBarViewController != self.tabBarViewController) {
|
||||
[UICompositeViewController addSubView: self.tabBarViewController view:tabBarView];
|
||||
}
|
||||
if(oldViewDescription == nil || oldViewDescription.stateBar != currentViewDescription.stateBar) {
|
||||
[UICompositeViewController addSubView: stateBarViewController view:stateBarView];
|
||||
if(oldStateBarViewController == nil || oldStateBarViewController != self.stateBarViewController) {
|
||||
[UICompositeViewController addSubView: self.stateBarViewController view:stateBarView];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -527,7 +568,7 @@
|
|||
}
|
||||
|
||||
- (UIViewController *) getCurrentViewController {
|
||||
return contentViewController;
|
||||
return [[self.contentViewController retain] autorelease];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self removeTarget:self action:@selector(___touchDown:) forControlEvents:UIControlEventTouchDown];
|
||||
[self removeTarget:self action:@selector(___touchUp:) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)___touchDown:(id) sender {
|
||||
[self performSelector:@selector(doLongTouch) withObject:nil afterDelay:0.5];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -342,27 +342,27 @@
|
|||
|
||||
#pragma mark - Action Functions
|
||||
|
||||
- (IBAction)onHistoryClick: (id) sender {
|
||||
- (IBAction)onHistoryClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryViewController compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onContactsClick: (id) event {
|
||||
- (IBAction)onContactsClick:(id)event {
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||
[ContactSelection setAddAddress:nil];
|
||||
[ContactSelection setSipFilter:FALSE];
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onDialerClick: (id) event {
|
||||
- (IBAction)onDialerClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onSettingsClick: (id) event {
|
||||
- (IBAction)onSettingsClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[SettingsViewController compositeViewDescription]];
|
||||
}
|
||||
|
||||
/* MODIFICATION Remove chat
|
||||
- (IBAction)onChatClick: (id) event {
|
||||
- (IBAction)onChatClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ NSTimer *callSecurityTimer;
|
|||
break;
|
||||
case LinphoneRegistrationNone:
|
||||
registrationStateImage.hidden = NO;
|
||||
image =[UIImage imageNamed:@"led_disconnected.png"];
|
||||
image = [UIImage imageNamed:@"led_disconnected.png"];
|
||||
break;
|
||||
case LinphoneRegistrationProgress:
|
||||
registrationStateImage.hidden = NO;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#import "SettingsViewController.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "UACellBackgroundView.h"
|
||||
|
||||
|
|
@ -348,6 +349,8 @@
|
|||
- (void)dealloc {
|
||||
// Remove all observer
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[settingsController release];
|
||||
[navigationController release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
@ -453,6 +456,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
#ifndef DEBUG
|
||||
[hiddenKeys addObject:@"release_button"];
|
||||
[hiddenKeys addObject:@"clear_cache_button"];
|
||||
#endif
|
||||
|
||||
[hiddenKeys addObject:@"quit_button"]; // Hide for the moment
|
||||
|
|
@ -499,6 +503,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
NSString *key = [specifier.specifierDict objectForKey:kIASKKey];
|
||||
#ifdef DEBUG
|
||||
if([key isEqual:@"release_button"]) {
|
||||
[[UIApplication sharedApplication].keyWindow.rootViewController release];
|
||||
[[UIApplication sharedApplication].keyWindow setRootViewController:nil];
|
||||
[[LinphoneManager instance] destroyLibLinphone];
|
||||
[LinphoneManager instanceRelease];
|
||||
} else if([key isEqual:@"clear_cache_button"]) {
|
||||
[[PhoneMainView instance].mainViewController clearCache];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void
|
|||
- (void)dealloc {
|
||||
ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self);
|
||||
CFRelease(addressBook);
|
||||
[addressBookMap release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,6 +184,14 @@
|
|||
<key>Type</key>
|
||||
<string>IASKButtonSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>clear_cache_button</string>
|
||||
<key>Title</key>
|
||||
<string>Clear cache</string>
|
||||
<key>Type</key>
|
||||
<string>IASKButtonSpecifier</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>StringsTable</key>
|
||||
<string>Root</string>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit e93d9096ff433d3195c177e4c767881406e71d88
|
||||
Subproject commit c97efee37aea1ccae3c476a108e988e47f38faa4
|
||||
Loading…
Add table
Reference in a new issue