Fix crashbug and tweaked UI. 0.1.2-rc0
authorJimmy Christensen <dusted@dusted.dk>
Thu, 18 Sep 2014 09:21:24 +0000 (12:21 +0300)
committerJimmy Christensen <dusted@dusted.dk>
Thu, 18 Sep 2014 09:21:24 +0000 (12:21 +0300)
src/fkgui/MainWin.java
src/fkgui/SerialWorker.java

index 947f860..d1736aa 100644 (file)
@@ -430,7 +430,7 @@ public class MainWin implements ConsoleMsg, UpdateCheckResultListener {
                lblPassword.setAlignment(SWT.RIGHT);
                FormData fd_lblPassword = new FormData();
                fd_lblPassword.right = new FormAttachment(0, 95);
-               fd_lblPassword.top = new FormAttachment(0, 29);
+               fd_lblPassword.top = new FormAttachment(txtPsw, 0, SWT.CENTER);
                fd_lblPassword.left = new FormAttachment(0, 10);
                lblPassword.setLayoutData(fd_lblPassword);
                lblPassword.setText(Messages.MainWin_18);
@@ -685,6 +685,7 @@ public class MainWin implements ConsoleMsg, UpdateCheckResultListener {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                NewAccountDialog dialog = new NewAccountDialog(shell, shell.getStyle() );
+                               btnOpenAccount.setEnabled(false);
                                shell.setEnabled(false);
                                dialog.open();
                                shell.setEnabled(true);
@@ -998,7 +999,6 @@ public class MainWin implements ConsoleMsg, UpdateCheckResultListener {
                btnShowaccountsReady.addSelectionListener( new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                                prefs.putBoolean( PREF_SHOW_ACCOUNTS_READY_NOTICE, btnShowaccountsReady.getSelection() );
-                               checkForUpdates();
                        }
                });
 
@@ -1068,7 +1068,7 @@ public class MainWin implements ConsoleMsg, UpdateCheckResultListener {
                                        }
                                }
                        } else {
-                               log("\nNot visiting the website.");
+                               log(Messages.MainWin_11);
                        }
 
                        break;
index 96aba14..1675503 100644 (file)
@@ -111,7 +111,6 @@ public class SerialWorker extends javax.swing.SwingWorker<Void, String> implemen
                 * 
                 */
                
-               int numAccounts=0;
                try {
                        serialPort.openPort();
                        serialPort.setParams(9600, 8, 1, 0);
@@ -261,7 +260,7 @@ public class SerialWorker extends javax.swing.SwingWorker<Void, String> implemen
                        accounts = accounts.substring(3);
 
                        String[] lines = accounts.split( "\r\n" ); //$NON-NLS-1$
-                       numAccounts=lines.length;
+
                        Boolean kbList=false;
                        for(String l:lines)
                        {
@@ -301,11 +300,11 @@ public class SerialWorker extends javax.swing.SwingWorker<Void, String> implemen
                if( state != SerialState.Disconnected )
                {
                        publish(""); //$NON-NLS-1$
-                       if(numAccounts==1)
+                       if( FkManager.getInstance().getList().size()==1 )
                        {
-                               publish(numAccounts+Messages.SerialWorker_35);
+                               publish(Messages.SerialWorker_35);
                        } else {
-                               publish(numAccounts+Messages.SerialWorker_36);
+                               publish(FkManager.getInstance().getList().size()+Messages.SerialWorker_36);
                        }
 
                        state = SerialState.Connected;