Commit 90869e7c authored by Marjorie Hahn's avatar Marjorie Hahn
Browse files

Prevented qtie from crashing when user attempts to select a registration template. Fixes #2375

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6943 41f8697f-d340-4b68-9986-7bafba869bb8
parent e236be86
Loading
Loading
Loading
Loading
+5 −15
Original line number Diff line number Diff line
@@ -35,14 +35,14 @@ namespace Isis {
  // Constructor
  QtieFileTool::QtieFileTool(QWidget *parent) : FileTool(parent) {
    openAction()->setToolTip("Open images");
    QString whatsThis =
      "<b>Function:</b> Open a <i>images</i> \
    QString whatsThis = "<b>Function:</b> Open a <i>images</i> \
                        <p><b>Shortcut:</b>  Ctrl+O\n</p>";
    openAction()->setWhatsThis(whatsThis);

    saveAction()->setEnabled(false);
  }

  
  /**
   *  Open base image and image to be adjusted
   *
@@ -63,7 +63,6 @@ namespace Isis {
   */
  void QtieFileTool::open() {


    //  If we've already opened files, clear before starting over
    if (cubeViewportList()->size() > 0) {
      //  Close viewport containing ground source
@@ -341,14 +340,5 @@ namespace Isis {
      p.Add(mB);
    }
    return true;

  }


}
 No newline at end of file





+15 −20
Original line number Diff line number Diff line
@@ -180,8 +180,7 @@ namespace Isis {
                "coordinate of each sample/line of the control points from "
                "the \"Match\" level 1 cube with the latitude/longitude from "
                "the \"Base\" map projected cube.  To solve for all three "
                "camera angles, select the <strong>Twist</strong> check "
                "box.");
                "camera angles, select the <strong>Twist</strong> check box.");
    connect(solve, SIGNAL(clicked()), this, SLOT(solve()));
    gridLayout->addWidget(solve, row++, 0);

@@ -205,8 +204,8 @@ namespace Isis {
   */
  void QtieTool::createMenus() {

    p_saveNet = new QAction(QIcon(FileName(
      "$base/icons/mActionFileSaveAs.png").expanded()), "Save Control Network &As...",
    p_saveNet = new QAction(QIcon(FileName("$base/icons/mActionFileSaveAs.png").expanded()),
                            "Save Control Network &As...",
                            p_tieTool);
    p_saveNet->setToolTip("Save current control network to chosen file");
    p_saveNet->setStatusTip("Save current control network to chosen file");
@@ -218,8 +217,7 @@ namespace Isis {
    QAction *closeQtieTool = new QAction(p_tieTool);
    closeQtieTool->setText("&Close");
    closeQtieTool->setShortcut(Qt::ALT + Qt::Key_F4);
    whatsThis =
      "<b>Function:</b> Closes the Qtie Tool window for this point \
    whatsThis = "<b>Function:</b> Closes the Qtie Tool window for this point \
                <p><b>Shortcut:</b> Alt+F4 </p>";
    closeQtieTool->setWhatsThis(whatsThis);
    connect(closeQtieTool, SIGNAL(activated()), p_tieTool, SLOT(close()));
@@ -237,8 +235,7 @@ namespace Isis {

    QAction *viewTemplate = new QAction(p_tieTool);
    viewTemplate->setText("&View/edit registration template");
    whatsThis =
      "<b>Function:</b> Displays the curent registration template.  \
    whatsThis = "<b>Function:</b> Displays the curent registration template.  \
                The user may edit and save changes under a chosen filename.";
    viewTemplate->setWhatsThis(whatsThis);
    connect(viewTemplate, SIGNAL(activated()), this, SLOT(viewTemplateFile()));
@@ -251,9 +248,9 @@ namespace Isis {
    regMenu->addAction(viewTemplate);
    //    registrationMenu->addAction(interestOp);
    

    p_whatsThis = new QAction(QIcon(FileName(
      "$base/icons/contexthelp.png").expanded()),"&Whats's This", p_tieTool);
    p_whatsThis = new QAction(QIcon(FileName("$base/icons/contexthelp.png").expanded()),
                              "&Whats's This", 
                              p_tieTool);
    p_whatsThis->setShortcut(Qt::SHIFT | Qt::Key_F1);
    p_whatsThis->setToolTip("Activate What's This and click on items on "
                            "user interface to see more information.");
@@ -283,7 +280,6 @@ namespace Isis {
   * @param pad   Input  Toolpad for the main window
   *
   */

  QAction *QtieTool::toolPadAction(ToolPad *pad) {
    QAction *action = new QAction(pad);
    action->setIcon(QPixmap(toolIconDir() + "/stock_draw-connector-with-arrows.png"));
@@ -386,8 +382,7 @@ namespace Isis {
    //  TODO:  Do not know if radius came from DEM (if cube spiceinit'ed
    //   with DEM) or from ellipsoid.  Once change made to camera to return
    //   DEM filename, update the point aprioiRadiusSource parameters.
    p_matchGM->SetGround(
              Latitude(lat, Angle::Degrees), Longitude(lon, Angle::Degrees));
    p_matchGM->SetGround(Latitude(lat, Angle::Degrees), Longitude(lon, Angle::Degrees));
    Distance radius = p_matchGM->Camera()->LocalRadius();
    if (!radius.isValid()) {
      QString message = "Could not determine radius from DEM at lat/lon ["
@@ -905,7 +900,8 @@ namespace Isis {
   */

  void QtieTool::setTemplateFile() {
    QString filename = QFileDialog::getOpenFileName(p_mw,
    
    QString filename = QFileDialog::getOpenFileName(p_tieTool,
                       "Select a registration template", ".",
                       "Registration template files (*.def *.pvl);;All files (*)");

@@ -997,7 +993,6 @@ namespace Isis {
  }



  void QtieTool::enterWhatsThisMode() {
    QWhatsThis::enterWhatsThisMode();
  }
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ namespace Isis {
      QAction *p_deletePoint;
      QAction *p_saveNet;

      QMainWindow *p_mw;
      //QMainWindow *p_mw; Value never initialized
      ControlPointEdit *p_pointEditor;
      QLineEdit *p_tolValue;
      QLabel *p_ptIdValue;
+4 −0
Original line number Diff line number Diff line
@@ -208,5 +208,9 @@
      Added shortcuts to Qtie Tool window for selecting right measures, registration, saving 
      measures, and find. Fixes #2324.
    </change>
    <change name="Marjorie Hahn" date="2016-08-02">
      Prevented qtie from crashing when user attempts to select a registration template. 
      Fixes #2375.
    </change>
  </history>
</application>