diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-16 16:24:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-16 16:24:33 +0100 |
| commit | 03c5a8155043613c01e0e151735a7fcf8ab84415 (patch) | |
| tree | 671045ad4731e1782e92be9109f48da8b5726081 /src/wx | |
| parent | 47e78514ffa98c991ddd38d077836f4a558fbec0 (diff) | |
Tidy up a few details with custom filenames.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/config_dialog.cc | 14 | ||||
| -rw-r--r-- | src/wx/kdm_output_panel.cc | 2 | ||||
| -rw-r--r-- | src/wx/name_format_editor.cc | 7 | ||||
| -rw-r--r-- | src/wx/name_format_editor.h | 3 |
4 files changed, 14 insertions, 12 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index cb9f4669b..c18cf3c92 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -1440,13 +1440,11 @@ private: add_top_aligned_label_to_sizer (table, _panel, _("DCP metadata filename format")); dcp::NameFormat::Map titles; titles['t'] = "type (cpl/pkl)"; - titles['i'] = "unique ID"; - titles['c'] = "content filename"; dcp::NameFormat::Map examples; examples['t'] = "cpl"; - examples['i'] = "eb1c112c-ca3c-4ae6-9263-c6714ff05d64"; - examples['c'] = "myfile.mp4"; - _dcp_metadata_filename_format = new NameFormatEditor (_panel, Config::instance()->dcp_metadata_filename_format(), titles, examples); + _dcp_metadata_filename_format = new NameFormatEditor ( + _panel, Config::instance()->dcp_metadata_filename_format(), titles, examples, "_eb1c112c-ca3c-4ae6-9263-c6714ff05d64.xml" + ); table->Add (_dcp_metadata_filename_format->panel(), 1, wxEXPAND | wxALL); } @@ -1454,17 +1452,17 @@ private: add_top_aligned_label_to_sizer (table, _panel, _("DCP asset filename format")); dcp::NameFormat::Map titles; titles['t'] = "type (j2c/pcm/sub)"; - titles['i'] = "unique ID"; titles['r'] = "reel number"; titles['n'] = "number of reels"; titles['c'] = "content filename"; dcp::NameFormat::Map examples; examples['t'] = "j2c"; - examples['i'] = "eb1c112c-ca3c-4ae6-9263-c6714ff05d64"; examples['r'] = "1"; examples['n'] = "4"; examples['c'] = "myfile.mp4"; - _dcp_asset_filename_format = new NameFormatEditor (_panel, Config::instance()->dcp_asset_filename_format(), titles, examples); + _dcp_asset_filename_format = new NameFormatEditor ( + _panel, Config::instance()->dcp_asset_filename_format(), titles, examples, "_eb1c112c-ca3c-4ae6-9263-c6714ff05d64.mxf" + ); table->Add (_dcp_asset_filename_format->panel(), 1, wxEXPAND | wxALL); } diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index 537cf6652..4130e4938 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -68,7 +68,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop) 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); + _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")); diff --git a/src/wx/name_format_editor.cc b/src/wx/name_format_editor.cc index 7d0915896..160a554c0 100644 --- a/src/wx/name_format_editor.cc +++ b/src/wx/name_format_editor.cc @@ -21,13 +21,16 @@ #include "name_format_editor.h" #include "wx_util.h" -NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples) +using std::string; + +NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples, string suffix) : _panel (new wxPanel (parent)) , _example (new wxStaticText (_panel, wxID_ANY, "")) , _sizer (new wxBoxSizer (wxVERTICAL)) , _specification (new wxTextCtrl (_panel, wxID_ANY, "")) , _name (name) , _examples (examples) + , _suffix (suffix) { _sizer->Add (_specification, 0, wxEXPAND, DCPOMATIC_SIZER_Y_GAP); _sizer->Add (_example, 0, wxBOTTOM, DCPOMATIC_SIZER_Y_GAP); @@ -61,7 +64,7 @@ NameFormatEditor::update_example () { _name.set_specification (wx_to_std (_specification->GetValue ())); - wxString example = wxString::Format (_("e.g. %s"), _name.get (_examples)); + wxString example = wxString::Format (_("e.g. %s"), _name.get (_examples, _suffix)); wxString wrapped; for (size_t i = 0; i < example.Length(); ++i) { if (i > 0 && (i % 40) == 0) { diff --git a/src/wx/name_format_editor.h b/src/wx/name_format_editor.h index 204de76d3..2ae3f5e93 100644 --- a/src/wx/name_format_editor.h +++ b/src/wx/name_format_editor.h @@ -30,7 +30,7 @@ class NameFormatEditor { public: - NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples); + NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples, std::string suffix); wxPanel* panel () const { return _panel; @@ -54,6 +54,7 @@ private: dcp::NameFormat _name; dcp::NameFormat::Map _examples; + std::string _suffix; }; #endif |
