Commit 0d1c7726 authored by Cole Neubauer's avatar Cole Neubauer
Browse files

Control Net Tool is not available until Control net is active Fixes #5046 #5039

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7861 41f8697f-d340-4b68-9986-7bafba869bb8
parent d0f34843
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -613,13 +613,9 @@ namespace Isis {
   * @return @b (Footprint2DView*) A pointer to the Footprint2DView to display.
   */
  Footprint2DView *Directory::addFootprint2DView() {
//  qDebug()<<"Directory::addFootprint2DView  this = "<<this;
    Footprint2DView *result = new Footprint2DView(this);
//  qDebug()<<"Directory::addFootprint2DView internalModel after constructor = "<<result->internalModel();
//  qDebug()<<"                              m_projectItemModel = "<<m_projectItemModel;
    //  Set source model on Proxy

    result->setModel(m_projectItemModel);
//  qDebug()<<"                              internalModel after setModel = "<<result->internalModel();
    m_footprint2DViewWidgets.append(result);
    result->setWindowTitle( tr("Footprint View %1").arg( m_footprint2DViewWidgets.count() ) );

@@ -645,6 +641,14 @@ namespace Isis {
    //  I have one signal, controlChanged?
    connect(this, SIGNAL(controlPointAdded(QString)), result, SIGNAL(controlPointAdded(QString)));

    if (!project()->activeControl()) {
      QList<QAction *> toolbar = result->toolPadActions();
      QAction* cnetButton = toolbar[3];
      cnetButton->setEnabled(false);
      connect (project(), SIGNAL(activeControlSet(bool)),
              cnetButton, SLOT(setEnabled(bool)));

    }
    return result;

    /*
+4 −3
Original line number Diff line number Diff line
@@ -142,9 +142,10 @@ namespace Isis {
   *                           doing anything.  However, I'm leaving the method for now, because
   *                           once the views are connected, we will probably need to cleanup the
   *                           connections when the view is closed.  Fixes #4959.
   *  @history 2017-07-14 Cole Neubauer - Added a signal for IpceMainWindow to listen to to be
   *                           available to bring the Warning tab to the top when a new warning
   *                           is added Fixes #5041 
   *   @history 2017-07-17 Cole Neubauer - Disabled CNet tool when a Footprint2DView is added if a
   *                           control net is not active and slotted it to reenable when Project
   *                           emits activeControlSet(bool).
   *                           Fixes #5046
   */
  class Directory : public QObject {
    Q_OBJECT
+2 −2
Original line number Diff line number Diff line
@@ -1236,7 +1236,7 @@ namespace Isis {
    }

    activeControl()->controlNet()->SetImages(*(activeImageList()->serialNumberList()));
    emit activeControlSet();
    emit activeControlSet(true);
  }


+7 −2
Original line number Diff line number Diff line
@@ -147,6 +147,11 @@ namespace Isis {
   *                           imports, shape imports, and bundle solution info. Fixes #4855, 
   *                           #4979, #4980.
   *                
   *
   *   @history 2017-07-17 Cole Neubauer - Changed activeControl signal to emit a bool to be able
   *                           to slot a setEnabled(bool) call to a QAction. This was necessary to
   *                           reenable the CNet Tool when a control net is made active.
   *                           Fixes #5046
   */
  class Project : public QObject {
    Q_OBJECT
@@ -257,7 +262,7 @@ namespace Isis {
       * Emitted when an active control is set.
       * receivers: Project::checkActiveControlAndImageList
       */
      void activeControlSet();
      void activeControlSet(bool boolean);

      /**
       * Emitted when all controls have been removed from the Project.