Revert "JAL-2852 added framework for saving as EPS file"
[jalview.git] / forester / java / src / org / forester / archaeopteryx / MainFrameApplication.java
index 2c9b585..07984fc 100644 (file)
@@ -304,10 +304,12 @@ public final class MainFrameApplication extends MainFrame {
         //        } );
         // The window listener
         setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
         addInternalFrameListener( new InternalFrameAdapter() {
 
             @Override
             public void internalFrameClosing( final InternalFrameEvent e ) {
+                if (MainFrameApplication.this.getParent() == null) {
                 if ( isUnsavedDataPresent() ) {
                     final int r = JOptionPane.showConfirmDialog( _mainpanel,
                                                                  "Close Archaeopteryx despite potentially unsaved changes?",
@@ -317,16 +319,16 @@ public final class MainFrameApplication extends MainFrame {
                         return;
                     }
                 }
-//                else {
-//                    final int r = JOptionPane
-//                            .showConfirmDialog( null, "Exit Archaeopteryx?", "Exit?", JOptionPane.YES_NO_OPTION );
-//                    if ( r != JOptionPane.YES_OPTION ) {
-//                        return;
-//                    }
-//                }
+                else {
+                    final int r = JOptionPane
+                            .showConfirmDialog( null, "Exit Archaeopteryx?", "Exit?", JOptionPane.YES_NO_OPTION );
+                    if ( r != JOptionPane.YES_OPTION ) {
+                        return;
+                    }
+                }}
                 exit();
-            }
-        } );
+            
+        } });
         // The component listener
         addComponentListener( new ComponentAdapter() {