*/
/** @file src/config_dialog.cc
- * @brief A dialogue to edit DVD-o-matic configuration.
+ * @brief A dialogue to edit DCP-o-matic configuration.
*/
#include <iostream>
#include <boost/lexical_cast.hpp>
+#include <boost/filesystem.hpp>
+#include <wx/stdpaths.h>
+#include <wx/notebook.h>
#include "lib/config.h"
#include "lib/server.h"
-#include "lib/screen.h"
#include "lib/format.h"
#include "lib/scaler.h"
#include "lib/filter.h"
+#include "lib/dcp_content_type.h"
#include "config_dialog.h"
#include "wx_util.h"
#include "filter_dialog.h"
#include "server_dialog.h"
+#include "dir_picker_ctrl.h"
+#include "dci_metadata_dialog.h"
using namespace std;
-using namespace boost;
+using boost::bind;
ConfigDialog::ConfigDialog (wxWindow* parent)
- : wxDialog (parent, wxID_ANY, _("DVD-o-matic Configuration"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+ : wxDialog (parent, wxID_ANY, _("DCP-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
- wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6);
- table->AddGrowableCol (1, 1);
+ wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+ _notebook = new wxNotebook (this, wxID_ANY);
+ s->Add (_notebook, 1);
+
+ make_misc_panel ();
+ _notebook->AddPage (_misc_panel, _("Miscellaneous"), true);
+ make_servers_panel ();
+ _notebook->AddPage (_servers_panel, _("Encoding servers"), false);
+ make_metadata_panel ();
+ _notebook->AddPage (_metadata_panel, _("Metadata"), false);
+ make_tms_panel ();
+ _notebook->AddPage (_tms_panel, _("TMS"), false);
+ make_ab_panel ();
+ _notebook->AddPage (_ab_panel, _("A/B mode"), false);
- add_label_to_sizer (table, this, "TMS IP address");
- _tms_ip = new wxTextCtrl (this, wxID_ANY);
- table->Add (_tms_ip, 1, wxEXPAND);
- table->AddSpacer (0);
+ wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+ overall_sizer->Add (s, 1, wxEXPAND | wxALL, 6);
- add_label_to_sizer (table, this, "TMS target path");
- _tms_path = new wxTextCtrl (this, wxID_ANY);
- table->Add (_tms_path, 1, wxEXPAND);
- table->AddSpacer (0);
+ wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
+ if (buttons) {
+ overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
+ }
- add_label_to_sizer (table, this, "TMS user name");
- _tms_user = new wxTextCtrl (this, wxID_ANY);
- table->Add (_tms_user, 1, wxEXPAND);
+ SetSizer (overall_sizer);
+ overall_sizer->Layout ();
+ overall_sizer->SetSizeHints (this);
+}
+
+void
+ConfigDialog::make_misc_panel ()
+{
+ _misc_panel = new wxPanel (_notebook);
+ wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+ _misc_panel->SetSizer (s);
+
+ wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6);
+ table->AddGrowableCol (1, 1);
+ s->Add (table, 1, wxALL | wxEXPAND, 8);
+
+ _set_language = new wxCheckBox (_misc_panel, wxID_ANY, _("Set language"));
+ table->Add (_set_language, 1, wxEXPAND);
+ _language = new wxChoice (_misc_panel, wxID_ANY);
+ _language->Append (wxT ("English"));
+ _language->Append (wxT ("Français"));
+ _language->Append (wxT ("Italiano"));
+ _language->Append (wxT ("Español"));
+ _language->Append (wxT ("Svenska"));
+ table->Add (_language, 1, wxEXPAND);
table->AddSpacer (0);
- add_label_to_sizer (table, this, "TMS password");
- _tms_password = new wxTextCtrl (this, wxID_ANY);
- table->Add (_tms_password, 1, wxEXPAND);
+ wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DCP-o-matic to see language changes)"));
+ wxFont font = restart->GetFont();
+ font.SetStyle (wxFONTSTYLE_ITALIC);
+ font.SetPointSize (font.GetPointSize() - 1);
+ restart->SetFont (font);
+ table->AddSpacer (0);
table->AddSpacer (0);
- add_label_to_sizer (table, this, "Threads to use for encoding on this host");
- _num_local_encoding_threads = new wxSpinCtrl (this);
+ add_label_to_sizer (table, _misc_panel, _("Threads to use for encoding on this host"));
+ _num_local_encoding_threads = new wxSpinCtrl (_misc_panel);
table->Add (_num_local_encoding_threads, 1, wxEXPAND);
table->AddSpacer (0);
- add_label_to_sizer (table, this, "Colour look-up table");
- _colour_lut = new wxComboBox (this, wxID_ANY);
- _colour_lut->Append (wxT ("sRGB"));
- _colour_lut->Append (wxT ("Rec 709"));
- _colour_lut->SetSelection (0);
- table->Add (_colour_lut, 1, wxEXPAND);
+ add_label_to_sizer (table, _misc_panel, _("Default duration of still images"));
+ _default_still_length = new wxSpinCtrl (_misc_panel);
+ table->Add (_default_still_length, 1, wxEXPAND);
+ add_label_to_sizer (table, _misc_panel, _("s"));
+
+ add_label_to_sizer (table, _misc_panel, _("Default directory for new films"));
+#ifdef __WXMSW__
+ _default_directory = new DirPickerCtrl (_misc_panel);
+#else
+ _default_directory = new wxDirPickerCtrl (_misc_panel, wxDD_DIR_MUST_EXIST);
+#endif
+ table->Add (_default_directory, 1, wxEXPAND);
table->AddSpacer (0);
- add_label_to_sizer (table, this, "JPEG2000 bandwidth");
- _j2k_bandwidth = new wxSpinCtrl (this, wxID_ANY);
- table->Add (_j2k_bandwidth, 1, wxEXPAND);
- add_label_to_sizer (table, this, "MBps");
+ add_label_to_sizer (table, _misc_panel, _("Default DCI name details"));
+ _default_dci_metadata_button = new wxButton (_misc_panel, wxID_ANY, _("Edit..."));
+ table->Add (_default_dci_metadata_button);
+ table->AddSpacer (1);
+
+ add_label_to_sizer (table, _misc_panel, _("Default format"));
+ _default_format = new wxChoice (_misc_panel, wxID_ANY);
+ table->Add (_default_format);
+ table->AddSpacer (1);
+
+ add_label_to_sizer (table, _misc_panel, _("Default content type"));
+ _default_dcp_content_type = new wxChoice (_misc_panel, wxID_ANY);
+ table->Add (_default_dcp_content_type);
+ table->AddSpacer (1);
+
+ Config* config = Config::instance ();
- add_label_to_sizer (table, this, "Reference scaler for A/B");
- _reference_scaler = new wxComboBox (this, wxID_ANY);
+ _set_language->SetValue (config->language ());
+
+ if (config->language().get_value_or ("") == "fr") {
+ _language->SetSelection (1);
+ } else if (config->language().get_value_or ("") == "it") {
+ _language->SetSelection (2);
+ } else if (config->language().get_value_or ("") == "es") {
+ _language->SetSelection (3);
+ } else if (config->language().get_value_or ("") == "sv") {
+ _language->SetSelection (4);
+ } else {
+ _language->SetSelection (0);
+ }
+
+ setup_language_sensitivity ();
+
+ _set_language->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (ConfigDialog::set_language_changed), 0, this);
+ _language->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::language_changed), 0, this);
+
+ _num_local_encoding_threads->SetRange (1, 128);
+ _num_local_encoding_threads->SetValue (config->num_local_encoding_threads ());
+ _num_local_encoding_threads->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::num_local_encoding_threads_changed), 0, this);
+
+ _default_still_length->SetRange (1, 3600);
+ _default_still_length->SetValue (config->default_still_length ());
+ _default_still_length->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::default_still_length_changed), 0, this);
+
+ _default_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()))));
+ _default_directory->Connect (wxID_ANY, wxEVT_COMMAND_DIRPICKER_CHANGED, wxCommandEventHandler (ConfigDialog::default_directory_changed), 0, this);
+
+ _default_dci_metadata_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::edit_default_dci_metadata_clicked), 0, this);
+
+ vector<Format const *> fmt = Format::all ();
+ int n = 0;
+ for (vector<Format const *>::iterator i = fmt.begin(); i != fmt.end(); ++i) {
+ _default_format->Append (std_to_wx ((*i)->name ()));
+ if (*i == config->default_format ()) {
+ _default_format->SetSelection (n);
+ }
+ ++n;
+ }
+
+ _default_format->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::default_format_changed), 0, this);
+
+ vector<DCPContentType const *> const ct = DCPContentType::all ();
+ n = 0;
+ for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
+ _default_dcp_content_type->Append (std_to_wx ((*i)->pretty_name ()));
+ if (*i == config->default_dcp_content_type ()) {
+ _default_dcp_content_type->SetSelection (n);
+ }
+ ++n;
+ }
+
+ _default_dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::default_dcp_content_type_changed), 0, this);
+}
+
+void
+ConfigDialog::make_tms_panel ()
+{
+ _tms_panel = new wxPanel (_notebook);
+ wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+ _tms_panel->SetSizer (s);
+
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ table->AddGrowableCol (1, 1);
+ s->Add (table, 1, wxALL | wxEXPAND, 8);
+
+ add_label_to_sizer (table, _tms_panel, _("IP address"));
+ _tms_ip = new wxTextCtrl (_tms_panel, wxID_ANY);
+ table->Add (_tms_ip, 1, wxEXPAND);
+
+ add_label_to_sizer (table, _tms_panel, _("Target path"));
+ _tms_path = new wxTextCtrl (_tms_panel, wxID_ANY);
+ table->Add (_tms_path, 1, wxEXPAND);
+
+ add_label_to_sizer (table, _tms_panel, _("User name"));
+ _tms_user = new wxTextCtrl (_tms_panel, wxID_ANY);
+ table->Add (_tms_user, 1, wxEXPAND);
+
+ add_label_to_sizer (table, _tms_panel, _("Password"));
+ _tms_password = new wxTextCtrl (_tms_panel, wxID_ANY);
+ table->Add (_tms_password, 1, wxEXPAND);
+
+ Config* config = Config::instance ();
+
+ _tms_ip->SetValue (std_to_wx (config->tms_ip ()));
+ _tms_ip->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_ip_changed), 0, this);
+ _tms_path->SetValue (std_to_wx (config->tms_path ()));
+ _tms_path->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_path_changed), 0, this);
+ _tms_user->SetValue (std_to_wx (config->tms_user ()));
+ _tms_user->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_user_changed), 0, this);
+ _tms_password->SetValue (std_to_wx (config->tms_password ()));
+ _tms_password->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_password_changed), 0, this);
+}
+
+void
+ConfigDialog::make_ab_panel ()
+{
+ _ab_panel = new wxPanel (_notebook);
+ wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+ _ab_panel->SetSizer (s);
+
+ wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6);
+ table->AddGrowableCol (1, 1);
+ s->Add (table, 1, wxALL, 8);
+
+ add_label_to_sizer (table, _ab_panel, _("Reference scaler"));
+ _reference_scaler = new wxChoice (_ab_panel, wxID_ANY);
vector<Scaler const *> const sc = Scaler::all ();
for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
_reference_scaler->Append (std_to_wx ((*i)->name ()));
table->AddSpacer (0);
{
- add_label_to_sizer (table, this, "Reference filters for A/B");
+ add_label_to_sizer (table, _ab_panel, _("Reference filters"));
wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _reference_filters = new wxStaticText (this, wxID_ANY, wxT (""));
+ _reference_filters = new wxStaticText (_ab_panel, wxID_ANY, wxT (""));
s->Add (_reference_filters, 1, wxEXPAND);
- _reference_filters_button = new wxButton (this, wxID_ANY, _("Edit..."));
+ _reference_filters_button = new wxButton (_ab_panel, wxID_ANY, _("Edit..."));
s->Add (_reference_filters_button, 0);
table->Add (s, 1, wxEXPAND);
table->AddSpacer (0);
}
+}
+
+void
+ConfigDialog::make_metadata_panel ()
+{
+ _metadata_panel = new wxPanel (_notebook);
+ wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+ _metadata_panel->SetSizer (s);
+
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ table->AddGrowableCol (1, 1);
+ s->Add (table, 1, wxALL | wxEXPAND, 8);
+
+ add_label_to_sizer (table, _metadata_panel, _("Issuer"));
+ _issuer = new wxTextCtrl (_metadata_panel, wxID_ANY);
+ table->Add (_issuer, 1, wxEXPAND);
+
+ add_label_to_sizer (table, _metadata_panel, _("Creator"));
+ _creator = new wxTextCtrl (_metadata_panel, wxID_ANY);
+ table->Add (_creator, 1, wxEXPAND);
- add_label_to_sizer (table, this, "Encoding Servers");
- _servers = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL);
+ Config* config = Config::instance ();
+
+ _issuer->SetValue (std_to_wx (config->dcp_metadata().issuer));
+ _issuer->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::issuer_changed), 0, this);
+ _creator->SetValue (std_to_wx (config->dcp_metadata().creator));
+ _creator->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::creator_changed), 0, this);
+}
+
+void
+ConfigDialog::make_servers_panel ()
+{
+ _servers_panel = new wxPanel (_notebook);
+ wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+ _servers_panel->SetSizer (s);
+
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ table->AddGrowableCol (0, 1);
+ s->Add (table, 1, wxALL | wxEXPAND, 8);
+
+ Config* config = Config::instance ();
+
+ _servers = new wxListCtrl (_servers_panel, wxID_ANY, wxDefaultPosition, wxSize (220, 100), wxLC_REPORT | wxLC_SINGLE_SEL);
wxListItem ip;
ip.SetId (0);
ip.SetText (_("IP address"));
- ip.SetWidth (100);
+ ip.SetWidth (120);
_servers->InsertColumn (0, ip);
ip.SetId (1);
ip.SetText (_("Threads"));
- ip.SetWidth (90);
+ ip.SetWidth (80);
_servers->InsertColumn (1, ip);
- table->Add (_servers, 1, wxEXPAND);
+ table->Add (_servers, 1, wxEXPAND | wxALL);
{
wxSizer* s = new wxBoxSizer (wxVERTICAL);
- _add_server = new wxButton (this, wxID_ANY, _("Add"));
+ _add_server = new wxButton (_servers_panel, wxID_ANY, _("Add"));
s->Add (_add_server);
- _edit_server = new wxButton (this, wxID_ANY, _("Edit"));
+ _edit_server = new wxButton (_servers_panel, wxID_ANY, _("Edit"));
s->Add (_edit_server);
- _remove_server = new wxButton (this, wxID_ANY, _("Remove"));
+ _remove_server = new wxButton (_servers_panel, wxID_ANY, _("Remove"));
s->Add (_remove_server);
table->Add (s, 0);
}
-
- Config* config = Config::instance ();
- _tms_ip->SetValue (std_to_wx (config->tms_ip ()));
- _tms_ip->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_ip_changed), 0, this);
- _tms_path->SetValue (std_to_wx (config->tms_path ()));
- _tms_path->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_path_changed), 0, this);
- _tms_user->SetValue (std_to_wx (config->tms_user ()));
- _tms_user->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_user_changed), 0, this);
- _tms_password->SetValue (std_to_wx (config->tms_password ()));
- _tms_password->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_password_changed), 0, this);
-
- _num_local_encoding_threads->SetRange (1, 128);
- _num_local_encoding_threads->SetValue (config->num_local_encoding_threads ());
- _num_local_encoding_threads->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::num_local_encoding_threads_changed), 0, this);
-
- _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (ConfigDialog::colour_lut_changed), 0, this);
-
- _j2k_bandwidth->SetRange (50, 250);
- _j2k_bandwidth->SetValue (config->j2k_bandwidth() / 1e6);
- _j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::j2k_bandwidth_changed), 0, this);
-
- _reference_scaler->SetSelection (Scaler::as_index (config->reference_scaler ()));
- _reference_scaler->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (ConfigDialog::reference_scaler_changed), 0, this);
-
- pair<string, string> p = Filter::ffmpeg_strings (config->reference_filters ());
- _reference_filters->SetLabel (std_to_wx (p.first + " " + p.second));
- _reference_filters_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::edit_reference_filters_clicked), 0, this);
-
- vector<Server*> servers = config->servers ();
- for (vector<Server*>::iterator i = servers.begin(); i != servers.end(); ++i) {
+ vector<ServerDescription*> servers = config->servers ();
+ for (vector<ServerDescription*>::iterator i = servers.begin(); i != servers.end(); ++i) {
add_server_to_control (*i);
}
_servers->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler (ConfigDialog::server_selection_changed), 0, this);
wxListEvent ev;
server_selection_changed (ev);
+}
- wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
- overall_sizer->Add (table, 1, wxEXPAND);
-
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
- if (buttons) {
- overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
+void
+ConfigDialog::language_changed (wxCommandEvent &)
+{
+ switch (_language->GetSelection ()) {
+ case 0:
+ Config::instance()->set_language ("en");
+ break;
+ case 1:
+ Config::instance()->set_language ("fr");
+ break;
+ case 2:
+ Config::instance()->set_language ("it");
+ break;
+ case 3:
+ Config::instance()->set_language ("es");
+ break;
+ case 4:
+ Config::instance()->set_language ("sv");
+ break;
}
-
- SetSizer (overall_sizer);
- overall_sizer->Layout ();
- overall_sizer->SetSizeHints (this);
}
void
}
void
-ConfigDialog::colour_lut_changed (wxCommandEvent &)
+ConfigDialog::default_directory_changed (wxCommandEvent &)
{
- Config::instance()->set_colour_lut_index (_colour_lut->GetSelection ());
+ Config::instance()->set_default_directory (wx_to_std (_default_directory->GetPath ()));
}
void
-ConfigDialog::j2k_bandwidth_changed (wxCommandEvent &)
-{
- Config::instance()->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1e6);
-}
-
-void
-ConfigDialog::add_server_to_control (Server* s)
+ConfigDialog::add_server_to_control (ServerDescription* s)
{
wxListItem item;
int const n = _servers->GetItemCount ();
{
ServerDialog* d = new ServerDialog (this, 0);
d->ShowModal ();
- Server* s = d->server ();
+ ServerDescription* s = d->server ();
d->Destroy ();
add_server_to_control (s);
- vector<Server*> o = Config::instance()->servers ();
+ vector<ServerDescription*> o = Config::instance()->servers ();
o.push_back (s);
Config::instance()->set_servers (o);
}
item.SetColumn (0);
_servers->GetItem (item);
- vector<Server*> servers = Config::instance()->servers ();
- vector<Server*>::iterator j = servers.begin();
- while (j != servers.end() && (*j)->host_name() != wx_to_std (item.GetText ())) {
- ++j;
- }
-
- if (j == servers.end()) {
- return;
- }
+ vector<ServerDescription*> servers = Config::instance()->servers ();
+ assert (i >= 0 && i < int (servers.size ()));
- ServerDialog* d = new ServerDialog (this, *j);
+ ServerDialog* d = new ServerDialog (this, servers[i]);
d->ShowModal ();
d->Destroy ();
- _servers->SetItem (i, 0, std_to_wx ((*j)->host_name ()));
- _servers->SetItem (i, 1, std_to_wx (boost::lexical_cast<string> ((*j)->threads ())));
+ _servers->SetItem (i, 0, std_to_wx (servers[i]->host_name ()));
+ _servers->SetItem (i, 1, std_to_wx (boost::lexical_cast<string> (servers[i]->threads ())));
}
void
if (i >= 0) {
_servers->DeleteItem (i);
}
+
+ vector<ServerDescription*> o = Config::instance()->servers ();
+ o.erase (o.begin() + i);
+ Config::instance()->set_servers (o);
}
void
-ConfigDialog::server_selection_changed (wxListEvent& ev)
+ConfigDialog::server_selection_changed (wxListEvent &)
{
int const i = _servers->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
_edit_server->Enable (i >= 0);
ConfigDialog::edit_reference_filters_clicked (wxCommandEvent &)
{
FilterDialog* d = new FilterDialog (this, Config::instance()->reference_filters ());
- d->ActiveChanged.connect (sigc::mem_fun (*this, &ConfigDialog::reference_filters_changed));
+ d->ActiveChanged.connect (boost::bind (&ConfigDialog::reference_filters_changed, this, _1));
d->ShowModal ();
d->Destroy ();
}
{
Config::instance()->set_reference_filters (f);
pair<string, string> p = Filter::ffmpeg_strings (Config::instance()->reference_filters ());
- _reference_filters->SetLabel (std_to_wx (p.first + " " + p.second));
+ _reference_filters->SetLabel (std_to_wx (p.first) + N_(" ") + std_to_wx (p.second));
+}
+
+void
+ConfigDialog::edit_default_dci_metadata_clicked (wxCommandEvent &)
+{
+ DCIMetadataDialog* d = new DCIMetadataDialog (this, Config::instance()->default_dci_metadata ());
+ d->ShowModal ();
+ Config::instance()->set_default_dci_metadata (d->dci_metadata ());
+ d->Destroy ();
+}
+
+void
+ConfigDialog::set_language_changed (wxCommandEvent& ev)
+{
+ setup_language_sensitivity ();
+ if (_set_language->GetValue ()) {
+ language_changed (ev);
+ } else {
+ Config::instance()->unset_language ();
+ }
+}
+
+void
+ConfigDialog::setup_language_sensitivity ()
+{
+ _language->Enable (_set_language->GetValue ());
+}
+
+void
+ConfigDialog::default_still_length_changed (wxCommandEvent &)
+{
+ Config::instance()->set_default_still_length (_default_still_length->GetValue ());
+}
+
+void
+ConfigDialog::default_format_changed (wxCommandEvent &)
+{
+ vector<Format const *> fmt = Format::all ();
+ Config::instance()->set_default_format (fmt[_default_format->GetSelection()]);
+}
+
+void
+ConfigDialog::default_dcp_content_type_changed (wxCommandEvent &)
+{
+ vector<DCPContentType const *> ct = DCPContentType::all ();
+ Config::instance()->set_default_dcp_content_type (ct[_default_dcp_content_type->GetSelection()]);
+}
+
+void
+ConfigDialog::issuer_changed (wxCommandEvent &)
+{
+ libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
+ m.issuer = wx_to_std (_issuer->GetValue ());
+ Config::instance()->set_dcp_metadata (m);
+}
+
+void
+ConfigDialog::creator_changed (wxCommandEvent &)
+{
+ libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
+ m.creator = wx_to_std (_creator->GetValue ());
+ Config::instance()->set_dcp_metadata (m);
}