mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 17:29:20 +00:00
Fix station cell
remove history update in background mode
This commit is contained in:
parent
0360583532
commit
8d5a5f8f77
6 changed files with 70 additions and 9 deletions
|
|
@ -90,14 +90,21 @@ static BuschJaegerMainView* mainViewInstance=nil;
|
|||
assert (!mainViewInstance);
|
||||
mainViewInstance = self;
|
||||
loadCount = 0;
|
||||
historyTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0
|
||||
target: self
|
||||
selector: @selector(updateIconBadge:)
|
||||
userInfo: nil
|
||||
repeats: YES];
|
||||
historyTimer = nil;
|
||||
historyQueue = [[NSOperationQueue alloc] init];
|
||||
historyQueue.name = @"History queue";
|
||||
historyQueue.maxConcurrentOperationCount = 1;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(applicationWillEnterForeground:)
|
||||
name:UIApplicationWillEnterForegroundNotification
|
||||
object:nil];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(applicationWillEnterBackground:)
|
||||
name:UIApplicationDidEnterBackgroundNotification
|
||||
object:nil];
|
||||
[self applicationWillEnterForeground:nil];
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
|
|
@ -125,6 +132,12 @@ static BuschJaegerMainView* mainViewInstance=nil;
|
|||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:UIApplicationWillEnterForegroundNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:UIApplicationDidEnterBackgroundNotification
|
||||
object:nil];
|
||||
[navigationController release];
|
||||
[callView release];
|
||||
[settingsView release];
|
||||
|
|
@ -236,6 +249,24 @@ static BuschJaegerMainView* mainViewInstance=nil;
|
|||
|
||||
#pragma mark - Event Functions
|
||||
|
||||
- (void)applicationWillEnterForeground:(NSNotification*)notif {
|
||||
if(historyTimer != nil) {
|
||||
historyTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0
|
||||
target: self
|
||||
selector: @selector(updateIconBadge:)
|
||||
userInfo: nil
|
||||
repeats: YES];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationWillEnterBackground:(NSNotification*)notif {
|
||||
[historyTimer invalidate];
|
||||
historyTimer = nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)updateIconBadge:(id)info {
|
||||
if([historyQueue operationCount] == 0) {
|
||||
[historyQueue addOperationWithBlock:^(void) {
|
||||
|
|
@ -315,6 +346,35 @@ static BuschJaegerMainView* mainViewInstance=nil;
|
|||
case LinphoneCallError:
|
||||
case LinphoneCallEnd:
|
||||
{
|
||||
if(linphone_call_get_reason(call) == LinphoneReasonBusy) {
|
||||
NSString *contactName = NSLocalizedString(@"Unknown", nil);
|
||||
|
||||
// Extract caller address
|
||||
const LinphoneAddress* addr = linphone_call_get_remote_address(call);
|
||||
if(addr) {
|
||||
char *address = linphone_address_as_string_uri_only(addr);
|
||||
if(address != NULL) {
|
||||
contactName = [FastAddressBook normalizeSipURI:[NSString stringWithUTF8String:address]];
|
||||
ms_free(address);
|
||||
}
|
||||
}
|
||||
|
||||
// Find caller in outdoor stations
|
||||
NSSet *outstations = [[LinphoneManager instance] configuration].outdoorStations;
|
||||
for(OutdoorStation *os in outstations) {
|
||||
if([[FastAddressBook normalizeSipURI:os.address] isEqualToString:contactName]) {
|
||||
contactName = os.name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
UIAlertView* error = [[UIAlertView alloc] initWithTitle:@"Welcome"
|
||||
message: [NSString stringWithFormat:NSLocalizedString(@"%@ is busy",nil), contactName]
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
|
||||
otherButtonTitles:nil,nil];
|
||||
[error show];
|
||||
[error release];
|
||||
}
|
||||
[self dismissIncomingCall:call];
|
||||
if ((linphone_core_get_calls([LinphoneManager getLc]) == NULL)) {
|
||||
[navigationController popToViewController:welcomeView animated:FALSE]; // No animation... Come back when Apple have learned how to create a good framework
|
||||
|
|
@ -353,7 +413,8 @@ static BuschJaegerMainView* mainViewInstance=nil;
|
|||
otherButtonTitles:nil,nil];
|
||||
[error show];
|
||||
[error release];
|
||||
AudioServicesPlayAlertSound([LinphoneManager instance].sounds.level);
|
||||
// Not working during a call
|
||||
// AudioServicesPlayAlertSound([LinphoneManager instance].sounds.level);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
if(layer.delegate == nil) {
|
||||
[layer setFrame:layer.superlayer.bounds];
|
||||
} else if([layer.delegate isKindOfClass:[UIView class]]) {
|
||||
[layer setFrame:((UIView *)layer.delegate).bounds];
|
||||
[layer setFrame:((UIView *)layer.delegate).frame];
|
||||
}
|
||||
}
|
||||
if([layer respondsToSelector:@selector(sublayers)]) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
</object>
|
||||
<object class="IBUILabel" id="942147892">
|
||||
<reference key="NSNextResponder" ref="1038390791"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrame">{{59, 20}, {130, 21}}</string>
|
||||
<reference key="NSSuperview" ref="1038390791"/>
|
||||
<reference key="NSWindow"/>
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@
|
|||
shadow.layer.name = @"BuschJaegerLayer";
|
||||
shadow.clipsToBounds = NO;
|
||||
shadow.layer.shadowOpacity = 0.9f;
|
||||
[cellBackgroundView setFrame:[shadow bounds]];
|
||||
[cellBackgroundView.superview insertSubview:shadow belowSubview:cellBackgroundView];
|
||||
[shadow addSubview:cellBackgroundView];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@
|
|||
<string key="NSFrame">{{147, 44}, {27, 36}}</string>
|
||||
<reference key="NSSuperview" ref="909827972"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Reference in a new issue