- auto d = new SendI18NDialog (this);
- ScopeGuard sg = [d]() { d->Destroy(); };
- if (d->ShowModal() == wxID_OK) {
- string body;
- body += d->name() + "\n";
- body += d->language() + "\n";
- body += string(dcpomatic_version) + " " + string(dcpomatic_git_commit) + "\n";
- body += "--\n";
- auto translations = I18NHook::translations ();
- for (auto i: translations) {
- body += i.first + "\n" + i.second + "\n\n";
- }
- list<string> to = { "carl@dcpomatic.com" };
- if (d->email().find("@") == string::npos) {
- error_dialog (this, _("You must enter a valid email address when sending translations, "
- "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions."));
- } else {
- Emailer emailer (d->email(), to, "DCP-o-matic translations", body);
- try {
- emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS);
- } catch (NetworkError& e) {
- error_dialog (this, _("Could not send translations"), std_to_wx(e.what()));
- }
+ SendI18NDialog dialog(this);
+ if (dialog.ShowModal() != wxID_OK) {
+ return;
+ }
+
+ string body;
+ body += dialog.name() + "\n";
+ body += dialog.language() + "\n";
+ body += string(dcpomatic_version) + " " + string(dcpomatic_git_commit) + "\n";
+ body += "--\n";
+ auto translations = I18NHook::translations ();
+ for (auto i: translations) {
+ body += i.first + "\n" + i.second + "\n\n";
+ }
+ if (dialog.email().find("@") == string::npos) {
+ error_dialog (this, _("You must enter a valid email address when sending translations, "
+ "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions."));
+ } else {
+ Emailer emailer(dialog.email(), { "carl@dcpomatic.com" }, "DCP-o-matic translations", body);
+ try {
+ emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS);
+ } catch (NetworkError& e) {
+ error_dialog (this, _("Could not send translations"), std_to_wx(e.what()));