Commit aa5412e3 authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

qview no longer crashes when attempting to apply a stretch to a cube that is...

qview no longer crashes when attempting to apply a stretch to a cube that is still loading. Fixes #2117.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6310 41f8697f-d340-4b68-9986-7bafba869bb8
parent c424e719
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

#include <QHBoxLayout>
#include <QMenuBar>
#include <QMessageBox>
#include <QPixmap>
#include <QSizePolicy>
#include <QToolBar>
@@ -790,10 +791,17 @@ namespace Isis {
   *
   */
  void StretchTool::stretchRegional(CubeViewport *cvp) {
    try {
      QRect rect(0, 0, cvp->viewport()->width(), cvp->viewport()->height());

      stretchRect(cvp, rect);
    }
    catch (IException &e) {
      QString message = "Cannot stretch while the cube is still loading";
      QMessageBox::warning((QWidget *)parent(), "Warning", message);
      return;
    }
  }


  /**
+4 −0
Original line number Diff line number Diff line
@@ -91,6 +91,10 @@ namespace Isis {
   *                          between viewports, and another that caused the stretch
   *                          to be copied the new viewport if the advanced stretch
   *                          dialog is active. Fixes #771.
   *  @history 2015-08-07 Makayla Shepherd - No longer crashes when the user attempts 
   *                          to apply a stretch while the cube is still loading. This
   *                          crash was caused by an unhandled exception being thrown 
   *                          in a connected slot. Fixes #2117.
   */
  class StretchTool : public Tool {
      Q_OBJECT