mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Use server and port specified in ConnectDialog rather than in the preference.
This commit is contained in:
parent
cb050c3208
commit
f5765383c7
3 changed files with 20 additions and 8 deletions
|
@ -97,10 +97,10 @@ public class ConnectDialog extends MageDialog {
|
|||
this.txtUserName.addActionListener(connectAction);
|
||||
this.txtPassword.addActionListener(connectAction);
|
||||
|
||||
registerUserDialog = new RegisterUserDialog();
|
||||
registerUserDialog = new RegisterUserDialog(this);
|
||||
MageFrame.getDesktop().add(registerUserDialog, JLayeredPane.POPUP_LAYER);
|
||||
|
||||
resetPasswordDialog = new ResetPasswordDialog();
|
||||
resetPasswordDialog = new ResetPasswordDialog(this);
|
||||
MageFrame.getDesktop().add(resetPasswordDialog, JLayeredPane.POPUP_LAYER);
|
||||
}
|
||||
|
||||
|
@ -587,6 +587,14 @@ public class ConnectDialog extends MageDialog {
|
|||
resetPasswordDialog.showDialog();
|
||||
}//GEN-LAST:event_btnForgotPasswordActionPerformed
|
||||
|
||||
public String getServer() {
|
||||
return this.txtServer.getText();
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return this.txtPort.getText();
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnCancel;
|
||||
private javax.swing.JButton btnConnect;
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.apache.log4j.Logger;
|
|||
public class RegisterUserDialog extends MageDialog {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ConnectDialog.class);
|
||||
private ConnectDialog connectDialog;
|
||||
private Connection connection;
|
||||
private ConnectTask task;
|
||||
private Session session;
|
||||
|
@ -22,13 +23,14 @@ public class RegisterUserDialog extends MageDialog {
|
|||
/**
|
||||
* Creates new form RegisterUserDialog
|
||||
*/
|
||||
public RegisterUserDialog() {
|
||||
public RegisterUserDialog(ConnectDialog connectDialog) {
|
||||
initComponents();
|
||||
this.connectDialog = connectDialog;
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
this.txtServer.setText(MageFrame.getPreferences().get("serverAddress", Config.serverName));
|
||||
this.txtPort.setText(MageFrame.getPreferences().get("serverPort", Integer.toString(Config.port)));
|
||||
this.txtServer.setText(this.connectDialog.getServer());
|
||||
this.txtPort.setText(this.connectDialog.getPort());
|
||||
this.lblStatus.setText("");
|
||||
|
||||
this.setModal(true);
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.apache.log4j.Logger;
|
|||
public class ResetPasswordDialog extends MageDialog {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ResetPasswordDialog.class);
|
||||
private ConnectDialog connectDialog;
|
||||
private Connection connection;
|
||||
private Session session;
|
||||
private GetAuthTokenTask getAuthTokenTask;
|
||||
|
@ -23,13 +24,14 @@ public class ResetPasswordDialog extends MageDialog {
|
|||
/**
|
||||
* Creates new form ResetPasswordDialog
|
||||
*/
|
||||
public ResetPasswordDialog() {
|
||||
public ResetPasswordDialog(ConnectDialog connectDialog) {
|
||||
initComponents();
|
||||
this.connectDialog = connectDialog;
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
this.txtServer.setText(MageFrame.getPreferences().get("serverAddress", Config.serverName));
|
||||
this.txtPort.setText(MageFrame.getPreferences().get("serverPort", Integer.toString(Config.port)));
|
||||
this.txtServer.setText(this.connectDialog.getServer());
|
||||
this.txtPort.setText(this.connectDialog.getPort());
|
||||
this.lblStatus.setText("");
|
||||
|
||||
this.setModal(true);
|
||||
|
|
Loading…
Reference in a new issue