diff --git a/src/net/java/sip/communicator/impl/gui/i18n/messages.properties b/src/net/java/sip/communicator/impl/gui/i18n/messages.properties index 440677ea3..ca043b598 100644 --- a/src/net/java/sip/communicator/impl/gui/i18n/messages.properties +++ b/src/net/java/sip/communicator/impl/gui/i18n/messages.properties @@ -177,6 +177,7 @@ statusChangeNetworkFailure=Failed to change status for ? account due to a networ summary=Summary today=Today tools=&Tools +typeYourRequest=Type your request here uin=UIN: unknown=Unknown user msgDeliveryFailedUnknownError=Unknown error has occured while delivering your message. diff --git a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationHandlerImpl.java b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationHandlerImpl.java index e8a08cbc1..14298db27 100644 --- a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationHandlerImpl.java +++ b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationHandlerImpl.java @@ -6,8 +6,6 @@ */ package net.java.sip.communicator.impl.gui.main.authorization; -import javax.swing.*; - import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.service.protocol.*; @@ -49,15 +47,15 @@ public AuthorizationResponse processAuthorisationRequest( if(result == AuthorizationRequestedDialog.ACCEPT_CODE) { response = new AuthorizationResponse(AuthorizationResponse.ACCEPT, - dialog.getResponseReason()); + null); } else if(result == AuthorizationRequestedDialog.REJECT_CODE) { response = new AuthorizationResponse(AuthorizationResponse.REJECT, - dialog.getResponseReason()); + null); } else if(result == AuthorizationRequestedDialog.IGNORE_CODE) { response = new AuthorizationResponse(AuthorizationResponse.IGNORE, - dialog.getResponseReason()); + null); } return response; } 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 47653014a..4c0cfd38c 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 @@ -37,8 +37,6 @@ public class AuthorizationRequestedDialog private JEditorPane requestPane = new JEditorPane(); - private JEditorPane responsePane = new JEditorPane(); - private JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); private JPanel northPanel = new JPanel(new BorderLayout()); @@ -64,8 +62,6 @@ public class AuthorizationRequestedDialog private JScrollPane requestScrollPane = new JScrollPane(); - private JScrollPane responseScrollPane = new JScrollPane(); - private JPanel mainPanel = new JPanel(new BorderLayout(10, 10)); private JPanel reasonsPanel = new JPanel(new GridLayout(0, 1, 5, 5)); @@ -125,19 +121,12 @@ public AuthorizationRequestedDialog(MainFrame mainFrame, Contact contact, this.reasonsPanel.add(requestScrollPane); - this.mainPanel.setPreferredSize(new Dimension(550, 400)); + this.mainPanel.setPreferredSize(new Dimension(550, 300)); } else { - this.mainPanel.setPreferredSize(new Dimension(550, 350)); + this.mainPanel.setPreferredSize(new Dimension(550, 200)); } - this.responseScrollPane.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEmptyBorder(3, 3, 3, 3), - SIPCommBorders.getBoldRoundBorder())); - - this.responseScrollPane.getViewport().add(responsePane); - - this.reasonsPanel.add(responseScrollPane); this.acceptButton.setName("accept"); this.rejectButton.setName("reject"); @@ -212,15 +201,6 @@ else if (name.equals("ignore")) { this.dispose(); } - /** - * Returns the response reason, which has been entered from the user to - * explain it's response on the request. - * @return the response reason of the user - */ - public String getResponseReason() { - return this.responsePane.getText(); - } - protected void close(boolean isEscaped) { this.ignoreButton.doClick(); diff --git a/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java b/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java index 2c051ae27..4c39d97d5 100644 --- a/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java @@ -8,11 +8,11 @@ import java.awt.*; import java.awt.event.*; + import javax.swing.*; import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.impl.gui.i18n.*; -import net.java.sip.communicator.impl.gui.lookandfeel.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; @@ -32,7 +32,12 @@ public class RequestAuthorizationDialog private JTextArea infoTextArea = new JTextArea(); - private JEditorPane requestPane = new JEditorPane(); + private JLabel requestLabel = new JLabel( + Messages.getI18NString("typeYourRequest").getText() + ": "); + + private JTextField requestField = new JTextField(); + + private JPanel requestPanel = new JPanel(new BorderLayout()); private JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -44,8 +49,6 @@ public class RequestAuthorizationDialog private JButton cancelButton = new JButton(cancelString.getText()); - private JScrollPane requestScrollPane = new JScrollPane(); - private JPanel mainPanel = new JPanel(new BorderLayout(10, 10)); private JPanel northPanel = new JPanel(new BorderLayout()); @@ -85,19 +88,13 @@ public RequestAuthorizationDialog(MainFrame mainFrame, Contact contact, titleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD, 18f)); titleLabel.setText(title); - this.mainPanel.setPreferredSize(new Dimension(400, 300)); + this.mainPanel.setPreferredSize(new Dimension(400, 230)); this.request = request; infoTextArea.setText(Messages.getI18NString("requestAuthorizationInfo", contact.getDisplayName()).getText()); - this.requestScrollPane.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEmptyBorder(3, 3, 3, 3), - SIPCommBorders.getBoldRoundBorder())); - - this.requestScrollPane.getViewport().add(requestPane); - this.infoTextArea.setFont(Constants.FONT.deriveFont(Font.BOLD, 12f)); this.infoTextArea.setLineWrap(true); this.infoTextArea.setOpaque(false); @@ -110,6 +107,9 @@ public RequestAuthorizationDialog(MainFrame mainFrame, Contact contact, this.northPanel.add(iconLabel, BorderLayout.WEST); this.northPanel.add(titlePanel, BorderLayout.CENTER); + this.requestPanel.add(requestLabel, BorderLayout.WEST); + this.requestPanel.add(requestField, BorderLayout.CENTER); + this.requestButton.setName("request"); this.cancelButton.setName("cancel"); @@ -125,7 +125,7 @@ public RequestAuthorizationDialog(MainFrame mainFrame, Contact contact, this.mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); this.mainPanel.add(northPanel, BorderLayout.NORTH); - this.mainPanel.add(requestScrollPane, BorderLayout.CENTER); + this.mainPanel.add(requestPanel, BorderLayout.CENTER); this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH); this.getContentPane().add(mainPanel); @@ -140,7 +140,7 @@ public int showDialog() { this.setVisible(true); - this.requestPane.requestFocus(); + this.requestField.requestFocus(); synchronized (lock) { try { @@ -184,7 +184,7 @@ else if(name.equals("cancel")) { */ public String getRequestReason() { - return requestPane.getText(); + return requestField.getText(); } protected void close(boolean isEscaped)