Commit b0019e14 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

If not shapes have been imported, do not allow point type on new pt dialog to...

If not shapes have been imported, do not allow point type on new pt dialog to be changed to constrained or fixed.  Fixes #5087.
parent 490bd79e
Loading
Loading
Loading
Loading
+24 −8
Original line number Diff line number Diff line
@@ -20,9 +20,15 @@

namespace Isis {
  /**
   * NewControlPointDialog constructor
   * @param parent The parent widget for the
   *               cube points filter
   * @description Create dialog for creating a new Control Point
   *  
   * @param controlNet               The control net the new control point will be contained in 
   * @param serialNumberList         The serial number list corresponding to the controlNet 
   * @param defaultPointId           The default pointID, usually empty string 
   * @param parent                   Parent widget 
   * @param pointType                Show the Point Type combo box, default = false 
   * @param groundSource             Show the Ground Source list, default = false 
   * @param subpixelRegisterMeasures Show the check box for sub-pixel registration option, default = false
   *
   * @internal
   *   @history 2008-11-26 Jeannie Walldren - Set lastPointIdValue
@@ -180,12 +186,22 @@ namespace Isis {


  void NewControlPointDialog::setGroundSource(QStringList groundFiles, int numberShapesWithPoint) {

    if (groundFiles.count() != 0) {
      m_groundSourceCombo->addItems(groundFiles); 
      for (int i = 0; i < numberShapesWithPoint; i++) {
        m_groundSourceCombo->setItemData(i, QColor(Qt::red), Qt::ForegroundRole);
      }
      m_groundSourceCombo->insertSeparator(numberShapesWithPoint);
    }
    else {
      //  If there are not available shapes, remove constrained/fixed point type from combo
      m_pointTypeCombo->setToolTip("If Point Type cannot be changed from \"Free\", make sure there "
                                   "is a shape imported into your project.");
      m_pointTypeCombo->removeItem(m_pointTypeCombo->findText("Constrained"));
      m_pointTypeCombo->removeItem(m_pointTypeCombo->findText("Fixed"));
    }
  }


  /**
+6 −2
Original line number Diff line number Diff line
@@ -33,8 +33,12 @@ namespace Isis {
   *   @history 2016-10-18 Tracie Sucharski - Added method to return value of the
   *                          subpixelRegister radio button.  If set, all measures in the control
   *                          point created will be subpixel registered.
   *   @history 2017-07-04 Christopher Combs - Added bools to toggle on specific elements of the
   *                          dialog to remove similar classes like QnetNewPointDialog. Fixes #4383.
   *   @history 2017-07-04 Christopher Combs - Combined functionality of dialogs from qnet,
   *                          qview and ipce applications by adding bools to toggle on specific
   *                          elements of the dialog to remove similar classes like
   *                          QnetNewPointDialog. Fixes #4383.
   *   @history 2018-05-02 Tracie Sucharski - If no shapes available remove option to change point
   *                          type to "Constrained" or "Fixed". Fixes #5087.
   */
  class NewControlPointDialog : public QDialog {