def resetConf(self): try: serialized = self.mainwindow.init_call('antispam', 'getAntispamConfig') self.spam_config = AntispamConf.deserialize(serialized) except: self.spam_config = None mail_inst = QMailObject.getInitializedInstance(self.client) self.antivirus_enable.setChecked(mail_inst.mailcfg.use_antivirus) if self.spam_config is not None: self.antispam_enable.setChecked(self.spam_config.use_antispam) self.mark_spam_level.setValue(self.spam_config.mark_spam_level) self.mark_spam_level.setMaximumWidth(self.mark_spam_level.fontMetrics().averageCharWidth() * 10) self.deny_spam_level.setValue(self.spam_config.deny_spam_level) self.deny_spam_level.setMaximumWidth(self.deny_spam_level.fontMetrics().averageCharWidth() * 10) if not self.spam_config.use_antispam: self.mark_spam_level.setEnabled(False) self.deny_spam_level.setEnabled(False) relayed_domains_data = [] for domain, ip in mail_inst.mailcfg.relay_domain_in.iteritems(): relayed_domains_data.append([domain, ip]) self.relayed_domains.reset(relayed_domains_data) self.relayed_net.setIpAddrs(mail_inst.mailcfg.relay_net_out)
def resetConf(self): self._modified = False serialized = self.mainwindow.init_call("contact", u'getContactConfig') self.config = ContactConf.deserialize(serialized) self.admin_mail.setText(self.config.admin_mail) self.sender_mail.setText(self.config.sender_mail) if self.config.language in ContactConf.CODE_TO_NAME: lang_id = self.language.findText(ContactConf.CODE_TO_NAME[self.config.language]) self.language.setCurrentIndex(lang_id) smarthost = QMailObject.getInitializedInstance(self.client).mailcfg.smarthost self.use_smarthost.setChecked(bool(smarthost)) self.mail_relay.setEnabled(self.use_smarthost.isChecked()) self.mail_relay.setText(smarthost) self.smarthost_group.setVisible(True)