Commit 0efa71ce authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

If an active control net is not set, the cnet tool will not be enabled.

parent 289dfaa8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ namespace Isis {
    m_workspace = new Workspace(false, this);
    m_workspace->mdiArea()->setActivationOrder(QMdiArea::StackingOrder);

    m_directory = directory;

    // Since this is a QMainWindow, set the workspace as the central widget.
    setCentralWidget(m_workspace);

@@ -304,9 +306,13 @@ namespace Isis {

  /**
   * Enables toolbars and toolpad actions/widgets. Overriden method.
   * If an active control network has not been set, do not enable the cnet tool.
   */
  void CubeDnView::enableActions() {
    foreach (QAction *action, actions()) {
      if (action->objectName() == "ControlNetTool" && !m_directory->project()->activeControl()) {
        continue;
      }
      action->setEnabled(true);
    }
    foreach (QWidget *widget, m_childWidgets) {
+1 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ namespace Isis {
    private:
      QMap<Cube *, ProjectItem *> m_cubeItemMap; //!< Maps cubes to their items
      Workspace *m_workspace; //!< The workspace
      Directory *m_directory; //!< The directory

      ProjectItemViewMenu *m_viewMenu; //!< View menu for storing actions
      ProjectItemViewMenu *m_optionsMenu; //!< Options menu for storing actions
+21 −12
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ namespace Isis {
    m_fileListWidget->setWindowTitle( tr("File List")  );
    m_fileListWidget->setObjectName( m_fileListWidget->windowTitle() );

    m_directory = directory;

    QDockWidget *imageFileListdock = new QDockWidget( m_fileListWidget->windowTitle() );
    imageFileListdock->setObjectName(imageFileListdock->windowTitle());
    imageFileListdock->setFeatures( QDockWidget::DockWidgetFloatable |
@@ -144,17 +146,6 @@ namespace Isis {
    // On default, actions are disabled until the cursor enters the view.
    disableActions();

    // MosaicSceneWidget's default is to have the Control Net Tool enabled.
    // In ipce, we want it to be disabled if an active control is not set.
    foreach (QAction *action, m_toolPad->actions()) {
      if (action->toolTip() == "Control Net (c)") {
        m_controlNetTool = action;
      }
    }
    if (!directory->project()->activeControl()) {
      m_controlNetTool->setEnabled(false);
    }

    setAcceptDrops(true);
  }

@@ -326,7 +317,25 @@ namespace Isis {
   * @param value The boolean that holds if a control network has been set.
   */
  void Footprint2DView::enableControlNetTool(bool value) {
    m_controlNetTool->setEnabled(value);
    foreach (QAction *action, m_toolPad->actions()) {
      if (action->toolTip() == "Control Net (c)") {
        action->setEnabled(value);
      }
    }
  }


  /**
   * Enables toolbars and toolpad actions. Overriden method.
   * If an active control network has not been set, do not enable the cnet tool.
   */
  void Footprint2DView::enableActions() {
    foreach (QAction *action, actions()) {
      if (action->toolTip() == "Control Net (c)" && !m_directory->project()->activeControl()) {
        continue;
      }
      action->setEnabled(true);
    }
  }


+3 −0
Original line number Diff line number Diff line
@@ -130,6 +130,8 @@ namespace Isis {
      void onMosItemRemoved(Image *image);

    private:
      void enableActions();

      /**
       * @author 2018-05-11 Tracie Sucharski
       *
@@ -156,6 +158,7 @@ namespace Isis {
      ImageFileListWidget *m_fileListWidget; //!< The file list widget
      QMainWindow *m_window; //!< Main window
      QMap<Image *, ProjectItem *> m_imageItemMap; //!< Maps images to their items
      Directory *m_directory; //!< The directory

      QToolBar *m_permToolBar; //!< The permanent tool bar
      QToolBar *m_activeToolBar; //!< The active tool bar