Loading isis/src/qisis/apps/ipce/IpceMainWindow.cpp +25 −13 Original line number Diff line number Diff line Loading @@ -252,9 +252,20 @@ namespace Isis { 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 *))); // Only emit the signal when one view is added just for simplicity; behavior would not change // if this was emitted after every addition. if (m_viewDocks.size() == 1) { emit enableViewActions(true); } } /** * Cleans up m_viewDocks when a view is closed (object is destroyed). * * @param view QObject* The dock widget to remove from the m_viewDocks */ void IpceMainWindow::cleanupViewDockList(QObject *obj) { QDockWidget *dock = static_cast<QDockWidget *>(obj); Loading @@ -262,6 +273,10 @@ namespace Isis { m_viewDocks.removeAll(dock); m_specialDocks.removeAll(dock); } if (m_viewDocks.size() == 0) { emit enableViewActions(false); } } Loading @@ -287,7 +302,6 @@ namespace Isis { foreach (QDockWidget *dock, m_viewDocks) { if (dock) { removeDockWidget(dock); m_viewDocks.removeAll(dock); delete dock; } } Loading @@ -301,6 +315,7 @@ namespace Isis { } m_viewDocks.clear(); m_specialDocks.clear(); emit enableViewActions(false); } Loading Loading @@ -409,11 +424,15 @@ namespace Isis { QAction *tabViewsAction = new QAction("Tab Views", this); connect( tabViewsAction, SIGNAL(triggered()), this, SLOT(tabViews()) ); connect( this, SIGNAL(enableViewActions(bool)), tabViewsAction, SLOT(setEnabled(bool)) ); m_viewMenuActions.append(tabViewsAction); tabViewsAction->setDisabled(true); // Disabled on default, until a view is added QAction *tileViewsAction = new QAction("Tile Views", this); connect( tileViewsAction, SIGNAL(triggered()), this, SLOT(tileViews()) ); connect( this, SIGNAL(enableViewActions(bool)), tileViewsAction, SLOT(setEnabled(bool)) ); m_viewMenuActions.append(tileViewsAction); tileViewsAction->setDisabled(true); // Disabled on default, until a view is added QAction *undoAction = m_directory->undoAction(); undoAction->setShortcut(Qt::Key_Z | Qt::CTRL); Loading Loading @@ -783,13 +802,6 @@ namespace Isis { m_maxThreadCount = globalSettings.value("maxThreadCount", m_maxThreadCount).toInt(); applyMaxThreadCount(); } // The geom/state isn't enough for main windows to correctly remember // their position and size, so let's restore those on top of // the geom and state. if (!projectSettings.value("pos").toPoint().isNull()) { move(projectSettings.value("pos").toPoint()); } // m_directory->project()->setClean(true); } Loading isis/src/qisis/apps/ipce/IpceMainWindow.h +6 −3 Original line number Diff line number Diff line Loading @@ -194,6 +194,9 @@ namespace Isis { * the geometry value does not exist in the config file. This allows the * geometry to be saved if the config file does not exist and a user * opens a project. Before, it would not save the geometry because the * opened project was not temporary. References #5433. * @history 2018-07-17 Kaitlyn Lee - Added signal enableViewActions(bool) to enable/disable * tab/tile views when views are opened/closed. * opened project was not temporary. References #5433 * @history 2018-07-19 Tracie Sucharski - Keep separate dock lists for the view docks and * "special" docks such as sensor, target and jigsaw. The Loading @@ -209,6 +212,9 @@ namespace Isis { explicit IpceMainWindow(QWidget *parent = 0); ~IpceMainWindow(); signals: void enableViewActions(bool value); public slots: void addView(QWidget *newWidget, Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, Qt::Orientation orientation = Qt::Horizontal); Loading Loading @@ -283,9 +289,6 @@ namespace Isis { QList<QAction *> m_helpMenuActions;//!< Internal list of help actions QList<QAction *> m_permToolBarActions;//!< Internal list of permanent toolbar actions QAction *m_cascadeViewsAction; //!< Action that cascades the mdi area QAction *m_tileViewsAction; //!< Action that tiles the mdi area }; } Loading isis/src/qisis/objs/CnetEditorView/CnetEditorView.h +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ namespace Isis { * set the central widget's layout. * @history 2018-06-05 Kaitlyn Lee - Added createMenus() and createToolBars(). The body of createMenus() * was moved from the constructor. createToolBars() was copied and edited * from CnetEditorWindow. Fixes #5416 * from CnetEditorWindow. Fixes #5416. Fixes #4988 * @history 2018-06-13 Kaitlyn Lee - Since views now inherit from QMainWindow, each individual * view has its own toolbar, so having getters that return toolbar * actions to fill the toolbar of the IpceMainWindow are unnecessary. Loading isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ namespace Isis { connect(CnetDisplayProperties::getInstance(), SIGNAL(compositionFinished()), this, SLOT(rebuildModels())); connect(this, SIGNAL(cnetModified()), this, SLOT(setCnetModified())); m_settingsPath = new QString(pathForSettings); QBoxLayout *mainLayout = createMainLayout(); Loading Loading @@ -1050,4 +1051,12 @@ namespace Isis { m_connectionModel->setFrozen(false); } } /** * Connected to cnetModified(). Sets the modification of m_control when the cnet is modified. */ void CnetEditorWidget::setCnetModified() { m_control->setModified(true); } } isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.h +10 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,14 @@ namespace Isis { * CnetEditorView class for ipce. * @history 2018-06-12 Kaitlyn Lee - Added m_sortDialog to keep track if a dialog exists * so only one instance can be open at a time. * @history 2018-07-12 Kaitlyn Lee - Added setCnetModified() and the connection with * cnetModified() to call setModified(true) on a control when a user * edits a cnet. cnetModified() was only connected to a slot in * Directory, and this was connected to a slot in Project called * activeControlModified() that would call setModified(true) on the * active control. So, when a user changed any cnets, the only cnet that * was recognized as being modified was the active. Adding this allows * a user to save changes made to a nonactive cnet. Fixes #5414. */ class CnetEditorWidget : public QWidget { Q_OBJECT Loading Loading @@ -141,6 +149,8 @@ namespace Isis { void handlePointTableFilterCountsChanged(int visibleRows, int totalRows); void handleMeasureTableFilterCountsChanged(int visibleRows, int totalRows); void setCnetModified(); private: //methods Loading Loading
isis/src/qisis/apps/ipce/IpceMainWindow.cpp +25 −13 Original line number Diff line number Diff line Loading @@ -252,9 +252,20 @@ namespace Isis { 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 *))); // Only emit the signal when one view is added just for simplicity; behavior would not change // if this was emitted after every addition. if (m_viewDocks.size() == 1) { emit enableViewActions(true); } } /** * Cleans up m_viewDocks when a view is closed (object is destroyed). * * @param view QObject* The dock widget to remove from the m_viewDocks */ void IpceMainWindow::cleanupViewDockList(QObject *obj) { QDockWidget *dock = static_cast<QDockWidget *>(obj); Loading @@ -262,6 +273,10 @@ namespace Isis { m_viewDocks.removeAll(dock); m_specialDocks.removeAll(dock); } if (m_viewDocks.size() == 0) { emit enableViewActions(false); } } Loading @@ -287,7 +302,6 @@ namespace Isis { foreach (QDockWidget *dock, m_viewDocks) { if (dock) { removeDockWidget(dock); m_viewDocks.removeAll(dock); delete dock; } } Loading @@ -301,6 +315,7 @@ namespace Isis { } m_viewDocks.clear(); m_specialDocks.clear(); emit enableViewActions(false); } Loading Loading @@ -409,11 +424,15 @@ namespace Isis { QAction *tabViewsAction = new QAction("Tab Views", this); connect( tabViewsAction, SIGNAL(triggered()), this, SLOT(tabViews()) ); connect( this, SIGNAL(enableViewActions(bool)), tabViewsAction, SLOT(setEnabled(bool)) ); m_viewMenuActions.append(tabViewsAction); tabViewsAction->setDisabled(true); // Disabled on default, until a view is added QAction *tileViewsAction = new QAction("Tile Views", this); connect( tileViewsAction, SIGNAL(triggered()), this, SLOT(tileViews()) ); connect( this, SIGNAL(enableViewActions(bool)), tileViewsAction, SLOT(setEnabled(bool)) ); m_viewMenuActions.append(tileViewsAction); tileViewsAction->setDisabled(true); // Disabled on default, until a view is added QAction *undoAction = m_directory->undoAction(); undoAction->setShortcut(Qt::Key_Z | Qt::CTRL); Loading Loading @@ -783,13 +802,6 @@ namespace Isis { m_maxThreadCount = globalSettings.value("maxThreadCount", m_maxThreadCount).toInt(); applyMaxThreadCount(); } // The geom/state isn't enough for main windows to correctly remember // their position and size, so let's restore those on top of // the geom and state. if (!projectSettings.value("pos").toPoint().isNull()) { move(projectSettings.value("pos").toPoint()); } // m_directory->project()->setClean(true); } Loading
isis/src/qisis/apps/ipce/IpceMainWindow.h +6 −3 Original line number Diff line number Diff line Loading @@ -194,6 +194,9 @@ namespace Isis { * the geometry value does not exist in the config file. This allows the * geometry to be saved if the config file does not exist and a user * opens a project. Before, it would not save the geometry because the * opened project was not temporary. References #5433. * @history 2018-07-17 Kaitlyn Lee - Added signal enableViewActions(bool) to enable/disable * tab/tile views when views are opened/closed. * opened project was not temporary. References #5433 * @history 2018-07-19 Tracie Sucharski - Keep separate dock lists for the view docks and * "special" docks such as sensor, target and jigsaw. The Loading @@ -209,6 +212,9 @@ namespace Isis { explicit IpceMainWindow(QWidget *parent = 0); ~IpceMainWindow(); signals: void enableViewActions(bool value); public slots: void addView(QWidget *newWidget, Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, Qt::Orientation orientation = Qt::Horizontal); Loading Loading @@ -283,9 +289,6 @@ namespace Isis { QList<QAction *> m_helpMenuActions;//!< Internal list of help actions QList<QAction *> m_permToolBarActions;//!< Internal list of permanent toolbar actions QAction *m_cascadeViewsAction; //!< Action that cascades the mdi area QAction *m_tileViewsAction; //!< Action that tiles the mdi area }; } Loading
isis/src/qisis/objs/CnetEditorView/CnetEditorView.h +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ namespace Isis { * set the central widget's layout. * @history 2018-06-05 Kaitlyn Lee - Added createMenus() and createToolBars(). The body of createMenus() * was moved from the constructor. createToolBars() was copied and edited * from CnetEditorWindow. Fixes #5416 * from CnetEditorWindow. Fixes #5416. Fixes #4988 * @history 2018-06-13 Kaitlyn Lee - Since views now inherit from QMainWindow, each individual * view has its own toolbar, so having getters that return toolbar * actions to fill the toolbar of the IpceMainWindow are unnecessary. Loading
isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ namespace Isis { connect(CnetDisplayProperties::getInstance(), SIGNAL(compositionFinished()), this, SLOT(rebuildModels())); connect(this, SIGNAL(cnetModified()), this, SLOT(setCnetModified())); m_settingsPath = new QString(pathForSettings); QBoxLayout *mainLayout = createMainLayout(); Loading Loading @@ -1050,4 +1051,12 @@ namespace Isis { m_connectionModel->setFrozen(false); } } /** * Connected to cnetModified(). Sets the modification of m_control when the cnet is modified. */ void CnetEditorWidget::setCnetModified() { m_control->setModified(true); } }
isis/src/qisis/objs/CnetEditorWidget/CnetEditorWidget.h +10 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,14 @@ namespace Isis { * CnetEditorView class for ipce. * @history 2018-06-12 Kaitlyn Lee - Added m_sortDialog to keep track if a dialog exists * so only one instance can be open at a time. * @history 2018-07-12 Kaitlyn Lee - Added setCnetModified() and the connection with * cnetModified() to call setModified(true) on a control when a user * edits a cnet. cnetModified() was only connected to a slot in * Directory, and this was connected to a slot in Project called * activeControlModified() that would call setModified(true) on the * active control. So, when a user changed any cnets, the only cnet that * was recognized as being modified was the active. Adding this allows * a user to save changes made to a nonactive cnet. Fixes #5414. */ class CnetEditorWidget : public QWidget { Q_OBJECT Loading Loading @@ -141,6 +149,8 @@ namespace Isis { void handlePointTableFilterCountsChanged(int visibleRows, int totalRows); void handleMeasureTableFilterCountsChanged(int visibleRows, int totalRows); void setCnetModified(); private: //methods Loading