#include "lib/dcp_content_type.h"
#include "lib/log.h"
#include "lib/util.h"
-#include "lib/raw_convert.h"
#include "lib/cross.h"
#include "lib/exceptions.h"
+#include <dcp/locale_convert.h>
#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
-#include <dcp/raw_convert.h>
#include <wx/stdpaths.h>
#include <wx/preferences.h>
#include <wx/spinctrl.h>
using boost::shared_ptr;
using boost::function;
using boost::optional;
+using dcp::locale_convert;
class Page
{
_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ()));
checked_set (_j2k_bandwidth, config->default_j2k_bandwidth() / 1000000);
_j2k_bandwidth->SetRange (50, config->maximum_j2k_bandwidth() / 1000000);
- checked_set (_dcp_audio_channels, raw_convert<string> (config->default_dcp_audio_channels()));
+ checked_set (_dcp_audio_channels, locale_convert<string> (config->default_dcp_audio_channels()));
checked_set (_audio_delay, config->default_audio_delay ());
checked_set (_standard, config->default_interop() ? 1 : 0);
}
{
int const s = _dcp_audio_channels->GetSelection ();
if (s != wxNOT_FOUND) {
- Config::instance()->set_default_dcp_audio_channels (dcp::raw_convert<int> (string_client_data (_dcp_audio_channels->GetClientObject (s))));
+ Config::instance()->set_default_dcp_audio_channels (
+ locale_convert<int> (string_client_data (_dcp_audio_channels->GetClientObject (s)))
+ );
}
}
++r;
_button_sizer = new wxBoxSizer (wxHORIZONTAL);
- _remake_certificates = new wxButton (this, wxID_ANY, _("Re-make certificates and key..."));
+ _remake_certificates = new wxButton (this, wxID_ANY, _("Re-make certificates\nand key..."));
_button_sizer->Add (_remake_certificates, 1, wxRIGHT, border);
table->Add (_button_sizer, wxGBPosition (r, 0), wxGBSpan (1, 4));
++r;
void add_button (wxWindow* button)
{
- _button_sizer->Add (button);
+ _button_sizer->Add (button, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_X_GAP);
_sizer->Layout ();
}
_panel->GetSizer()->Add (_decryption);
- _export_decryption_certificate = new wxButton (_decryption, wxID_ANY, _("Export DCP decryption certificate..."));
+ _export_decryption_certificate = new wxButton (_decryption, wxID_ANY, _("Export DCP decryption\ncertificate..."));
_decryption->add_button (_export_decryption_certificate);
+ _export_decryption_chain = new wxButton (_decryption, wxID_ANY, _("Export DCP decryption\nchain..."));
+ _decryption->add_button (_export_decryption_chain);
_export_decryption_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KeysPage::export_decryption_certificate, this));
+ _export_decryption_chain->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&KeysPage::export_decryption_chain, this));
}
void export_decryption_certificate ()
d->Destroy ();
}
+ void export_decryption_chain ()
+ {
+ wxFileDialog* d = new wxFileDialog (
+ _panel, _("Select Chain File"), wxEmptyString, wxEmptyString, wxT ("PEM files (*.pem)|*.pem"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT
+ );
+
+ if (d->ShowModal () == wxID_OK) {
+ FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "w");
+ if (!f) {
+ throw OpenFileError (wx_to_std (d->GetPath ()));
+ }
+
+ string const s = Config::instance()->decryption_chain()->chain();
+ fwrite (s.c_str(), 1, s.length(), f);
+ fclose (f);
+ }
+ d->Destroy ();
+ }
+
void config_changed ()
{
_signer->config_changed ();
CertificateChainEditor* _signer;
CertificateChainEditor* _decryption;
wxButton* _export_decryption_certificate;
+ wxButton* _export_decryption_chain;
};
class TMSPage : public StandardPage