Got rid of some warnings pertaining to calling Pyqt4 Gui APIs from within a thread

Moved the relevant code out of the thread.