Adds an option to display peer names in call history tooltips.

cusax-fix
Damian Minkov 12 years ago
parent 2e1e00308e
commit ff12a2c690

@ -111,7 +111,14 @@ private void initPeerDetails()
if (peerAddress != null)
{
ContactDetail contactDetail = new ContactDetail(peerAddress);
String peerRecordDisplayName = peerRecord.getDisplayName();
if(peerRecordDisplayName == null
|| peerRecordDisplayName.length() == 0)
peerRecordDisplayName = peerAddress;
ContactDetail contactDetail =
new ContactDetail(peerAddress, peerRecordDisplayName);
Map<Class<? extends OperationSet>, ProtocolProviderService>
preferredProviders = null;

@ -13,6 +13,7 @@
import javax.swing.*;
import org.jitsi.service.resources.*;
import org.jitsi.util.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.contactlist.*;
@ -22,6 +23,7 @@
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.globalstatus.*;
import net.java.sip.communicator.util.*;
/**
* The <tt>SourceUIContact</tt> is the implementation of the UIContact for the
@ -517,7 +519,20 @@ private void addDetailsToToolTip( List<ContactDetail> details,
}
}
jLabels[i] = new JLabel(contactDetail.getDetail());
String labelText;
if(ConfigurationUtils.isHideAddressInCallHistoryTooltipEnabled())
{
labelText = contactDetail.getDisplayName();
if(StringUtils.isNullOrEmpty(labelText))
labelText = contactDetail.getDetail();
}
else
{
labelText = contactDetail.getDetail();
}
jLabels[i] = new JLabel(labelText);
toolTip.addLine(jLabels);
}

@ -307,6 +307,19 @@ public class ConfigurationUtils
*/
private static boolean isSingleWindowInterfaceEnabled = false;
/**
* Whether addresses will be shown in call history tooltips.
*/
private static boolean isHideAddressInCallHistoryTooltipEnabled = false;
/**
* The name of the property, whether to show addresses in call history
* tooltip.
*/
private static final String HIDE_ADDR_IN_CALL_HISTORY_TOOLTIP_PROPERTY
= "net.java.sip.communicator.impl.gui.contactlist" +
".HIDE_ADDRESS_IN_CALL_HISTORY_TOOLTIP_ENABLED";
/**
* The name of the show smileys property.
*/
@ -874,6 +887,10 @@ public static void loadGuiConfigurations()
= configService.getBoolean(
"impl.gui.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS",
true);
isHideAddressInCallHistoryTooltipEnabled = configService.getBoolean(
HIDE_ADDR_IN_CALL_HISTORY_TOOLTIP_PROPERTY,
isHideAddressInCallHistoryTooltipEnabled);
}
/**
@ -1743,6 +1760,15 @@ public static boolean isSingleWindowInterfaceEnabled()
return isSingleWindowInterfaceEnabled;
}
/**
* Whether addresses will be shown in call history tooltips.
* @return whether addresses will be shown in call history tooltips.
*/
public static boolean isHideAddressInCallHistoryTooltipEnabled()
{
return isHideAddressInCallHistoryTooltipEnabled;
}
/**
* Updates the "singleWindowInterface" property through the
* <tt>ConfigurationService</tt>.

Loading…
Cancel
Save