2014-07-16 Carl Hetherington <cth@carlh.net>
+ * Make KDM email subject configurable.
+
* Updates to de_DE from Carsten Kurz.
* Limit allowed KDM types based on Interop/SMPTE setting
_mail_server = f.string_child ("MailServer");
_mail_user = f.optional_string_child("MailUser").get_value_or ("");
_mail_password = f.optional_string_child("MailPassword").get_value_or ("");
+ _kdm_subject = f.optional_string_child ("KDMSubject").get_value_or (_("KDM delivery"));
_kdm_from = f.string_child ("KDMFrom");
_kdm_cc = f.optional_string_child ("KDMCC").get_value_or ("");
_kdm_email = f.string_child ("KDMEmail");
root->add_child("MailServer")->add_child_text (_mail_server);
root->add_child("MailUser")->add_child_text (_mail_user);
root->add_child("MailPassword")->add_child_text (_mail_password);
+ root->add_child("KDMSubject")->add_child_text (_kdm_subject);
root->add_child("KDMFrom")->add_child_text (_kdm_from);
root->add_child("KDMCC")->add_child_text (_kdm_cc);
root->add_child("KDMEmail")->add_child_text (_kdm_email);
return _mail_password;
}
+ std::string kdm_subject () const {
+ return _kdm_subject;
+ }
+
std::string kdm_from () const {
return _kdm_from;
}
changed ();
}
+ void set_kdm_subject (std::string s) {
+ _kdm_subject = s;
+ changed ();
+ }
+
void set_kdm_from (std::string f) {
_kdm_from = f;
changed ();
std::string _mail_server;
std::string _mail_user;
std::string _mail_password;
+ std::string _kdm_subject;
std::string _kdm_from;
std::string _kdm_cc;
std::string _kdm_email;
/* Send email */
quickmail_initialize ();
- quickmail mail = quickmail_create (Config::instance()->kdm_from().c_str(), "KDM delivery");
+ quickmail mail = quickmail_create (Config::instance()->kdm_from().c_str(), Config::instance()->kdm_subject().c_str ());
quickmail_add_to (mail, i->cinema->email.c_str ());
if (!Config::instance()->kdm_cc().empty ()) {
quickmail_add_cc (mail, Config::instance()->kdm_cc().c_str ());
font.SetPointSize (font.GetPointSize() - 1);
plain->SetFont (font);
table->AddSpacer (0);
+
+ add_label_to_sizer (table, panel, _("Subject"), true);
+ _kdm_subject = new wxTextCtrl (panel, wxID_ANY);
+ table->Add (_kdm_subject, 1, wxEXPAND | wxALL);
add_label_to_sizer (table, panel, _("From address"), true);
_kdm_from = new wxTextCtrl (panel, wxID_ANY);
_mail_user->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::mail_user_changed, this));
_mail_password->SetValue (std_to_wx (config->mail_password ()));
_mail_password->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::mail_password_changed, this));
+ _kdm_subject->SetValue (std_to_wx (config->kdm_subject ()));
+ _kdm_subject->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::kdm_subject_changed, this));
_kdm_from->SetValue (std_to_wx (config->kdm_from ()));
_kdm_from->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::kdm_from_changed, this));
_kdm_cc->SetValue (std_to_wx (config->kdm_cc ()));
{
Config::instance()->set_mail_password (wx_to_std (_mail_password->GetValue ()));
}
+
+ void kdm_subject_changed ()
+ {
+ Config::instance()->set_kdm_subject (wx_to_std (_kdm_subject->GetValue ()));
+ }
void kdm_from_changed ()
{
wxTextCtrl* _mail_server;
wxTextCtrl* _mail_user;
wxTextCtrl* _mail_password;
+ wxTextCtrl* _kdm_subject;
wxTextCtrl* _kdm_from;
wxTextCtrl* _kdm_cc;
wxTextCtrl* _kdm_email;