55import fi .helsinki .cs .tmc .coreimpl .TmcCoreSettingsImpl ;
66
77import com .google .common .base .Optional ;
8+ import fi .helsinki .cs .tmc .utilities .LoginListener ;
89
910import org .openide .windows .WindowManager ;
1011
1617
1718public class LoginDialog extends javax .swing .JDialog {
1819
19- public static void display (ActionListener onOk , final Runnable onClosed ) {
20+ public static void display (LoginListener onOk , final Runnable onClosed ) {
2021 LoginDialog dialog = new LoginDialog (onOk );
2122 dialog .setLocationRelativeTo (null );
2223 dialog .setVisible (true );
@@ -29,13 +30,13 @@ public void windowClosed(WindowEvent e) {
2930 }
3031
3132 private TmcCoreSettingsImpl settings ;
32- private ActionListener onLogin ;
33+ private LoginListener onLogin ;
3334 private static boolean visible ;
3435
3536 /**
3637 * Creates new form LoginForm
3738 */
38- public LoginDialog (ActionListener onLogin ) {
39+ public LoginDialog (LoginListener onLogin ) {
3940 super (WindowManager .getDefault ().getMainWindow (), false );
4041 initComponents ();
4142
@@ -222,9 +223,8 @@ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
222223
223224 private void loginButtonActionPerformed (java .awt .event .ActionEvent evt ) {//GEN-FIRST:event_loginButtonActionPerformed
224225 settings .setUsername (usernameField .getText ());
225- settings .setPassword (Optional .of (new String (passwordField .getPassword ())));
226226 settings .save ();
227-
227+ onLogin . setPassword ( new String ( passwordField . getPassword ()));
228228 onLogin .actionPerformed (evt );
229229
230230 this .setVisible (false );
0 commit comments