I think this may cause problems if we try to launch the preferences dialog from another dialog.  Maybe we should add a check to see if the editor had focus before the dialog was opened before giving focus back to the editor.

We should also add tests to make sure that the focus is restored properly (both to the editor and to another dialog).