Merge branch 'master' into 2.0--libdcp-1.0
[dcpomatic.git] / src / wx / config_dialog.cc
index 52c08018f7724c2284d4ad14b9e87a97b18b9e68..d636b3b3d131f022f53523264f96f90f58d9fd10 100644 (file)
@@ -135,6 +135,14 @@ ConfigDialog::make_misc_panel ()
        add_label_to_sizer (table, _misc_panel, _("From address for KDM emails"), true);
        _kdm_from = new wxTextCtrl (_misc_panel, wxID_ANY);
        table->Add (_kdm_from, 1, wxEXPAND | wxALL);
+
+       _check_for_updates = new wxCheckBox (_misc_panel, wxID_ANY, _("Check for updates on startup"));
+       table->Add (_check_for_updates, 1, wxEXPAND | wxALL);
+       table->AddSpacer (0);
+
+       _check_for_test_updates = new wxCheckBox (_misc_panel, wxID_ANY, _("Check for testing updates as well as stable ones"));
+       table->Add (_check_for_test_updates, 1, wxEXPAND | wxALL);
+       table->AddSpacer (0);
        
        Config* config = Config::instance ();
 
@@ -171,6 +179,10 @@ ConfigDialog::make_misc_panel ()
        _mail_password->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::mail_password_changed, this));
        _kdm_from->SetValue (std_to_wx (config->kdm_from ()));
        _kdm_from->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::kdm_from_changed, this));
+       _check_for_updates->SetValue (config->check_for_updates ());
+       _check_for_updates->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&ConfigDialog::check_for_updates_changed, this));
+       _check_for_test_updates->SetValue (config->check_for_test_updates ());
+       _check_for_test_updates->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&ConfigDialog::check_for_test_updates_changed, this));
 }
 
 void
@@ -218,7 +230,7 @@ ConfigDialog::make_defaults_panel ()
                wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
                _default_j2k_bandwidth = new wxSpinCtrl (_defaults_panel);
                s->Add (_default_j2k_bandwidth);
-               add_label_to_sizer (s, _defaults_panel, _("MBps"), false);
+               add_label_to_sizer (s, _defaults_panel, _("Mbit/s"), false);
                table->Add (s, 1);
        }
 
@@ -489,7 +501,7 @@ ConfigDialog::default_dcp_content_type_changed ()
 void
 ConfigDialog::issuer_changed ()
 {
-       libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
+       dcp::XMLMetadata m = Config::instance()->dcp_metadata ();
        m.issuer = wx_to_std (_issuer->GetValue ());
        Config::instance()->set_dcp_metadata (m);
 }
@@ -497,7 +509,7 @@ ConfigDialog::issuer_changed ()
 void
 ConfigDialog::creator_changed ()
 {
-       libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
+       dcp::XMLMetadata m = Config::instance()->dcp_metadata ();
        m.creator = wx_to_std (_creator->GetValue ());
        Config::instance()->set_dcp_metadata (m);
 }
@@ -578,3 +590,15 @@ ConfigDialog::kdm_email_changed ()
 {
        Config::instance()->set_kdm_email (wx_to_std (_kdm_email->GetValue ()));
 }
+
+void
+ConfigDialog::check_for_updates_changed ()
+{
+       Config::instance()->set_check_for_updates (_check_for_updates->GetValue ());
+}
+
+void
+ConfigDialog::check_for_test_updates_changed ()
+{
+       Config::instance()->set_check_for_test_updates (_check_for_test_updates->GetValue ());
+}