Commit f0370278 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Updated the JigsawSetupDialog::createObservationSolveSettingsTreeView()...

Updated the JigsawSetupDialog::createObservationSolveSettingsTreeView() function so that the root index of the tree view is selected by the user and not hardcoded.
parent ae3533c7
Loading
Loading
Loading
Loading
+20 −17
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <QPushButton>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <QItemSelection>

#include "BundleSolutionInfo.h"
#include "BundleSettings.h"
@@ -17,6 +18,7 @@
#include "MaximumLikelihoodWFunctions.h"
#include "SubTreeProxyModel.h"
#include "Project.h"
#include "ProjectItem.h"
#include "ProjectItemProxyModel.h"
#include "SpecialPixel.h"
#include "ui_JigsawSetupDialog.h"
@@ -51,6 +53,11 @@ namespace Isis {
      makeReadOnly();
    }



    //connect( m_project->directory()->model(), SIGNAL(selectionChanged(QList<ProjectItem *> &)),
    //         this, SLOT(on_projectItemSelectionChanged(const QList<ProjectItem *> &) ) );

    // initializations for general tab

    // fill control net combo box from project
@@ -196,6 +203,7 @@ namespace Isis {
  }



  JigsawSetupDialog::~JigsawSetupDialog() {
    // delete/null m_ui since we did "new" this pointers in the constructor
    if (m_ui) {
@@ -1130,6 +1138,11 @@ namespace Isis {
  void JigsawSetupDialog::createObservationSolveSettingsTreeView() {
    // Proof-of-

    QList<ProjectItem *> selectedItems = m_project->directory()->model()->selectedItems();

    foreach(ProjectItem *item,selectedItems){
      qDebug() << "Selected Item:  " << item->text();
    }
    qDebug() << "JigsawSetupDialog::createObservationSolveSettingsTreeView()";

//    m_ui->treeView->setModel((QAbstractItemModel*)(m_project->directory()->model()));
@@ -1141,33 +1154,23 @@ namespace Isis {

     //QModelIndex SubTreeProxyModel::mapFromSource(const QModelIndex &sourceIndex)
    // find the root "Images" and set it in the proxy
    QStandardItem *item = model->invisibleRootItem()->child(0)->child(1);
    qDebug() << "ITEM: " << item << ", " << item->text();
    qDebug() << "PARENT: " << item->parent() << ", " << item->parent()->text();
    //QStandardItem *item = model->invisibleRootItem()->child(0)->child(1);
    //qDebug() << "ITEM: " << item << ", " << item->text();
    //qDebug() << "PARENT: " << item->parent() << ", " << item->parent()->text();


    // i think source model tries to add top root item, which is invalid???
    //osspm->setRoot(item);

    m_ui->treeView->setModel(osspm);

    //Set the root index to display the subtree we are interesting in.  This requires
    //Set the root index to display the subtree we are interested in.  This requires
    //computing the proxy index from the source model.
     m_ui->treeView->setRootIndex(osspm->mapFromSource(item->index() ));








    if (selectedItems.count() > 0) {
      m_ui->treeView->setRootIndex(osspm->mapFromSource(selectedItems[0]->index() ));

    }

    // Try to loop through the view here to add the "groups" so they aren't part of the model

    // Add apply button to the tab view
    // set the text to bold?

  }
}
+7 −0
Original line number Diff line number Diff line
@@ -9,8 +9,12 @@ namespace Ui {
  class JigsawSetupDialog;
}

class QItemSelection;


namespace Isis {
  class Project;
  class ProjectItem;
  class Control;

  /**
@@ -80,6 +84,9 @@ namespace Isis {

  private slots:


    //void on_projectItemSelectionChanged(const QList<ProjectItem *> selectedItems);

    void on_radiusCheckBox_toggled(bool checked);
    //void on_outlierRejectionCheckBox_toggled(bool checked);