No-op; rename a whole load of wx constants to their shorter equivalents.
[dcpomatic.git] / src / wx / kdm_output_panel.cc
index 1d9e56f4bac48cf0cea67f19478c10b8ea8f9bef..f61c3668ba75f5cc9bc1ec69719ca3382cb217ad 100644 (file)
@@ -46,7 +46,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
        _type->SetSelection (0);
 
        {
-               int flags = wxALIGN_TOP | wxTOP | wxLEFT;
+               int flags = wxALIGN_TOP | wxTOP | wxLEFT | wxRIGHT;
                wxString t = _("Filename format");
 #ifdef __WXOSX__
                flags |= wxALIGN_RIGHT;
@@ -56,17 +56,22 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
                table->Add (m, 0, flags, DCPOMATIC_SIZER_Y_GAP);
        }
 
-       _filename_format = new NameFormatEditor<KDMNameFormat> (this, Config::instance()->kdm_filename_format());
+       dcp::NameFormat::Map titles;
+       titles['f'] = "film name";
+       titles['c'] = "cinema";
+       titles['s'] = "screen";
+       titles['b'] = "from date/time";
+       titles['e'] = "to date/time";
        dcp::NameFormat::Map ex;
-       ex["film_name"] = "Bambi";
-       ex["cinema"] = "Lumière";
-       ex["screen"] = "Screen 1";
-       ex["from"] = "2012/03/15 12:30";
-       ex["to"] = "2012/03/22 02:30";
-       _filename_format->set_example (ex);
+       ex['f'] = "Bambi";
+       ex['c'] = "Lumière";
+       ex['s'] = "Screen 1";
+       ex['b'] = "2012/03/15 12:30";
+       ex['e'] = "2012/03/22 02:30";
+       _filename_format = new NameFormatEditor (this, Config::instance()->kdm_filename_format(), titles, ex, ".xml");
        table->Add (_filename_format->panel(), 1, wxEXPAND);
 
-       _write_to = new wxRadioButton (this, wxID_ANY, _("Write to"));
+       _write_to = new wxCheckBox (this, wxID_ANY, _("Write to"));
        table->Add (_write_to, 1, wxEXPAND);
 
 #ifdef DCPOMATIC_USE_OWN_PICKER
@@ -79,14 +84,14 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
 
        table->Add (_folder, 1, wxEXPAND);
 
-       _email = new wxRadioButton (this, wxID_ANY, _("Send by email"));
+       _email = new wxCheckBox (this, wxID_ANY, _("Send by email"));
        table->Add (_email, 1, wxEXPAND);
        table->AddSpacer (0);
 
        _write_to->SetValue (true);
 
-       _write_to->Bind (wxEVT_COMMAND_RADIOBUTTON_SELECTED, boost::bind (&KDMOutputPanel::setup_sensitivity, this));
-       _email->Bind    (wxEVT_COMMAND_RADIOBUTTON_SELECTED, boost::bind (&KDMOutputPanel::setup_sensitivity, this));
+       _write_to->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::setup_sensitivity, this));
+       _email->Bind    (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::setup_sensitivity, this));
 
        SetSizer (table);
 }
@@ -109,6 +114,12 @@ KDMOutputPanel::write_to () const
        return _write_to->GetValue ();
 }
 
+bool
+KDMOutputPanel::email () const
+{
+       return _email->GetValue ();
+}
+
 dcp::Formulation
 KDMOutputPanel::formulation () const
 {
@@ -121,7 +132,7 @@ KDMOutputPanel::save_kdm_name_format () const
        Config::instance()->set_kdm_filename_format (name_format ());
 }
 
-KDMNameFormat
+dcp::NameFormat
 KDMOutputPanel::name_format () const
 {
        return _filename_format->get ();