JAL-3551 pull up Close Viewer dialog to base class
[jalview.git] / src / jalview / gui / PymolViewer.java
index d0c9ea2..98582b2 100644 (file)
@@ -290,7 +290,8 @@ public class PymolViewer extends StructureViewerBase
     if (!binding.launchPymol())
     {
       JvOptionPane.showMessageDialog(Desktop.desktop,
-              MessageManager.getString("label.pymol_failed"),
+              MessageManager.formatMessage("label.open_viewer_failed",
+                      getViewerName()),
               MessageManager.getString("label.error_loading_file"),
               JvOptionPane.ERROR_MESSAGE);
       this.dispose();
@@ -316,44 +317,6 @@ public class PymolViewer extends StructureViewerBase
   }
 
   @Override
-  public void closeViewer(boolean closePymol)
-  {
-    if (binding != null && binding.isPymolRunning())
-    {
-      if (!closePymol)
-      {
-        // TODO i18n (and pull up)
-        String prompt = MessageManager
-                .formatMessage("label.confirm_close_pymol", new Object[]
-                { binding.getViewerTitle(getViewerName(), false) });
-        prompt = JvSwingUtils.wrapTooltip(true, prompt);
-        int confirm = JvOptionPane.showConfirmDialog(this, prompt,
-                MessageManager.getString("label.close_viewer"),
-                JvOptionPane.YES_NO_CANCEL_OPTION);
-        /*
-         * abort closure if user hits escape or Cancel
-         */
-        if (confirm == JvOptionPane.CANCEL_OPTION
-                || confirm == JvOptionPane.CLOSED_OPTION)
-        {
-          return;
-        }
-        closePymol = confirm == JvOptionPane.YES_OPTION;
-      }
-      binding.closeViewer(closePymol);
-    }
-    setAlignmentPanel(null);
-    _aps.clear();
-    _alignwith.clear();
-    _colourwith.clear();
-    // TODO: check for memory leaks where instance isn't finalised because
-    // binding
-    // holds a reference to the window
-    binding = null;
-    dispose();
-  }
-
-  @Override
   public ViewerType getViewerType()
   {
     return ViewerType.PYMOL;