aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/settings/SettingsSendMail.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ui/settings/SettingsSendMail.cpp40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/ui/settings/SettingsSendMail.cpp b/src/ui/settings/SettingsSendMail.cpp
index 821bf978..733ed82f 100644
--- a/src/ui/settings/SettingsSendMail.cpp
+++ b/src/ui/settings/SettingsSendMail.cpp
@@ -49,7 +49,7 @@ SendMailTab::SendMailTab(QWidget* parent)
ui->defaultSenderEmailEdit->setDisabled(state != Qt::Checked);
ui->checkConnectionButton->setDisabled(state != Qt::Checked);
});
-
+
#ifdef SMTP_SUPPORT
connect(ui->checkConnectionButton, &QPushButton::clicked, this,
&SendMailTab::slotCheckConnection);
@@ -96,22 +96,6 @@ SendMailTab::SendMailTab(QWidget* parent)
void SendMailTab::setSettings() {
auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
- ui->enableCheckBox->setCheckState(Qt::Unchecked);
- try {
- bool smtp_enable = settings.lookup("smtp.enable");
- if (smtp_enable) ui->enableCheckBox->setCheckState(Qt::Checked);
- } catch (...) {
- LOG(ERROR) << _("Setting Operation Error") << _("save_key_checked");
- }
-
- ui->identityCheckBox->setCheckState(Qt::Unchecked);
- try {
- bool identity_enable = settings.lookup("smtp.identity_enable");
- if (identity_enable) ui->identityCheckBox->setCheckState(Qt::Checked);
- } catch (...) {
- LOG(ERROR) << _("Setting Operation Error") << _("identity_enable");
- }
-
try {
std::string mail_address = settings.lookup("smtp.mail_address");
ui->smtpServerAddressEdit->setText(mail_address.c_str());
@@ -154,6 +138,28 @@ void SendMailTab::setSettings() {
} catch (...) {
LOG(ERROR) << _("Setting Operation Error") << _("default_sender");
}
+
+ ui->identityCheckBox->setCheckState(Qt::Unchecked);
+ try {
+ bool identity_enable = settings.lookup("smtp.identity_enable");
+ if (identity_enable)
+ ui->identityCheckBox->setCheckState(Qt::Checked);
+ else
+ ui->identityCheckBox->setCheckState(Qt::Unchecked);
+ } catch (...) {
+ LOG(ERROR) << _("Setting Operation Error") << _("identity_enable");
+ }
+
+ ui->enableCheckBox->setCheckState(Qt::Unchecked);
+ try {
+ bool smtp_enable = settings.lookup("smtp.enable");
+ if (smtp_enable)
+ ui->enableCheckBox->setCheckState(Qt::Checked);
+ else
+ ui->enableCheckBox->setCheckState(Qt::Unchecked);
+ } catch (...) {
+ LOG(ERROR) << _("Setting Operation Error") << _("save_key_checked");
+ }
}
void SendMailTab::applySettings() {