#define NEEDS_SELECTED_CONTENT 0x10
#define NEEDS_SELECTED_VIDEO_CONTENT 0x20
#define NEEDS_CLIPBOARD 0x40
+#define NEEDS_ENCRYPTION 0x80
map<wxMenuItem*, int> menu_items;
catch (std::exception& e) {
wxString p = std_to_wx (file.string ());
wxCharBuffer b = p.ToUTF8 ();
- error_dialog (this, wxString::Format (_("Could not open film at %s (%s)"), p.data(), std_to_wx (e.what()).data()));
+ error_dialog (this, wxString::Format (_("Could not open film at %s"), p.data()), std_to_wx (e.what()));
}
void set_film (shared_ptr<Film> film)
if (_film->directory()) {
Config::instance()->add_to_history (_film->directory().get());
}
+ _film->Changed.connect (boost::bind (&DOMFrame::set_menu_sensitivity, this));
}
shared_ptr<Film> film () const {
_film->write_metadata ();
_film->make_dcp ();
} catch (BadSettingError& e) {
- error_dialog (this, wxString::Format (_("Bad setting for %s (%s)"), std_to_wx(e.setting()).data(), std_to_wx(e.what()).data()));
+ error_dialog (this, wxString::Format (_("Bad setting for %s."), std_to_wx(e.setting()).data()), std_to_wx(e.what()));
} catch (std::exception& e) {
- error_dialog (this, wxString::Format (_("Could not make DCP: %s."), std_to_wx(e.what()).data()));
+ error_dialog (this, wxString::Format (_("Could not make DCP.")), std_to_wx(e.what()));
}
}
d->cpl (),
dcp::LocalTime ("2012-01-01T01:00:00+00:00"),
dcp::LocalTime ("2112-01-01T01:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1
+ dcp::MODIFIED_TRANSITIONAL_1,
+ true,
+ 0
);
} catch (dcp::NotEncryptedError& e) {
error_dialog (this, _("CPL's content is not encrypted."));
if (WEXITSTATUS (r) == 0) {
r = system (String::compose("nautilus \"%1\"", _film->directory()->string()).c_str());
if (WEXITSTATUS (r)) {
- error_dialog (this, _("Could not show DCP (could not run nautilus)"));
+ error_dialog (this, _("Could not show DCP."), _("Could not run nautilus"));
}
} else {
int r = system ("which konqueror");
if (WEXITSTATUS (r) == 0) {
r = system (String::compose ("konqueror \"%1\"", _film->directory()->string()).c_str());
if (WEXITSTATUS (r)) {
- error_dialog (this, _("Could not show DCP (could not run konqueror)"));
+ error_dialog (this, _("Could not show DCP"), _("Could not run konqueror"));
}
}
}
enabled = false;
}
+ if ((j->second & NEEDS_ENCRYPTION) && (!_film || !_film->encrypted())) {
+ enabled = false;
+ }
+
j->first->Enable (enabled);
}
}
add_item (jobs_menu, _("Make DCP in &batch converter\tCtrl-B"), ID_jobs_make_dcp_batch, NEEDS_FILM | NOT_DURING_DCP_CREATION);
jobs_menu->AppendSeparator ();
add_item (jobs_menu, _("Make &KDMs...\tCtrl-K"), ID_jobs_make_kdms, NEEDS_FILM);
- add_item (jobs_menu, _("Make DKDM for DCP-o-matic..."), ID_jobs_make_self_dkdm, NEEDS_FILM);
+ add_item (jobs_menu, _("Make DKDM for DCP-o-matic..."), ID_jobs_make_self_dkdm, NEEDS_FILM | NEEDS_ENCRYPTION);
jobs_menu->AppendSeparator ();
add_item (jobs_menu, _("Export...\tCtrl-E"), ID_jobs_export, NEEDS_FILM);
jobs_menu->AppendSeparator ();
try {
_frame->load_film (_film_to_load);
} catch (exception& e) {
- error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load film %1 (%2)")), _film_to_load, e.what())));
+ error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load film %1 (%2)")), _film_to_load)), std_to_wx(e.what()));
}
}
}
catch (exception& e)
{
- error_dialog (0, wxString::Format ("DCP-o-matic could not start: %s", e.what ()));
+ error_dialog (0, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what()));
return true;
}