Fixed bug in new-account, added error dialogs.
[FinalKeyGui.git] / src / fkgui / TriggerDialog.java
index 48e22a7..cb0108e 100644 (file)
@@ -1,12 +1,5 @@
 package fkgui;
 
-import java.awt.Color;
-import java.io.Closeable;
-
-import javax.swing.JFrame;
-import javax.swing.JTextField;
-
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.widgets.Dialog;
 import org.eclipse.swt.widgets.Display;
@@ -246,10 +239,16 @@ public class TriggerDialog extends Dialog implements FkActionEventListener {
 
        }
 
+       @SuppressWarnings("incomplete-switch")
        @Override
        public void fkActionEvent(FkActionEvent event) {
                MessageBox dialog;
                
+               if( shell.isDisposed() )
+               {
+                       return;
+               }
+               
                if( permitCountdownDialog != null && !permitCountdownDialog.shell.isDisposed() )
                {
                        permitCountdownDialog.shell.close();
@@ -257,6 +256,12 @@ public class TriggerDialog extends Dialog implements FkActionEventListener {
                
                switch(event.type)
                {
+               case STATE_ERROR:
+                       dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
+                       dialog.setText(Messages.TriggerDialog_5);
+                       dialog.setMessage(Messages.TriggerDialog_9);
+                       dialog.open();                  
+               break;
                case ACTION_ABORTED:
                        dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
                        dialog.setText(event.acc.name);
@@ -303,13 +308,10 @@ public class TriggerDialog extends Dialog implements FkActionEventListener {
                                        
                                } );
                        }
-                       
-                       if( !shell.isDisposed() )
-                       {
-                               shell.close();
-                       }                       
+                       shell.close();
                        break;
-               }
+               } //Switch
+