some little bugs fixed

cusax-fix
Yana Stamcheva 20 years ago
parent 43e452dae2
commit 939e3689f1

@ -78,6 +78,8 @@ public class CallManager
private boolean isCallMetaContact;
private Timer removeCallTimer;
/**
* Creates an instance of <tt>CallManager</tt>.
* @param mainFrame The main application window.
@ -196,26 +198,30 @@ else if (buttonName.equalsIgnoreCase("hangup")) {
Call call = selectedCallPanel.getCall();
activeCalls.remove(call);
mainFrame.removeCallPanel(selectedCallPanel);
updateButtonsStateAccordingToSelectedPanel();
ProtocolProviderService pps
= call.getProtocolProvider();
OperationSetBasicTelephony telephony
= mainFrame.getTelephony(pps);
Iterator participants = call.getCallParticipants();
while(participants.hasNext()) {
try {
//now we hang up the first call participant in the call
telephony.hangupCallParticipant(
(CallParticipant)participants.next());
}
catch (OperationFailedException e) {
logger.error("Hang up was not successful: " + e);
if(activeCalls.get(call) != null) {
if(removeCallTimer.isRunning())
removeCallTimer.stop();
mainFrame.removeCallPanel(selectedCallPanel);
ProtocolProviderService pps
= call.getProtocolProvider();
OperationSetBasicTelephony telephony
= mainFrame.getTelephony(pps);
Iterator participants = call.getCallParticipants();
while(participants.hasNext()) {
try {
//now we hang up the first call participant in the call
telephony.hangupCallParticipant(
(CallParticipant)participants.next());
}
catch (OperationFailedException e) {
logger.error("Hang up was not successful: " + e);
}
}
}
}
@ -325,11 +331,12 @@ public void callEnded(CallEvent event)
SoundLoader.stop(Constants.getDefaultIncomingCallAudio());
Call sourceCall = event.getSourceCall();
if(activeCalls.get(sourceCall) != null) {
CallPanel callPanel = (CallPanel) activeCalls.get(sourceCall);
this.removeCallPanel(callPanel);
this.removeCallPanelWait(callPanel);
}
}
@ -340,14 +347,24 @@ public void outgoingCallCreated(CallEvent event)
* Removes the given call panel tab.
* @param callPanel the CallPanel to remove
*/
public void removeCallPanel(CallPanel callPanel)
{
Timer timer = new Timer(5000, new RemoveCallPanelListener(callPanel));
public void removeCallPanelWait(CallPanel callPanel)
{
removeCallTimer = new Timer(5000, new RemoveCallPanelListener(callPanel));
timer.setRepeats(false);
timer.start();
removeCallTimer.setRepeats(false);
removeCallTimer.start();
}
/**
* Removes the given call panel tab.
* @param callPanel the CallPanel to remove
*/
private void removeCallPanel(CallPanel callPanel)
{
this.activeCalls.remove(callPanel.getCall());
mainFrame.removeCallPanel(callPanel);
updateButtonsStateAccordingToSelectedPanel();
}
/**
* Removes the given CallPanel from the main tabbed pane.
@ -361,10 +378,8 @@ public RemoveCallPanelListener(CallPanel callPanel)
}
public void actionPerformed(ActionEvent e)
{
activeCalls.remove(callPanel.getCall());
mainFrame.removeCallPanel(callPanel);
updateButtonsStateAccordingToSelectedPanel();
{
removeCallPanel(callPanel);
}
}

@ -160,13 +160,13 @@ public void callParticipantRemoved(CallParticipantEvent evt)
//Create a call record and add it to the call list.
GuiCallParticipantRecord participantRecord
= new GuiCallParticipantRecord(
participantPanel.getName(),
participantPanel.getParticipantName(),
participantPanel.getCallType(),
participantPanel.getStartTime(),
participantPanel.getEndTime());
callManager.getMainFrame().getCallList().addItem(
participantRecord, 1);
callManager.getMainFrame().getCallListManager().addCallRecord(
1, participantRecord);
//remove the participant panel for this participant
this.participantsPanels.remove(participant);

@ -46,6 +46,9 @@ public class CallParticipantPanel extends JPanel
private String callType;
private String participantName;
/**
* Creates a <tt>CallParticipantPanel</tt> for the given call participant.
*
@ -64,9 +67,11 @@ public CallParticipantPanel(CallParticipant participant)
this.timer.setRepeats(true);
if(participant.getDisplayName() != null)
nameLabel.setText(participant.getDisplayName());
participantName = participant.getDisplayName();
else
nameLabel.setText(participant.getAddress());
participantName = participant.getAddress();
this.nameLabel.setText(participantName);
namePanel.add(nameLabel);
namePanel.add(stateLabel);
@ -153,8 +158,8 @@ public String getCallType()
return GuiCallParticipantRecord.INCOMING_CALL;
}
public void setCallType(String callType)
public String getParticipantName()
{
this.callType = callType;
return participantName;
}
}

Loading…
Cancel
Save