Commit eb549907 authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

Fixing merge conflicts

parents 07287615 66d7bd3d
Loading
Loading
Loading
Loading
+56 −41
Original line number Diff line number Diff line
@@ -93,16 +93,15 @@ 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 *)));
      connect(m_directory, SIGNAL(viewClosed(QWidget *)),
              this, SLOT(removeView(QWidget *)));
      connect(m_directory, SIGNAL( directoryCleaned() ),
              this, SLOT( removeAllViews() ) );
      connect(m_directory->project(), SIGNAL(projectLoaded(Project *)),
              this, SLOT(readSettings(Project *)));
      connect(m_directory->project(), SIGNAL(projectSave(Project *)),
      connect(m_directory->project(), SIGNAL(projectSaved(Project *)),
              this, SLOT(writeSettings(Project *)));
      connect(m_directory, SIGNAL( newWarning() ),
              this, SLOT( raiseWarningTab() ) );
@@ -169,9 +168,12 @@ namespace Isis {
    createMenus();
    createToolBars();

<<<<<<< HEAD
//  setTabbedViewMode();
//  centralWidget->setTabsMovable(true);
//  centralWidget->setTabsClosable(true);
=======
>>>>>>> upstream/ipceDocks
    // Read default app settings
    readSettings(m_directory->project() );

@@ -184,49 +186,54 @@ 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);
    }

    // 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()));
    // The list of dock widgets needs cleanup as each view is destroyed
    connect(dock, SIGNAL(destroyed(QObject *)),
            this, SLOT(cleanupViewDockList(QObject *)));

    // Save view docks for cleanup during a project close
    m_viewDocks.append(dock);
  }


  void IpceMainWindow::cleanupViewDockList(QObject *obj) {

    QDockWidget *dock = static_cast<QDockWidget *>(obj);
    if (dock) {
      m_viewDocks.removeAll(dock);
    }
//    m_dockedWidgets.append
  }


  /**
   * @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* 
   *
@@ -243,17 +250,14 @@ namespace Isis {
   */
  void IpceMainWindow::removeAllViews() {
    setWindowTitle("ipce");



    QList<QDockWidget *> docks = tabifiedDockWidgets(m_projectDock);
    if(docks.count() > 1) {
      foreach ( QDockWidget* widget, docks ) {
        if(widget != m_projectDock) {
          delete widget;
        }
    foreach (QDockWidget *dock, m_viewDocks) {
      if (dock) {
        removeDockWidget(dock);
        m_viewDocks.removeAll(dock);
        delete dock;
      }
    }
    m_viewDocks.clear();
  }


@@ -567,6 +571,7 @@ namespace Isis {
        QSettings::NativeFormat);

    projectSettings.setValue("geometry", QVariant(geometry()));
<<<<<<< HEAD
    
    // If we try to restore a state when we don't have the cubes for a view it could cause a crash
    // Therefore we only want to save the state if we are NOT saving to the default area
@@ -574,6 +579,11 @@ namespace Isis {
      projectSettings.setValue("windowState", saveState());
    }
    projectSettings.sync();
=======
    projectSettings.setValue("windowState", saveState());
//  projectSettings.setValue("size", size());
//  projectSettings.setValue("pos", pos());
>>>>>>> upstream/ipceDocks

    projectSettings.setValue("maxThreadCount", m_maxThreadCount);

@@ -702,6 +712,7 @@ namespace Isis {
    
    QSettings settings(FileName(filePath).expanded(), QSettings::NativeFormat);

<<<<<<< HEAD
    if (!setFullScreen) {
      setGeometry(settings.value("geometry").value<QRect>());
      restoreState(settings.value("windowState").toByteArray());
@@ -709,6 +720,10 @@ namespace Isis {
    else {
      this->showMaximized();
    }
=======
    setGeometry(settings.value("geometry").value<QRect>());
    restoreState(settings.value("windowState").toByteArray());
>>>>>>> upstream/ipceDocks

    QStringList projectNameList;
    QStringList projectPathList;
@@ -788,7 +803,7 @@ namespace Isis {
        m_directory->project()->save();
      }
    }
    writeSettings(m_directory->project());
    //writeSettings(m_directory->project());
    m_directory->project()->clear();

    QMainWindow::closeEvent(event);
+14 −4
Original line number Diff line number Diff line
@@ -134,10 +134,17 @@ namespace Isis {
   *                           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.
   *   @history 2018-06-13 Tracie Sucharski - Fixed cleanup of views and QDockWidgets. 
   *   @history 2018-06-14 Makayla Shepherd - ipce now defaults to full screen if there is not an
   *                           ipce.config in the project or in ~/.Isis/ipce.
   *   @history 2018-06-14 Makayla Shepherd - We are no longer saving the state of a temporary
   *                           project.
   *  
   */
  class IpceMainWindow : public QMainWindow {
      Q_OBJECT
@@ -146,12 +153,13 @@ 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();

      void readSettings(Project *);
      void writeSettings(Project *project);

    protected:
      void closeEvent(QCloseEvent *event);
@@ -167,6 +175,7 @@ namespace Isis {
      
      void writeSettings(Project *project);

      void cleanupViewDockList(QObject *obj);
    private:
      Q_DISABLE_COPY(IpceMainWindow);

@@ -186,7 +195,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
+5 −3
Original line number Diff line number Diff line
@@ -219,8 +219,6 @@ namespace Isis {
    saveMeasureLayout->insertStretch(-1);

    m_cnetFileNameLabel = new QLabel("Control Network: " + m_cnetFileName);
    m_cnetFileNameLabel->setToolTip("Name of opened control network file.");
    m_cnetFileNameLabel->setWhatsThis("Name of opened control network file.");

    m_templateFileNameLabel = new QLabel("Template File: " +
        m_measureEditor->templateFileName());
@@ -589,7 +587,11 @@ namespace Isis {
    m_controlNet = control->controlNet();
    m_cnetFileName = control->fileName();

    m_cnetFileNameLabel->setText("Control Network: " + m_cnetFileName);
    QStringList cnetDirs = m_cnetFileName.split('/');
    QString strippedCnetFilename = cnetDirs.value(cnetDirs.length() -1);
    m_cnetFileNameLabel->setText("Control Network: " + strippedCnetFilename);
    m_cnetFileNameLabel->setToolTip(m_cnetFileName);
    m_cnetFileNameLabel->setWhatsThis(m_cnetFileName);
    setWindowTitle("Control Point Editor- Control Network File: " + m_cnetFileName);

    emit newControlNetwork(m_controlNet);
Loading