Unverified Commit b1e90678 authored by Tracie Sucharski's avatar Tracie Sucharski Committed by GitHub
Browse files

Merge pull request #197 from kdl222/ipceMW

ControlPointEditView and CnetEditorView converted to QMainWindows
parents 3853e473 ca8fde62
Loading
Loading
Loading
Loading
+11 −61
Original line number Diff line number Diff line
@@ -60,77 +60,28 @@ namespace Isis {
    // TODO: This layout should be inside of the cnet editor widget, but I put it here to not
    //     conflict with current work in the cnet editor widget code.
    //QWidget *result = new QWidget;
    QGridLayout *resultLayout = new QGridLayout;
    setLayout(resultLayout);

    int row = 0;

    QMenuBar *menuBar = new QMenuBar;
    resultLayout->addWidget(menuBar, row, 0, 1, 2);
    row++;
    QWidget *centralWidget = new QWidget;
    setCentralWidget(centralWidget);
    QGridLayout *resultLayout = new QGridLayout;
    centralWidget->setLayout(resultLayout);

    m_cnetEditorWidget = new CnetEditorWidget(control, configFile.expanded());
    m_control = control;

    resultLayout->addWidget(m_cnetEditorWidget, row, 0, 1, 2);
    row++;

    // Populate the menu...
    QMap< QAction *, QList< QString > > actionMap = m_cnetEditorWidget->menuActions();
    QMapIterator< QAction *, QList< QString > > actionMapIterator(actionMap);

    QMap<QString, QMenu *> topLevelMenus;

    while ( actionMapIterator.hasNext() ) {
      actionMapIterator.next();
      QAction *actionToAdd = actionMapIterator.key();
      QList< QString > location = actionMapIterator.value();

      QMenu *menuToPutActionInto = NULL;

      if ( location.count() ) {
        QString topLevelMenuTitle = location.takeFirst();
        if (!topLevelMenus[topLevelMenuTitle]) {
          topLevelMenus[topLevelMenuTitle] = menuBar->addMenu(topLevelMenuTitle);
        }

        menuToPutActionInto = topLevelMenus[topLevelMenuTitle];
      }

      foreach (QString menuName, location) {
        bool foundSubMenu = false;
        foreach ( QAction *possibleSubMenu, menuToPutActionInto->actions() ) {
          if (!foundSubMenu &&
              possibleSubMenu->menu() && possibleSubMenu->menu()->title() == menuName) {
            foundSubMenu = true;
            menuToPutActionInto = possibleSubMenu->menu();
          }
        }

        if (!foundSubMenu) {
          menuToPutActionInto = menuToPutActionInto->addMenu(menuName);
        }
      }

      menuToPutActionInto->addAction(actionToAdd);
    }
    resultLayout->addWidget(m_cnetEditorWidget, 0, 0, 1, 2);

    QTabWidget *treeViews = new QTabWidget;
    treeViews->addTab( m_cnetEditorWidget->pointTreeView(), tr("Point View") );
    treeViews->addTab( m_cnetEditorWidget->serialTreeView(), tr("Serial View") );
    treeViews->addTab( m_cnetEditorWidget->connectionTreeView(), tr("Connection View") );
    resultLayout->addWidget(treeViews, row, 0, 1, 1);
    resultLayout->addWidget(treeViews, 1, 0, 1, 1);

    QTabWidget *filterViews = new QTabWidget;
    filterViews->addTab( m_cnetEditorWidget->pointFilterWidget(), tr("Filter Points and Measures") );
    filterViews->addTab( m_cnetEditorWidget->serialFilterWidget(), tr("Filter Images and Points") );
    filterViews->addTab( m_cnetEditorWidget->connectionFilterWidget(), tr("Filter Connections") );
    resultLayout->addWidget(filterViews, row, 1, 1, 1);
    row++;




    resultLayout->addWidget(filterViews, 1, 1, 1, 1);

    m_permToolBar = new QToolBar("Standard Tools", 0);
    m_permToolBar->setObjectName("permToolBar");
@@ -325,4 +276,3 @@ namespace Isis {
    return result;
  }
}
+8 −3
Original line number Diff line number Diff line
@@ -51,6 +51,11 @@ namespace Isis {
   * @author 2018-04-04 Tracie Sucharski
   *
   * @internal
   *    @history 2018-06-1 Kaitlyn Lee - Because AbstractProjectItemView now inherits
   *                                from QMainWindow, I added a dummy central widget
   *                                and set its layout to the grid layout. We used to set
   *                                the whole CnetEditorView widget's layout, now we only
   *                                set the central widget's layout.
   */

class CnetEditorView : public AbstractProjectItemView {
+3 −3
Original line number Diff line number Diff line
@@ -53,9 +53,10 @@ namespace Isis {
    //       net, while the editors might be using a different net.  Will Directory keep track?
    //


    QWidget *centralWidget = new QWidget;
    setCentralWidget(centralWidget);
    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
    centralWidget->setLayout(layout);

    layout->addWidget(m_controlPointEditWidget);

@@ -160,4 +161,3 @@ namespace Isis {


}
+8 −3
Original line number Diff line number Diff line
@@ -44,6 +44,11 @@ namespace Isis {
   * @internal
   *   @history 2016-09-30 Tracie Sucharski - Pass in directory to constructor, so that we can
   *                           query for shapes and other data from the project.
   *   @history 2018-05-28 Kaitlyn Lee - Since AbstractProjectItemView now inherits
   *                           from QMainWindow, I added a dummy central widget
   *                           and set its layout to QVBoxLayout. We used to set
   *                           the whole CnetEditorView widget's layout, now we only
   *                           set the central widget's layout.
   */

class ControlPointEditView : public AbstractProjectItemView {
+14 −14
Original line number Diff line number Diff line
@@ -679,7 +679,7 @@ namespace Isis {
    result->setWindowTitle(title);
    result->setObjectName(title);

    emit newWidgetAvailable(result);
    emit newDockAvailable(result);

    return result;
  }
@@ -823,7 +823,7 @@ namespace Isis {

      connect(result, SIGNAL(destroyed(QObject *)),
              this, SLOT(cleanupControlPointEditViewWidget(QObject *)));
      emit newWidgetAvailable(result);
      emit newDockAvailable(result);

// 2017-06-09 Ken commented out for Data Workshop demo
//      m_chipViewports = new ChipViewportsWidget(result);
Loading