#include "lib/cinema_kdms.h"
#include "lib/dcpomatic_socket.h"
#include <dcp/exceptions.h>
-#include <dcp/raw_convert.h>
#include <wx/generic/aboutdlgg.h>
#include <wx/stdpaths.h>
#include <wx/cmdline.h>
using std::exception;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
-using dcp::raw_convert;
class FilmChangedDialog
{
ID_tools_restore_default_preferences,
ID_help_report_a_problem,
/* IDs for shortcuts (with no associated menu item) */
- ID_add_file
+ ID_add_file,
+ ID_remove
};
class DOMFrame : public wxFrame
overall_panel->SetSizer (main_sizer);
- wxAcceleratorEntry accel[1];
+ wxAcceleratorEntry accel[2];
accel[0].Set (wxACCEL_CTRL, static_cast<int>('A'), ID_add_file);
+ accel[1].Set (wxACCEL_NORMAL, WXK_DELETE, ID_remove);
Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file);
- wxAcceleratorTable accel_table (1, accel);
+ Bind (wxEVT_MENU, boost::bind (&ContentPanel::remove_clicked, _film_editor->content_panel(), true), ID_remove);
+ wxAcceleratorTable accel_table (2, accel);
SetAcceleratorTable (accel_table);
/* Instantly save any config changes when using the DCP-o-matic GUI */
/* i = 0; try to connect via socket
i = 1; try again, and then try to start the batch converter
- i = 2; try again.
- i = 3; try again.
+ i = 2 onwards; try again.
*/
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 8; ++i) {
try {
boost::asio::io_service io_service;
boost::asio::ip::tcp::resolver resolver (io_service);
boost::asio::ip::tcp::resolver::query query ("127.0.0.1", raw_convert<string> (Config::instance()->server_port_base() + 2));
boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
- Socket socket (1);
+ Socket socket (5);
socket.connect (*endpoint_iterator);
string s = _film->directory().string ();
socket.write (s.length() + 1);
socket.read (ok, 3);
return;
} catch (exception& e) {
- std::cout << "start batch failed: " << e.what() << "\n";
+
}
if (i == 1) {
}
try {
- dcp::EncryptedKDM kdm = _film->make_kdm (
- Config::instance()->decryption_chain()->leaf(),
- vector<dcp::Certificate> (),
- d->cpl (),
- dcp::LocalTime ("2012-01-01T01:00:00+00:00"),
- dcp::LocalTime ("2112-01-01T01:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1
+ vector<dcp::EncryptedKDM> dkdms = Config::instance()->dkdms ();
+ dkdms.push_back (
+ _film->make_kdm (
+ Config::instance()->decryption_chain()->leaf(),
+ vector<dcp::Certificate> (),
+ d->cpl (),
+ dcp::LocalTime ("2012-01-01T01:00:00+00:00"),
+ dcp::LocalTime ("2112-01-01T01:00:00+00:00"),
+ dcp::MODIFIED_TRANSITIONAL_1
+ )
);
- string const name = tidy_for_filename(_film->name()) + "_DKDM.kdm.xml";
- kdm.as_xml (d->directory() / name);
+ Config::instance()->set_dkdms (dkdms);
} catch (dcp::NotEncryptedError& e) {
error_dialog (this, _("CPL's content is not encrypted."));
} catch (exception& e) {
wxSplashScreen* splash = 0;
try {
- if (!Config::have_existing ()) {
+ if (!Config::have_existing ("config.xml")) {
wxBitmap bitmap;
boost::filesystem::path p = shared_path () / "splash.png";
if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) {
error_dialog (
0,
wxString::Format (
- _("An exception occurred: %s.\n\n") + " " + REPORT_PROBLEM,
+ _("An exception occurred: %s.\n\n") + REPORT_PROBLEM,
std_to_wx (e.what ())
)
);