Loading isis/src/qisis/apps/qnet/qnet.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -225,8 +225,11 @@ int main(int argc, char *argv[]) { /**** EXITING ****/ // Connect the viewport's close signal to the file tool's exit method // Added 2008-12-04 by Jeannie Walldren QObject::connect(vw , SIGNAL(closeWindow()), ftool, SLOT(exit())); // Added 2018-04-24 by Adam Goins - Added in optional parameters to the closeWindow() signal // And the exit() slot so that the window's closeEvent can be handled // Appropriately. Fixes #4146. QObject::connect(vw , SIGNAL(closeWindow(QCloseEvent *)), ftool, SLOT(exit(QCloseEvent *))); //----------------------------------------------------------------- vw->show(); Loading isis/src/qisis/objs/QnetTools/QnetFileTool.cpp +15 −6 Original line number Diff line number Diff line Loading @@ -219,11 +219,19 @@ namespace Isis { emit newControlNetwork(controlNet()); } /** * Exit the program * * @internal * @history 2018-04-24 Adam Goins - Added QCloseEvent optional parameter to * set the CloseEvent triggered by an onwindowclose * to ignore the event if the 'cancel' option was selected * after clicking the close button of the viewport window. * This fixes an issue where clicking the close button and then clicking * 'cancel' from the QMessageBox would close the window but keep the * application running. Fixes #4146. */ void QnetFileTool::exit() { void QnetFileTool::exit(QCloseEvent *event) { // If control net has been changed , prompt for user to save if (m_isDirty) { int resp = QMessageBox::warning((QWidget *)parent(), "QnetTool", Loading @@ -236,14 +244,15 @@ namespace Isis { saveAs(); } if (resp == QMessageBox::Cancel) { if (event) { event->setAccepted(false); } return; } } qApp->quit(); } /** * Save control network with given file * @internal Loading isis/src/qisis/objs/QnetTools/QnetFileTool.h +12 −4 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ */ #include "FileTool.h" #include <QCloseEvent> class QString; class QWidget; Loading Loading @@ -79,6 +80,13 @@ namespace Isis { * @history 2016-04-22 Jeannie Backer - Modified to use cube labels to set * ControlNet's target instead of the TargetName. * References #3892 * @history 2018-04-24 Adam Goins - Added QCloseEvent optional parameter to slot "exit()" to * set the CloseEvent triggered by an onwindowclose * to ignore the event if the 'cancel' option was selected * after clicking the close button of the viewport window. * This fixes an issue where clicking the close button and then clicking * 'cancel' from the QMessageBox would close the window but keep the * application running. Fixes #4146. * */ Loading @@ -103,7 +111,7 @@ namespace Isis { public slots: virtual void open(); virtual void exit(); virtual void exit(QCloseEvent *event = NULL); virtual void save(); virtual void saveAs(); void loadPointImages(ControlPoint *point); Loading isis/src/qisis/objs/ViewportMainWindow/ViewportMainWindow.cpp +15 −3 Original line number Diff line number Diff line Loading @@ -103,15 +103,27 @@ namespace Isis { * signal and ignores the close event. * * @param event * * @internal * @history 2018-04-24 Adam Goins - Added optional parameter QCloseEvent to * the closeWindow() signal so that the close event can be caught * and set to rejected by listening applications (such as qnet). * Fixes an issue where closing qnet and clicking 'cancel' from the * proceeding popup dialogue would still close the window but leave * the application running. Fixes #4146. */ void ViewportMainWindow::closeEvent(QCloseEvent *event) { if (p_workspace->confirmClose()) { emit closeWindow(); emit closeWindow(event); if (event->isAccepted()) { MainWindow::closeEvent(event); } else { event->ignore(); } } else { event->ignore(); } } } isis/src/qisis/objs/ViewportMainWindow/ViewportMainWindow.h +7 −1 Original line number Diff line number Diff line Loading @@ -33,12 +33,18 @@ namespace Isis { * when exception occured * @history 2012-05-29 Steven Lambright - Updated closeEvent() to ask the user to save any * unsaved modifications to the opened cube. References #854. * @history 2018-04-24 Adam Goins - Added optional parameter QCloseEvent to * the closeWindow() signal so that the close event can be caught * and set to rejected by listening applications (such as qnet). * Fixes an issue where closing qnet and clicking 'cancel' from the * proceeding popup dialogue would still close the window but leave * the application running. Fixes #4146. */ class ViewportMainWindow : public MainWindow { Q_OBJECT signals: void closeWindow(); //!< Signal called when the window receives a close event void closeWindow(QCloseEvent *event = NULL); //!< Signal called when the window receives a close event public slots: void displayWarning(std::string &pStr, const std::string &pExStr); Loading Loading
isis/src/qisis/apps/qnet/qnet.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -225,8 +225,11 @@ int main(int argc, char *argv[]) { /**** EXITING ****/ // Connect the viewport's close signal to the file tool's exit method // Added 2008-12-04 by Jeannie Walldren QObject::connect(vw , SIGNAL(closeWindow()), ftool, SLOT(exit())); // Added 2018-04-24 by Adam Goins - Added in optional parameters to the closeWindow() signal // And the exit() slot so that the window's closeEvent can be handled // Appropriately. Fixes #4146. QObject::connect(vw , SIGNAL(closeWindow(QCloseEvent *)), ftool, SLOT(exit(QCloseEvent *))); //----------------------------------------------------------------- vw->show(); Loading
isis/src/qisis/objs/QnetTools/QnetFileTool.cpp +15 −6 Original line number Diff line number Diff line Loading @@ -219,11 +219,19 @@ namespace Isis { emit newControlNetwork(controlNet()); } /** * Exit the program * * @internal * @history 2018-04-24 Adam Goins - Added QCloseEvent optional parameter to * set the CloseEvent triggered by an onwindowclose * to ignore the event if the 'cancel' option was selected * after clicking the close button of the viewport window. * This fixes an issue where clicking the close button and then clicking * 'cancel' from the QMessageBox would close the window but keep the * application running. Fixes #4146. */ void QnetFileTool::exit() { void QnetFileTool::exit(QCloseEvent *event) { // If control net has been changed , prompt for user to save if (m_isDirty) { int resp = QMessageBox::warning((QWidget *)parent(), "QnetTool", Loading @@ -236,14 +244,15 @@ namespace Isis { saveAs(); } if (resp == QMessageBox::Cancel) { if (event) { event->setAccepted(false); } return; } } qApp->quit(); } /** * Save control network with given file * @internal Loading
isis/src/qisis/objs/QnetTools/QnetFileTool.h +12 −4 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ */ #include "FileTool.h" #include <QCloseEvent> class QString; class QWidget; Loading Loading @@ -79,6 +80,13 @@ namespace Isis { * @history 2016-04-22 Jeannie Backer - Modified to use cube labels to set * ControlNet's target instead of the TargetName. * References #3892 * @history 2018-04-24 Adam Goins - Added QCloseEvent optional parameter to slot "exit()" to * set the CloseEvent triggered by an onwindowclose * to ignore the event if the 'cancel' option was selected * after clicking the close button of the viewport window. * This fixes an issue where clicking the close button and then clicking * 'cancel' from the QMessageBox would close the window but keep the * application running. Fixes #4146. * */ Loading @@ -103,7 +111,7 @@ namespace Isis { public slots: virtual void open(); virtual void exit(); virtual void exit(QCloseEvent *event = NULL); virtual void save(); virtual void saveAs(); void loadPointImages(ControlPoint *point); Loading
isis/src/qisis/objs/ViewportMainWindow/ViewportMainWindow.cpp +15 −3 Original line number Diff line number Diff line Loading @@ -103,15 +103,27 @@ namespace Isis { * signal and ignores the close event. * * @param event * * @internal * @history 2018-04-24 Adam Goins - Added optional parameter QCloseEvent to * the closeWindow() signal so that the close event can be caught * and set to rejected by listening applications (such as qnet). * Fixes an issue where closing qnet and clicking 'cancel' from the * proceeding popup dialogue would still close the window but leave * the application running. Fixes #4146. */ void ViewportMainWindow::closeEvent(QCloseEvent *event) { if (p_workspace->confirmClose()) { emit closeWindow(); emit closeWindow(event); if (event->isAccepted()) { MainWindow::closeEvent(event); } else { event->ignore(); } } else { event->ignore(); } } }
isis/src/qisis/objs/ViewportMainWindow/ViewportMainWindow.h +7 −1 Original line number Diff line number Diff line Loading @@ -33,12 +33,18 @@ namespace Isis { * when exception occured * @history 2012-05-29 Steven Lambright - Updated closeEvent() to ask the user to save any * unsaved modifications to the opened cube. References #854. * @history 2018-04-24 Adam Goins - Added optional parameter QCloseEvent to * the closeWindow() signal so that the close event can be caught * and set to rejected by listening applications (such as qnet). * Fixes an issue where closing qnet and clicking 'cancel' from the * proceeding popup dialogue would still close the window but leave * the application running. Fixes #4146. */ class ViewportMainWindow : public MainWindow { Q_OBJECT signals: void closeWindow(); //!< Signal called when the window receives a close event void closeWindow(QCloseEvent *event = NULL); //!< Signal called when the window receives a close event public slots: void displayWarning(std::string &pStr, const std::string &pExStr); Loading