Fix and refactor editor puzzle import
Fixes #227 (closed)
Previously:
- Importing a puzzle from the greeter was broken. The greeter used a
PuzzleDownloaderto open a file dialog, but it didn't register a listener for thefinishedsignal. So nothing happened after the user selected a file. - Importing from the edit window worked.
- The edit window handled the importing on its own, instead of relying on a
PuzzleDownloader. - It only supported
IPUZfiles, as opposed toPuzzleDownloader, which supports other file types. - It didn't open the new puzzle in a new window.
- The edit window handled the importing on its own, instead of relying on a
For this MR:
- I created an
edit_window_start_with_file_explorerfunction. This function does the following:- Present the user with a file explorer.
- Start a new edit window using the puzzle selected by the user.
- Close the previous window (either a greeter or an edit window).
- Both the greeter and edit window now use this function to handle puzzle imports.