Preferences/ConfigurationPages/EmailPage.py

branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 3058
0a02c433f52d
parent 3038
7fe9a53280bd
child 3145
a9de05d4a22f
equal deleted inserted replaced
3058:0a02c433f52d 3060:5883ce99ee12
80 def __updateTestButton(self): 80 def __updateTestButton(self):
81 """ 81 """
82 Private slot to update the enabled state of the test button. 82 Private slot to update the enabled state of the test button.
83 """ 83 """
84 self.testButton.setEnabled( 84 self.testButton.setEnabled(
85 self.mailAuthenticationCheckBox.isChecked() and \ 85 self.mailAuthenticationCheckBox.isChecked() and
86 self.mailUserEdit.text() != "" and \ 86 self.mailUserEdit.text() != "" and
87 self.mailPasswordEdit.text() != "" and \ 87 self.mailPasswordEdit.text() != "" and
88 self.mailServerEdit.text() != "" 88 self.mailServerEdit.text() != ""
89 ) 89 )
90 90
91 @pyqtSlot(bool) 91 @pyqtSlot(bool)
92 def on_mailAuthenticationCheckBox_toggled(self, checked): 92 def on_mailAuthenticationCheckBox_toggled(self, checked):
153 E5MessageBox.critical( 153 E5MessageBox.critical(
154 self, 154 self,
155 self.trUtf8("Login Test"), 155 self.trUtf8("Login Test"),
156 self.trUtf8( 156 self.trUtf8(
157 """<p>The login test failed.<br>Reason: {0}</p>""") 157 """<p>The login test failed.<br>Reason: {0}</p>""")
158 .format(errorStr)) 158 .format(errorStr))
159 server.quit() 159 server.quit()
160 except (smtplib.SMTPException, socket.error) as e: 160 except (smtplib.SMTPException, socket.error) as e:
161 QApplication.restoreOverrideCursor() 161 QApplication.restoreOverrideCursor()
162 if isinstance(e, smtplib.SMTPResponseException): 162 if isinstance(e, smtplib.SMTPResponseException):
163 errorStr = e.smtp_error.decode() 163 errorStr = e.smtp_error.decode()
172 errorStr = str(e) 172 errorStr = str(e)
173 E5MessageBox.critical( 173 E5MessageBox.critical(
174 self, 174 self,
175 self.trUtf8("Login Test"), 175 self.trUtf8("Login Test"),
176 self.trUtf8("""<p>The login test failed.<br>Reason: {0}</p>""") 176 self.trUtf8("""<p>The login test failed.<br>Reason: {0}</p>""")
177 .format(errorStr)) 177 .format(errorStr))
178 178
179 179
180 def create(dlg): 180 def create(dlg):
181 """ 181 """
182 Module function to create the configuration page. 182 Module function to create the configuration page.

eric ide

mercurial