2 Copyright (C) 2014-2015 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 "download_certificate_panel.h"
23 #include <dcp/exceptions.h>
24 #include <boost/bind.hpp>
26 using boost::function;
27 using boost::optional;
29 DownloadCertificatePanel::DownloadCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog)
30 : wxPanel (parent, wxID_ANY)
33 _overall_sizer = new wxBoxSizer (wxVERTICAL);
34 SetSizer (_overall_sizer);
36 _table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
37 _table->AddGrowableCol (1, 1);
39 _overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
43 DownloadCertificatePanel::layout ()
45 _overall_sizer->Layout ();
46 _overall_sizer->SetSizeHints (this);
50 DownloadCertificatePanel::load (boost::filesystem::path file)
53 _certificate = dcp::Certificate (dcp::file_to_string (file));
54 } catch (dcp::MiscError& e) {
55 error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), std_to_wx(e.what()).data()));
59 optional<dcp::Certificate>
60 DownloadCertificatePanel::certificate () const