2 Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #include "self_dkdm_dialog.h"
23 #include "kdm_output_panel.h"
24 #include "kdm_cpl_panel.h"
26 #include "lib/screen.h"
27 #include <libcxml/cxml.h>
28 #include <wx/treectrl.h>
29 #include <wx/listctrl.h>
30 #include <wx/stdpaths.h>
40 using boost::shared_ptr;
42 SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film)
43 : wxDialog (parent, wxID_ANY, _("Make DKDM for DCP-o-matic"))
46 wxBoxSizer* vertical = new wxBoxSizer (wxVERTICAL);
48 /* Font for sub-headings */
49 wxFont subheading_font (*wxNORMAL_FONT);
50 subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
52 /* Sub-heading: CPL */
53 wxStaticText* h = new wxStaticText (this, wxID_ANY, _("CPL"));
54 h->SetFont (subheading_font);
55 vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2);
56 _cpl = new KDMCPLPanel (this, film->cpls ());
59 /* Make an overall sizer to get a nice border, and put some buttons in */
61 wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
62 overall_sizer->Add (vertical, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER);
64 wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
66 overall_sizer->Add (buttons, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP);
71 SetSizer (overall_sizer);
72 overall_sizer->Layout ();
73 overall_sizer->SetSizeHints (this);
77 SelfDKDMDialog::setup_sensitivity ()
79 wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
81 ok->Enable (_cpl->has_selected ());
85 boost::filesystem::path
86 SelfDKDMDialog::cpl () const