Closed Keksilton closed 2 years ago
@diwersan7 do you know how to do that in (py)qt?
@duk3luk3 I don't know python 😞
There are some ways this can be done:
It's probably a good idea to delay any work on this until after we've transitioned to using python3.
In C# I would use threading option, to load web content in different thread and then load it to display( also in c# it's done in web browser element, which doesn't cause window freezes)
So as it turns out, Qt of course has support for this built-in. It has QNetworkAccessManager
to make non-blocking web requests, and it has QThread
/ QThreadPool
/ QRunnable
to put tasks into threads.
Obviously some work has already gone into that with various "Download Managers" implemented in the client code. I think the easiest avenue to make the client a lot more responsive is to hunt down all urllib
uses and turn them into properly dispatched QNetworkAccessManager
uses.
It's still a good idea to delay any work on this until after we've finished the python3 transition, but that's hit some roadblocks because of travis.
Nice to hear that.
The map downloader is now in use. It's pretty slick.
Remaining imports of urllib:
src/downloadManager/__init__.py
src/vault/__init__.py
src/modvault/utils.py
src/modvault/__init__.py
src/modvault/modwidget.py
src/modvault/uploadwidget.py
src/modvault/uimodwidget.py
src/stats/__init__.py
src/chat/chatter.py
src/fa/updater.py
src/fa/maps.py
src/util/__init__.py
We want those gone.
It would be cool if you make loading page contents in async way(some async implementations or just use different thread for this)