Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request aims to close issue #59. To get the desired behavior, I made the settings window a member of the MainWindow class. Then I simply check if the dialog is already visible before calling exec_(). Something else I added is that if the settings dialog is already open and the user clicks Edit->Settings, the settings window is brought to the front by calling the raise_() function.
This pull request also fixes the issue that I mentioned in my comment on #59. So, closing the xqemu-manager now also closes the settings window. I accomplished this by adding a closeEvent method to the MainWindow class. I think this should of been there from the beginning. The onExitClicked code is only called from the File->Exit button and not when the window is closed.
A downside to closing the settings window when the main window is closed is that currently the code doesn't save your settings before closing the window. So, the user's settings could be lost. I think this can be fixed with issue #15. Maybe we can detect if the settings have changed without being saved then on exit ask the user if they would like to save them before closing.
Please reply if I've done anything wrong or if this should be split up into two separate issues.