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

qt: Fixes to the process for selecting an existing hdd image #3086

Merged
merged 1 commit into from Feb 5, 2023

Conversation

cold-brewed
Copy link
Contributor

Summary

In settings -> hdd selection -> existing disk, when you type a filename then select specify, you'll get an error about the file not existing. Sometimes the dialog will still appear for selection, but this seems to vary a little by OS.

The message is mainly because once the file entry loses focus (editingFinished signal) it's connected to fileSelected which then connects to onExistingFileSelected. The file does need to be checked once selected and I believe that was the intent. However, the way the signals are wired up you can actually wind up with the check happening twice: once before selection and once after selection.

I tried to go for a minimal fix without too much impact to the existing logic (which could use some updating, really). I did this by allowing the function to differentiate between the signal received when focus is lost (editingFinished) and when a file is actually selected from a dialog (fileSelected). Now, if you type in an existing image name and then tab out or otherwise remove focus, the CHS / size fields are correctly auto-populated. If the image name does not exist, there is no error dialog displayed. However, the OK button is not enabled, requiring a manual selection.

Additionally, there was another bug where the CHS selection was supposed to be disabled when selecting an existing image. Another event (on_comboBoxFormat_currentIndexChanged) caused it to get re-enabled. This was fixed by moving the section in the constructor to after that event fires (combo box being populated).

Checklist

  • I have discussed this with core contributors already

References

N/A

@OBattler OBattler merged commit c36b68b into 86Box:master Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants