summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalina Jasinska <kalina.jasinska@gmail.com>2013-07-31 12:07:50 (GMT)
committer Kalina Jasinska <kalina.jasinska@gmail.com>2013-07-31 12:07:50 (GMT)
commit0394366f9bd1324040c814bd7668e805cfe6689e (patch)
treee313ac14701d3f2aa673ec6eccf808040bd44075
parent745d3cb2de81501754c5b5406dd4bfb3dedb22a9 (diff)
downloadQCG-Data-0394366f9bd1324040c814bd7668e805cfe6689e.zip
QCG-Data-0394366f9bd1324040c814bd7668e805cfe6689e.tar.gz
QCG-Data-0394366f9bd1324040c814bd7668e805cfe6689e.tar.bz2
automatic login
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/Version.java2
-rw-r--r--idrop-swing/pom.xml16
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form8
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java494
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java4
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java15
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java2
9 files changed, 300 insertions, 245 deletions
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/Version.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/Version.java
index cf29458..4305d1c 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/Version.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/Version.java
@@ -1,5 +1,5 @@
package org.irods.jargon.idrop.lite;
public final class Version {
public static String VERSION="2.0.1-SNAPSHOT";
- public static String BUILD_TIME="20130529-0944";
+ public static String BUILD_TIME="20130723-1452";
}
diff --git a/idrop-swing/pom.xml b/idrop-swing/pom.xml
index 18f612b..5833bef 100644
--- a/idrop-swing/pom.xml
+++ b/idrop-swing/pom.xml
@@ -71,6 +71,16 @@
<version>3.3.2.GA</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.10</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.10</version>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -160,7 +170,7 @@
<configuration>
<archive>
<manifest>
- <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass>
+ <mainClass>org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop</mainClass>
</manifest>
</archive>
</configuration>
@@ -173,7 +183,7 @@
</descriptorRefs>
<archive>
<manifest>
- <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass>
+ <mainClass>org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop</mainClass>
</manifest>
</archive>
</configuration>
@@ -199,7 +209,7 @@
</execution>
</executions>
<configuration>
- <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass>
+ <mainClass>org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop</mainClass>
</configuration>
</plugin>
<plugin>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
index dac2fce..aa80d05 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
@@ -175,7 +175,7 @@ public class IDROPDesktop {
loginDialog.setLocation(x, y);
idropSplashWindow.toBack();
loginDialog.toFront();
- loginDialog.setVisible(true);
+ loginDialog.setVisible(!loginDialog.isLoginTrialSuccesful());
if (idropCore.getIrodsAccount() == null) {
log.warn("no login account, exiting");
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form
index aa8775b..7f44c13 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.form
@@ -201,6 +201,14 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkGuestLoginActionPerformed"/>
</Events>
</Component>
+ <Component class="javax.swing.JCheckBox" name="chkRememberPass">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Remember password"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkRememberPassActionPerformed"/>
+ </Events>
+ </Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="lblLoginMode">
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
index fbdc6d2..edbdf81 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
@@ -19,6 +19,7 @@ import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationServ
import org.irods.jargon.idrop.desktop.systraygui.utils.IdropPropertiesHelper;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.openide.util.Exceptions;
import org.slf4j.LoggerFactory;
/**
@@ -32,6 +33,12 @@ public class LoginDialog extends JDialog {
public static org.slf4j.Logger log = LoggerFactory
.getLogger(LoginDialog.class);
+ private boolean loginTrialSuccesful = false;
+
+ public boolean isLoginTrialSuccesful() {
+ return loginTrialSuccesful;
+ }
+
public LoginDialog(final JDialog parentDialog, final IDROPCore idropCore) {
super(parentDialog, true);
if (idropCore == null) {
@@ -39,7 +46,7 @@ public class LoginDialog extends JDialog {
}
this.idropCore = idropCore;
initComponents();
-
+
if (idropCore.getIdropConfig().isLoginPreset()) {
loginUsingPreset();
} else {
@@ -82,7 +89,18 @@ public class LoginDialog extends JDialog {
String username = idropCore.getIdropConfig().getPropertyForKey(
IdropConfigurationService.ACCOUNT_CACHE_USER_NAME);
txtUserName.setText(username);
- hideAdvancedViewFields();
+
+ String save = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS);
+ boolean saveP = "true".equals(save);
+ if(saveP){
+ String savedPassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD);
+ password.setText(savedPassword);
+ chkRememberPass.setSelected(true);
+
+ loginTrialSuccesful = !processLogin();
+ }
+
+ hideAdvancedViewFields();
}
private void loginUsingPreset() {
@@ -108,7 +126,7 @@ public class LoginDialog extends JDialog {
*/
private boolean processLogin() throws NumberFormatException {
// validate various inputs based on whether a full login, or a uid only
- // login is indicated
+ // login is indicated
if (!idropCore.getIdropConfig().isLoginPreset()) {
txtHost.setBackground(Color.white);
txtPort.setBackground(Color.white);
@@ -180,7 +198,7 @@ public class LoginDialog extends JDialog {
presetPort, txtUserName.getText(), new String(
password.getPassword()), sb.toString(),
presetZone, presetResource);
- }
+ }
} else {
sb.append('/');
sb.append(txtZone.getText());
@@ -230,7 +248,7 @@ public class LoginDialog extends JDialog {
.getAuthenticatedIRODSAccount());
try {
idropCore.getIdropConfigurationService()
- .saveLogin(irodsAccount);
+ .saveLogin(irodsAccount, chkRememberPass.isSelected());
} catch (IdropException ex) {
throw new IdropRuntimeException("error saving irodsAccount", ex);
}
@@ -308,210 +326,217 @@ public class LoginDialog extends JDialog {
// <editor-fold defaultstate="collapsed"
// <editor-fold defaultstate="collapsed"
- // desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
- java.awt.GridBagConstraints gridBagConstraints;
-
- pnlLoginInfo = new javax.swing.JPanel();
- lblHost = new javax.swing.JLabel();
- txtHost = new javax.swing.JTextField();
- lblPort = new javax.swing.JLabel();
- txtPort = new javax.swing.JTextField();
- lblZone = new javax.swing.JLabel();
- txtZone = new javax.swing.JTextField();
- lblResource = new javax.swing.JLabel();
- txtResource = new javax.swing.JTextField();
- lblUserName = new javax.swing.JLabel();
- txtUserName = new javax.swing.JTextField();
- lblPassword = new javax.swing.JLabel();
- password = new javax.swing.JPasswordField();
- jPanel1 = new javax.swing.JPanel();
- chkAdvancedLogin = new javax.swing.JCheckBox();
- chkGuestLogin = new javax.swing.JCheckBox();
- lblLoginMode = new javax.swing.JLabel();
- comboLoginMode = new javax.swing.JComboBox();
- pnlToolbar = new javax.swing.JPanel();
- btnOK = new javax.swing.JButton();
- btnCancel = new javax.swing.JButton();
- lblLogin = new javax.swing.JLabel();
-
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- pnlLoginInfo.setLayout(new java.awt.GridBagLayout());
-
- lblHost.setText("Host:");
- lblHost.setMaximumSize(new java.awt.Dimension(40, 14));
- lblHost.setMinimumSize(new java.awt.Dimension(30, 14));
- lblHost.setPreferredSize(null);
- lblHost.setRequestFocusEnabled(false);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
- pnlLoginInfo.add(lblHost, gridBagConstraints);
-
- txtHost.setColumns(30);
- txtHost.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtHost, gridBagConstraints);
-
- lblPort.setText("Port:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
- pnlLoginInfo.add(lblPort, gridBagConstraints);
-
- txtPort.setColumns(30);
- txtPort.setText("1247");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtPort, gridBagConstraints);
-
- lblZone.setText("Zone:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblZone, gridBagConstraints);
-
- txtZone.setColumns(30);
- txtZone.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtZone, gridBagConstraints);
-
- lblResource.setText("Resource:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblResource, gridBagConstraints);
-
- txtResource.setColumns(30);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtResource, gridBagConstraints);
-
- lblUserName.setText("User Name:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 5;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblUserName, gridBagConstraints);
-
- txtUserName.setColumns(30);
- txtUserName.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 5;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(txtUserName, gridBagConstraints);
-
- lblPassword.setText("Password:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
- pnlLoginInfo.add(lblPassword, gridBagConstraints);
-
- password.setColumns(30);
- password.setPreferredSize(null);
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- pnlLoginInfo.add(password, gridBagConstraints);
-
- chkAdvancedLogin.setText("Advanced Login Settings");
- chkAdvancedLogin.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- chkAdvancedLoginActionPerformed(evt);
- }
- });
- jPanel1.add(chkAdvancedLogin);
-
- chkGuestLogin.setText("Login As Guest");
- chkGuestLogin.setToolTipText("Use a guest login");
- chkGuestLogin.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- chkGuestLoginActionPerformed(evt);
- }
- });
- jPanel1.add(chkGuestLogin);
-
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 8;
- pnlLoginInfo.add(jPanel1, gridBagConstraints);
-
- lblLoginMode.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
- lblLoginMode.setText("Login Mode:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 7;
- pnlLoginInfo.add(lblLoginMode, gridBagConstraints);
-
- comboLoginMode.setModel(new javax.swing.DefaultComboBoxModel(
- new String[] { "Standard", "PAM" }));
- comboLoginMode.setToolTipText("Authentication mode used at login");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 7;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
- pnlLoginInfo.add(comboLoginMode, gridBagConstraints);
-
- getContentPane().add(pnlLoginInfo, java.awt.BorderLayout.CENTER);
-
- pnlToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT,
- 2, 5));
-
- btnOK.setMnemonic('L');
- btnOK.setText("Login");
- btnOK.setMaximumSize(new java.awt.Dimension(100, 100));
- btnOK.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- btnOKActionPerformed(evt);
- }
- });
- pnlToolbar.add(btnOK);
-
- btnCancel.setMnemonic('c');
- btnCancel.setText("Cancel");
- btnCancel.setMaximumSize(new java.awt.Dimension(100, 100));
- btnCancel.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(final java.awt.event.ActionEvent evt) {
- btnCancelActionPerformed(evt);
- }
- });
- pnlToolbar.add(btnCancel);
-
- getContentPane().add(pnlToolbar, java.awt.BorderLayout.SOUTH);
-
- lblLogin.setText("Please log in to your iDrop data grid");
- getContentPane().add(lblLogin, java.awt.BorderLayout.PAGE_START);
-
- pack();
- }// </editor-fold>//GEN-END:initComponents
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ pnlLoginInfo = new javax.swing.JPanel();
+ lblHost = new javax.swing.JLabel();
+ txtHost = new javax.swing.JTextField();
+ lblPort = new javax.swing.JLabel();
+ txtPort = new javax.swing.JTextField();
+ lblZone = new javax.swing.JLabel();
+ txtZone = new javax.swing.JTextField();
+ lblResource = new javax.swing.JLabel();
+ txtResource = new javax.swing.JTextField();
+ lblUserName = new javax.swing.JLabel();
+ txtUserName = new javax.swing.JTextField();
+ lblPassword = new javax.swing.JLabel();
+ password = new javax.swing.JPasswordField();
+ jPanel1 = new javax.swing.JPanel();
+ chkAdvancedLogin = new javax.swing.JCheckBox();
+ chkGuestLogin = new javax.swing.JCheckBox();
+ chkRememberPass = new javax.swing.JCheckBox();
+ lblLoginMode = new javax.swing.JLabel();
+ comboLoginMode = new javax.swing.JComboBox();
+ pnlToolbar = new javax.swing.JPanel();
+ btnOK = new javax.swing.JButton();
+ btnCancel = new javax.swing.JButton();
+ lblLogin = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ pnlLoginInfo.setLayout(new java.awt.GridBagLayout());
+
+ lblHost.setText("Host:");
+ lblHost.setMaximumSize(new java.awt.Dimension(40, 14));
+ lblHost.setMinimumSize(new java.awt.Dimension(30, 14));
+ lblHost.setPreferredSize(null);
+ lblHost.setRequestFocusEnabled(false);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ pnlLoginInfo.add(lblHost, gridBagConstraints);
+
+ txtHost.setColumns(30);
+ txtHost.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtHost, gridBagConstraints);
+
+ lblPort.setText("Port:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ pnlLoginInfo.add(lblPort, gridBagConstraints);
+
+ txtPort.setColumns(30);
+ txtPort.setText("1247");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtPort, gridBagConstraints);
+
+ lblZone.setText("Zone:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 3;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblZone, gridBagConstraints);
+
+ txtZone.setColumns(30);
+ txtZone.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 3;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtZone, gridBagConstraints);
+
+ lblResource.setText("Resource:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 4;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblResource, gridBagConstraints);
+
+ txtResource.setColumns(30);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 4;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtResource, gridBagConstraints);
+
+ lblUserName.setText("User Name:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 5;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblUserName, gridBagConstraints);
+
+ txtUserName.setColumns(30);
+ txtUserName.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 5;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(txtUserName, gridBagConstraints);
+
+ lblPassword.setText("Password:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 6;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ pnlLoginInfo.add(lblPassword, gridBagConstraints);
+
+ password.setColumns(30);
+ password.setPreferredSize(null);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 6;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlLoginInfo.add(password, gridBagConstraints);
+
+ chkAdvancedLogin.setText("Advanced Login Settings");
+ chkAdvancedLogin.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkAdvancedLoginActionPerformed(evt);
+ }
+ });
+ jPanel1.add(chkAdvancedLogin);
+
+ chkGuestLogin.setText("Login As Guest");
+ chkGuestLogin.setToolTipText("Use a guest login");
+ chkGuestLogin.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkGuestLoginActionPerformed(evt);
+ }
+ });
+ jPanel1.add(chkGuestLogin);
+
+ chkRememberPass.setText("Remember password");
+ chkRememberPass.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkRememberPassActionPerformed(evt);
+ }
+ });
+ jPanel1.add(chkRememberPass);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 8;
+ pnlLoginInfo.add(jPanel1, gridBagConstraints);
+
+ lblLoginMode.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+ lblLoginMode.setText("Login Mode:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 7;
+ pnlLoginInfo.add(lblLoginMode, gridBagConstraints);
+
+ comboLoginMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Standard", "PAM" }));
+ comboLoginMode.setToolTipText("Authentication mode used at login");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 7;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ pnlLoginInfo.add(comboLoginMode, gridBagConstraints);
+
+ getContentPane().add(pnlLoginInfo, java.awt.BorderLayout.CENTER);
+
+ pnlToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 2, 5));
+
+ btnOK.setMnemonic('L');
+ btnOK.setText("Login");
+ btnOK.setMaximumSize(new java.awt.Dimension(100, 100));
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+ pnlToolbar.add(btnOK);
+
+ btnCancel.setMnemonic('c');
+ btnCancel.setText("Cancel");
+ btnCancel.setMaximumSize(new java.awt.Dimension(100, 100));
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ pnlToolbar.add(btnCancel);
+
+ getContentPane().add(pnlToolbar, java.awt.BorderLayout.SOUTH);
+
+ lblLogin.setText("Please log in to your iDrop data grid");
+ getContentPane().add(lblLogin, java.awt.BorderLayout.PAGE_START);
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void chkRememberPassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkRememberPassActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_chkRememberPassActionPerformed
private void chkAdvancedLoginActionPerformed(
final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_chkAdvancedLoginActionPerformed
@@ -539,32 +564,31 @@ public class LoginDialog extends JDialog {
private void btnCancelActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnCancelActionPerformed
dispose();
}// GEN-LAST:event_btnCancelActionPerformed
- // Variables declaration - do not modify//GEN-BEGIN:variables
-
- private javax.swing.JButton btnCancel;
- private javax.swing.JButton btnOK;
- private javax.swing.JCheckBox chkAdvancedLogin;
- private javax.swing.JCheckBox chkGuestLogin;
- private javax.swing.JComboBox comboLoginMode;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JLabel lblHost;
- private javax.swing.JLabel lblLogin;
- private javax.swing.JLabel lblLoginMode;
- private javax.swing.JLabel lblPassword;
- private javax.swing.JLabel lblPort;
- private javax.swing.JLabel lblResource;
- private javax.swing.JLabel lblUserName;
- private javax.swing.JLabel lblZone;
- private javax.swing.JPasswordField password;
- private javax.swing.JPanel pnlLoginInfo;
- private javax.swing.JPanel pnlToolbar;
- private javax.swing.JTextField txtHost;
- private javax.swing.JTextField txtPort;
- private javax.swing.JTextField txtResource;
- private javax.swing.JTextField txtUserName;
- private javax.swing.JTextField txtZone;
-
- // End of variables declaration//GEN-END:variables
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnCancel;
+ private javax.swing.JButton btnOK;
+ private javax.swing.JCheckBox chkAdvancedLogin;
+ private javax.swing.JCheckBox chkGuestLogin;
+ private javax.swing.JCheckBox chkRememberPass;
+ private javax.swing.JComboBox comboLoginMode;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JLabel lblHost;
+ private javax.swing.JLabel lblLogin;
+ private javax.swing.JLabel lblLoginMode;
+ private javax.swing.JLabel lblPassword;
+ private javax.swing.JLabel lblPort;
+ private javax.swing.JLabel lblResource;
+ private javax.swing.JLabel lblUserName;
+ private javax.swing.JLabel lblZone;
+ private javax.swing.JPasswordField password;
+ private javax.swing.JPanel pnlLoginInfo;
+ private javax.swing.JPanel pnlToolbar;
+ private javax.swing.JTextField txtHost;
+ private javax.swing.JTextField txtPort;
+ private javax.swing.JTextField txtResource;
+ private javax.swing.JTextField txtUserName;
+ private javax.swing.JTextField txtZone;
+ // End of variables declaration//GEN-END:variables
private void showAdvancedViewFields() {
txtResource.setVisible(true);
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index e21fb60..d654040 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -166,7 +166,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
IRODSAccount savedAccount = iDropCore.getIrodsAccount();
iDropCore.setIrodsAccount(null);
- LoginDialog loginDialog = new LoginDialog(null, iDropCore);
+ LoginDialog loginDialog = new LoginDialog(null, iDropCore);
loginDialog.setLocationRelativeTo(null);
loginDialog.setVisible(true);
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
index a7a98f5..92efe86 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -33,6 +33,8 @@ public interface IdropConfigurationService {
public static final String ACCOUNT_CACHE_ZONE = "irods.account.zone";
public static final String ACCOUNT_CACHE_RESOURCE = "irods.account.resource";
public static final String ACCOUNT_CACHE_USER_NAME = "irods.account.user";
+ public static final String ACCOUNT_CACHE_USER_PASSWORD = "irods.account.password";
+ public static final String ACCOUNT_CACHE_USER_SAVE_PASS = "irods.account.savepassword";
public static final String ACCOUNT_CACHE_ROOT_DIR = "irods.account.root.dir";
public static final String ACCOUNT_CACHE_LOGIN_MODE = "irods.account.login.mode";
public static final String POLICY_AWARE_PROPERTY = "policy.aware";
@@ -88,7 +90,7 @@ public interface IdropConfigurationService {
* {@link IRODSAccount} to be cached
* @throws IdropException
*/
- void saveLogin(final IRODSAccount irodsAccount) throws IdropException;
+ void saveLogin(final IRODSAccount irodsAccount, boolean savePassword) throws IdropException;
void removeConfigProperty(final String key) throws IdropException;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
index e65e245..342e24a 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
@@ -99,7 +99,7 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
throw new IdropException(ex);
}
- }
+ }
log.debug("properties from database:{}", databaseProperties);
if (databaseProperties.isEmpty()) {
@@ -250,7 +250,7 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
}
@Override
- public void saveLogin(final IRODSAccount irodsAccount)
+ public void saveLogin(final IRODSAccount irodsAccount, boolean savePassword)
throws IdropException {
log.info("save login");
if (irodsAccount == null) {
@@ -272,6 +272,17 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
irodsAccount.getUserName());
updateConfig(IdropConfigurationService.ACCOUNT_CACHE_LOGIN_MODE,
irodsAccount.getAuthenticationScheme().name());
+ if(savePassword){
+ updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
+ irodsAccount.getPassword());
+ updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
+ "true");
+ }else{
+ updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
+ "");
+ updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
+ "false");
+ }
log.info("config updated");
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
index c2d1dc7..5a5d516 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java
@@ -1,5 +1,5 @@
package org.irods.jargon.idrop.desktop.systraygui.utils;
public final class Version {
public static String VERSION="2.0.1-SNAPSHOT";
- public static String BUILD_TIME="20130605-1641";
+ public static String BUILD_TIME="20130731-1333";
}