2 Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
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.
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.
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/>.
22 #include "download_certificate_panel.h"
24 #include <dcp/exceptions.h>
25 #include <boost/bind.hpp>
27 using boost::function;
28 using boost::optional;
30 DownloadCertificatePanel::DownloadCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog)
31 : wxPanel (parent, wxID_ANY)
34 _overall_sizer = new wxBoxSizer (wxVERTICAL);
35 SetSizer (_overall_sizer);
37 _table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
38 _table->AddGrowableCol (1, 1);
40 _overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
44 DownloadCertificatePanel::layout ()
46 _overall_sizer->Layout ();
47 _overall_sizer->SetSizeHints (this);
51 DownloadCertificatePanel::load (boost::filesystem::path file)
54 _certificate = dcp::Certificate (dcp::file_to_string (file));
55 } catch (dcp::MiscError& e) {
56 error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), std_to_wx(e.what()).data()));
60 optional<dcp::Certificate>
61 DownloadCertificatePanel::certificate () const