in general, only the GUI (main) thread should do GUI stuff.
Have the worker thread raise a flag on which the dialog will be launched in the GUI thread.