Rewrite __prepare_dialog to __query_dialog.