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

Fixed the multiple points selection error that pops up after the dialog is closed. Fixes #4490.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7256 41f8697f-d340-4b68-9986-7bafba869bb8
parent 3785a649
Loading
Loading
Loading
Loading
+25 −6
Original line number Diff line number Diff line
@@ -843,7 +843,6 @@ namespace Isis {
  }



  /**
   * Delete selected Points from control network
   *
@@ -937,13 +936,15 @@ namespace Isis {
  }

  

  /**
   * Bring up apriori dialog
   *
   * @author 2011-04-19 Tracie Sucharski 
   *  
   * @internal 
   *   @history 2016-11-18 Makayla Shepherd - Added a connection to disconnectAprioriDialog() which
   *                           will disconnect the dialog and delete it.
   * 
   * @todo  This method should be temporary until the control point editor 
   *           comes online.  If this stick around, needs to be re-designed-
   *           put in a separate class??
@@ -963,12 +964,13 @@ namespace Isis {
              this, SIGNAL(pointChanged(QString)));
      connect(m_aprioriDialog, SIGNAL(netChanged()),
              this, SIGNAL(netChanged()));
      connect(m_aprioriDialog, SIGNAL(aprioriDialogClosed()),
              this, SLOT(disconnectAprioriDialog()));
    }
    m_aprioriDialog->setVisiblity();
  }
  
  

  /**
   * Slot to pass points selected in Nav List Widget to Apriori Dialog 
   *  
@@ -992,6 +994,23 @@ namespace Isis {
  }
  
  
  /**
   * Apriori dialog has been closed and needs to be disconnected and deleted so a new dialog can 
   * be brought up next time.
   * 
   * @author 2016-11-14 Makayla Shepherd
   *
   */
  void QnetNavTool::disconnectAprioriDialog() {
    if (m_aprioriDialog) {
      disconnect(m_listBox, SIGNAL(itemSelectionChanged()),
                 this, SLOT(setAprioriDialogPoints()));
      disconnect(m_aprioriDialog, 0, 0, 0);
      m_aprioriDialog = NULL;
    }
  }

  
  /**
   * Figures out what type of widget the filter was selected for and calls the
   * filter method for that filter class
+3 −0
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ namespace Isis {
   *                          Points to Cubes, and vice versa, and then back to the original type, 
   *                          the filtered data is saved rather than forcing the user to refilter
   *                          the data. Fixes #2144.
   *   @history 2016-11-18 Makayla Shepherd - Added disconnection and deletion of the Set Apriori
   *                          Dialog on close. Fixes #4490.
   *
   *
   */
@@ -167,6 +169,7 @@ namespace Isis {
      void resetList();
      void refreshList();
      void updateEditPoint(QString pointId);
      void disconnectAprioriDialog();

    private slots:
      void load();
+52 −7
Original line number Diff line number Diff line
@@ -99,9 +99,14 @@ namespace Isis {
    connect(m_currentSigmaButton, SIGNAL(clicked()), this, SLOT(fillSigmaLineEdits()));
    connect(m_currentSigmaButton, SIGNAL(clicked()), this, SLOT(fillSigmaLineEdits()));
    
    connect(m_aprioriDialog, SIGNAL(rejected()), this, SLOT(reject()));
    
    connect(m_okButton, SIGNAL(clicked()), this, SLOT(setApriori()));
    connect(m_okButton, SIGNAL(clicked()), this, SLOT(closeEvent()));
    connect(m_okButton, SIGNAL(clicked()), m_aprioriDialog, SLOT(close()));
    
    connect(m_applyButton, SIGNAL(clicked()), this, SLOT(setApriori()));
    connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(closeEvent()));   
    connect(m_cancelButton, SIGNAL(clicked()), m_aprioriDialog, SLOT(close()));
  }

@@ -252,6 +257,44 @@ namespace Isis {
  }
  
  
  /**
   * This is called when the user selects the X button on the top right or they hit ESC.
   * Disconnect all slots on close event.
   * 
   * @author 2016-11-18 Makayla Shepherd
   * 
   */
  void QnetSetAprioriDialog::reject() {
    closeEvent();
    QDialog::reject();
  }
  
  
  /**
   * Disconnect all of the slots on a close event
   * 
   * @author 2016-11-18 Makayla Shepherd
   */
  void QnetSetAprioriDialog::closeEvent() {
    
      disconnect(m_currentAprioriButton, SIGNAL(clicked()), this, 
                SLOT(fillCurrentAprioriLineEdits()));
      disconnect(m_referenceAprioriButton, SIGNAL(clicked()), this, 
                SLOT(fillReferenceAprioriLineEdits()));
      disconnect(m_averageAprioriButton, SIGNAL(clicked()), this, 
                SLOT(fillAverageAprioriLineEdits()));
      
      disconnect(m_currentSigmaButton, SIGNAL(clicked()), this, SLOT(fillSigmaLineEdits()));
      disconnect(m_currentSigmaButton, SIGNAL(clicked()), this, SLOT(fillSigmaLineEdits()));
      
      disconnect(m_okButton, SIGNAL(clicked()), this, SLOT(setApriori()));
      disconnect(m_applyButton, SIGNAL(clicked()), this, SLOT(setApriori()));
      
      emit aprioriDialogClosed();
    
  }
  
  
  /**
   * Shows the dialog box 
   * 
@@ -699,7 +742,7 @@ namespace Isis {
      }
      if (m_multiPointsFixedCount > 0 || m_multiPointsFreeCount > 0) {
        m_aprioriDialog->setDisabled(true);
        QString msg = "Sigmas can only be set on Contrained points. Use Filters to filter by";
        QString msg = "Sigmas can only be set on Constrained points. Use Filters to filter by";
        msg = msg + " Constrained points.";
        QMessageBox::warning((QWidget *)parent(), "Warning", msg);
        return;
@@ -827,9 +870,11 @@ namespace Isis {
   *                        are made and populated in the fill methods.
   * @history 2016-10-14 Makayla Shepherd - Fixed an issue that caused the apriori sigmas to be set 
   *                        to NULL. You can now set the apriori sigmas.
   * @history 2016-11-16 Makayla Shepherd - Fixed the sigma setting for Fixed and Free points.
   *                        
   */
  void QnetSetAprioriDialog::setApriori() {
    
    if (m_points.size() == 0) {
      QString msg = "There are no Points selected. Please select a Point.";
      QMessageBox::warning((QWidget *)parent(), "Warning", msg);
@@ -927,11 +972,11 @@ namespace Isis {
        spt.SetRadii(Distance(targetRadii[0]),
                     Distance(targetRadii[1]),
                     Distance(targetRadii[2]));
        if (pt->GetPointTypeString() == "Constrained") {

        spt.SetSphericalSigmasDistance(Distance(latSigma,Distance::Meters),
                                        Distance(lonSigma,Distance::Meters),
                                        Distance(radiusSigma,Distance::Meters));
        }

        //  Write the surface point back out to the controlPoint
        pt->SetAprioriSurfacePoint(spt);

+9 −0
Original line number Diff line number Diff line
@@ -30,6 +30,10 @@ namespace Isis {
   *                           Fixes #2325, #2383.
   *   @history 2016-10-14 Makayla Shepherd - Fixed an issue that caused the apriori sigmas to be 
   *                           set to NULL. You can now set the apriori sigmas. Fixes #4457.
   *   @history 2016-11-18 Makayla Shepherd - Corrected the deletion of this dialog. The incorrect
   *                           deletion caused an error message to pop up when selecting multiple 
   *                           Free or Fixed points after closing the Set Apriori dialog. Fixes 
   *                           #4490.
   */
  class QnetSetAprioriDialog : public QDialog {
      Q_OBJECT
@@ -38,12 +42,15 @@ namespace Isis {
      QnetSetAprioriDialog(QnetTool *qnetTool, QWidget *parent = 0);
      void setPoints(QList<QListWidgetItem *> selectedPoints);
      
    
    public slots:
      void setVisiblity();
      virtual void reject();
      
    signals:
      void pointChanged(QString pointId);
      void netChanged();
      void aprioriDialogClosed();

    private slots:
      void fillCurrentAprioriLineEdits();
@@ -54,6 +61,8 @@ namespace Isis {
      void clearLineEdits();
      void resetInfoLabels();
      void setApriori();
      void closeEvent();
      
      
    private: