diff --git a/resources/languages/resources.properties b/resources/languages/resources.properties index 0e60b6f7f..43f3fc1d8 100644 --- a/resources/languages/resources.properties +++ b/resources/languages/resources.properties @@ -35,6 +35,7 @@ service.gui.ADD=&Add service.gui.ADD_ACCOUNT=Add account service.gui.ADD_CONTACT=&Add contact 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_ERROR=Failed to add contact with id: {0} service.gui.ADD_CONTACT_ERROR_TITLE=Add contact Error diff --git a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java index 7c80cc7ef..6c5b31872 100644 --- a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java @@ -24,6 +24,7 @@ /** * @author Yana Stamcheva * @author Adam Netocny + * @author Hristo Terezov */ public class AuthorizationRequestedDialog extends SIPCommDialog @@ -116,13 +117,23 @@ public AuthorizationRequestedDialog(MainFrame mainFrame, } else { + String displayName = contact.getDisplayName(); + if(displayName.length() > 64) + { + displayName = displayName.substring(0, 47) + "..."; + } 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( - GuiActivator.getResources().getI18NString( - "service.gui.AUTHORIZATION_REQUESTED_INFO", - new String[]{contactName})); + infoTextArea.setText(infoText); this.infoTextArea.setFont(infoTextArea.getFont().deriveFont(Font.BOLD)); this.infoTextArea.setLineWrap(true); @@ -156,21 +167,32 @@ public AuthorizationRequestedDialog(MainFrame mainFrame, this.reasonsPanel.add(requestScrollPane); - this.mainPanel.setPreferredSize(new Dimension(500, 250)); + this.mainPanel.setPreferredSize(new Dimension(700, 270)); } 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, // we'll suggest to the user to add it to the contact list. if (!contact.isPersistent()) { - addContactCheckBox - = new SIPCommCheckBox(GuiActivator.getResources() + String addContactText = ""; + 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", - new String[]{contactName}), true); + new String[]{contactName}); + } + addContactCheckBox + = new SIPCommCheckBox(addContactText, true); addContactCheckBox.setBorder(null); JPanel checkBoxPanel @@ -223,8 +245,6 @@ public AuthorizationRequestedDialog(MainFrame mainFrame, */ public void showDialog() { - pack(); - repaint(); this.setVisible(true); }