Supporters update.
[dcpomatic.git] / src / wx / export_subtitles_dialog.cc
index 3c32fae536f900ef1934da7c7e80ae24cd48e765..9baa1396e8be5ed7f4180bdc70acfa15efb5ef2e 100644 (file)
@@ -58,7 +58,7 @@ ExportSubtitlesDialog::ExportSubtitlesDialog (wxWindow* parent, int reels, bool
        wxString const wildcard = _interop ? _("Subtitle files (.xml)|*.xml") : _("Subtitle files (.mxf)|*.mxf");
 
        _file_label = add (_("Output file"), true);
-       _file = new FilePickerCtrl (this, _("Select output file"), wildcard, false, true);
+       _file = new FilePickerCtrl(this, _("Select output file"), wildcard, false, true, "ExportSubtitlesPath");
        add (_file);
 
        _dir_label = add (_("Output folder"), true);
@@ -97,9 +97,11 @@ boost::filesystem::path
 ExportSubtitlesDialog::path () const
 {
        if (_file->IsEnabled()) {
-               wxFileName fn (_file->GetPath());
-               fn.SetExt (_interop ? "xml" : "mxf");
-               return wx_to_std (fn.GetFullPath());
+               if (auto path = _file->path()) {
+                       wxFileName fn(std_to_wx(path->string()));
+                       fn.SetExt(_interop ? "xml" : "mxf");
+                       return wx_to_std(fn.GetFullPath());
+               }
        }
 
        return wx_to_std (_dir->GetPath());