2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "dci_metadata_dialog.h"
25 using boost::shared_ptr;
27 DCIMetadataDialog::DCIMetadataDialog (wxWindow* parent, DCIMetadata dm)
28 : wxDialog (parent, wxID_ANY, _("DCI name"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
30 wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
31 table->AddGrowableCol (1, 1);
33 add_label_to_sizer (table, this, _("Audio Language (e.g. EN)"));
34 _audio_language = new wxTextCtrl (this, wxID_ANY);
35 table->Add (_audio_language, 1, wxEXPAND);
37 add_label_to_sizer (table, this, _("Subtitle Language (e.g. FR)"));
38 _subtitle_language = new wxTextCtrl (this, wxID_ANY);
39 table->Add (_subtitle_language, 1, wxEXPAND);
41 add_label_to_sizer (table, this, _("Territory (e.g. UK)"));
42 _territory = new wxTextCtrl (this, wxID_ANY);
43 table->Add (_territory, 1, wxEXPAND);
45 add_label_to_sizer (table, this, _("Rating (e.g. 15)"));
46 _rating = new wxTextCtrl (this, wxID_ANY);
47 table->Add (_rating, 1, wxEXPAND);
49 add_label_to_sizer (table, this, _("Studio (e.g. TCF)"));
50 _studio = new wxTextCtrl (this, wxID_ANY);
51 table->Add (_studio, 1, wxEXPAND);
53 add_label_to_sizer (table, this, _("Facility (e.g. DLA)"));
54 _facility = new wxTextCtrl (this, wxID_ANY);
55 table->Add (_facility, 1, wxEXPAND);
57 add_label_to_sizer (table, this, _("Package Type (e.g. OV)"));
58 _package_type = new wxTextCtrl (this, wxID_ANY);
59 table->Add (_package_type, 1, wxEXPAND);
61 _audio_language->SetValue (std_to_wx (dm.audio_language));
62 _subtitle_language->SetValue (std_to_wx (dm.subtitle_language));
63 _territory->SetValue (std_to_wx (dm.territory));
64 _rating->SetValue (std_to_wx (dm.rating));
65 _studio->SetValue (std_to_wx (dm.studio));
66 _facility->SetValue (std_to_wx (dm.facility));
67 _package_type->SetValue (std_to_wx (dm.package_type));
69 wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
70 overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6);
72 wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
74 overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
77 SetSizer (overall_sizer);
78 overall_sizer->Layout ();
79 overall_sizer->SetSizeHints (this);
83 DCIMetadataDialog::dci_metadata () const
87 dm.audio_language = wx_to_std (_audio_language->GetValue ());
88 dm.subtitle_language = wx_to_std (_subtitle_language->GetValue ());
89 dm.territory = wx_to_std (_territory->GetValue ());
90 dm.rating = wx_to_std (_rating->GetValue ());
91 dm.studio = wx_to_std (_studio->GetValue ());
92 dm.facility = wx_to_std (_facility->GetValue ());
93 dm.package_type = wx_to_std (_package_type->GetValue ());