Cleanup: remove some unnecessary includes.
[dcpomatic.git] / src / wx / config_dialog.cc
index bf7e295ee3c809ba14060c223d5a18d51654cbf2..9e79829ab53a049238ef0ae5b146b22d675a4848 100644 (file)
@@ -367,8 +367,7 @@ CertificateChainEditor::add_button (wxWindow* button)
 void
 CertificateChainEditor::add_certificate ()
 {
-       auto d = new wxFileDialog (this, _("Select Certificate File"));
-       ScopeGuard sg = [d]() { d->Destroy(); };
+       auto d = make_wx<wxFileDialog>(this, _("Select Certificate File"));
 
        if (d->ShowModal() == wxID_OK) {
                try {
@@ -450,11 +449,10 @@ CertificateChainEditor::export_certificate ()
                default_name = "intermediate.pem";
        }
 
-       auto d = new wxFileDialog(
+       auto d = make_wx<wxFileDialog>(
                this, _("Select Certificate File"), wxEmptyString, default_name, wxT ("PEM files (*.pem)|*.pem"),
                wxFD_SAVE | wxFD_OVERWRITE_PROMPT
                );
-       ScopeGuard sg = [d]() { d->Destroy(); };
 
        auto j = all.begin ();
        for (int k = 0; k < i; ++k) {
@@ -481,11 +479,10 @@ CertificateChainEditor::export_certificate ()
 void
 CertificateChainEditor::export_chain ()
 {
-       auto d = new wxFileDialog (
+       auto d = make_wx<wxFileDialog>(
                this, _("Select Chain File"), wxEmptyString, wxT("certificate_chain.pem"), wxT("PEM files (*.pem)|*.pem"),
                wxFD_SAVE | wxFD_OVERWRITE_PROMPT
                );
-       ScopeGuard sg = [d]() { d->Destroy(); };
 
        if (d->ShowModal() != wxID_OK) {
                return;
@@ -546,8 +543,7 @@ CertificateChainEditor::remake_certificates ()
                return;
        }
 
-       auto d = new MakeChainDialog (this, _get());
-       ScopeGuard sg = [d]() { d->Destroy(); };
+       auto d = make_wx<MakeChainDialog>(this, _get());
 
        if (d->ShowModal () == wxID_OK) {
                _set (d->get());
@@ -574,8 +570,7 @@ CertificateChainEditor::update_private_key ()
 void
 CertificateChainEditor::import_private_key ()
 {
-       auto d = new wxFileDialog (this, _("Select Key File"));
-       ScopeGuard sg = [d]() { d->Destroy(); };
+       auto d = make_wx<wxFileDialog>(this, _("Select Key File"));
 
        if (d->ShowModal() == wxID_OK) {
                try {
@@ -608,11 +603,10 @@ CertificateChainEditor::export_private_key ()
                return;
        }
 
-       auto d = new wxFileDialog (
+       auto d = make_wx<wxFileDialog>(
                this, _("Select Key File"), wxEmptyString, wxT("private_key.pem"), wxT("PEM files (*.pem)|*.pem"),
                wxFD_SAVE | wxFD_OVERWRITE_PROMPT
                );
-       ScopeGuard sg = [d]() { d->Destroy(); };
 
        if (d->ShowModal () == wxID_OK) {
                boost::filesystem::path path (wx_to_std(d->GetPath()));
@@ -727,11 +721,10 @@ KeysPage::signing_advanced ()
 void
 KeysPage::export_decryption_chain_and_key ()
 {
-       auto d = new wxFileDialog (
+       auto d = make_wx<wxFileDialog>(
                _panel, _("Select Export File"), wxEmptyString, wxEmptyString, wxT ("DOM files (*.dom)|*.dom"),
                wxFD_SAVE | wxFD_OVERWRITE_PROMPT
                );
-       ScopeGuard sg = [d]() { d->Destroy(); };
 
        if (d->ShowModal() != wxID_OK) {
                return;
@@ -762,10 +755,9 @@ KeysPage::import_decryption_chain_and_key ()
                return;
        }
 
-       auto d = new wxFileDialog (
+       auto d = make_wx<wxFileDialog>(
                _panel, _("Select File To Import"), wxEmptyString, wxEmptyString, wxT ("DOM files (*.dom)|*.dom")
                );
-       ScopeGuard sg = [d]() { d->Destroy(); };
 
        if (d->ShowModal() != wxID_OK) {
                return;
@@ -825,11 +817,10 @@ KeysPage::export_decryption_certificate ()
        }
        default_name += wxT("_kdm_decryption_cert.pem");
 
-       auto d = new wxFileDialog (
+       auto d = make_wx<wxFileDialog>(
                _panel, _("Select Certificate File"), wxEmptyString, default_name, wxT("PEM files (*.pem)|*.pem"),
                wxFD_SAVE | wxFD_OVERWRITE_PROMPT
                );
-       ScopeGuard sg = [d]() { d->Destroy(); };
 
        if (d->ShowModal() != wxID_OK) {
                return;
@@ -874,7 +865,6 @@ SoundPage::setup ()
 
        add_label_to_sizer (table, _panel, _("Mapping"), true, wxGBPosition(r, 0));
        _map = new AudioMappingView (_panel, _("DCP"), _("DCP"), _("Output"), _("output"));
-       _map->SetSize (-1, 400);
        table->Add (_map, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND);
        ++r;