-{
- wxBoxSizer* vertical = new wxBoxSizer (wxVERTICAL);
- wxBoxSizer* targets = new wxBoxSizer (wxHORIZONTAL);
-
- _targets = new wxTreeCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT | wxTR_MULTIPLE | wxTR_HAS_BUTTONS);
- targets->Add (_targets, 1, wxEXPAND | wxALL, 6);
-
- _root = _targets->AddRoot ("Foo");
-
- list<shared_ptr<Cinema> > c = Config::instance()->cinemas ();
- for (list<shared_ptr<Cinema> >::iterator i = c.begin(); i != c.end(); ++i) {
- add_cinema (*i);
- }
-
- _targets->ExpandAll ();
-
- wxBoxSizer* target_buttons = new wxBoxSizer (wxVERTICAL);
-
- _add_cinema = new wxButton (this, wxID_ANY, _("Add Cinema..."));
- target_buttons->Add (_add_cinema, 1, wxEXPAND, 6);
- _edit_cinema = new wxButton (this, wxID_ANY, _("Edit Cinema..."));
- target_buttons->Add (_edit_cinema, 1, wxEXPAND, 6);
- _remove_cinema = new wxButton (this, wxID_ANY, _("Remove Cinema"));
- target_buttons->Add (_remove_cinema, 1, wxEXPAND, 6);
-
- _add_screen = new wxButton (this, wxID_ANY, _("Add Screen..."));
- target_buttons->Add (_add_screen, 1, wxEXPAND, 6);
- _edit_screen = new wxButton (this, wxID_ANY, _("Edit Screen..."));
- target_buttons->Add (_edit_screen, 1, wxEXPAND, 6);
- _remove_screen = new wxButton (this, wxID_ANY, _("Remove Screen"));
- target_buttons->Add (_remove_screen, 1, wxEXPAND, 6);
-
- targets->Add (target_buttons, 0, 0, 6);
-
- vertical->Add (targets, 1, wxEXPAND | wxALL, 6);
-
- wxFlexGridSizer* table = new wxFlexGridSizer (3, 2, 6);
- add_label_to_sizer (table, this, _("From"), true);
- wxDateTime from;
- from.SetToCurrent ();
- _from_date = new wxDatePickerCtrl (this, wxID_ANY, from);
- table->Add (_from_date, 1, wxEXPAND);
- _from_time = new wxTimePickerCtrl (this, wxID_ANY, from);
- table->Add (_from_time, 1, wxEXPAND);
-
- add_label_to_sizer (table, this, _("Until"), true);
- wxDateTime to = from;
- /* 1 week from now */
- to.Add (wxDateSpan (0, 0, 1, 0));
- _until_date = new wxDatePickerCtrl (this, wxID_ANY, to);
- table->Add (_until_date, 1, wxEXPAND);
- _until_time = new wxTimePickerCtrl (this, wxID_ANY, to);
- table->Add (_until_time, 1, wxEXPAND);
-
- vertical->Add (table, 0, wxEXPAND | wxALL, 6);
-
- _dcps = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL);
- wxListItem ip;
- ip.SetId (0);
- ip.SetText (_("DCP"));
- ip.SetWidth (400);
- _dcps->InsertColumn (0, ip);
- vertical->Add (_dcps, 0, wxEXPAND | wxALL, 6);
-
- list<boost::filesystem::path> dcps = film->dcps ();
- for (list<boost::filesystem::path>::const_iterator i = dcps.begin(); i != dcps.end(); ++i) {
- wxListItem item;
- int const n = _dcps->GetItemCount ();
- item.SetId (n);
- _dcps->InsertItem (item);
- _dcps->SetItem (n, 0, std_to_wx (i->string ()));
-
- if (dcps.size() == 1 || i->string() == film->dcp_name ()) {
- _dcps->SetItemState (n, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
- }
- }
-
- table = new wxFlexGridSizer (3, 2, 6);
-
- _write_to = new wxRadioButton (this, wxID_ANY, _("Write to"));
- table->Add (_write_to, 1, wxEXPAND);
-
-#ifdef DCPOMATIC_USE_OWN_DIR_PICKER
- _folder = new DirPickerCtrl (this);
-#else
- _folder = new wxDirPickerCtrl (this, wxID_ANY);
-#endif
-
- _folder->SetPath (wxStandardPaths::Get().GetDocumentsDir());
-
- table->Add (_folder, 1, wxEXPAND);
- table->AddSpacer (0);
-
- _email = new wxRadioButton (this, wxID_ANY, _("Send by email"));
- table->Add (_email, 1, wxEXPAND);
- table->AddSpacer (0);
-
- vertical->Add (table, 0, wxEXPAND | wxALL, 6);
-
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
- if (buttons) {
- vertical->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
- }
-
- _write_to->SetValue (true);
-
- _targets->Bind (wxEVT_COMMAND_TREE_SEL_CHANGED, boost::bind (&KDMDialog::setup_sensitivity, this));
-
- _add_cinema->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::add_cinema_clicked, this));
- _edit_cinema->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::edit_cinema_clicked, this));
- _remove_cinema->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::remove_cinema_clicked, this));
-
- _add_screen->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::add_screen_clicked, this));
- _edit_screen->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::edit_screen_clicked, this));
- _remove_screen->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KDMDialog::remove_screen_clicked, this));
-
- _dcps->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&KDMDialog::setup_sensitivity, this));
- _dcps->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&KDMDialog::setup_sensitivity, this));
-
- _write_to->Bind (wxEVT_COMMAND_RADIOBUTTON_SELECTED, boost::bind (&KDMDialog::setup_sensitivity, this));
- _email->Bind (wxEVT_COMMAND_RADIOBUTTON_SELECTED, boost::bind (&KDMDialog::setup_sensitivity, this));
+ , _film (film)
+{
+ /* Main sizers */
+ wxBoxSizer* horizontal = new wxBoxSizer (wxHORIZONTAL);
+ wxBoxSizer* left = new wxBoxSizer (wxVERTICAL);
+ wxBoxSizer* right = new wxBoxSizer (wxVERTICAL);
+
+ horizontal->Add (left, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP * 4);
+ horizontal->Add (right, 1, wxEXPAND);
+
+ /* Font for sub-headings */
+ wxFont subheading_font (*wxNORMAL_FONT);
+ subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
+
+ /* Sub-heading: Screens */
+ wxStaticText* h = new wxStaticText (this, wxID_ANY, _("Screens"));
+ h->SetFont (subheading_font);
+ left->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM, DCPOMATIC_SIZER_Y_GAP);
+ _screens = new ScreensPanel (this);
+ left->Add (_screens, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_SIZER_Y_GAP);
+
+ /* Sub-heading: Timing */
+ /// TRANSLATORS: translate the word "Timing" here; do not include the "KDM|" prefix
+ h = new wxStaticText (this, wxID_ANY, S_("KDM|Timing"));
+ h->SetFont (subheading_font);
+ right->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2);
+ _timing = new KDMTimingPanel (this);
+ right->Add (_timing);
+
+ /* Sub-heading: CPL */
+ h = new wxStaticText (this, wxID_ANY, _("CPL"));
+ h->SetFont (subheading_font);
+ right->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2);
+ _cpl = new KDMCPLPanel (this, film->cpls ());
+ right->Add (_cpl, 0, wxEXPAND);
+
+ /* Sub-heading: Output */
+ h = new wxStaticText (this, wxID_ANY, _("Output"));
+ h->SetFont (subheading_font);
+ right->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
+ _output = new KDMOutputPanel (this, film->interop ());
+ right->Add (_output, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP);
+
+ _make = new wxButton (this, wxID_ANY, _("Make KDMs"));
+ right->Add (_make, 0, wxTOP | wxBOTTOM, DCPOMATIC_SIZER_GAP);
+
+ /* Make an overall sizer to get a nice border */
+
+ wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+ overall_sizer->Add (horizontal, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER);
+
+ /* Bind */
+
+ _screens->ScreensChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
+ _timing->TimingChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
+ _make->Bind (wxEVT_BUTTON, boost::bind (&KDMDialog::make_clicked, this));