Provisional changes to qt/restoredialog.py to prevent user from exiti…#2505
Provisional changes to qt/restoredialog.py to prevent user from exiti…#2505maluskid wants to merge 4 commits into
Conversation
…ng restoration early and causing problems.
…erride QT's closeEvent() function.
|
Apologies for the number of commits needed to get the change to pass the build checks, I'm still getting used to working with these tools. |
No problem.
Where you able to run the full test suite on your local machine before you pushed the commits? Anyway... See also this: https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qtcore/qt.html#WindowType What do you think? |
Resolves #2503 - Edited the restoredialogue.py file to include another method for RestoreDialogue class which listens for 'closeEvent' and refuses it if the thread has yet to complete restoring the backup. Since closeEvent() overloads the original QT closeEvent function the naming convention doesn't conform to the other methods. Wasn't sure if using
if not self._btn_close.isEnabled():would be worse for readability than adding aself._thread_finishedboolean to test, but I wanted to make the change with the fewest number of edits to original code as possible. I tested this by modifying restoration to just sleep for 10 seconds and tried to exit while it ran that modified code, tested both 'x' button and 'alt-f4' methods of exiting.Screenshot after attempting to exit 'Restore':
