Improve copythread class and progress dialog