diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-16 22:50:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-16 23:16:35 +0100 |
| commit | e3c48c1b52b7b61bd3fda7a6276eb697bad17977 (patch) | |
| tree | 41aff324deb77f7f5b69020079c717f43df19c8c /src/wx/screen_dialog.cc | |
| parent | 5063594e6836cfabed7d55f4963da9c8cf3b9f11 (diff) | |
Stack-allocate wxDialog instead of using wx_ptr.
Diffstat (limited to 'src/wx/screen_dialog.cc')
| -rw-r--r-- | src/wx/screen_dialog.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index b985888ea..3e1d7da54 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -25,7 +25,6 @@ #include "screen_dialog.h" #include "static_text.h" #include "table_dialog.h" -#include "wx_ptr.h" #include "wx_util.h" #include "lib/compose.hpp" #include "lib/scope_guard.h" @@ -65,13 +64,13 @@ public: void load_certificate () { - auto dialog = make_wx<FileDialog>(this, _("Trusted Device certificate"), wxEmptyString, wxFD_DEFAULT_STYLE, "SelectCertificatePath"); - if (!dialog->show()) { + FileDialog dialog(this, _("Trusted Device certificate"), wxEmptyString, wxFD_DEFAULT_STYLE, "SelectCertificatePath"); + if (!dialog.show()) { return; } try { - _certificate = dcp::Certificate(dcp::file_to_string(dialog->paths()[0])); + _certificate = dcp::Certificate(dcp::file_to_string(dialog.paths()[0])); _thumbprint->SetValue (std_to_wx(_certificate->thumbprint())); } catch (dcp::MiscError& e) { error_dialog(this, wxString::Format(_("Could not load certificate (%s)"), std_to_wx(e.what()))); @@ -280,9 +279,9 @@ ScreenDialog::load_recipient (boost::filesystem::path file) void ScreenDialog::get_recipient_from_file () { - auto dialog = make_wx<FileDialog>(this, _("Select Certificate File"), wxEmptyString, wxFD_DEFAULT_STYLE , "SelectCertificatePath"); - if (dialog->show()) { - load_recipient(dialog->paths()[0]); + FileDialog dialog(this, _("Select Certificate File"), wxEmptyString, wxFD_DEFAULT_STYLE , "SelectCertificatePath"); + if (dialog.show()) { + load_recipient(dialog.paths()[0]); } setup_sensitivity (); @@ -292,10 +291,10 @@ ScreenDialog::get_recipient_from_file () void ScreenDialog::download_recipient () { - auto dialog = make_wx<DownloadCertificateDialog>(this); - if (dialog->ShowModal() == wxID_OK) { - set_recipient(dialog->certificate()); - set_recipient_file(dialog->url()); + DownloadCertificateDialog dialog(this); + if (dialog.ShowModal() == wxID_OK) { + set_recipient(dialog.certificate()); + set_recipient_file(dialog.url()); } setup_sensitivity (); } |
