X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Femail_dialog.cc;h=b95d79b03ba83174c72e091eb21635d9b83ff28b;hb=HEAD;hp=854a130c6e541e185499dcfd7a6d035d4ca86817;hpb=1ea8806c7c628cba3cc063200efca10b327356cf;p=dcpomatic.git diff --git a/src/wx/email_dialog.cc b/src/wx/email_dialog.cc index 854a130c6..65fb47473 100644 --- a/src/wx/email_dialog.cc +++ b/src/wx/email_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2015 Carl Hetherington + Copyright (C) 2015-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,37 +18,42 @@ */ + #include "email_dialog.h" #include "wx_util.h" + using std::string; -using boost::shared_ptr; +using std::shared_ptr; using boost::optional; + EmailDialog::EmailDialog (wxWindow* parent) : TableDialog (parent, _("Email address"), 2, 1, true) { add (_("Email address"), true); - _email = add (new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (400, -1))); + _email = add (new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(400, -1))); layout (); _email->SetFocus (); } + void EmailDialog::set (string address) { - _email->SetValue (std_to_wx (address)); + _email->SetValue (std_to_wx(address)); } + optional EmailDialog::get () const { - string s = wx_to_std (_email->GetValue ()); - if (s.empty ()) { + auto s = wx_to_std (_email->GetValue ()); + if (s.empty()) { /* Invalid email address */ - return optional (); + return {}; } return s;