Makes call window wait after a hang up only if there was no user intervention. Makes the window disappear immediately if the X button has been pressed.

cusax-fix
Yana Stamcheva 13 years ago
parent 90c1de2895
commit 3e6e886b74

@ -86,6 +86,18 @@ public void callTitleChanged(CallPanel callPanel)
@Override
protected void close(boolean escape)
{
// If the window has been closed by clicking the X button or pressing
// the key combination corresponding to the same button we close the
// window first and then perform all hang up operations.
if (!escape)
{
this.callPanel.disposeCallInfoFrame();
// We hide the window here. It will be disposed when the call has
// been ended.
setVisible(false);
}
// Then perform hang up operations.
callPanel.actionPerformedOnHangupButton(escape);
}

@ -202,7 +202,7 @@ public void callEndedInEventDispatchThread(CallEvent ev)
{
Call sourceCall = ev.getSourceCall();
closeCallContainerIfNotNecessary(sourceCall, true);
closeCallContainerIfNotNecessary(sourceCall);
/*
* Notify the existing CallPanels about the CallEvent (in case
@ -1044,6 +1044,38 @@ public static void transferCall(CallPeer peer, String target)
}
}
/**
* Closes the <tt>CallPanel</tt> of a specific <tt>Call</tt> if it is no
* longer necessary (i.e. is not used by other <tt>Call</tt>s participating
* in the same telephony conference as the specified <tt>Call</tt>.)
*
* @param call the <tt>Call</tt> which is to have its associated
* <tt>CallPanel</tt>, if any, closed
* {@link CallContainer#closeWait(CallPanel)} or <tt>false</tt> to use
* {@link CallContainer#close(CallPanel)}
*/
private static void closeCallContainerIfNotNecessary(final Call call)
{
if (!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(
new Runnable()
{
public void run()
{
closeCallContainerIfNotNecessary(call);
}
});
return;
}
CallPanel callPanel = callPanels.get(call.getConference());
if (callPanel != null)
closeCallContainerIfNotNecessary(
call, callPanel.isCloseWaitAfterHangup());
}
/**
* Closes the <tt>CallPanel</tt> of a specific <tt>Call</tt> if it is no
* longer necessary (i.e. is not used by other <tt>Call</tt>s participating

@ -263,6 +263,14 @@ public class CallPanel
*/
private final UIVideoHandler2 uiVideoHandler;
/**
* Indicates if this call panel should be closed immediately after hang up
* or should wait some time so that the user can be notified of the last
* state. By default we wait, so that the user can be notified of the
* current state of the call.
*/
private boolean isCloseWaitAfterHangup = true;
/**
* The <tt>Observer</tt> which listens to {@link #uiVideoHandler} about
* changes in the video-related information.
@ -445,14 +453,28 @@ else if (buttonName.equals(INFO_BUTTON))
*/
public void actionPerformedOnHangupButton(boolean closeWait)
{
this.disposeCallInfoFrame();
isCloseWaitAfterHangup = closeWait;
CallManager.hangupCalls(callConference);
this.disposeCallInfoFrame();
/*
* XXX It is the responsibility of CallManager to close this CallPanel
* when a Call is ended.
*/
CallManager.hangupCalls(callConference);
}
/**
* Indicates if this call panel should be closed immediately after hang up
* or should wait some time so that the user can be notified of the last
* state.
*
* @return <tt>true</tt> to indicate that when hanged up this call panel
* should not be closed immediately, <tt>false</tt> - otherwise
*/
public boolean isCloseWaitAfterHangup()
{
return isCloseWaitAfterHangup;
}
/**

Loading…
Cancel
Save