Commit 601b2379 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Added functionality to cnetsuite. Fixes #4220, #4367, #4474, #4482.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7188 41f8697f-d340-4b68-9986-7bafba869bb8
parent 0e88404b
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
 */
#include "CNetSuiteMainWindow.h"

#include <QObject>
#include <QtWidgets>
#include <QSettings>
#include <QTreeView>
@@ -36,7 +37,6 @@
#include "Project.h"
#include "ProjectItemModel.h"
#include "ProjectItemTreeView.h"
//#include "ProjectTreeWidget.h"
#include "SensorInfoWidget.h"
#include "TargetInfoWidget.h"

@@ -469,7 +469,7 @@ namespace Isis {
        QPixmap(FileName("$base/icons/contexthelp.png").expanded()));
    activateWhatsThisAct->setToolTip("Activate What's This and click on parts "
        "this program to see more information about them");
    connect(activateWhatsThisAct, SIGNAL(activated()), this, SLOT(enterWhatsThisMode()));
    connect(activateWhatsThisAct, SIGNAL(triggered()), this, SLOT(enterWhatsThisMode()));

    m_helpMenuActions.append(activateWhatsThisAct);
  }
@@ -514,7 +514,11 @@ namespace Isis {
        QSettings::NativeFormat);

    settings.setValue("geometry", saveGeometry());
    settings.setValue("windowState", saveState());
    // TODO 2016-08-03 TLS  saveState giving the following errors:
    //QMainWindow::saveState(): 'objectName' not set for QToolBar 0x1d79070 ''
    //QMainWindow::saveState(): 'objectName' not set for QToolBar 0x1d5bea0 ''
    //QMainWindow::saveState(): 'objectName' not set for QToolBar 0x19aa7f0 ''
//  settings.setValue("windowState", saveState());
    settings.setValue("size", size());
    settings.setValue("pos", pos());

+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ namespace Isis {
   *                          regular QActions can be used in menus and toolbars. Views can
   *                          now be detached from the main window into their own independent
   *                          window with internalized menus and toolbars.
   *   @history 2016-10-20 Tracie Sucharski - Clean up included headers that are commented out,
   *                          updated for Qt5, comment call to saveState for window which caused
   *                          errors.  TODO:  Determine problem with saveState call.
   */
  class CNetSuiteMainWindow : public QMainWindow {
      Q_OBJECT
+41 −11
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "AbstractProjectItemView.h"

#include <QAction>
#include <QDebug>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
@@ -75,6 +76,27 @@ namespace Isis {
  }


  /**
   * Sets the internal model of the view.
   *
   * @param[in] model (ProjectItemModel *) The new internal model
   */
  void AbstractProjectItemView::setInternalModel(ProjectItemModel *model) {
    m_internalModel = model;
  }


  /**
   * Returns the internal model of the view. By default it is a proxy
   * model.
   *
   * @return @b ProjectItemModel * The internal model
   */
  ProjectItemModel *AbstractProjectItemView::internalModel() {
    return m_internalModel;
  }


  /**
   * Accepts the drag enter event if the internal model can accept the
   * mime data.
@@ -270,22 +292,30 @@ namespace Isis {


  /**
   * Returns the internal model of the view. By default it is a proxy
   * model.
   * Removes an item to the view. The item must be part of the view's
   * model. This method can be overriden in a subclass to filter out
   * unneeded items.
   *
   * @return @b ProjectItemModel * The internal model
   * @param[in] item (ProjectItem *) The item to remove.
   */
  ProjectItemModel *AbstractProjectItemView::internalModel() {
    return m_internalModel;
  void AbstractProjectItemView::removeItem(ProjectItem *item) {
    if (ProjectItemProxyModel *proxyModel = 
            qobject_cast<ProjectItemProxyModel *>( internalModel() ) ) {
//    qDebug()<<"AbstractProjectItemView::removeItem";
      proxyModel->removeItem(item);
    }
  }


  /**
   * Sets the internal model of the view.
   * Removes several items from the view. The items must be a part of the
   * view's model.
   *
   * @param[in] model (ProjectItemModel *) The new internal model
   * @param[in] items (QList<ProjectItem *>) The items to remove.
   */
  void AbstractProjectItemView::setInternalModel(ProjectItemModel *model) {
    m_internalModel = model;
  void AbstractProjectItemView::removeItems(QList<ProjectItem *> items) {
    foreach (ProjectItem *item, items) {
      removeItem(item);
    }
  }
}
+4 −1
Original line number Diff line number Diff line
@@ -54,10 +54,10 @@ namespace Isis {
   *
   * @author 2015-10-21 Jeffrey Covington
   * @internal
   *
   *   @history 2015-10-21 Jeffrey Covington - Original version.
   *   @history 2016-06-27 Ian Humphrey - Minor updates to documentation and coding standards. 
   *                           Fixes #4004.
   *   @history 2016-07-28 Tracie Sucharski - Implemented removeItem and removeItems methods.
   *   @history 2016-08-25 Adam Paquette - Minor updates to documentation.
   *                           Fixes #4299.
   */
@@ -98,6 +98,9 @@ namespace Isis {
      virtual void addItem(ProjectItem *item);
      virtual void addItems(QList<ProjectItem *> items);

      virtual void removeItem(ProjectItem *item);
      virtual void removeItems(QList<ProjectItem *> items);

    private:
      ProjectItemModel *m_internalModel; //!< The internal model used by the view
  };
+5 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ namespace Isis {
   *   @history 2014-09-05 Kim Oyama - Added default initialization of Image to ChipViewport
   *                           construtor.
   *   @history 2015-12-08 Jeannie Backer - Fixed whitespace per ISIS coding standards.
   *   @history 2016-03-31 Tracie Sucharski - Added method to return the chip cube.
   *   @history 2016-06-07 Ian Humphrey - Updated documentation and coding standards. Fixes #3958.
   */
  class ChipViewport : public QWidget {
@@ -102,6 +103,10 @@ namespace Isis {
        return m_chip;
      };

      Cube *chipCube() const {
        return m_chipCube;
      };

      //! Return the number of samples in the chip
      int chipSamples() const {
        return m_chip->Samples();
Loading