From 9c696344683332400000e40c2c54dc98e98d947b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 28 Sep 2008 22:44:27 +0000 Subject: Client: Completed steps 3, 4 and 5 Refs #63 --- .../fourisland/instadisc/ChangePasswordForm.java | 2 +- .../instadisc/FirstRun/FirstRunWizard.java | 13 +- .../com/fourisland/instadisc/FirstRun/Step1.form | 28 ++- .../com/fourisland/instadisc/FirstRun/Step1.java | 31 +++- .../com/fourisland/instadisc/FirstRun/Step2.form | 53 +++--- .../com/fourisland/instadisc/FirstRun/Step2.java | 60 ++++--- .../com/fourisland/instadisc/FirstRun/Step2A.form | 139 +++++++++++++++ .../com/fourisland/instadisc/FirstRun/Step2A.java | 191 +++++++++++++++++++++ .../instadisc/FirstRun/StepEndResults.java | 1 + .../instadisc/FirstRun/resources/Step1.properties | 5 +- .../instadisc/FirstRun/resources/Step2.properties | 5 +- .../FirstRun/resources/Step2_1.properties | 11 ++ .../src/com/fourisland/instadisc/Item/MD5.java | 55 ------ .../instadisc/Item/SubscriptionFile.java | 1 + .../fourisland/instadisc/Item/Verification.java | 1 + .../fourisland/instadisc/Item/WellFormedItem.java | 1 + client/trunk/src/com/fourisland/instadisc/MD5.java | 56 ++++++ 17 files changed, 528 insertions(+), 125 deletions(-) create mode 100644 client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.form create mode 100644 client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java create mode 100644 client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2_1.properties delete mode 100644 client/trunk/src/com/fourisland/instadisc/Item/MD5.java create mode 100644 client/trunk/src/com/fourisland/instadisc/MD5.java (limited to 'client') diff --git a/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.java b/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.java index 8af46ff..2a071fb 100644 --- a/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.java +++ b/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.java @@ -7,7 +7,7 @@ package com.fourisland.instadisc; import com.fourisland.instadisc.Database.Wrapper; -import com.fourisland.instadisc.Item.MD5; +import com.fourisland.instadisc.MD5; /** * diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/FirstRunWizard.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/FirstRunWizard.java index 713cc83..1a9c6ec 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/FirstRunWizard.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/FirstRunWizard.java @@ -7,6 +7,7 @@ package com.fourisland.instadisc.FirstRun; import com.fourisland.instadisc.Database.Wrapper; import com.fourisland.instadisc.DownloadItem.DownloadItemModeTest; +import javax.swing.JDialog; import javax.swing.JFrame; /** @@ -22,7 +23,15 @@ public class FirstRunWizard implements Runnable { if (StepEndResults.ok) { StepEndResults.ok = false; - Step2 s2 = new Step2(new JFrame(), true); + JDialog s2; + + if (StepEndResults.hasAccount) + { + s2 = new Step2(new JFrame(), true); + } else { + s2 = new Step2A(new JFrame(), true); + } + s2.setVisible(true); if (StepEndResults.ok) { @@ -43,6 +52,8 @@ public class FirstRunWizard implements Runnable { Wrapper.setConfig("ipCheckUnit", "day"); Wrapper.setConfig("useUnreadFlag", "true"); } + } else { + run(); } } System.exit(0); diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form index b33a49c..d515313 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form @@ -22,11 +22,6 @@ - - - - - @@ -38,6 +33,13 @@ + + + + + + + @@ -48,8 +50,11 @@ - - + + + + + @@ -77,5 +82,14 @@ + + + + + + + + + diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java index e96b275..ed664c0 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java @@ -29,6 +29,7 @@ public class Step1 extends javax.swing.JDialog { jLabel1 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); + jButton2 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setName("Form"); // NOI18N @@ -49,14 +50,18 @@ public class Step1 extends javax.swing.JDialog { jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N jLabel3.setName("jLabel3"); // NOI18N + jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N + jButton2.setName("jButton2"); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(448, Short.MAX_VALUE) - .addComponent(jButton1) - .addContainerGap()) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -65,6 +70,12 @@ public class Step1 extends javax.swing.JDialog { .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 466, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel1)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(198, Short.MAX_VALUE) + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1) + .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -74,7 +85,9 @@ public class Step1 extends javax.swing.JDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) .addContainerGap()) ); @@ -83,8 +96,15 @@ public class Step1 extends javax.swing.JDialog { private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed StepEndResults.ok = true; + StepEndResults.hasAccount = false; this.setVisible(false); }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + StepEndResults.ok = true; + StepEndResults.hasAccount = true; + this.setVisible(false); + }//GEN-LAST:event_jButton2ActionPerformed /** * @param args the command line arguments @@ -105,6 +125,7 @@ public class Step1 extends javax.swing.JDialog { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel3; // End of variables declaration//GEN-END:variables diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form index ce8ae5c..6f928c4 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form @@ -26,32 +26,30 @@ + + + + - + - - + - - + + + + + + + - - - - - - - - - - @@ -64,7 +62,7 @@ - + @@ -74,10 +72,10 @@ - - - - + + + + @@ -110,12 +108,6 @@ - - - - - - @@ -137,5 +129,14 @@ + + + + + + + + + diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java index 85180ee..59f82c0 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java @@ -6,7 +6,7 @@ package com.fourisland.instadisc.FirstRun; import com.fourisland.instadisc.Database.Wrapper; -import com.fourisland.instadisc.Item.MD5; +import com.fourisland.instadisc.MD5; import com.fourisland.instadisc.XmlRpc; /** @@ -33,10 +33,10 @@ public class Step2 extends javax.swing.JDialog { jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); jPasswordField1 = new javax.swing.JPasswordField(); + jButton2 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setName("Form"); // NOI18N @@ -55,9 +55,6 @@ public class Step2 extends javax.swing.JDialog { jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N jLabel3.setName("jLabel3"); // NOI18N - jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N - jLabel5.setName("jLabel5"); // NOI18N - jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N jButton1.setName("jButton1"); // NOI18N jButton1.addActionListener(new java.awt.event.ActionListener() { @@ -72,6 +69,14 @@ public class Step2 extends javax.swing.JDialog { jPasswordField1.setText(resourceMap.getString("jPasswordField1.text")); // NOI18N jPasswordField1.setName("jPasswordField1"); // NOI18N + jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N + jButton2.setName("jButton2"); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -80,25 +85,23 @@ public class Step2 extends javax.swing.JDialog { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() + .addComponent(jLabel1)) + .addGroup(layout.createSequentialGroup() + .addGap(24, 24, 24) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() - .addGap(12, 12, 12) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel3)) - .addGap(66, 66, 66) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) - .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE))))) - .addGroup(layout.createSequentialGroup() - .addGap(24, 24, 24) - .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1)) + .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE) + .addComponent(jPasswordField1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)))))) .addContainerGap()) ); layout.setVerticalGroup( @@ -108,7 +111,7 @@ public class Step2 extends javax.swing.JDialog { .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -116,10 +119,10 @@ public class Step2 extends javax.swing.JDialog { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(17, 17, 17) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) - .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jButton2)) .addContainerGap()) ); @@ -127,10 +130,10 @@ public class Step2 extends javax.swing.JDialog { }// //GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed if (jTextField1.getText().equals("")) { - jLabel5.setText("Error: You forgot to enter a username"); + jLabel2.setText("Error: You forgot to enter a username"); } else { if (jPasswordField1.getPassword().length == 0) { - jLabel5.setText("Error: You forgot to enter a password"); + jLabel2.setText("Error: You forgot to enter a password"); } else { MD5 md5 = new MD5(jPasswordField1.getPassword()); String password = md5.hash(); @@ -140,7 +143,7 @@ public class Step2 extends javax.swing.JDialog { if (r == 1) { - jLabel5.setText("Error: Couldn't find the specified user."); + jLabel2.setText("Error: Couldn't find the specified user."); } else { Wrapper.setConfig("username", jTextField1.getText()); Wrapper.setConfig("password", password); @@ -152,6 +155,11 @@ public class Step2 extends javax.swing.JDialog { } }//GEN-LAST:event_jButton1ActionPerformed + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + StepEndResults.ok = false; + setVisible(false); + }//GEN-LAST:event_jButton2ActionPerformed + /** * @param args the command line arguments */ @@ -172,10 +180,10 @@ public class Step2 extends javax.swing.JDialog { } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JPasswordField jPasswordField1; private javax.swing.JTextField jTextField1; diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.form b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.form new file mode 100644 index 0000000..ff8fd3e --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.form @@ -0,0 +1,139 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java new file mode 100644 index 0000000..c027ef6 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java @@ -0,0 +1,191 @@ +/* + * Step2.java + * + * Created on July 28, 2008, 4:18 PM + */ +package com.fourisland.instadisc.FirstRun; + +import com.fourisland.instadisc.Database.Wrapper; +import com.fourisland.instadisc.MD5; +import com.fourisland.instadisc.XmlRpc; + +/** + * + * @author hatkirby + */ +public class Step2A extends javax.swing.JDialog { + + /** Creates new form Step2 */ + public Step2A(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jPasswordField1 = new javax.swing.JPasswordField(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setName("Form"); // NOI18N + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.fourisland.instadisc.InstaDiscApp.class).getContext().getResourceMap(Step2A.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N + jLabel2.setName("jLabel2"); // NOI18N + + jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N + jLabel3.setName("jLabel3"); // NOI18N + + jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N + jLabel4.setName("jLabel4"); // NOI18N + + jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N + jTextField1.setName("jTextField1"); // NOI18N + + jPasswordField1.setText(resourceMap.getString("jPasswordField1.text")); // NOI18N + jPasswordField1.setName("jPasswordField1"); // NOI18N + + jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N + jButton1.setName("jButton1"); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N + jButton2.setName("jButton2"); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addGroup(layout.createSequentialGroup() + .addGap(12, 12, 12) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + if (jTextField1.getText().equals("")) { + jLabel2.setText("Error: You forgot to enter a username"); + } else { + if (jPasswordField1.getPassword().length == 0) { + jLabel2.setText("Error: You forgot to enter a password"); + } else { + MD5 md5 = new MD5(jPasswordField1.getPassword()); + String password = md5.hash(); + + XmlRpc xmlrpc = new XmlRpc("createUser", jTextField1.getText(), password); + String usr = (String) xmlrpc.execute(); + + if (!usr.equals(jTextField1.getText())) + { + jLabel2.setText("Error: The specified username is already taken. Why don't you try: " + usr); + } else { + Wrapper.setConfig("username", jTextField1.getText()); + Wrapper.setConfig("password", password); + + StepEndResults.ok = true; + this.setVisible(false); + } + } + } + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + StepEndResults.ok = false; + setVisible(false); + }//GEN-LAST:event_jButton2ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + + public void run() { + Step2 dialog = new Step2(new javax.swing.JFrame(), true); + dialog.addWindowListener(new java.awt.event.WindowAdapter() { + + public void windowClosing(java.awt.event.WindowEvent e) { + System.exit(0); + } + }); + dialog.setVisible(true); + } + }); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JPasswordField jPasswordField1; + private javax.swing.JTextField jTextField1; + // End of variables declaration//GEN-END:variables +} diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/StepEndResults.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/StepEndResults.java index ccdd4b9..b4b4d7a 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/StepEndResults.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/StepEndResults.java @@ -12,5 +12,6 @@ package com.fourisland.instadisc.FirstRun; public class StepEndResults { public static boolean ok = false; + public static boolean hasAccount = false; } diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step1.properties b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step1.properties index fb9ecf0..bfc7213 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step1.properties +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step1.properties @@ -1,5 +1,6 @@ jLabel1.text=Welcome to the InstaDisc FirstRun Wizard! #NOI18N jLabel1.font=DejaVu Sans-Plain-18 -jButton1.text=Next -jLabel3.text=This is, apparently, the first time you've run InstaDisc, so you need to step through me before being able to use InstaDisc.

