Some minor changes to security UI (ongoing work).

cusax-fix
Yana Stamcheva 17 years ago
parent 333a823b14
commit 8f8bd6471e

@ -127,16 +127,16 @@ public Object getSelectedItem()
}
public void setSelectedItem(Object val)
{
{
if ((selectedItem == null) && (val == null))
return;
if ((selectedItem != null) && selectedItem.equals(val))
return;
if ((val != null) && val.equals(selectedItem))
return;
selectedItem = val;
fireContentsChanged(this, -1, -1);
}
@ -227,11 +227,12 @@ protected void handleChange()
{
if (setting)
return;
filtering = true;
Filter filter = null;
if (text.getText().length() > 0) {
if (text.getText().length() > 0)
{
filter = new StartsWithFilter(text.getText());
}

@ -248,17 +248,22 @@ public void participantImageChanged(CallParticipantChangeEvent evt)
{
}
public void securityStatusChanged(SecurityGUIEvent securityEvent) {
public void securityStatusChanged(SecurityGUIEvent securityEvent)
{
CallParticipant part = (CallParticipant)securityEvent.getSource();
CallParticipantPanel panel = getParticipantPanel(part);
if (securityEvent.getEventID() == SecurityGUIEvent.SECURITY_ENABLED) {
panel.changeSecureCallButton(true);
if (securityEvent.getEventID() == SecurityGUIEvent.SECURITY_ENABLED)
{
panel.changeSecureCallButton(true);
}
if (securityEvent.getProvider() == SecurityGUIEvent.ZRTP) {
panel.changeZrtpPanel((SecurityGUIEventZrtp)securityEvent);
if (securityEvent.getProvider() == SecurityGUIEvent.ZRTP)
{
panel.changeZrtpPanel((SecurityGUIEventZrtp) securityEvent);
}
}
/**
* Returns the call for this call panel.
*

@ -331,20 +331,19 @@ private Component createSecureCallButton()
{
secureButton = new SecureButton(callParticipant);
secureButton.setActionCommand("startSecureMode");
secureButton.setName("secureButton");
secureButton.setToolTipText(
GuiActivator.getResources().getI18NString(
"impl.media.security.TOGGLE_ON_SECURITY"));
return secureButton;
}
}
return null;
}
public void changeSecureCallButton(boolean onOff)
public void changeSecureCallButton(boolean isEnabled)
{
secureButton.updateSecureButton(onOff);
secureButton.updateSecureButton(isEnabled);
}
public void changeZrtpPanel(SecurityGUIEventZrtp securityEvent)

@ -8,10 +8,7 @@
import java.awt.event.*;
import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
@ -30,6 +27,7 @@ public class SecureButton
public SecureButton(CallParticipant callParticipant)
{
super(ImageLoader.getImage(ImageLoader.SECURE_BUTTON_OFF));
this.callParticipant = callParticipant;
// this.addActionListener(this);
}
@ -40,30 +38,27 @@ public void actionPerformed(ActionEvent evt)
if (call != null)
{
String command = evt.getActionCommand();
if (command.equals("startSecureMode"))
{
OperationSetSecureTelephony telephony =
(OperationSetSecureTelephony) call.getProtocolProvider()
OperationSetSecureTelephony telephony
= (OperationSetSecureTelephony) call.getProtocolProvider()
.getOperationSet(OperationSetSecureTelephony.class);
if (telephony != null && telephony.isSecure(callParticipant))
if (telephony != null )
{
if (!telephony.isSecure(callParticipant))
{
updateSecureButton(false);
telephony.setSecure(callParticipant,
false,
OperationSetSecureTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
true,
OperationSetSecureTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
}
else if (telephony != null)
else
{
updateSecureButton(true);
telephony.setSecure(callParticipant,
true,
OperationSetSecureTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
false,
OperationSetSecureTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
}
}
}
@ -79,21 +74,17 @@ public void updateSecureButton(boolean isSecure)
{
if(isSecure)
{
this.setIcon(
new ImageIcon(
ImageLoader.getImage(ImageLoader.SECURE_BUTTON_ON)));
this.setImage(ImageLoader.getImage(ImageLoader.SECURE_BUTTON_ON));
// TODO GoClear
// We deactivate the tooltip at the moment, because the
// secure mode cannot be toggled off
//this.setToolTipText(
// this.setToolTipText(
// GuiActivator.getResources().getI18NString("impl.media.security.TOGGLE_OFF_SECURITY").getText());
this.setToolTipText(null);
}
else
{
this.setIcon(
new ImageIcon(
ImageLoader.getImage(ImageLoader.SECURE_BUTTON_OFF)));
this.setImage(ImageLoader.getImage(ImageLoader.SECURE_BUTTON_OFF));
this.setToolTipText(
GuiActivator.getResources()
.getI18NString("impl.media.security.TOGGLE_ON_SECURITY"));

Loading…
Cancel
Save