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

Avoid freezing the application with downloads by implementing threaded downloads #4645

Open
slicerbot opened this issue Mar 13, 2020 · 1 comment
Assignees
Milestone

Comments

@slicerbot
Copy link
Collaborator

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.

@slicerbot slicerbot added this to the Slicer 4.11.0 milestone Mar 13, 2020
@pieper
Copy link
Member

pieper commented Aug 11, 2020

Looked into this a bit. We could replace this use of urllib which is synchronous with a callback, with use of [QNetworkAccessManager ](https://doc.qt.io/qt-5/qnetworkaccessmanager.html) so it would be tied into the event loop.

Probably putting an async instance variable to SampleDataLogic that defaults to false would be the best for backwards compatibility. Probably the logic should also keep the QNetworkAccessManager as an instance variable so that users of the class could connect to its signals.

The original mantis issue calls out the TCIA browser, so maybe the best approach is not to do anything generic in SampleData where it would require a lot of logic changes and instead encourage the use of QNetworkAccessManager in places where networking and progress bars are needed.

Note it's also possible to use the qSlicerWebWidget to initiate the download and then get the signal for progress and when the download completes.

@lassoan lassoan modified the milestones: Slicer 4.13.0, Backlog Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants