diff --git a/src/qt/dialog.cpp b/src/qt/dialog.cpp index 892f52cc44..31713d0570 100644 --- a/src/qt/dialog.cpp +++ b/src/qt/dialog.cpp @@ -68,8 +68,11 @@ bool wxDialog::Create( wxWindow *parent, wxWindowID id, int wxDialog::ShowModal() { wxCHECK_MSG( GetHandle() != NULL, -1, "Invalid dialog" ); - - return GetDialogHandle()->exec() ? wxID_OK : wxID_CANCEL; + + bool ret = GetDialogHandle()->exec(); + if(GetReturnCode() == 0) + return ret ? wxID_OK : wxID_CANCEL; + return GetReturnCode(); } void wxDialog::EndModal(int retCode) @@ -77,7 +80,7 @@ void wxDialog::EndModal(int retCode) wxCHECK_RET( GetDialogHandle() != NULL, "Invalid dialog" ); SetReturnCode(retCode); - GetDialogHandle()->done( retCode ); + GetDialogHandle()->done( QDialog::Accepted ); } bool wxDialog::IsModal() const