Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing the main qnet window after modifying control net and hitting "Cancel" closes the main window #2223

Closed
ascbot opened this issue Feb 14, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@ascbot
Copy link
Contributor

ascbot commented Feb 14, 2019


Author Name: Ian Humphrey (Ian Humphrey)

Original Assignee: Adam Goins


This occurs (on Fedora21) when running qnet and modifying a control network (by either changing points in an existing control network or creating a new control network).

When closing the main qnet window (clicking the window's close / X button), a prompt will appear:

QnetTool

The control network files have been modified.
Do you want to save your changes?

[Cancel] [No] [Yes]

Clicking Cancel will close the main qnet application window, but qnet will still be running.

This bug does not occur when using File->Exit or the CTRL-Q shortcut to quit and then clicking Cancel on the dialog.

@ascbot ascbot added the bug Something isn't working label Feb 14, 2019
@ascbot
Copy link
Contributor Author

ascbot commented Feb 14, 2019


Original Redmine Comment
Author Name: Adam Goins (Adam Goins)
Original Date: 2018-04-24T20:00:41Z


This was caused because we connect the ViewportMainWindow::closeWindow() signal directly to the QnetFileTool::exit() slot.
The exit() slot prompts the popup dialogue, and if 'cancel' is selected it simply returns from the exit function. The CloseWindow() is emitted from the window's closeEvent() method, which emits that signal but then proceeds to close the application anyway with no regard to what happened in the listening exit() slot.
There was insufficient communication between these two programs.

The solution was to pass a pointer to the QCloseEvent object that ViewportMainWindow receives when closed, and pass that into the QnetFileTool's exit() slot so that we could set that QCloseEvent to be ignored if the "cancel" option was clicked.
These parameters were added as optional parameters to address backwards compatibility and not interfere with applications that were listening for a ViewportMainWindow::closeWindow() signal that wasn't populated with a QCloseEvent object.

Changes can be found in /work/projects/isis/latest/m04146 and have been built on prog24 for testing.

@ascbot
Copy link
Contributor Author

ascbot commented Feb 14, 2019


Original Redmine Comment
Author Name: Lynn Weller (Lynn Weller)
Original Date: 2018-04-26T18:14:00Z


I was able to reproduce Ian's problem and verified the changes work as expected via astrovm4.

@ascbot
Copy link
Contributor Author

ascbot commented Feb 14, 2019


Original Redmine Comment
Author Name: Ian Humphrey (Ian Humphrey)
Original Date: 2018-05-08T21:12:09Z


Looks good! Tried to create a new control network, added a point, and closed. I was prompted with the dialog asking if I wanted to save changes or not, and hitting cancel brings back focus to qnet. It no longer closes the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant