Cleanup: rename some methods in FilePickerCtrl and use boost::filesystem::path more.
[dcpomatic.git] / src / wx / export_video_file_dialog.cc
index 3cc4b133fdf672a0f1f4a4793440de647288478f..8b01282b659cdbd848b6efa0b8ead841dc18b54b 100644 (file)
@@ -97,7 +97,7 @@ ExportVideoFileDialog::ExportVideoFileDialog (wxWindow* parent, string name)
           so disable its check and the caller will have to do it themselves.
        */
        _file = new FilePickerCtrl (this, _("Select output file"), format_filters[0], false, false);
-       _file->SetPath (_initial_name);
+       _file->set_path(_initial_name);
        add (_file);
 
        for (int i = 0; i < FORMATS; ++i) {
@@ -118,9 +118,9 @@ ExportVideoFileDialog::ExportVideoFileDialog (wxWindow* parent, string name)
                _x264_crf_label[i]->Enable (false);
        }
 
-       _mixdown->Bind (wxEVT_CHECKBOX, bind(&ExportVideoFileDialog::mixdown_changed, this));
-       _split_reels->Bind (wxEVT_CHECKBOX, bind(&ExportVideoFileDialog::split_reels_changed, this));
-       _split_streams->Bind (wxEVT_CHECKBOX, bind(&ExportVideoFileDialog::split_streams_changed, this));
+       _mixdown->bind(&ExportVideoFileDialog::mixdown_changed, this);
+       _split_reels->bind(&ExportVideoFileDialog::split_reels_changed, this);
+       _split_streams->bind(&ExportVideoFileDialog::split_streams_changed, this);
        _x264_crf->Bind (wxEVT_SLIDER, bind(&ExportVideoFileDialog::x264_crf_changed, this));
        _format->Bind (wxEVT_CHOICE, bind (&ExportVideoFileDialog::format_changed, this));
        _file->Bind (wxEVT_FILEPICKER_CHANGED, bind (&ExportVideoFileDialog::file_changed, this));
@@ -167,13 +167,12 @@ ExportVideoFileDialog::format_changed ()
 {
        auto const selection = _format->GetSelection();
        DCPOMATIC_ASSERT (selection >= 0 && selection < FORMATS);
-       _file->SetWildcard (format_filters[selection]);
-       _file->SetPath (_initial_name);
+       _file->set_wildcard(format_filters[selection]);
+       _file->set_path(_initial_name);
        _x264_crf->Enable (formats[selection] == ExportFormat::H264_AAC);
        for (int i = 0; i < 2; ++i) {
                _x264_crf_label[i]->Enable(formats[selection] == ExportFormat::H264_AAC);
        }
-       _mixdown->Enable (selection != 2);
 
        Config::instance()->export_config().set_format(formats[selection]);
 }
@@ -181,7 +180,7 @@ ExportVideoFileDialog::format_changed ()
 boost::filesystem::path
 ExportVideoFileDialog::path () const
 {
-       wxFileName fn (_file->GetPath());
+       wxFileName fn(std_to_wx(_file->path().string()));
        fn.SetExt (format_extensions[_format->GetSelection()]);
        return wx_to_std (fn.GetFullPath());
 }