Commit db1c124e authored by Tyler Wilson's avatar Tyler Wilson
Browse files

If no control nets are in the project, the Ipce tool is inactive. Fixes #4994.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7887 41f8697f-d340-4b68-9986-7bafba869bb8
parent def3cc6c
Loading
Loading
Loading
Loading
+25 −2
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include <QString>

#include "Application.h"
#include "ControlList.h"
#include "ControlMeasure.h"
#include "ControlNet.h"
#include "ControlPoint.h"
@@ -59,20 +60,42 @@ namespace Isis {
    * @return @b QAction* Pointer to Tie tool action
    *
    * @internal
    *   @history 2017-07-25 Tyler Wilson - Set the
    *       object name for the QAction in this 
    *       method.  It provides a convenient key
    *       to search through a list of actions in
    *       other classes.  References #4994.
    *
    */
   QAction *IpceTool::toolPadAction(ToolPad *pad) {
     

     QAction *action = new QAction(pad);
//   action->setIcon(QPixmap(toolIconDir()+"/stock_draw-connector-with-arrows.png"));
     action->setIcon(QPixmap(toolIconDir()+"/HILLBLU_molecola.png"));
     action->setToolTip("Control Point Editor (T)");
     action->setShortcut(Qt::Key_T);
//     QObject::connect(action,SIGNAL(triggered(bool)),this,SLOT(showNavWindow(bool)));

     //The object name is being set and used as a key to search with for this action in 
     //other classes (ie. CubeDnView)
     action->setObjectName("IpceTool");

     QList<ControlList *> cnets = m_directory->project()->controls();

     //Check to see if there are any control nets within the project.
     //If not, then this action should be disabled.
     if (cnets.isEmpty()) {
       action->setDisabled(true);
     }

     return action;
   }




   void IpceTool::setControlNet(ControlNet *cnet) {
     m_controlNet = cnet;

     refresh();
   }

+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ namespace Isis {
   *   @history 2016-10-25 Tracie Sucharski - Check for existence of Control net in the
   *                           paintViewport method.
   *   @history 2017-05-18 Tracie Sucharski - Added serialNumber to the modifyControlPoint signal. 
   *   @history 2017-07-18 Tyler Wilson - Added the ability for the Ipce tool to check and see
   *                           if control nets exist within the current project within
   *                           the toolPadAction function.  If no control nets exist within the
   *                           project, the Ipce tool is disabled on start-up.  Fixes #4994.
   *                           
   */
  class IpceTool : public Tool {