Commit 07eb23a3 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Active control and active image list default if project only contains one of each. Fixes #4867.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7677 41f8697f-d340-4b68-9986-7bafba869bb8
parent d9dc690e
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1248,8 +1248,17 @@ namespace Isis {
   *
   * @internal
   *   @history 2016-06-23 Tracie Sucharski - Original version.
   *   @history 2017-05-17 Tracie Sucharski - If no active control set & there is only one control
   *                          in the project, default to that control.
   */
  Control *Project::activeControl() {

    if (!m_activeControl && m_controls->count() == 1) {
      if (m_controls->at(0)->count() == 1) {
        m_activeControl = m_controls->at(0)->at(0);
        qDebug()<<"activeControl = "<<m_activeControl->displayProperties()->displayName();
      }
    }
    return m_activeControl;
  }

@@ -1298,8 +1307,15 @@ namespace Isis {
   *
   * @internal
   *   @history 2016-06-23 Tracie Sucharski - Original version.
   *   @history 2017-05-17 Tracie Sucharski - If no active ImageList set & there is only one
   *                          ImageList in the project, default to that ImageList.
   */
  ImageList *Project::activeImageList() {

    if (!m_activeImageList && m_images->count() == 1) {
      m_activeImageList = m_images->at(0);
      qDebug()<<"activeImageList = "<<m_activeImageList->name();
    }
    return m_activeImageList;
  }

+3 −0
Original line number Diff line number Diff line
@@ -140,6 +140,9 @@ namespace Isis {
   *                           project and reading a saved project (which already has the folder).
   *                           Backed out changes make for deciding whether to copy cube dn data
   *                           because this broke importing images.
   *   @history 2017-05-17 Tracie Sucharski - Changed activeControl and activeImageList methods to
   *                           return default values if project contains a single control and a
   *                           single image list.  Fixes #4867.
   *                
   */
  class Project : public QObject {