From 344764225810e48b9a3bf4fb19cbb669db785cca Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Wed, 29 Jan 2014 14:55:41 +0100 Subject: [PATCH] Allow UICallCellData to be initialized with a minimized/maximized state. This fixes the problem of incoming call information being displayed in fullscreen. --- Classes/InCallTableViewController.h | 1 + Classes/InCallTableViewController.m | 7 ++++++- Classes/LinphoneUI/UICallCell.h | 2 +- Classes/LinphoneUI/UICallCell.m | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Classes/InCallTableViewController.h b/Classes/InCallTableViewController.h index e1dcd6d30..18f9d40a4 100644 --- a/Classes/InCallTableViewController.h +++ b/Classes/InCallTableViewController.h @@ -26,6 +26,7 @@ @interface InCallTableViewController : UITableViewController { @private NSTimer *updateTime; + BOOL minimized; } - (void)minimizeAll; diff --git a/Classes/InCallTableViewController.m b/Classes/InCallTableViewController.m index cf13e8be2..cd47bfd43 100644 --- a/Classes/InCallTableViewController.m +++ b/Classes/InCallTableViewController.m @@ -35,6 +35,7 @@ enum TableSection { #pragma mark - Lifecycle Functions - (void)initInCallTableViewController { + minimized = false; } - (id)init{ @@ -147,7 +148,7 @@ enum TableSection { if(appData != NULL) { data = [appData->userInfos objectForKey:kLinphoneInCallCellData]; if(data == nil) { - data = [[[UICallCellData alloc] init:call] autorelease]; + data = [[[UICallCellData alloc] init:call minimized:minimized] autorelease]; [appData->userInfos setObject:data forKey:kLinphoneInCallCellData]; } } @@ -179,11 +180,14 @@ enum TableSection { } - (void)minimizeAll { + const MSList *list = linphone_core_get_calls([LinphoneManager getLc]); + minimized = true; while(list != NULL) { UICallCellData *data = [self getCallData:(LinphoneCall*)list->data]; if(data) { data->minimize = true; + } else { } list = list->next; } @@ -192,6 +196,7 @@ enum TableSection { - (void)maximizeAll { const MSList *list = linphone_core_get_calls([LinphoneManager getLc]); + minimized = false; while(list != NULL) { UICallCellData *data = [self getCallData:(LinphoneCall*)list->data]; if(data) { diff --git a/Classes/LinphoneUI/UICallCell.h b/Classes/LinphoneUI/UICallCell.h index b23867634..0a7b4d9d1 100644 --- a/Classes/LinphoneUI/UICallCell.h +++ b/Classes/LinphoneUI/UICallCell.h @@ -37,7 +37,7 @@ typedef enum _UICallCellOtherView { LinphoneCall *call; } -- (id)init:(LinphoneCall*) call; +- (id)init:(LinphoneCall*) call minimized:(BOOL)minimized; @property (nonatomic, retain) UIImage *image; @property (nonatomic, retain) NSString *address; diff --git a/Classes/LinphoneUI/UICallCell.m b/Classes/LinphoneUI/UICallCell.m index fc9bc1490..ce900f6cd 100644 --- a/Classes/LinphoneUI/UICallCell.m +++ b/Classes/LinphoneUI/UICallCell.m @@ -29,10 +29,10 @@ @synthesize address; @synthesize image; -- (id)init:(LinphoneCall*) acall { +- (id)init:(LinphoneCall*)acall minimized:(BOOL)minimized{ self = [super init]; if(self != nil) { - self->minimize = false; + self->minimize = minimized; self->view = UICallCellOtherView_Avatar; self->call = acall; image = [[UIImage imageNamed:@"avatar_unknown.png"] retain];