summaryrefslogtreecommitdiff
path: root/src/wx/email_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-29 09:14:20 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-29 20:53:49 +0200
commit39fb8198febde1937019db1c300ec363aab5aa56 (patch)
tree52bc32134e8ae2b5587b3a62130baa9acf815b60 /src/wx/email_dialog.cc
parentb249700e1da7dd6631a8b4440587f4093a2bdef1 (diff)
C++11 tidying.
Diffstat (limited to 'src/wx/email_dialog.cc')
-rw-r--r--src/wx/email_dialog.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/wx/email_dialog.cc b/src/wx/email_dialog.cc
index 4d3ae4fe1..65fb47473 100644
--- a/src/wx/email_dialog.cc
+++ b/src/wx/email_dialog.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,37 +18,42 @@
*/
+
#include "email_dialog.h"
#include "wx_util.h"
+
using std::string;
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<string>
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<string> ();
+ return {};
}
return s;