diff --git a/Classes/LinphoneUI/UICallBar.h b/Classes/LinphoneUI/UICallBar.h index 4574531e5..862286c74 100644 --- a/Classes/LinphoneUI/UICallBar.h +++ b/Classes/LinphoneUI/UICallBar.h @@ -36,7 +36,7 @@ @property (nonatomic, strong) IBOutlet UIMicroButton* microButton; @property (nonatomic, strong) IBOutlet UISpeakerButton* speakerButton; @property (nonatomic, strong) IBOutlet UIToggleButton* routesButton; -@property (nonatomic, strong) IBOutlet UIToggleButton* optionsButton; +@property(nonatomic, strong) IBOutlet UIToggleButton *optionsButton; @property (nonatomic, strong) IBOutlet UIHangUpButton* hangupButton; @property (nonatomic, strong) IBOutlet UIView* padView; @property (nonatomic, strong) IBOutlet UIView* routesView; diff --git a/Classes/LinphoneUI/UICallBar.m b/Classes/LinphoneUI/UICallBar.m index 049b057b5..7a341c403 100644 --- a/Classes/LinphoneUI/UICallBar.m +++ b/Classes/LinphoneUI/UICallBar.m @@ -177,12 +177,17 @@ { UIButton *optionsButtonLandscape = (UIButton *)[landscapeView viewWithTag:[optionsButton tag]]; + // Set selected+disabled background: IB lack ! + [optionsButton setBackgroundImage:[UIImage imageNamed:@"options_disabled.png"] + forState:(UIControlStateDisabled | UIControlStateSelected)]; + [optionsButtonLandscape setBackgroundImage:[UIImage imageNamed:@"options_disabled_landscape.png"] + forState:(UIControlStateDisabled | UIControlStateSelected)]; + // Set selected+over background: IB lack ! [optionsButton setBackgroundImage:[UIImage imageNamed:@"options_over.png"] forState:(UIControlStateHighlighted | UIControlStateSelected)]; [optionsButtonLandscape setBackgroundImage:[UIImage imageNamed:@"options_over_landscape.png"] forState:(UIControlStateHighlighted | UIControlStateSelected)]; - [LinphoneUtils buttonFixStates:optionsButton]; [LinphoneUtils buttonFixStates:optionsButtonLandscape]; } @@ -269,6 +274,9 @@ [videoButton update]; [hangupButton update]; + optionsButton.enabled = + (state == LinphoneCallPaused || state == LinphoneCallPausing || state == LinphoneCallStreamsRunning); + // Show Pause/Conference button following call count if (linphone_core_get_calls_nb(lc) > 1) { if (![pauseButton isHidden]) { diff --git a/Classes/LinphoneUI/UIPauseButton.m b/Classes/LinphoneUI/UIPauseButton.m index d071be3c1..894cd0e67 100644 --- a/Classes/LinphoneUI/UIPauseButton.m +++ b/Classes/LinphoneUI/UIPauseButton.m @@ -152,47 +152,30 @@ - (bool)onUpdate { bool ret = false; - // TODO: disable pause on not running call LinphoneCore *lc = [LinphoneManager getLc]; + LinphoneCall *c = call; switch (type) { - case UIPauseButtonType_Call: { - if (call != nil) { - LinphoneCallState state = linphone_call_get_state(call); - if (state == LinphoneCallPaused || state == LinphoneCallPausing) { - ret = true; + case UIPauseButtonType_Conference: { + self.enabled = (linphone_core_get_conference_size(lc) > 0); + if (self.enabled) { + ret = (!linphone_core_is_in_conference(lc)); } - [self setEnabled:TRUE]; - } else { - [self setEnabled:FALSE]; + break; } - break; - } - case UIPauseButtonType_Conference: { - if (linphone_core_get_conference_size(lc) > 0) { - if (!linphone_core_is_in_conference(lc)) { - ret = true; + case UIPauseButtonType_CurrentCall: + c = [UIPauseButton getCall]; + case UIPauseButtonType_Call: { + if (c != nil) { + LinphoneCallState state = linphone_call_get_state(c); + ret = (state == LinphoneCallPaused || state == LinphoneCallPausing); + self.enabled = (state == LinphoneCallPaused || state == LinphoneCallPausing || + state == LinphoneCallStreamsRunning); + } else { + self.enabled = FALSE; } - [self setEnabled:TRUE]; - } else { - [self setEnabled:FALSE]; + break; } - break; } - case UIPauseButtonType_CurrentCall: { - LinphoneCall *currentCall = [UIPauseButton getCall]; - if (currentCall != nil) { - LinphoneCallState state = linphone_call_get_state(currentCall); - if (state == LinphoneCallPaused || state == LinphoneCallPausing) { - ret = true; - } - [self setEnabled:TRUE]; - } else { - [self setEnabled:FALSE]; - } - break; - } - } - return ret; } diff --git a/submodules/linphone b/submodules/linphone index 3312e8be0..04c43a9f6 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 3312e8be0bc8336aecf6feffc4cdae9b1cc6904a +Subproject commit 04c43a9f64db5152e2859528c40dbd79008ccf5b