*/
+
+#include "dcpomatic_button.h"
+#include "download_certificate_dialog.h"
#include "recipient_dialog.h"
-#include "wx_util.h"
-#include "file_dialog_wrapper.h"
#include "static_text.h"
-#include "download_certificate_dialog.h"
#include "table_dialog.h"
-#include "dcpomatic_button.h"
+#include "wx_util.h"
#include "lib/compose.hpp"
#include "lib/util.h"
#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
-#include "lib/warnings.h"
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/filepicker.h>
#include <wx/validate.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
#include <iostream>
-using std::string;
+
using std::cout;
-using std::vector;
using std::list;
-using boost::optional;
+using std::string;
+using std::vector;
using boost::bind;
+using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
static string
: wxDialog (parent, wxID_ANY, title)
, _recipient (recipient)
{
- wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+ auto overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (overall_sizer);
_sizer = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
copy (emails.begin(), emails.end(), back_inserter (_emails));
vector<EditableListColumn> columns;
- columns.push_back (EditableListColumn(wx_to_std(_("Address"))));
+ columns.push_back (EditableListColumn(_("Address")));
_email_list = new EditableList<string, EmailDialog> (
- this, columns, bind(&RecipientDialog::get_emails, this), bind(&RecipientDialog::set_emails, this, _1), bind(&column, _1)
+ this, columns, bind(&RecipientDialog::get_emails, this), bind(&RecipientDialog::set_emails, this, _1), bind(&column, _1),
+ EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE, true
);
_sizer->Add (_email_list, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND);
++r;
wxClientDC dc (this);
- wxFont font = _name->GetFont ();
+ auto font = _name->GetFont ();
font.SetFamily (wxFONTFAMILY_TELETYPE);
dc.SetFont (font);
- wxSize size = dc.GetTextExtent (wxT ("1234567890123456789012345678"));
- size.SetHeight (-1);
+ auto size = dc.GetTextExtent(wxT("1234567890123456789012345678"));
+ size.SetHeight (-1);
add_label_to_sizer (_sizer, this, _("Recipient certificate"), true, wxGBPosition (r, 0));
- wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+ auto s = new wxBoxSizer (wxHORIZONTAL);
_recipient_thumbprint = new StaticText (this, wxT (""), wxDefaultPosition, size);
_recipient_thumbprint->SetFont (font);
set_recipient (recipient);
overall_sizer->Add (_sizer, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+ auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
if (buttons) {
overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
void
RecipientDialog::get_recipient_from_file ()
{
- wxFileDialog* d = new wxFileDialog (this, _("Select Certificate File"));
+ auto d = new wxFileDialog (this, _("Select Certificate File"));
if (d->ShowModal () == wxID_OK) {
load_recipient (boost::filesystem::path (wx_to_std (d->GetPath ())));
}
void
RecipientDialog::setup_sensitivity ()
{
- wxButton* ok = dynamic_cast<wxButton*> (FindWindowById (wxID_OK, this));
+ auto ok = dynamic_cast<wxButton*> (FindWindowById (wxID_OK, this));
if (ok) {
ok->Enable (static_cast<bool>(_recipient) && !_name->GetValue().IsEmpty());
}