show a message to user when no info is available for a certain contact

cusax-fix
Yana Stamcheva 20 years ago
parent 6754814d3b
commit e66065f01d

@ -164,6 +164,7 @@ selectProvidersWizardTitle=Select account(s)
send=Send
sendFile=Send file
useCtrlEnterToSend=Use Ctrl-Enter to send
selectContactSupportingInfo=There is no info for this contact.
sendMessage=Send a message
sendVia=Send via
settings=Settings

@ -9,6 +9,7 @@
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
@ -166,19 +167,35 @@ else if (buttonName.equals("info")) {
.getContactList().getSelectedValue();
if(selectedMetaContact != null) {
Contact defaultContact = selectedMetaContact
.getDefaultContact();
ProtocolProviderService defaultProvider
= defaultContact.getProtocolProvider();
OperationSetWebContactInfo wContactInfo
= mainFrame.getWebContactInfo(defaultProvider);
CrossPlatformBrowserLauncher.openURL(
wContactInfo.getWebContactInfo(defaultContact)
.toString());
}
OperationSetWebContactInfo wContactInfo = null;
Iterator protocolContacts = selectedMetaContact.getContacts();
while(protocolContacts.hasNext()) {
Contact protoContact = (Contact) protocolContacts.next();
wContactInfo = mainFrame.getWebContactInfo(
protoContact.getProtocolProvider());
if(wContactInfo != null)
break;
}
if(wContactInfo != null) {
Contact defaultContact = selectedMetaContact
.getDefaultContact();
CrossPlatformBrowserLauncher.openURL(
wContactInfo.getWebContactInfo(defaultContact)
.toString());
}
else {
JOptionPane.showMessageDialog(mainFrame,
Messages.getString("selectContactSupportingInfo"),
Messages.getString("warning"),
JOptionPane.WARNING_MESSAGE);
}
}
}
}

Loading…
Cancel
Save