X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fkdm_dialog.cc;h=5ed1169b13390a3ac8504f39609dd7ce428dcee1;hb=7e4d7d9e4f146576a63c6ab1be9bca5a79b507d9;hp=40efc5411e61bfac248e8a181ecb386552d2e1a4;hpb=234623db3306626520e06cac985eb157379eff99;p=dcpomatic.git diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 40efc5411..5ed1169b1 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -48,6 +48,7 @@ using std::cout; using std::vector; using std::make_pair; using boost::shared_ptr; +using boost::bind; KDMDialog::KDMDialog (wxWindow* parent, shared_ptr film) : wxDialog (parent, wxID_ANY, _("Make KDMs")) @@ -106,7 +107,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr film) _screens->ScreensChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this)); _timing->TimingChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this)); - _make->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::make_clicked, this)); + _make->Bind (wxEVT_BUTTON, boost::bind (&KDMDialog::make_clicked, this)); setup_sensitivity (); @@ -123,6 +124,15 @@ KDMDialog::setup_sensitivity () _make->Enable (!_screens->screens().empty() && _timing->valid() && _cpl->has_selected()); } +bool +KDMDialog::confirm_overwrite (boost::filesystem::path path) +{ + return confirm_dialog ( + this, + wxString::Format (_("File %s already exists. Do you want to overwrite it?"), std_to_wx(path.string()).data()) + ); +} + void KDMDialog::make_clicked () { @@ -146,7 +156,8 @@ KDMDialog::make_clicked () screen_kdms, _output->directory(), _output->name_format(), - name_values + name_values, + bind (&KDMDialog::confirm_overwrite, this, _1) ); }