Move the dialogs to QML to reduce code.