X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fkdm_dialog.cc;h=ee164518aed47070613f53f267cb8c5dd35b0dd5;hb=736b3a068ba5a402b541d32f270669e6e1a4e5c4;hp=0ee502d49c46b889080f309e370525062e145734;hpb=d2118a1cc5dfce446caa33a9917ef9129fc576e1;p=dcpomatic.git diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 0ee502d49..ee164518a 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -1,19 +1,20 @@ /* Copyright (C) 2012-2015 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ @@ -54,9 +55,14 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr film) h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL); _screens = new ScreensPanel (this); + /* Hack to stop KDM dialogs that are taller than my laptop screen; this + really isn't the right way to fix it... + */ + _screens->SetMaxSize (wxSize (-1, 280)); vertical->Add (_screens, 1, wxEXPAND); /* 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); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); @@ -66,9 +72,9 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr film) /* Sub-heading: CPL */ h = new wxStaticText (this, wxID_ANY, _("CPL")); h->SetFont (subheading_font); - vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); + vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2); _cpl = new KDMCPLPanel (this, film->cpls ()); - vertical->Add (_cpl); + vertical->Add (_cpl, 0, wxEXPAND); /* Sub-heading: Output */ h = new wxStaticText (this, wxID_ANY, _("Output")); @@ -91,6 +97,7 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr film) /* Bind */ _screens->ScreensChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this)); + _timing->TimingChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this)); setup_sensitivity (); @@ -109,7 +116,7 @@ KDMDialog::setup_sensitivity () wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); if (ok) { - ok->Enable (!_screens->screens().empty() && sd); + ok->Enable (!_screens->screens().empty() && _timing->valid() && sd); } } @@ -154,3 +161,17 @@ KDMDialog::formulation () const { return _output->formulation (); } + +KDMNameFormat +KDMDialog::name_format () const +{ + return _output->name_format (); +} + +int +KDMDialog::ShowModal () +{ + int const r = wxDialog::ShowModal (); + _output->save_kdm_name_format (); + return r; +}