Loading isis/src/qisis/apps/ipce/IpceMainWindow.cpp +44 −48 Original line number Diff line number Diff line Loading @@ -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 *))); Loading Loading @@ -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(); Loading @@ -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* * Loading @@ -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(); } Loading Loading @@ -400,8 +398,6 @@ namespace Isis { connect(activateWhatsThisAct, SIGNAL(triggered()), this, SLOT(enterWhatsThisMode())); m_helpMenuActions.append(activateWhatsThisAct); readSettings(m_directory->project() ); } Loading Loading @@ -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); Loading Loading @@ -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; Loading isis/src/qisis/apps/ipce/IpceMainWindow.h +9 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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(); Loading Loading @@ -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 Loading isis/src/qisis/objs/BundleObservationView/BundleObservationView.cpp +4 −12 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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(); Loading @@ -217,6 +212,3 @@ namespace Isis { BundleObservationView::~BundleObservationView() { } } isis/src/qisis/objs/BundleObservationView/BundleObservationView.h +3 −0 Original line number Diff line number Diff line Loading @@ -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 Loading isis/src/qisis/objs/Directory/Directory.cpp +20 −20 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -302,7 +304,6 @@ namespace Isis { m_templateEditorWidgets.clear(); m_projectItemModel->clean(); emit directoryCleaned(); } Loading Loading @@ -679,7 +680,7 @@ namespace Isis { result->setWindowTitle(title); result->setObjectName(title); emit newDockAvailable(result); emit newWidgetAvailable(result); return result; } Loading @@ -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)), Loading Loading @@ -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 *)), Loading Loading @@ -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 Loading
isis/src/qisis/apps/ipce/IpceMainWindow.cpp +44 −48 Original line number Diff line number Diff line Loading @@ -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 *))); Loading Loading @@ -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(); Loading @@ -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* * Loading @@ -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(); } Loading Loading @@ -400,8 +398,6 @@ namespace Isis { connect(activateWhatsThisAct, SIGNAL(triggered()), this, SLOT(enterWhatsThisMode())); m_helpMenuActions.append(activateWhatsThisAct); readSettings(m_directory->project() ); } Loading Loading @@ -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); Loading Loading @@ -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; Loading
isis/src/qisis/apps/ipce/IpceMainWindow.h +9 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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(); Loading Loading @@ -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 Loading
isis/src/qisis/objs/BundleObservationView/BundleObservationView.cpp +4 −12 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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(); Loading @@ -217,6 +212,3 @@ namespace Isis { BundleObservationView::~BundleObservationView() { } }
isis/src/qisis/objs/BundleObservationView/BundleObservationView.h +3 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
isis/src/qisis/objs/Directory/Directory.cpp +20 −20 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -302,7 +304,6 @@ namespace Isis { m_templateEditorWidgets.clear(); m_projectItemModel->clean(); emit directoryCleaned(); } Loading Loading @@ -679,7 +680,7 @@ namespace Isis { result->setWindowTitle(title); result->setObjectName(title); emit newDockAvailable(result); emit newWidgetAvailable(result); return result; } Loading @@ -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)), Loading Loading @@ -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 *)), Loading Loading @@ -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