Merge.
[dcpomatic.git] / src / wx / wx_util.cc
index dd4ec3948765bbcdbf9946c8d0a923c3a669f24e..e017f404de8df788a2017923704145c703d17fda 100644 (file)
@@ -85,11 +85,15 @@ add_label_to_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool, wxGBPositi
 /** Pop up an error dialogue box.
  *  @param parent Parent.
  *  @param m Message.
+ *  @param e Extended message.
  */
 void
-error_dialog (wxWindow* parent, wxString m)
+error_dialog (wxWindow* parent, wxString m, optional<wxString> e)
 {
        wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK | wxICON_ERROR);
+       if (e) {
+               d->SetExtendedMessage (*e);
+       }
        d->ShowModal ();
        d->Destroy ();
 }
@@ -404,3 +408,9 @@ maybe_show_splash ()
 
        return splash;
 }
+
+boost::filesystem::path
+path_from_file_dialog (wxFileDialog* dialog, string extension)
+{
+       return boost::filesystem::path(wx_to_std(dialog->GetPath())).replace_extension(extension);
+}