Commit 6d3427f1 authored by Summer Stapleton's avatar Summer Stapleton
Browse files

Fixed merged conflict after Tracie's PR

parents 61435879 f8f5c0d3
Loading
Loading
Loading
Loading
+44 −48
Original line number Diff line number Diff line
@@ -93,8 +93,6 @@ namespace Isis {

    try {
      m_directory = new Directory(this);
      connect(m_directory, SIGNAL(newDockAvailable(QMainWindow *)),
              this, SLOT(addDock(QMainWindow *)));
      connect(m_directory, SIGNAL( newWidgetAvailable(QWidget *) ),
              this, SLOT( addView(QWidget *) ) );
      connect(m_directory, SIGNAL(viewClosed(QWidget *)), this, SLOT(removeView(QWidget *)));
@@ -170,6 +168,8 @@ namespace Isis {
//  setTabbedViewMode();
//  centralWidget->setTabsMovable(true);
//  centralWidget->setTabsClosable(true);
    // Read default app settings
    readSettings(m_directory->project() );

    QStringList args = QCoreApplication::arguments();

@@ -180,49 +180,41 @@ namespace Isis {
  }


  void IpceMainWindow::addDock(QMainWindow *newWidgetForDock) {

    QDockWidget *dock = new QDockWidget(newWidgetForDock->windowTitle(), this, Qt::SubWindow);
    dock->setWidget(newWidgetForDock);
    dock->setObjectName(newWidgetForDock->windowTitle());

    // This needs to eventually be a work order...
    dock->setAttribute(Qt::WA_DeleteOnClose);

    connect(newWidgetForDock, SIGNAL(destroyed(QObject *)),
            dock, SLOT(deleteLater()));

    addDockWidget(Qt::LeftDockWidgetArea, dock, Qt::Horizontal);
//    addDockWidget(area, dock, orientation);
  }


  /**
   * This is connected from Directory's newWidgetAvailable signal and called when re-attaching a
   * view which was detached from the MDI main window.
   * This is connected from Directory's newWidgetAvailable signal
   *
   * @param[in] newWidget (QWidget *)
   */
  void IpceMainWindow::addView(QWidget *newWidget) {
  void IpceMainWindow::addView(QWidget *newWidget, Qt::DockWidgetArea area,
                               Qt::Orientation orientation) {

    QDockWidget *dock = new QDockWidget(newWidget->windowTitle(), this);
    dock->setWidget(newWidget);
    dock->setObjectName(newWidget->windowTitle());
    dock->setAttribute(Qt::WA_DeleteOnClose);
    dock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable |
                      QDockWidget::DockWidgetFloatable);

    if ( qobject_cast<SensorInfoWidget *>(newWidget) ||
         qobject_cast<TargetInfoWidget *>(newWidget) ||
         qobject_cast<TemplateEditorWidget *>(newWidget)) {
      QDockWidget *dock = new QDockWidget( newWidget->windowTitle() );
      dock->setAttribute(Qt::WA_DeleteOnClose, true);
      dock->setWidget(newWidget);
      dock->setObjectName(newWidget->windowTitle());
      splitDockWidget(m_projectDock, dock, Qt::Vertical);
    }
    else {

      addDockWidget(area, dock, orientation);
    }
//    m_dockedWidgets.append

    // Connections for cleanup in both directions to make sure both views and docks are cleaned up
    connect(newWidget, SIGNAL(destroyed(QObject *)), dock, SLOT(deleteLater()));
    connect(dock, SIGNAL(destroyed(QObject *)), newWidget, SLOT(deleteLater()));
    // Save view docks for cleanup during a project close
    m_viewDocks.append(dock);
  }


  /**
   * @description This slot is connected from Directory::viewClosed(QWidget *) signal.  It will 
   * close the given view and delete the view.
   * close the given view and delete the view. This was written to handle
   * 
   * @param view QWidget* 
   *
@@ -239,17 +231,23 @@ namespace Isis {
   */
  void IpceMainWindow::removeAllViews() {
    setWindowTitle("ipce");
//  qDebug()<<"IpceMainWindow::removeAllViews  directory footprint count = "<<m_directory->footprint2DViews().count();
//  qDebug()<<"                                directory cube disp count = "<<m_directory->cubeDnViews().count();



    QList<QDockWidget *> docks = tabifiedDockWidgets(m_projectDock);
    if(docks.count() > 1) {
      foreach ( QDockWidget* widget, docks ) {
        if(widget != m_projectDock) {
          delete widget;
        }
      }
    // Find all children of IpceMainWindow and close
    QList<QDockWidget *> dockedWidgets = findChildren<QDockWidget *>();
//  qDebug()<<"           # docks before removal = "<<dockedWidgets.count();
    foreach (QDockWidget *dock, m_viewDocks) {
      removeDockWidget(dock);
      m_viewDocks.removeAll(dock);
      delete dock;
    }

    QList<QDockWidget *> dockedWidgets2 = findChildren<QDockWidget *>();
//  qDebug()<<"           any docks left"<<dockedWidgets2.count();
//  qDebug()<<"IpceMainWindow::removeAllViews  directory footprint count = "<<m_directory->footprint2DViews().count();
//  qDebug()<<"                                directory cube disp count = "<<m_directory->cubeDnViews().count();
    m_viewDocks.clear();
  }


@@ -400,8 +398,6 @@ namespace Isis {
    connect(activateWhatsThisAct, SIGNAL(triggered()), this, SLOT(enterWhatsThisMode()));

    m_helpMenuActions.append(activateWhatsThisAct);

    readSettings(m_directory->project() );
  }


@@ -561,10 +557,10 @@ namespace Isis {
          .expanded(),
        QSettings::NativeFormat);

    projectSettings.setValue("geometry", saveGeometry());
    //projectSettings.setValue("windowState", saveState());
    projectSettings.setValue("size", size());
    projectSettings.setValue("pos", pos());
    projectSettings.setValue("geometry", QVariant(geometry()));
    projectSettings.setValue("windowState", saveState());
//  projectSettings.setValue("size", size());
//  projectSettings.setValue("pos", pos());

    projectSettings.setValue("maxThreadCount", m_maxThreadCount);

@@ -674,8 +670,8 @@ namespace Isis {
        FileName("$HOME/.Isis/" + appName + "/" + appName + "_" + project->name() + ".config")
        .expanded(), QSettings::NativeFormat);

    restoreGeometry(settings.value("geometry").toByteArray());
    //restoreState(settings.value("windowState").toByteArray());
    setGeometry(settings.value("geometry").value<QRect>());
    restoreState(settings.value("windowState").toByteArray());

    QStringList projectNameList;
    QStringList projectPathList;
+9 −5
Original line number Diff line number Diff line
@@ -132,8 +132,11 @@ namespace Isis {
   *                           Fixes #5412.
   *   @history 2018-05-30 Tracie Sucharski - Fix to handle the re-factored docked views.
   *                           Changed from MDI to SDI, changing the centralWidget to a dumy, unused
   *                           widget. Added addDock method. Remove all methods having to do with
   *                           MDI sub-windows, detached views.
   *                           widget. Remove all methods having to do with MDI sub-windows,
   *                           detached views.  The dock widgets holding the views are saved off
   *                           for cleanup because there is no way to get the dock from the view.
   *                           Cleanup connections are made for the views and the docks to ensure
   *                           that cleanup happens for both.  Fixes #5433.
   *  
   */
  class IpceMainWindow : public QMainWindow {
@@ -143,8 +146,8 @@ namespace Isis {
      ~IpceMainWindow();

    public slots:
      void addView(QWidget *newWidget);
      void addDock(QMainWindow *newWidgetForDock);
      void addView(QWidget *newWidget, Qt::DockWidgetArea area = Qt::LeftDockWidgetArea,
                   Qt::Orientation orientation = Qt::Horizontal);
      void removeView(QWidget *view);
      void removeAllViews();

@@ -182,7 +185,8 @@ namespace Isis {
      QDockWidget *m_projectDock;
      QDockWidget *m_warningsDock;

      QList<QDockWidget *> m_dockedWidgets;
      QList<QDockWidget *> m_viewDocks; //!< QDockWidgets holding the views

      /**
       * This is the "goal" or "estimated" maximum number of active threads running in this program
       *   at once. For now, the GUI consumes 1 thread and QtConcurrent
+4 −12
Original line number Diff line number Diff line
@@ -156,9 +156,7 @@ namespace Isis {
    // NOTE: QHeaderView::ResizeToContents does not allow user to resize by dragging column divider
    qtable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);

    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
    layout->addWidget(qtable);
    setCentralWidget(qtable);

    QSizePolicy policy = sizePolicy();
    policy.setHorizontalPolicy(QSizePolicy::Expanding);
@@ -198,10 +196,7 @@ namespace Isis {

    file.close();

    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
    layout->addWidget(qText);

    setCentralWidget(qText);
    qText->moveCursor(QTextCursor::Start);

    QSizePolicy policy = sizePolicy();
@@ -217,6 +212,3 @@ namespace Isis {
  BundleObservationView::~BundleObservationView() {
  }
}


+3 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ namespace Isis{
   *   @history 2018-04-16 Ken Edmundson - Modified display of residuals.csv to properly show the
   *                           rejected column if there are rejected measures. Also displays
   *                           rejected measure row in red.
   *   @history 2018-06-06 Kaitlyn Lee - Set a central widget and removed layout (it is not needed
   *                           after setting a central widget) because AbstractProjectItemView was
   *                           updated to inherit from QMainWindow.
   */

  class BundleObservationView : public AbstractProjectItemView
+20 −20
Original line number Diff line number Diff line
@@ -288,6 +288,8 @@ namespace Isis {
   * to allow for a new project to be opened in IPCE.
   */
  void Directory::clean() {
    emit directoryCleaned();

    m_historyTreeWidget->clear();
    m_warningTreeWidget->clear();
    m_bundleObservationViews.clear();
@@ -302,7 +304,6 @@ namespace Isis {
    m_templateEditorWidgets.clear();

    m_projectItemModel->clean();
    emit directoryCleaned();
  }


@@ -679,7 +680,7 @@ namespace Isis {
    result->setWindowTitle(title);
    result->setObjectName(title);

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

    return result;
  }
@@ -699,7 +700,7 @@ namespace Isis {
    result->setWindowTitle("Cube DN View");
    result->setWindowTitle( tr("Cube DN View %1").arg(m_cubeDnViewWidgets.count() ) );

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

    //  Connections between mouse button events from view and control point editing
    connect(result, SIGNAL(modifyControlPoint(ControlPoint *, QString)),
@@ -750,11 +751,10 @@ namespace Isis {

    connect(result, SIGNAL(destroyed(QObject *)),
            this, SLOT(cleanupFootprint2DViewWidgets(QObject *)));

    connect(result, SIGNAL(windowChangeEvent(bool)),
            m_project, SLOT(setClean(bool)));
                    
    emit newDockAvailable(result);
    emit newWidgetAvailable(result);

    //  Connections between mouse button events from footprint2DView and control point editing
    connect(result, SIGNAL(modifyControlPoint(ControlPoint *)),
@@ -826,7 +826,7 @@ namespace Isis {

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

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