Adjusts contact list unknown contact view in the case when calling and/or contact adding are disabled.

cusax-fix
Yana Stamcheva 15 years ago
parent e5f9af2237
commit b5fc3329e7

@ -310,6 +310,7 @@ service.gui.NO=No
service.gui.NO_CAMERA_AVAILABLE=No camera available
service.gui.NO_AVAILABLE_ROOMS=The list of rooms for this server is currently not available.
service.gui.NO_CONTACTS_FOUND=No matching contacts found. Press Ctrl+Enter to call {0} or use the buttons below.
service.gui.NO_CONTACTS_FOUND_SHORT=No matching contacts found.
service.gui.NO_MESSAGE=No message
service.gui.NO_GROUP_CHAT_ACCOUNT_AVAILABLE=No accounts, supporting multi user chat found. Check jitsi.org for more information on which protocols support multi user chat.
service.gui.NO_ONLINE_TELEPHONY_ACCOUNT=At least one online telephony account is needed in order to make a call. Please login to one of your telephony accounts and try again.

@ -8,6 +8,7 @@
import java.awt.*;
import java.awt.event.*;
import java.util.List;
import javax.swing.*;
import javax.swing.text.*;
@ -16,6 +17,7 @@
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.impl.gui.main.call.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
import net.java.sip.communicator.util.swing.event.*;
@ -66,10 +68,6 @@ public UnknownContactPanel(MainFrame window)
this.add(mainPanel, BorderLayout.NORTH);
initTextArea(parentWindow.getCurrentSearchText());
mainPanel.add(textArea, BorderLayout.CENTER);
TransparentPanel buttonPanel
= new TransparentPanel(new GridLayout(0, 1));
@ -96,31 +94,56 @@ public void actionPerformed(ActionEvent e)
});
}
callContact.setAlignmentX(JButton.CENTER_ALIGNMENT);
List<ProtocolProviderService> telephonyProviders
= CallManager.getTelephonyProviders();
if (telephonyProviders!= null && telephonyProviders.size() > 0)
{
callContact.setAlignmentX(JButton.CENTER_ALIGNMENT);
callContact.setMnemonic(GuiActivator.getResources()
.getI18nMnemonic("service.gui.CALL_CONTACT"));
callContact.setMnemonic(GuiActivator.getResources()
.getI18nMnemonic("service.gui.CALL_CONTACT"));
buttonPanel.add(callContact);
buttonPanel.add(callContact);
callContact.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String searchText = parentWindow.getCurrentSearchText();
TransparentPanel southPanel
= new TransparentPanel(new FlowLayout(FlowLayout.CENTER));
southPanel.add(buttonPanel);
if (searchText == null)
return;
mainPanel.add(southPanel, BorderLayout.SOUTH);
CallManager.createCall(searchText, callContact);
}
});
}
callContact.addActionListener(new ActionListener()
initTextArea();
mainPanel.add(textArea, BorderLayout.CENTER);
if (callContact.getParent() != null)
{
public void actionPerformed(ActionEvent e)
{
String searchText = parentWindow.getCurrentSearchText();
textArea.setText(GuiActivator.getResources()
.getI18NString( "service.gui.NO_CONTACTS_FOUND",
new String[]{'"'
+ parentWindow.getCurrentSearchText() + '"'}));
}
else
{
textArea.setText(GuiActivator.getResources()
.getI18NString( "service.gui.NO_CONTACTS_FOUND_SHORT"));
}
if (searchText == null)
return;
if (buttonPanel.getComponentCount() > 0)
{
TransparentPanel southPanel
= new TransparentPanel(new FlowLayout(FlowLayout.CENTER));
southPanel.add(buttonPanel);
CallManager.createCall(searchText, callContact);
}
});
mainPanel.add(southPanel, BorderLayout.SOUTH);
}
loadSkin();
}
@ -160,13 +183,9 @@ public void textRemoved()
/**
* Creates the text area.
* @param searchText the searched text
*/
private void initTextArea(String searchText)
private void initTextArea()
{
textArea.setText(GuiActivator.getResources()
.getI18NString( "service.gui.NO_CONTACTS_FOUND",
new String[]{'"' + searchText + '"'}));
textArea.setOpaque(false);
textArea.setEditable(false);
StyledDocument doc = textArea.getStyledDocument();
@ -186,11 +205,15 @@ private void initTextArea(String searchText)
*/
private void updateTextArea(String searchText)
{
textArea.setText(GuiActivator.getResources()
.getI18NString("service.gui.NO_CONTACTS_FOUND",
new String[]{'"' + searchText + '"'}));
this.revalidate();
this.repaint();
if (callContact.getParent() != null)
{
textArea.setText(GuiActivator.getResources()
.getI18NString("service.gui.NO_CONTACTS_FOUND",
new String[]{'"' + searchText + '"'}));
this.revalidate();
this.repaint();
}
}
/**

Loading…
Cancel
Save