Project

General

Profile

Bug #4146

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

Added by Ian Humphrey almost 2 years ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Applications
Target version:
-
Impact:

Minimal - Affected applications include qnet, as well as QnetFileTool, and ViewportMainWindow.

Software Version:
Test Reviewer:

Description

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.*

History

#1 Updated by Tammy Becker almost 2 years ago

  • Status changed from New to Acknowledged

#2 Updated by Adam Goins about 2 months ago

  • Assignee set to Adam Goins

#3 Updated by Adam Goins about 2 months ago

  • Status changed from Acknowledged to In Progress

#4 Updated by Adam Goins about 2 months ago

  • Status changed from In Progress to Resolved
  • Impact updated (diff)

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.

#5 Updated by Lynn Weller about 2 months ago

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

#6 Updated by Ian Humphrey about 1 month ago

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.

Also available in: Atom PDF