Fixes issue #484 - closing the call window does not end a call.

cusax-fix
Lyubomir Marinov 18 years ago
parent 95341d0e5c
commit ed5b009887

@ -88,19 +88,7 @@ public void actionPerformed(ActionEvent evt)
if (buttonName.equals(HANGUP_BUTTON))
{
Call call = callPanel.getCall();
CallManager.hangupCall(call);
this.dispose();
// if (removeCallTimers.containsKey(callPanel))
// {
// ((Timer) removeCallTimers.get(callPanel)).stop();
// removeCallTimers.remove(callPanel);
// }
//
// removeCallPanel(callPanel);
actionPerformedOnHangupButton();
}
else if (buttonName.equals(DIAL_BUTTON))
{
@ -134,6 +122,20 @@ else if (buttonName.equals(DIAL_BUTTON))
}
}
/**
* Executes the action associated with the "Hang up" button which may be
* invoked by clicking the button in question or closing this dialog.
*/
private void actionPerformedOnHangupButton()
{
Call call = getCall();
if (call != null)
CallManager.hangupCall(call);
this.dispose();
}
/**
* Returns the <tt>Call</tt> corresponding to this CallDialog.
*
@ -141,16 +143,15 @@ else if (buttonName.equals(DIAL_BUTTON))
*/
public Call getCall()
{
if (callPanel != null)
{
return callPanel.getCall();
}
else
return null;
return (callPanel != null) ? callPanel.getCall() : null;
}
@Override
protected void close(boolean isEscaped)
{
if (!isEscaped)
{
actionPerformedOnHangupButton();
}
}
}

Loading…
Cancel
Save