{
wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK | wxICON_ERROR);
if (e) {
- d->SetExtendedMessage (*e);
+ wxString em = *e;
+ em[0] = wxToupper (em[0]);
+ d->SetExtendedMessage (em);
}
d->ShowModal ();
d->Destroy ();
return splash;
}
-boost::filesystem::path
+optional<boost::filesystem::path>
path_from_file_dialog (wxFileDialog* dialog, string extension)
{
- return boost::filesystem::path(wx_to_std(dialog->GetPath())).replace_extension(extension);
+ boost::filesystem::path p(wx_to_std(dialog->GetPath()));
+ p.replace_extension(extension);
+ if (boost::filesystem::is_regular_file(p) && !confirm_dialog(dialog, wxString::Format(_("A file named %s already exists. Do you want to replace it?"), std_to_wx(p.filename().string())))) {
+ return optional<boost::filesystem::path>();
+ }
+ return p;
}
double