Send from addressbook label

When choosing an item from addressbook to send to, put both label and
address into the lineEditTo widget.
This commit is contained in:
mailchuck 2016-04-29 09:31:56 +02:00 committed by Peter Surda
parent 98313d594f
commit 46edb72b4f

View File

@ -3180,12 +3180,15 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.tableWidgetAddressBook.selectedIndexes()[i].row()] = 0
for currentRow in listOfSelectedRows:
addressAtCurrentRow = self.ui.tableWidgetAddressBook.item(
currentRow, 1).text()
currentRow, 0).address
labelAtCurrentRow = self.ui.tableWidgetAddressBook.item(
currentRow, 0).label
stringToAdd = labelAtCurrentRow + " <" + addressAtCurrentRow + ">"
if self.ui.lineEditTo.text() == '':
self.ui.lineEditTo.setText(str(addressAtCurrentRow))
self.ui.lineEditTo.setText(stringToAdd)
else:
self.ui.lineEditTo.setText(str(
self.ui.lineEditTo.text()) + '; ' + str(addressAtCurrentRow))
self.ui.lineEditTo.text()) + '; ' + stringToAdd)
if listOfSelectedRows == {}:
self.statusBar().showMessage(_translate(
"MainWindow", "No addresses selected."))