-
- add_label_to_sizer (table, _panel, _("Mail user name"), true);
- _mail_user = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_mail_user, 1, wxEXPAND | wxALL);
-
- add_label_to_sizer (table, _panel, _("Mail password"), true);
- _mail_password = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_mail_password, 1, wxEXPAND | wxALL);
-
- 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);
- table->Add (_kdm_from, 1, wxEXPAND | wxALL);
-
- vector<string> columns;
- columns.push_back (wx_to_std (_("Address")));
- add_label_to_sizer (table, _panel, _("CC addresses"), true);
- _kdm_cc = new EditableList<string, EmailDialog> (
- _panel,
- columns,
- bind (&Config::kdm_cc, Config::instance()),
- bind (&Config::set_kdm_cc, Config::instance(), _1),
- bind (&column, _1)
- );
- table->Add (_kdm_cc, 1, wxEXPAND | wxALL);
-
- add_label_to_sizer (table, _panel, _("BCC address"), true);
- _kdm_bcc = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_kdm_bcc, 1, wxEXPAND | wxALL);
-
- _kdm_email = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (-1, 200), wxTE_MULTILINE);
- _panel->GetSizer()->Add (_kdm_email, 0, wxEXPAND | wxALL, _border);
-
- _reset_kdm_email = new wxButton (_panel, wxID_ANY, _("Reset to default subject and text"));
- _panel->GetSizer()->Add (_reset_kdm_email, 0, wxEXPAND | wxALL, _border);
-
- _kdm_cc->layout ();
-
- _mail_server->Bind (wxEVT_TEXT, boost::bind (&KDMEmailPage::mail_server_changed, this));
- _mail_port->Bind (wxEVT_SPINCTRL, boost::bind (&KDMEmailPage::mail_port_changed, this));
- _mail_user->Bind (wxEVT_TEXT, boost::bind (&KDMEmailPage::mail_user_changed, this));
- _mail_password->Bind (wxEVT_TEXT, boost::bind (&KDMEmailPage::mail_password_changed, this));
- _kdm_subject->Bind (wxEVT_TEXT, boost::bind (&KDMEmailPage::kdm_subject_changed, this));
- _kdm_from->Bind (wxEVT_TEXT, boost::bind (&KDMEmailPage::kdm_from_changed, this));
- _kdm_bcc->Bind (wxEVT_TEXT, boost::bind (&KDMEmailPage::kdm_bcc_changed, this));
- _kdm_email->Bind (wxEVT_TEXT, boost::bind (&KDMEmailPage::kdm_email_changed, this));
- _reset_kdm_email->Bind (wxEVT_BUTTON, boost::bind (&KDMEmailPage::reset_kdm_email, this));
- }
-
- void config_changed ()
- {
- Config* config = Config::instance ();
-
- checked_set (_mail_server, config->mail_server ());
- checked_set (_mail_port, config->mail_port ());
- checked_set (_mail_user, config->mail_user ());
- checked_set (_mail_password, config->mail_password ());
- checked_set (_kdm_subject, config->kdm_subject ());
- checked_set (_kdm_from, config->kdm_from ());
- checked_set (_kdm_bcc, config->kdm_bcc ());
- checked_set (_kdm_email, Config::instance()->kdm_email ());
- }
-
- void mail_server_changed ()
- {
- Config::instance()->set_mail_server (wx_to_std (_mail_server->GetValue ()));
- }
-
- void mail_port_changed ()
- {
- Config::instance()->set_mail_port (_mail_port->GetValue ());