Fixes the authorisation requested dialog layout.

fix-message-formatting
hristoterezov 12 years ago
parent c9084a4bc9
commit 3ea4b0226a

@ -35,6 +35,7 @@ service.gui.ADD=&Add
service.gui.ADD_ACCOUNT=Add account service.gui.ADD_ACCOUNT=Add account
service.gui.ADD_CONTACT=&Add contact service.gui.ADD_CONTACT=&Add contact
service.gui.ADD_AUTHORIZED_CONTACT=Add {0} to your contact list service.gui.ADD_AUTHORIZED_CONTACT=Add {0} to your contact list
service.gui.ADD_CONTACT_TO_CONTACTLIST=Add the contact to your contact list
service.gui.ADD_CONTACT_TO=&Add contact to service.gui.ADD_CONTACT_TO=&Add contact to
service.gui.ADD_CONTACT_ERROR=Failed to add contact with id: {0} service.gui.ADD_CONTACT_ERROR=Failed to add contact with id: {0}
service.gui.ADD_CONTACT_ERROR_TITLE=Add contact Error service.gui.ADD_CONTACT_ERROR_TITLE=Add contact Error

@ -24,6 +24,7 @@
/** /**
* @author Yana Stamcheva * @author Yana Stamcheva
* @author Adam Netocny * @author Adam Netocny
* @author Hristo Terezov
*/ */
public class AuthorizationRequestedDialog public class AuthorizationRequestedDialog
extends SIPCommDialog extends SIPCommDialog
@ -116,13 +117,23 @@ public AuthorizationRequestedDialog(MainFrame mainFrame,
} }
else else
{ {
String displayName = contact.getDisplayName();
if(displayName.length() > 64)
{
displayName = displayName.substring(0, 47) + "...";
}
contactName contactName
= contact.getDisplayName() + " <" + contact.getAddress() + ">"; = displayName + " <" + contact.getAddress() + ">";
}
String infoText = GuiActivator.getResources().getI18NString(
"service.gui.AUTHORIZATION_REQUESTED_INFO",
new String[]{contactName});
if(infoText.length() > 256)
{
infoText = infoText.substring(0, 253) + "...";
} }
infoTextArea.setText( infoTextArea.setText(infoText);
GuiActivator.getResources().getI18NString(
"service.gui.AUTHORIZATION_REQUESTED_INFO",
new String[]{contactName}));
this.infoTextArea.setFont(infoTextArea.getFont().deriveFont(Font.BOLD)); this.infoTextArea.setFont(infoTextArea.getFont().deriveFont(Font.BOLD));
this.infoTextArea.setLineWrap(true); this.infoTextArea.setLineWrap(true);
@ -156,21 +167,32 @@ public AuthorizationRequestedDialog(MainFrame mainFrame,
this.reasonsPanel.add(requestScrollPane); this.reasonsPanel.add(requestScrollPane);
this.mainPanel.setPreferredSize(new Dimension(500, 250)); this.mainPanel.setPreferredSize(new Dimension(700, 270));
} }
else else
{ {
this.mainPanel.setPreferredSize(new Dimension(500, 200)); this.mainPanel.setPreferredSize(new Dimension(700, 220));
} }
// If the authorization request comes from a non-persistent contact, // If the authorization request comes from a non-persistent contact,
// we'll suggest to the user to add it to the contact list. // we'll suggest to the user to add it to the contact list.
if (!contact.isPersistent()) if (!contact.isPersistent())
{ {
addContactCheckBox String addContactText = "";
= new SIPCommCheckBox(GuiActivator.getResources() if(contactName.length() > 50)
{
addContactText = GuiActivator.getResources()
.getI18NString("service.gui.ADD_CONTACT_TO_CONTACTLIST",
new String[]{contactName});
}
else
{
addContactText = GuiActivator.getResources()
.getI18NString("service.gui.ADD_AUTHORIZED_CONTACT", .getI18NString("service.gui.ADD_AUTHORIZED_CONTACT",
new String[]{contactName}), true); new String[]{contactName});
}
addContactCheckBox
= new SIPCommCheckBox(addContactText, true);
addContactCheckBox.setBorder(null); addContactCheckBox.setBorder(null);
JPanel checkBoxPanel JPanel checkBoxPanel
@ -223,8 +245,6 @@ public AuthorizationRequestedDialog(MainFrame mainFrame,
*/ */
public void showDialog() public void showDialog()
{ {
pack();
repaint();
this.setVisible(true); this.setVisible(true);
} }

Loading…
Cancel
Save