diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/screen_dialog.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index 7f309ba66..030098920 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -69,12 +69,13 @@ public: void load_certificate () { wxFileDialog* d = new wxFileDialog (this, _("Trusted Device certificate")); - d->ShowModal (); - try { - _certificate = dcp::Certificate(dcp::file_to_string(wx_to_std(d->GetPath()))); - _thumbprint->SetValue (std_to_wx(_certificate->thumbprint())); - } catch (dcp::MiscError& e) { - error_dialog (this, wxString::Format(_("Could not load certficate (%s)"), std_to_wx(e.what()))); + if (d->ShowModal() == wxID_OK) { + try { + _certificate = dcp::Certificate(dcp::file_to_string(wx_to_std(d->GetPath()))); + _thumbprint->SetValue (std_to_wx(_certificate->thumbprint())); + } catch (dcp::MiscError& e) { + error_dialog (this, wxString::Format(_("Could not load certficate (%s)"), std_to_wx(e.what()))); + } } } |
