diff options
author | Yana Stamcheva <yana@jitsi.org> | 2011-01-14 00:12:09 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2011-01-14 00:12:09 +0000 |
commit | f140793cd967c2165f20f5e6a534fded940298f3 (patch) | |
tree | 73bcb2d804fe275b6f4f74a9eb41d0dbbb06dab0 /src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java | |
parent | c42acf53e0187a9a98dc95e12612d0338b7f0a54 (diff) | |
download | jitsi-f140793cd967c2165f20f5e6a534fded940298f3.zip jitsi-f140793cd967c2165f20f5e6a534fded940298f3.tar.gz jitsi-f140793cd967c2165f20f5e6a534fded940298f3.tar.bz2 |
When calling a contact, not contained in the contact list, we search for its image in one of the contact sources (mac address book/outlook).
Let the user choose the account to use when calling an address book/outlook contact (when clicking the call button, as well as when choosing the right button menu).
Remove the @ sign from number contacts when searching for a corresponding image.
Diffstat (limited to 'src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java index 63b40f0..e97361f 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java @@ -14,6 +14,7 @@ import java.util.List; 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.main.call.*; import net.java.sip.communicator.impl.gui.main.contactlist.contactsource.*; import net.java.sip.communicator.impl.gui.utils.*; @@ -109,15 +110,38 @@ public class SourceContactRightButtonMenu { public void actionPerformed(ActionEvent e) { - ProtocolProviderService protocolProvider - = detail.getPreferredProtocolProvider( - OperationSetBasicTelephony.class); - - if (protocolProvider != null) - CallManager.createCall( protocolProvider, - detail.getContactAddress()); - else - CallManager.createCall(detail.getContactAddress()); + List<ProtocolProviderService> providers + = GuiActivator.getOpSetRegisteredProviders( + OperationSetBasicTelephony.class, + detail.getPreferredProtocolProvider( + OperationSetBasicTelephony.class), + detail.getPreferredProtocol( + OperationSetBasicTelephony.class)); + + int providersCount = providers.size(); + + if (providers == null || providersCount <= 0) + { + new ErrorDialog(null, + GuiActivator.getResources().getI18NString( + "service.gui.CALL_FAILED"), + GuiActivator.getResources().getI18NString( + "service.gui.NO_ONLINE_TELEPHONY_ACCOUNT")) + .showDialog(); + return; + } + else if (providersCount > 1) + { + new ChooseCallAccountDialog( + detail.getContactAddress(), + OperationSetBasicTelephony.class, providers) + .setVisible(true); + } + else // providersCount == 1 + { + CallManager.createCall( + providers.get(0), detail.getContactAddress()); + } } }); callContactItem.setEnabled(detail.getSupportedOperationSets(). |