Got rid of some warnings pertaining to calling Pyqt4 Gui APIs from within
a thread by moving the relevant code out of the thread.