diff --git a/resources/images/images.properties b/resources/images/images.properties index de7584b23..a229135ca 100644 --- a/resources/images/images.properties +++ b/resources/images/images.properties @@ -68,7 +68,7 @@ service.gui.icons.MOVE_CONTACT=resources/images/impl/gui/common/moveContact.png service.gui.icons.ADD_CONTACT_DIALOG_ICON=resources/images/impl/gui/common/addContactDialogIcon.png service.gui.icons.RENAME_DIALOG_ICON=resources/images/impl/gui/common/renameDialogIcon.png service.gui.icons.BROWSER_ICON=resources/images/impl/gui/common/browser16x16.png -service.gui.icons.AUTHORIZATION_ICON=resources/images/impl/gui/common/padlock.gif +service.gui.icons.AUTHORIZATION_ICON=resources/images/impl/gui/common/padlock.png service.gui.icons.INCOMING_CALL=resources/images/impl/gui/common/incomingCall.png service.gui.icons.OUTGOING_CALL=resources/images/impl/gui/common/outgoingCall.png service.gui.icons.MISSED_CALL=resources/images/impl/gui/common/missedCall.png diff --git a/resources/images/impl/gui/common/padlock.gif b/resources/images/impl/gui/common/padlock.gif deleted file mode 100644 index adaabafe8..000000000 Binary files a/resources/images/impl/gui/common/padlock.gif and /dev/null differ diff --git a/resources/images/impl/gui/common/padlock.png b/resources/images/impl/gui/common/padlock.png new file mode 100644 index 000000000..9c91c6d7f Binary files /dev/null and b/resources/images/impl/gui/common/padlock.png differ diff --git a/src/net/java/sip/communicator/impl/gui/utils/MasterPasswordInputDialog.java b/src/net/java/sip/communicator/impl/gui/utils/MasterPasswordInputDialog.java index 29d5a7ede..f5e886f34 100644 --- a/src/net/java/sip/communicator/impl/gui/utils/MasterPasswordInputDialog.java +++ b/src/net/java/sip/communicator/impl/gui/utils/MasterPasswordInputDialog.java @@ -49,9 +49,8 @@ public class MasterPasswordInputDialog private JButton cancelButton; private JTextArea infoTextArea; private JTextArea errorTextArea; - private JPanel textFieldsPanel; private JPanel buttonsPanel; - private JPanel mainPanel; + private JPanel dataPanel; /** * Builds the dialog. @@ -67,6 +66,12 @@ private MasterPasswordInputDialog() this.setModal(true); this.setResizable(false); + JPanel mainPanel = new JPanel(new BorderLayout(10, 10)); + mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + mainPanel.add(createIconComponent(), BorderLayout.WEST); + mainPanel.add(dataPanel); + this.getContentPane().add(mainPanel); this.pack(); @@ -83,9 +88,8 @@ private MasterPasswordInputDialog() */ private void initComponents() { - mainPanel = new TransparentPanel(); - mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS)); - mainPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + dataPanel = new TransparentPanel(); + dataPanel.setLayout(new BoxLayout(dataPanel, BoxLayout.Y_AXIS)); // info text infoTextArea = new JTextArea(); @@ -115,8 +119,6 @@ public void actionPerformed(ActionEvent arg0) okButton.doClick(); } }); - textFieldsPanel = new TransparentPanel(new GridLayout(0, 1, 8, 8)); - textFieldsPanel.add(currentPasswdField); // OK and cancel buttons okButton = new JButton(resources.getI18NString("service.gui.OK")); @@ -129,7 +131,8 @@ public void actionPerformed(ActionEvent arg0) "service.gui.CANCEL")); cancelButton.addActionListener(this); - buttonsPanel = new TransparentPanel(new FlowLayout(FlowLayout.CENTER)); + buttonsPanel = new TransparentPanel( + new FlowLayout(FlowLayout.RIGHT, 0, 5)); buttonsPanel.add(okButton); buttonsPanel.add(cancelButton); @@ -143,13 +146,13 @@ public void actionPerformed(ActionEvent arg0) */ private void rebuildMainPanel(boolean includeErrorMsg) { - mainPanel.removeAll(); + dataPanel.removeAll(); if (includeErrorMsg) - mainPanel.add(errorTextArea); - mainPanel.add(infoTextArea); - mainPanel.add(textFieldsPanel); - mainPanel.add(buttonsPanel); + dataPanel.add(errorTextArea); + dataPanel.add(infoTextArea); + dataPanel.add(currentPasswdField); + dataPanel.add(buttonsPanel); } /** @@ -250,4 +253,23 @@ public void keyPressed(KeyEvent arg0) public void keyTyped(KeyEvent arg0) { } + + /** + * Creates the icon component to show on the left of this dialog. + * + * @return the created component + */ + private static Component createIconComponent() + { + JPanel wrapIconPanel = new JPanel(new BorderLayout()); + + JLabel iconLabel = new JLabel(); + + iconLabel.setIcon(GuiActivator.getResources() + .getImage("service.gui.icons.AUTHORIZATION_ICON")); + + wrapIconPanel.add(iconLabel, BorderLayout.NORTH); + + return wrapIconPanel; + } } diff --git a/src/net/java/sip/communicator/plugin/securityconfig/masterpassword/MasterPasswordChangeDialog.java b/src/net/java/sip/communicator/plugin/securityconfig/masterpassword/MasterPasswordChangeDialog.java index ee97d1fcf..25e2e2835 100644 --- a/src/net/java/sip/communicator/plugin/securityconfig/masterpassword/MasterPasswordChangeDialog.java +++ b/src/net/java/sip/communicator/plugin/securityconfig/masterpassword/MasterPasswordChangeDialog.java @@ -74,7 +74,7 @@ interface MasterPasswordExecutable private JPanel labelsPanel; private JPanel buttonsPanel; private JPanel qualityPanel; - private JPanel mainPanel; + private JPanel dataPanel; /** * The ResourceManagementService used by this instance to access @@ -94,10 +94,16 @@ private MasterPasswordChangeDialog() this.setTitle( resources.getI18NString( "plugin.securityconfig.masterpassword.MP_TITLE")); - this.setMinimumSize(new Dimension(350, 300)); - this.setPreferredSize(new Dimension(350, 300)); + this.setMinimumSize(new Dimension(450, 320)); + this.setPreferredSize(new Dimension(450, 320)); this.setResizable(false); + JPanel mainPanel = new JPanel(new BorderLayout(10, 10)); + mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + mainPanel.add(createIconComponent(), BorderLayout.WEST); + mainPanel.add(dataPanel); + this.getContentPane().add(mainPanel); this.pack(); @@ -124,8 +130,8 @@ private MasterPasswordChangeDialog() */ private void initComponents() { - mainPanel = new TransparentPanel(new BorderLayout(10, 10)); - mainPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + dataPanel = new TransparentPanel(new BorderLayout(10, 10)); + dataPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); // info text infoTextArea = new JTextArea(); @@ -135,23 +141,18 @@ private void initComponents() infoTextArea.setWrapStyleWord(true); infoTextArea.setFont(infoTextArea.getFont().deriveFont(Font.BOLD)); infoTextArea.setText( - resources.getI18NString("plugin.securityconfig.masterpassword.INFO_TEXT")); + resources.getI18NString( + "plugin.securityconfig.masterpassword.INFO_TEXT")); // label fields labelsPanel = new TransparentPanel(new GridLayout(0, 1, 8, 8)); - labelsPanel.add( - new JLabel( - resources.getI18NString( - "plugin.securityconfig.masterpassword.CURRENT_PASSWORD"))); - labelsPanel.add( - new JLabel( - resources.getI18NString( - "plugin.securityconfig.masterpassword.ENTER_PASSWORD"))); - labelsPanel.add( - new JLabel( - resources.getI18NString( - "plugin.securityconfig.masterpassword.REENTER_PASSWORD"))); + labelsPanel.add(new JLabel(resources.getI18NString( + "plugin.securityconfig.masterpassword.CURRENT_PASSWORD"))); + labelsPanel.add(new JLabel(resources.getI18NString( + "plugin.securityconfig.masterpassword.ENTER_PASSWORD"))); + labelsPanel.add(new JLabel(resources.getI18NString( + "plugin.securityconfig.masterpassword.REENTER_PASSWORD"))); // password fields ActionListener clickOkButton = new ActionListener() @@ -166,10 +167,8 @@ public void actionPerformed(ActionEvent e) .getCredentialsStorageService() .isUsingMasterPassword()) { - currentPasswdField - = new JTextField( - resources.getI18NString( - "plugin.securityconfig.masterpassword.MP_NOT_SET")); + currentPasswdField = new JTextField(resources.getI18NString( + "plugin.securityconfig.masterpassword.MP_NOT_SET")); currentPasswdField.setEnabled(false); } else @@ -207,22 +206,25 @@ public void actionPerformed(ActionEvent e) qualityPanel = new TransparentPanel(); qualityPanel.setLayout(new BoxLayout(qualityPanel, BoxLayout.Y_AXIS)); - qualityPanel.add( - new JLabel( - resources.getI18NString( - "plugin.securityconfig.masterpassword.PASSWORD_QUALITY_METER"))); + + JLabel qualityMeterLabel = new JLabel(resources.getI18NString( + "plugin.securityconfig.masterpassword.PASSWORD_QUALITY_METER")); + qualityMeterLabel.setAlignmentX(CENTER_ALIGNMENT); + + qualityPanel.add(qualityMeterLabel); qualityPanel.add(passwordQualityBar); qualityPanel.add(Box.createVerticalStrut(15)); - buttonsPanel = new TransparentPanel(new FlowLayout(FlowLayout.CENTER)); + buttonsPanel = new TransparentPanel( + new FlowLayout(FlowLayout.RIGHT, 0, 5)); buttonsPanel.add(okButton); buttonsPanel.add(cancelButton); qualityPanel.add(buttonsPanel); - mainPanel.add(infoTextArea, BorderLayout.NORTH); - mainPanel.add(labelsPanel, BorderLayout.WEST); - mainPanel.add(textFieldsPanel, BorderLayout.CENTER); - mainPanel.add(qualityPanel, BorderLayout.SOUTH); + dataPanel.add(infoTextArea, BorderLayout.NORTH); + dataPanel.add(labelsPanel, BorderLayout.WEST); + dataPanel.add(textFieldsPanel, BorderLayout.CENTER); + dataPanel.add(qualityPanel, BorderLayout.SOUTH); } /** @@ -384,4 +386,23 @@ public void setCallback(MasterPasswordExecutable callbackInstance) { this.callback = callbackInstance; } + + /** + * Creates the icon component to show on the left of this dialog. + * + * @return the created component + */ + private static Component createIconComponent() + { + JPanel wrapIconPanel = new JPanel(new BorderLayout()); + + JLabel iconLabel = new JLabel(); + + iconLabel.setIcon(SecurityConfigActivator.getResources() + .getImage("service.gui.icons.AUTHORIZATION_ICON")); + + wrapIconPanel.add(iconLabel, BorderLayout.NORTH); + + return wrapIconPanel; + } }