Commit 05b58b97 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Fixed JigsawSetupDialog to grey out target parameters and not seg fault if the...

Fixed JigsawSetupDialog to grey out target parameters and not seg fault if the SPICE does not have new frame type keyword. Added context menu to cneteditor view to edit control point.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7734 41f8697f-d340-4b68-9986-7bafba869bb8
parent 40b66bf9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -408,6 +408,9 @@ namespace Isis {
    connect(m_pointTableView, SIGNAL(filterCountsChanged(int, int)),
        this, SLOT(handlePointTableFilterCountsChanged(int, int)));

    connect(m_pointTableView, SIGNAL(editControlPoint(ControlPoint *, QString)),
            this, SIGNAL(editControlPoint(ControlPoint *, QString)));

    for (int i = 0; i < AbstractPointItem::COLS; i++) {
      QAction *act = new QAction(
        AbstractPointItem::getColumnName((AbstractPointItem::Column) i), this);
@@ -455,6 +458,9 @@ namespace Isis {
    connect(m_measureTableView, SIGNAL(filterCountsChanged(int, int)),
        this, SLOT(handleMeasureTableFilterCountsChanged(int, int)));

    connect(m_measureTableView, SIGNAL(editControlPoint(ControlPoint *, QString)),
            this, SIGNAL(editControlPoint(ControlPoint *, QString)));

    for (int i = 0; i < AbstractMeasureItem::COLS; i++) {
      QAction *act = new QAction(AbstractMeasureItem::getColumnName(
          (AbstractMeasureItem::Column) i), this);
+9 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ class QToolBar;

namespace Isis {
  class ControlNet;
  class ControlPoint;

  namespace CnetViz {
    class AbstractTableModel;
@@ -42,6 +43,11 @@ namespace Isis {
   * @internal
   *   @history 2015-10-07 Ian Humphrey - Icons updated and no longer embedded (in order
   *                           to not violate licensing terms). Fixes #1041.
   *   @history 2017-05-18 Tracie Sucharski - Added a signal to indicate the control point chosen
   *                           from either the point table or the measure table.  If the point was
   *                           chosen from the measure table, the serial number of the measure is
   *                           also passed.  This was added for IPCE, for the interaction with other
   *                           views.
   */
  class CnetEditorWidget : public QWidget {
      Q_OBJECT
@@ -89,11 +95,14 @@ namespace Isis {
    public slots:
      void configSorting();
      void setTablesFrozen(bool);
      void rebuildModels();


    signals:
      void cnetModified();

      void editControlPoint(ControlPoint *controlPoint, QString serialNumber);


    private:
      void nullify();
@@ -111,7 +120,6 @@ namespace Isis {


    private slots:
      void rebuildModels();
      void rebuildModels(QList< CnetViz::AbstractTreeItem * > itemsToDelete);

      void pointColToggled();
+2 −0
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ namespace Isis {
          this, SIGNAL(modelDataChanged()));
      connect(m_content, SIGNAL(tableSelectionChanged(QList<AbstractTreeItem *>)),
          this, SIGNAL(tableSelectionChanged(QList<AbstractTreeItem *>)));
      connect(m_content, SIGNAL(editControlPoint(ControlPoint *, QString)),
              this, SIGNAL(editControlPoint(ControlPoint *, QString)));

      connect(m_header, SIGNAL(columnResized(bool)),
          m_content, SLOT(updateHorizontalScrollBar(bool)));
+9 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ template<typename T> class QList;
class QString;

namespace Isis {
  class ControlPoint;

  namespace CnetViz {
    class AbstractTableModel;
    class AbstractTreeItem;
@@ -22,6 +24,11 @@ namespace Isis {
     *
     * @internal
     *   @history 2012-09-28 Kimberly Oyama - Changed member variables to be prefixed with "m_".
     *   @history 2017-05-18 Tracie Sucharski - Added a signal to indicate the control point chosen
     *                           from either the point table or the measure table.  If the point was
     *                           chosen from the measure table, the serial number of the measure is
     *                           also passed.  This was added for IPCE, for the interaction with
     *                           other views.
     */
    class TableView : public QWidget {
        Q_OBJECT
@@ -59,6 +66,8 @@ namespace Isis {
        void tableSelectionChanged(QList< AbstractTreeItem * >);
        void filterCountsChanged(int visibleRows, int totalRows);

        void editControlPoint(ControlPoint *, QString);


      private: // disable copying and assigning of this class
        TableView(const TableView &);
+41 −8
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <iostream>

#include <QAction>
#include <QApplication>
#include <QDebug>
#include <QLabel>
#include <QMenu>
@@ -62,7 +63,6 @@ namespace Isis {
      }

      m_items = new QList< QPointer<AbstractTreeItem> >;
      m_mousePressPos = new QPoint;
      m_activeCell = new QPair<AbstractTreeItem *, int>(NULL, -1);
      rowsWithActiveColumnSelected = new QList<AbstractTreeItem *>;
      m_lastShiftSelection = new QList<AbstractTreeItem *>;
@@ -92,9 +92,6 @@ namespace Isis {
      delete m_items;
      m_items = NULL;

      delete m_mousePressPos;
      m_mousePressPos = NULL;

      delete m_activeCell;
      m_activeCell = NULL;

@@ -113,6 +110,9 @@ namespace Isis {
      delete m_deleteSelectedRowsAct;
      m_deleteSelectedRowsAct = NULL;

      delete m_editControlPointAct;
      m_editControlPointAct = NULL;

      delete m_lastShiftArrowSelectedCell;
      m_lastShiftArrowSelectedCell = NULL;

@@ -270,6 +270,7 @@ namespace Isis {


    void TableViewContent::mousePressEvent(QMouseEvent *event) {

      if (event->buttons() & Qt::LeftButton) {
        // FIXME refactor this file (lol)
        if (!(event->modifiers() & Qt::ShiftModifier))
@@ -878,12 +879,12 @@ namespace Isis {
      m_editWidget = NULL;
      m_lastDirectlySelectedRow = NULL;
      m_lastShiftSelection = NULL;
      m_mousePressPos = NULL;
      m_columns = NULL;
      rowsWithActiveColumnSelected = NULL;
      m_applyToSelectionAct = NULL;
      m_applyToAllAct = NULL;
      m_deleteSelectedRowsAct = NULL;
      m_editControlPointAct = NULL;
    }


@@ -977,6 +978,12 @@ namespace Isis {
        tr("Delete the currently selected rows"));
      connect(m_deleteSelectedRowsAct, SIGNAL(triggered()),
          this, SLOT(deleteSelectedRows()));

      m_editControlPointAct = new QAction(tr("Edit selected control point"), this);
      m_editControlPointAct->setStatusTip(
        tr("Edit the selected control point or the parent control point of control measure"));
      connect(m_editControlPointAct, SIGNAL(triggered()),
          this, SLOT(editControlPoint()));
    }


@@ -1354,6 +1361,25 @@ namespace Isis {
    }


    void TableViewContent::editControlPoint() {

      AbstractTreeItem *item = m_activeCell->first;

      ControlPoint *cp;
      QString serialNumber;
      if (item->getPointerType() == AbstractTreeItem::Point) {
        cp = (ControlPoint *) (item->getPointer()); 
      }
      else {
        cp = (ControlPoint *) (item->parent()->getPointer());
        serialNumber = item->getData("Image ID").toString();
      }
//    qDebug()<<"activeCell cpid = "<<cp->GetId()<<"  sn = "<<serialNumber;

      emit editControlPoint(cp, serialNumber);
    }


    void TableViewContent::updateItemList() {
      ASSERT(m_items);

@@ -1374,11 +1400,18 @@ namespace Isis {
    void TableViewContent::showContextMenu(QPoint mouseLocation) {
      QMenu contextMenu(this);

      // Only add this action if a single row is selected or a cell is selected
      // TODO: 2017-05-17 TLS
      // Always allow editing of point.  Should we check for editLock??
      QList<AbstractTreeItem *> selectedRows = m_model->getSelectedItems();
      if (selectedRows.count() <= 1 && QApplication::applicationName() != "cneteditor") {
        contextMenu.addAction(m_editControlPointAct); 
      }

      // If there is a row selection, show a context menu if the user clicked
      // anywhere on any of the selected row(s).
      if (hasRowSelection() && mouseInRowSelection(mouseLocation)) {
        contextMenu.addAction(m_deleteSelectedRowsAct);
        contextMenu.exec(mapToGlobal(mouseLocation));
      }

      // Only show the context menu for cells if the user right-clicked on the
@@ -1388,8 +1421,8 @@ namespace Isis {
          contextMenu.addAction(m_applyToSelectionAct);

        contextMenu.addAction(m_applyToAllAct);
        contextMenu.exec(mapToGlobal(mouseLocation));
      }
      contextMenu.exec(mapToGlobal(mouseLocation));
    }
  }
}
Loading