First, ensure that you've chosen and signed up for a Central Server. If you haven't, or don't even know what that means, please read Choosing a Central Server before continuing. If you do know what you're doing, feel free to click on the NEXT button and get on with InstaDisc. +jButton1.text=I don't have an account +jLabel3.text=This is, apparently, the first time you've run InstaDisc, so you need to step through me before being able to use InstaDisc.

To use InstaDisc, you need an account. Have you ever used InstaDisc before, perhaps on a different computer? If so, then you already have an account, otherwise, we need to make one now. Choose the button that suits you: +jButton2.text=I have an account diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2.properties b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2.properties index 9adb0b8..aa0d075 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2.properties +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2.properties @@ -4,7 +4,8 @@ jLabel1.font=DejaVu Sans-Plain-18 jLabel2.text=Username: jTextField1.text= jLabel3.text=Password: -jLabel5.text= jButton1.text=Next -jLabel6.text=To use InstaDisc, you must have signed up for the Four Island InstaDisc Central Server. Please input your member details here. +jLabel6.text=If you already have an InstaDisc account, you can enter your details here. Otherwise, go back and click "I don't have an account" jPasswordField1.text= +jButton2.text=Back +jLabel4.text=jLabel4 diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2_1.properties b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2_1.properties new file mode 100644 index 0000000..65a8a60 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2_1.properties @@ -0,0 +1,11 @@ + +jLabel1.text=Central Server Details +#NOI18N +jLabel1.font=DejaVu Sans-Plain-18 +jLabel2.text=If you don't have an InstaDisc account yet, you can make one here. If you do, though, go back and click "I have an account" +jLabel3.text=Username: +jLabel4.text=Password: +jTextField1.text= +jPasswordField1.text= +jButton1.text=Next +jButton2.text=Back diff --git a/client/trunk/src/com/fourisland/instadisc/Item/MD5.java b/client/trunk/src/com/fourisland/instadisc/Item/MD5.java deleted file mode 100644 index 31a7a5c..0000000 --- a/client/trunk/src/com/fourisland/instadisc/Item/MD5.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package com.fourisland.instadisc.Item; - -import com.fourisland.instadisc.Functions; -import java.security.MessageDigest; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author hatkirby - */ -public class MD5 { - - String ver; - - public MD5(String ver) { - this.ver = ver; - } - - public MD5(char[] password) { - int i=0; - ver=""; - for (i=0;i