Mercurial > hg > release > icedtea-web-1.6
changeset 277:61e08e67b176
Update UI for SecurityDialog.
author | Danesh Dadachanji <ddadacha@redhat.com> |
---|---|
date | Wed, 17 Aug 2011 12:01:19 -0400 |
parents | dab2238acd6b |
children | bd59947fa857 |
files | ChangeLog netx/net/sourceforge/jnlp/resources/question.png netx/net/sourceforge/jnlp/security/CertWarningPane.java netx/net/sourceforge/jnlp/security/SecurityDialog.java |
diffstat | 4 files changed, 26 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Aug 17 10:07:38 2011 -0400 +++ b/ChangeLog Wed Aug 17 12:01:19 2011 -0400 @@ -1,3 +1,13 @@ +2011-08-17 Danesh Dadachanji <ddadacha@redhat.com> + + Update UI for SecurityDialog + * netx/net/sourceforge/jnlp/resources/question.png: New icon added. + * netx/net/sourceforge/jnlp/security/CertWarningPane.java: + (addComponents): When certs are verified, question.png is used as the icon + and SAlwaysTrustPublisher is automatically selected. + * netx/net/sourceforge/jnlp/security/SecurityDialog.java: + (initDialog): Changed the title of a CERT_WARNING dialog. + 2011-08-17 Danesh Dadachanji <ddadacha@redhat.com> AUTHORS: Adding myself and Denis Lila. Removing the extra email from
--- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Wed Aug 17 10:07:38 2011 -0400 +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Wed Aug 17 12:01:19 2011 -0400 @@ -135,6 +135,8 @@ //Top label String topLabelText = ""; String propertyName = ""; + String iconLocation = "net/sourceforge/jnlp/resources/"; + boolean alwaysTrustSelected = false; if (certVerifier instanceof HttpsCertVerifier) { topLabelText = R("SHttpsUnverified") + " " + R("Continue"); @@ -144,25 +146,30 @@ case VERIFIED: topLabelText = R("SSigVerified"); propertyName = "OptionPane.informationIcon"; + iconLocation += "question.png"; + alwaysTrustSelected = true; break; case UNVERIFIED: topLabelText = R("SSigUnverified"); propertyName = "OptionPane.warningIcon"; + iconLocation += "warning.png"; break; case SIGNING_ERROR: topLabelText = R("SSignatureError"); propertyName = "OptionPane.warningIcon"; + iconLocation += "warning.png"; break; } + ImageIcon icon = new ImageIcon((new sun.misc.Launcher()) - .getClassLoader().getResource("net/sourceforge/jnlp/resources/warning.png")); + .getClassLoader().getResource(iconLocation)); JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT); topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); - topPanel.setPreferredSize(new Dimension(400, 60)); + topPanel.setPreferredSize(new Dimension(400, 75)); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //application info @@ -175,6 +182,7 @@ alwaysTrust = new JCheckBox(R("SAlwaysTrustPublisher")); alwaysTrust.setEnabled(true); + alwaysTrust.setSelected(alwaysTrustSelected); JPanel infoPanel = new JPanel(new GridLayout(4, 1)); infoPanel.add(nameLabel);
--- a/netx/net/sourceforge/jnlp/security/SecurityDialog.java Wed Aug 17 10:07:38 2011 -0400 +++ b/netx/net/sourceforge/jnlp/security/SecurityDialog.java Wed Aug 17 12:01:19 2011 -0400 @@ -207,9 +207,12 @@ setSystemLookAndFeel(); String dialogTitle = ""; - if (dialogType == DialogType.CERT_WARNING) - dialogTitle = "Warning - Security"; - else if (dialogType == DialogType.MORE_INFO) + if (dialogType == DialogType.CERT_WARNING) { + if (accessType == AccessType.VERIFIED) + dialogTitle = "Security Approval Required"; + else + dialogTitle = "Security Warning"; + } else if (dialogType == DialogType.MORE_INFO) dialogTitle = "More Information"; else if (dialogType == DialogType.CERT_INFO) dialogTitle = "Details - Certificate";