Wolfmyths / Myth-Mod-Manager

An easy way to swap and manage Payday 2 mods outside the game
https://modworkshop.net/mod/43276
MIT License
9 stars 4 forks source link

Backup mods threading and progress bar #7

Closed Wolfmyths closed 1 year ago

Wolfmyths commented 1 year ago

The backing up mods function easily freezes the program

A possible solution is threading the backup mods function by making the class it belongs to, FileMover(), inherit QThread

A progress bar would be nice too, pyside has a widget called QProgressBar for this.

Check out these sources for more info:

https://stackoverflow.com/questions/20657753/python-pyside-and-progress-bar-threading https://pythonassets.com/posts/download-file-with-progress-bar-pyqt-pyside/

Wolfmyths commented 1 year ago

Update, this approach works only for methods without arguments like backUpMods()

A wrapper for the QThread's run() might work? I'm not familiar with QThreads

Worst case scenario we might have to rewrite the structure of FileMover()

Wolfmyths commented 1 year ago

It required a lot of restructuring, but it has been implemented and will show up in the next update.