Commit def3cc6c 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@7886 41f8697f-d340-4b68-9986-7bafba869bb8
parent f3df768a
Loading
Loading
Loading
Loading
+24 −9
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "CubeDnView.h"

#include <QAction>
#include <QDebug>
#include <QHBoxLayout>
#include <QMap>
#include <QMdiArea>
@@ -107,6 +108,12 @@ namespace Isis {
    connect(m_workspace, SIGNAL( cubeViewportAdded(MdiCubeViewport *) ),
            this, SLOT( onCubeViewportAdded(MdiCubeViewport *) ) );

    Project *activeProject = directory->project();
    // These connect signals listen to the active project, and if a control network
    // or list of control networks is added, then the enableIPCETool() function is called.
    connect(activeProject, SIGNAL(controlListAdded(ControlList *)), this, SLOT(enableIPCETool()));
    connect(activeProject, SIGNAL(controlAdded(Control *)), this, SLOT(enableIPCETool()));


    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
@@ -192,15 +199,6 @@ namespace Isis {
    layout->addWidget(statusBar);
    tools->append(new TrackTool(statusBar));

//  QnetNavTool *ntool = new QnetNavTool(qnetTool, this);
//  tools->append(ntool);
//  tools->append(qnetTool);
//
//  connect(qnetTool, SIGNAL(showNavTool()), ntool, SLOT(showNavTool()));

    //QMenuBar *menuBar = new QMenuBar;
    //QMap<QString, QMenu *> subMenus;

    m_separatorAction = new QAction(this);
    m_separatorAction->setSeparator(true);
    
@@ -258,6 +256,23 @@ namespace Isis {
  }


  /**
   * @description enableIPCETool:  This is a slot function which
   * is called when the active project emits a signal to the CubeDnView
   * object after a control network (or a list of control networks)
   * has been added.  It enables the control network editor tool if it
   * has been disabled.
   */
  void CubeDnView::enableIPCETool() {

    foreach (QAction * action, m_toolPadActions) {
      if (action->objectName() == "IpceTool") {
        action->setDisabled(false);
      }
    }
  }


  /**
   * Destructor
   */
+7 −1
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@ namespace Isis {
   *   @history 2017-01-02 Tracie Sucharski - Moved IpceTool to first tool on tool bar, change
   *                           icon to match the Footprint2DView.
   *   @history 2017-05-18 Tracie Sucharski - Added serialNumber to the modifyControlPoint signal.
   *   @history 2017-07-18 Tyler Wilson - Added a slot function (enableIPCETool) which is called
   *                           when a control network (or list of control networks) is added to
   *                           the active project.  Fixes #4994.
   */
  class CubeDnView : public AbstractProjectItemView {

@@ -99,6 +102,8 @@ namespace Isis {
      void load(XmlStackedHandlerReader *xmlReader, Project *project);
      void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const;



    signals:
      void modifyControlPoint(ControlPoint *controlPoint, QString serialNumber);
      void deleteControlPoint(ControlPoint *controlPoint);
@@ -109,6 +114,7 @@ namespace Isis {

    public slots:
      void addItem(ProjectItem *item);
      void enableIPCETool();
    
    private slots:
      void onCurrentChanged(const QModelIndex &current);