MailSettings: Set window modified state

This commit is contained in:
Sam Atkins 2022-05-11 17:40:47 +01:00 committed by Andreas Kling
parent ab2bbaabc7
commit c7d038cc26
Notes: sideshowbarker 2024-07-17 12:00:58 +09:00

View file

@ -46,15 +46,27 @@ MailSettingsWidget::MailSettingsWidget()
m_server_inputbox = *find_descendant_of_type_named<GUI::TextBox>("server_input"); m_server_inputbox = *find_descendant_of_type_named<GUI::TextBox>("server_input");
m_server_inputbox->set_text(Config::read_string("Mail", "Connection", "Server", "")); m_server_inputbox->set_text(Config::read_string("Mail", "Connection", "Server", ""));
m_server_inputbox->on_change = [&]() {
set_modified(true);
};
m_port_combobox = *find_descendant_of_type_named<GUI::ComboBox>("port_input"); m_port_combobox = *find_descendant_of_type_named<GUI::ComboBox>("port_input");
m_port_combobox->set_text(Config::read_string("Mail", "Connection", "Port", "993")); m_port_combobox->set_text(Config::read_string("Mail", "Connection", "Port", "993"));
m_port_combobox->set_only_allow_values_from_model(false); m_port_combobox->set_only_allow_values_from_model(false);
m_port_combobox->set_model(*GUI::ItemListModel<String>::create(m_common_ports)); m_port_combobox->set_model(*GUI::ItemListModel<String>::create(m_common_ports));
m_port_combobox->on_change = [&](auto, auto) {
set_modified(true);
};
m_tls_checkbox = *find_descendant_of_type_named<GUI::CheckBox>("tls_input"); m_tls_checkbox = *find_descendant_of_type_named<GUI::CheckBox>("tls_input");
m_tls_checkbox->set_checked(Config::read_bool("Mail", "Connection", "TLS", false)); m_tls_checkbox->set_checked(Config::read_bool("Mail", "Connection", "TLS", false));
m_tls_checkbox->on_checked = [&](auto) {
set_modified(true);
};
m_email_inputbox = *find_descendant_of_type_named<GUI::TextBox>("email_input"); m_email_inputbox = *find_descendant_of_type_named<GUI::TextBox>("email_input");
m_email_inputbox->set_text(Config::read_string("Mail", "User", "Username", "")); m_email_inputbox->set_text(Config::read_string("Mail", "User", "Username", ""));
m_email_inputbox->on_change = [&]() {
set_modified(true);
};
} }