UI/EmailDialog.py

changeset 564
b3d966393ba9
parent 550
22b951013193
child 791
9ec2ac20e54e
equal deleted inserted replaced
563:e35d2cda9a74 564:b3d966393ba9
268 server.starttls() 268 server.starttls()
269 if Preferences.getUser("MailServerAuthentication"): 269 if Preferences.getUser("MailServerAuthentication"):
270 # mail server needs authentication 270 # mail server needs authentication
271 password = Preferences.getUser("MailServerPassword") 271 password = Preferences.getUser("MailServerPassword")
272 if not password: 272 if not password:
273 password, ok = QInputDialog.getText(\ 273 password, ok = QInputDialog.getText(
274 self, 274 self,
275 self.trUtf8("Mail Server Password"), 275 self.trUtf8("Mail Server Password"),
276 self.trUtf8("Enter your mail server password"), 276 self.trUtf8("Enter your mail server password"),
277 QLineEdit.Password) 277 QLineEdit.Password)
278 if not ok: 278 if not ok:
313 @pyqtSlot() 313 @pyqtSlot()
314 def on_addButton_clicked(self): 314 def on_addButton_clicked(self):
315 """ 315 """
316 Private slot to handle the Add... button. 316 Private slot to handle the Add... button.
317 """ 317 """
318 fname = QFileDialog.getOpenFileName(\ 318 fname = QFileDialog.getOpenFileName(
319 self, 319 self,
320 self.trUtf8("Attach file")) 320 self.trUtf8("Attach file"))
321 if fname: 321 if fname:
322 self.attachFile(fname, False) 322 self.attachFile(fname, False)
323 323
344 """ 344 """
345 Private slot to handle the Delete button. 345 Private slot to handle the Delete button.
346 """ 346 """
347 itm = self.attachments.currentItem() 347 itm = self.attachments.currentItem()
348 if itm is not None: 348 if itm is not None:
349 itm = self.attachments.takeTopLevelItem(\ 349 itm = self.attachments.takeTopLevelItem(
350 self.attachments.indexOfTopLevelItem(itm)) 350 self.attachments.indexOfTopLevelItem(itm))
351 del itm 351 del itm
352 352
353 def on_subject_textChanged(self, txt): 353 def on_subject_textChanged(self, txt):
354 """ 354 """
355 Private slot to handle the textChanged signal of the subject edit. 355 Private slot to handle the textChanged signal of the subject edit.
356 356
357 @param txt changed text (string) 357 @param txt changed text (string)
358 """ 358 """
359 self.sendButton.setEnabled(\ 359 self.sendButton.setEnabled(
360 self.subject.text() != "" and \ 360 self.subject.text() != "" and \
361 self.message.toPlainText() != "") 361 self.message.toPlainText() != "")
362 362
363 def on_message_textChanged(self): 363 def on_message_textChanged(self):
364 """ 364 """
365 Private slot to handle the textChanged signal of the message edit. 365 Private slot to handle the textChanged signal of the message edit.
366 366
367 @param txt changed text (string) 367 @param txt changed text (string)
368 """ 368 """
369 self.sendButton.setEnabled(\ 369 self.sendButton.setEnabled(
370 self.subject.text() != "" and \ 370 self.subject.text() != "" and \
371 self.message.toPlainText() != "") 371 self.message.toPlainText() != "")

eric ide

mercurial