From 7e7530f01063640cf1ca05a16d98c5f5f25b3e73 Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Fri, 26 Aug 2016 17:39:18 -0400 Subject: [PATCH] return correct dialog return code for exec --- src/qt/dialog.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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