Add FilmViewer::time_until_next_frame.
[dcpomatic.git] / src / wx / send_i18n_dialog.cc
1 /*
2     Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
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.
10
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.
15
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/>.
18
19 */
20
21 #include "send_i18n_dialog.h"
22 #include "wx_util.h"
23 #include "i18n_hook.h"
24 #include <wx/listctrl.h>
25
26 using std::string;
27 using std::map;
28
29 SendI18NDialog::SendI18NDialog (wxWindow* parent)
30         : wxDialog (parent, wxID_ANY, _("Send translations"))
31 {
32         wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
33
34         wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
35         table->AddGrowableCol (1, 1);
36
37         add_label_to_sizer (table, this, _("Your name"), true);
38         _name = new wxTextCtrl (this, wxID_ANY);
39         table->Add (_name, 0, wxEXPAND);
40
41         add_label_to_sizer (table, this, _("Your email"), true);
42         _email = new wxTextCtrl (this, wxID_ANY);
43         table->Add (_email, 0, wxEXPAND);
44
45         add_label_to_sizer (table, this, _("Language"), true);
46         _language = new wxTextCtrl (this, wxID_ANY);
47         table->Add (_language, 0, wxEXPAND);
48
49         wxListCtrl* list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize(800, -1), wxLC_REPORT | wxLC_NO_HEADER);
50         list->AppendColumn(wxT(""), wxLIST_FORMAT_LEFT, 400);
51         list->AppendColumn(wxT(""), wxLIST_FORMAT_LEFT, 400);
52
53         map<string, string> translations = I18NHook::translations ();
54         int N = 0;
55         for (map<string, string>::const_iterator i = translations.begin(); i != translations.end(); ++i) {
56                 wxListItem it;
57                 it.SetId(N);
58                 it.SetColumn(0);
59                 it.SetText(std_to_wx(i->first));
60                 list->InsertItem(it);
61                 it.SetColumn(1);
62                 it.SetText(std_to_wx(i->second));
63                 list->SetItem(it);
64                 ++N;
65         }
66
67         overall_sizer->Add (table, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
68         overall_sizer->Add (list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
69
70         wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
71         if (buttons) {
72                 overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
73         }
74
75         SetSizerAndFit (overall_sizer);
76 }