- cerr << "Syntax: " << program_name << " [OPTION] [<FILM>]\n"
- " -h, --help show this help\n"
- " -o, --output output file or directory\n"
- " -f, --valid-from valid from time (e.g. \"2013-09-28 01:41:51\") or \"now\"\n"
- " -t, --valid-to valid to time (e.g. \"2014-09-28 01:41:51\")\n"
- " -d, --valid-duration valid duration (e.g. \"1 day\", \"4 hours\", \"2 weeks\")\n"
- " -z, --zip ZIP each cinema's KDMs into its own file\n"
- " -v, --verbose be verbose\n"
- " -c, --cinema specify a cinema, either by name or email address\n"
- " --cinemas list known cinemas from the DCP-o-matic settings\n"
- " --certificate file containing projector certificate\n\n"
- "For example:\n\n"
- "Create KDMs for my_great_movie to play in all of Fred's Cinema's screens for the next two weeks and zip them up.\n"
- "(Fred's Cinema must have been set up in DCP-o-matic's KDM window)\n\n"
- "\tdcpomatic_kdm -c \"Fred's Cinema\" -f now -d \"2 weeks\" -z my_great_movie\n\n";
-}
-
-static void
-error (string m)
-{
- cerr << program_name << ": " << m << "\n";
- exit (EXIT_FAILURE);
-}
+public:
+ DOMFrame (wxString const & title)
+ : wxFrame (NULL, -1, title)
+ , _config_dialog (0)
+ , _job_view (0)
+ {
+ wxMenuBar* bar = new wxMenuBar;
+ setup_menu (bar);
+ SetMenuBar (bar);
+
+ Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT);
+ Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES);
+ Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::help_about, this), wxID_ABOUT);
+ Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::help_report_a_problem, this), ID_help_report_a_problem);
+
+ /* Use a panel as the only child of the Frame so that we avoid
+ the dark-grey background on Windows.
+ */
+ wxPanel* overall_panel = new wxPanel (this, wxID_ANY);
+ wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL);
+
+ wxBoxSizer* vertical = new wxBoxSizer (wxVERTICAL);
+
+ wxFont subheading_font (*wxNORMAL_FONT);
+ subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
+
+ wxStaticText* h = new wxStaticText (overall_panel, wxID_ANY, _("Screens"));
+ h->SetFont (subheading_font);
+ vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL);
+ _screens = new ScreensPanel (overall_panel);
+ vertical->Add (_screens, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP);
+
+ h = new wxStaticText (overall_panel, wxID_ANY, S_("KDM|Timing"));
+ h->SetFont (subheading_font);
+ vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
+ _timing = new KDMTimingPanel (overall_panel);
+ vertical->Add (_timing, 0, wxALL, DCPOMATIC_SIZER_Y_GAP);
+
+ h = new wxStaticText (overall_panel, wxID_ANY, _("DKDM"));
+ h->SetFont (subheading_font);
+ vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
+ wxSizer* dkdm = new wxFlexGridSizer (4, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+ add_label_to_sizer (dkdm, overall_panel, _("DKDM file"), true);
+ _dkdm = new FilePickerCtrl (overall_panel, _("Select a DKDM XML file..."), "*.xml");
+ dkdm->Add (_dkdm, 1, wxEXPAND);
+ add_label_to_sizer (dkdm, overall_panel, _("Content title"), true);
+ _content_title_text = new wxStaticText (overall_panel, wxID_ANY, wxT(""));
+ dkdm->Add (_content_title_text, 1, wxEXPAND);
+ dkdm->AddSpacer (0);
+ dkdm->AddSpacer (0);
+ add_label_to_sizer (dkdm, overall_panel, _("Annotation"), true);
+ _annotation_text = new wxStaticText (overall_panel, wxID_ANY, wxT(""));
+ dkdm->Add (_annotation_text, 1, wxEXPAND);
+ dkdm->AddSpacer (0);
+ dkdm->AddSpacer (0);
+ add_label_to_sizer (dkdm, overall_panel, _("Issue date"), true);
+ _issue_date = new wxStaticText (overall_panel, wxID_ANY, wxT(""));
+ dkdm->Add (_issue_date, 1, wxEXPAND);
+ vertical->Add (dkdm, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
+
+ h = new wxStaticText (overall_panel, wxID_ANY, _("Output"));
+ h->SetFont (subheading_font);
+ vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
+ /* XXX: hard-coded non-interop here */
+ _output = new KDMOutputPanel (overall_panel, false);
+ vertical->Add (_output, 0, wxALL, DCPOMATIC_SIZER_Y_GAP);
+
+ _create = new wxButton (overall_panel, wxID_ANY, _("Create KDMs"));
+ vertical->Add (_create, 0, wxALL, DCPOMATIC_SIZER_GAP);
+
+ main_sizer->Add (vertical, 1, wxALL, DCPOMATIC_DIALOG_BORDER);
+ overall_panel->SetSizer (main_sizer);
+
+ /* Instantly save any config changes when using a DCP-o-matic GUI */
+ Config::instance()->Changed.connect (boost::bind (&Config::write, Config::instance ()));
+
+ _screens->ScreensChanged.connect (boost::bind (&DOMFrame::setup_sensitivity, this));
+ _dkdm->Bind (wxEVT_COMMAND_FILEPICKER_CHANGED, bind (&DOMFrame::dkdm_changed, this));
+ _create->Bind (wxEVT_COMMAND_BUTTON_CLICKED, bind (&DOMFrame::create_kdms, this));
+
+ setup_sensitivity ();
+ }