Sent tab:
- "Send another message": send from the same ID to the same recipient as before and quote the previous message (just like a reply, only in the same directions as the original message) - Add recipient to AddressBook - "Save message as..."
This commit is contained in:
parent
f7d37583e5
commit
7983df9e09
|
@ -173,9 +173,9 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.actionReplyChan = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
self.actionReplyChan = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Reply to Chan"), self.on_action_InboxReplyChan)
|
"MainWindow", "Reply to Chan"), self.on_action_InboxReplyChan)
|
||||||
self.actionSendtoSender = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
self.actionSendtoSender = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Send message to senders"), self.on_action_InboxSendtoSender)
|
"MainWindow", "Send message to sender"), self.on_action_InboxSendtoSender)
|
||||||
self.actionSendtoRecipient = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
self.actionSendtoRecipient = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Send message to recipients"), self.on_action_InboxSendtoRecipient)
|
"MainWindow", "Send message to recipient"), self.on_action_InboxSendtoRecipient)
|
||||||
self.actionInboxClipboardSender = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
self.actionInboxClipboardSender = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Copy sender to clipboard"), self.on_action_InboxClipboardSender)
|
"MainWindow", "Copy sender to clipboard"), self.on_action_InboxClipboardSender)
|
||||||
self.actionInboxClipboardRecipient = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
self.actionInboxClipboardRecipient = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
|
@ -190,17 +190,17 @@ class MyForm(QtGui.QMainWindow):
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'), self.on_context_menuInbox)
|
'customContextMenuRequested(const QPoint&)'), self.on_context_menuInbox)
|
||||||
|
# Recipient submenu
|
||||||
|
self.subMenuInboxRecipient = QtGui.QMenu(self)
|
||||||
|
self.subMenuInboxRecipient.setTitle(_translate("MainWindow", "Recipient"))
|
||||||
|
self.subMenuInboxRecipient.addAction(self.actionSendtoRecipient)
|
||||||
|
self.subMenuInboxRecipient.addAction(self.actionInboxClipboardRecipient)
|
||||||
# Sender submenu
|
# Sender submenu
|
||||||
self.subMenuInboxSender = QtGui.QMenu(self)
|
self.subMenuInboxSender = QtGui.QMenu(self)
|
||||||
self.subMenuInboxSender.setTitle(_translate("MainWindow", "Sender"))
|
self.subMenuInboxSender.setTitle(_translate("MainWindow", "Sender"))
|
||||||
self.subMenuInboxSender.addAction(self.actionSendtoSender)
|
self.subMenuInboxSender.addAction(self.actionSendtoSender)
|
||||||
self.subMenuInboxSender.addAction(self.actionInboxClipboardSender)
|
self.subMenuInboxSender.addAction(self.actionInboxClipboardSender)
|
||||||
self.subMenuInboxSender.addAction(self.actionAddSenderToAddressBook)
|
self.subMenuInboxSender.addAction(self.actionAddSenderToAddressBook)
|
||||||
# Recipient submenu
|
|
||||||
self.subMenuInboxRecipient = QtGui.QMenu(self)
|
|
||||||
self.subMenuInboxRecipient.setTitle(_translate("MainWindow", "Recipient"))
|
|
||||||
self.subMenuInboxRecipient.addAction(self.actionSendtoRecipient)
|
|
||||||
self.subMenuInboxRecipient.addAction(self.actionInboxClipboardRecipient)
|
|
||||||
# Popup menu
|
# Popup menu
|
||||||
self.popMenuInbox = QtGui.QMenu(self)
|
self.popMenuInbox = QtGui.QMenu(self)
|
||||||
self.popMenuInbox.addAction(self.actionInboxMessageForceHtml)
|
self.popMenuInbox.addAction(self.actionInboxMessageForceHtml)
|
||||||
|
@ -209,8 +209,8 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.popMenuInbox.addSeparator()
|
self.popMenuInbox.addSeparator()
|
||||||
self.popMenuInbox.addAction(self.actionReply)
|
self.popMenuInbox.addAction(self.actionReply)
|
||||||
self.popMenuInbox.addAction(self.actionReplyChan)
|
self.popMenuInbox.addAction(self.actionReplyChan)
|
||||||
self.popMenuInbox.addMenu(self.subMenuInboxSender)
|
|
||||||
self.popMenuInbox.addMenu(self.subMenuInboxRecipient)
|
self.popMenuInbox.addMenu(self.subMenuInboxRecipient)
|
||||||
|
self.popMenuInbox.addMenu(self.subMenuInboxSender)
|
||||||
self.popMenuInbox.addSeparator()
|
self.popMenuInbox.addSeparator()
|
||||||
self.popMenuInbox.addAction(self.actionSaveMessageAs)
|
self.popMenuInbox.addAction(self.actionSaveMessageAs)
|
||||||
self.popMenuInbox.addAction(self.actionTrashInboxMessage)
|
self.popMenuInbox.addAction(self.actionTrashInboxMessage)
|
||||||
|
@ -220,14 +220,20 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# Actions
|
# Actions
|
||||||
self.actionSentMessageForceHtml = self.ui.sentContextMenuToolbar.addAction(_translate(
|
self.actionSentMessageForceHtml = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "View HTML code as formatted text"), self.on_action_SentMessageForceHtml)
|
"MainWindow", "View HTML code as formatted text"), self.on_action_SentMessageForceHtml)
|
||||||
|
self.actionSendAnother = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
|
"MainWindow", "Send another message"), self.on_action_SentSendAnother)
|
||||||
self.actionSentSendtoRecipient = self.ui.sentContextMenuToolbar.addAction(_translate(
|
self.actionSentSendtoRecipient = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Send message to recipient(s)"), self.on_action_SentSendtoRecipient)
|
"MainWindow", "Send message to recipient"), self.on_action_SentSendtoRecipient)
|
||||||
self.actionSentSendtoSender = self.ui.sentContextMenuToolbar.addAction(_translate(
|
self.actionSentSendtoSender = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Send message to sender(s)"), self.on_action_SentSendtoSender)
|
"MainWindow", "Send message to sender"), self.on_action_SentSendtoSender)
|
||||||
self.actionSentClipboardRecipient = self.ui.sentContextMenuToolbar.addAction(_translate(
|
self.actionSentClipboardRecipient = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Copy recipient address(es) to clipboard"), self.on_action_SentClipboardRecipient)
|
"MainWindow", "Copy recipient address to clipboard"), self.on_action_SentClipboardRecipient)
|
||||||
self.actionSentClipboardSender = self.ui.sentContextMenuToolbar.addAction(_translate(
|
self.actionSentClipboardSender = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Copy sender address(es) to clipboard"), self.on_action_SentClipboardSender)
|
"MainWindow", "Copy sender address to clipboard"), self.on_action_SentClipboardSender)
|
||||||
|
self.actionSentAddRecipientToAddressBook = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
|
"MainWindow", "Add recipient to your Address Book"), self.on_action_SentAddRecipientToAddressBook)
|
||||||
|
self.actionSentSaveMessageAs = self.ui.inboxContextMenuToolbar.addAction(_translate(
|
||||||
|
"MainWindow", "Save message as..."), self.on_action_SentSaveMessageAs)
|
||||||
self.actionTrashSentMessage = self.ui.sentContextMenuToolbar.addAction(_translate(
|
self.actionTrashSentMessage = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Move to Trash"), self.on_action_SentTrash)
|
"MainWindow", "Move to Trash"), self.on_action_SentTrash)
|
||||||
self.actionForceSend = self.ui.sentContextMenuToolbar.addAction(_translate(
|
self.actionForceSend = self.ui.sentContextMenuToolbar.addAction(_translate(
|
||||||
|
@ -236,27 +242,27 @@ class MyForm(QtGui.QMainWindow):
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
self.connect(self.ui.tableWidgetSent, QtCore.SIGNAL(
|
self.connect(self.ui.tableWidgetSent, QtCore.SIGNAL(
|
||||||
'customContextMenuRequested(const QPoint&)'), self.on_context_menuSent)
|
'customContextMenuRequested(const QPoint&)'), self.on_context_menuSent)
|
||||||
# Sender submenu
|
|
||||||
self.subMenuSentSender = QtGui.QMenu(self)
|
|
||||||
self.subMenuSentSender.setTitle(_translate("MainWindow", "Sender"))
|
|
||||||
self.subMenuSentSender.addAction(self.actionSentSendtoSender)
|
|
||||||
self.subMenuSentSender.addAction(self.actionSentClipboardSender)
|
|
||||||
# self.subMenuSentSender.addAction(self.actionAddSenderToAddressBook)
|
|
||||||
# Recipient submenu
|
# Recipient submenu
|
||||||
self.subMenuSentRecipient = QtGui.QMenu(self)
|
self.subMenuSentRecipient = QtGui.QMenu(self)
|
||||||
self.subMenuSentRecipient.setTitle(_translate("MainWindow", "Recipient"))
|
self.subMenuSentRecipient.setTitle(_translate("MainWindow", "Recipient"))
|
||||||
self.subMenuSentRecipient.addAction(self.actionSentSendtoRecipient)
|
self.subMenuSentRecipient.addAction(self.actionSentSendtoRecipient)
|
||||||
self.subMenuSentRecipient.addAction(self.actionSentClipboardRecipient)
|
self.subMenuSentRecipient.addAction(self.actionSentClipboardRecipient)
|
||||||
#self.subMenuSentRecipient.addAction(self.actionSentAddRecipientToAddressBook)
|
self.subMenuSentRecipient.addAction(self.actionSentAddRecipientToAddressBook)
|
||||||
|
# Sender submenu
|
||||||
|
self.subMenuSentSender = QtGui.QMenu(self)
|
||||||
|
self.subMenuSentSender.setTitle(_translate("MainWindow", "Sender"))
|
||||||
|
self.subMenuSentSender.addAction(self.actionSentSendtoSender)
|
||||||
|
self.subMenuSentSender.addAction(self.actionSentClipboardSender)
|
||||||
|
|
||||||
# Popup menu
|
# Popup menu
|
||||||
self.popMenuSent = QtGui.QMenu(self)
|
self.popMenuSent = QtGui.QMenu(self)
|
||||||
self.popMenuSent.addAction(self.actionSentMessageForceHtml)
|
self.popMenuSent.addAction(self.actionSentMessageForceHtml)
|
||||||
self.popMenuSent.addSeparator()
|
self.popMenuSent.addSeparator()
|
||||||
### => Send another message
|
self.popMenuSent.addAction(self.actionSendAnother)
|
||||||
self.popMenuSent.addMenu(self.subMenuSentSender)
|
|
||||||
self.popMenuSent.addMenu(self.subMenuSentRecipient)
|
self.popMenuSent.addMenu(self.subMenuSentRecipient)
|
||||||
|
self.popMenuSent.addMenu(self.subMenuSentSender)
|
||||||
self.popMenuSent.addSeparator()
|
self.popMenuSent.addSeparator()
|
||||||
### => Save as goes here
|
self.popMenuSent.addAction(self.actionSentSaveMessageAs)
|
||||||
self.popMenuSent.addAction(self.actionTrashSentMessage)
|
self.popMenuSent.addAction(self.actionTrashSentMessage)
|
||||||
|
|
||||||
|
|
||||||
|
@ -271,10 +277,12 @@ class MyForm(QtGui.QMainWindow):
|
||||||
"MainWindow", "Enable"), self.on_action_YourIdentitiesEnable)
|
"MainWindow", "Enable"), self.on_action_YourIdentitiesEnable)
|
||||||
self.actionDisable = self.ui.addressContextMenuToolbar.addAction(_translate(
|
self.actionDisable = self.ui.addressContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Disable"), self.on_action_YourIdentitiesDisable)
|
"MainWindow", "Disable"), self.on_action_YourIdentitiesDisable)
|
||||||
|
self.actionYourIdentitiesSendFromAddress = self.ui.addressContextMenuToolbar.addAction(_translate(
|
||||||
|
"MainWindow", "Send message from this address"), self.on_action_YourIdentitiesSendFromAddress)
|
||||||
|
self.actionYourIdentitiesSendToChan = self.ui.addressContextMenuToolbar.addAction(_translate(
|
||||||
|
"MainWindow", "Send message to this Chan"), self.on_action_YourIdentitiesSendToChan)
|
||||||
self.actionYourIdentitiesClipboard = self.ui.addressContextMenuToolbar.addAction(_translate(
|
self.actionYourIdentitiesClipboard = self.ui.addressContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Copy address to clipboard"), self.on_action_YourIdentitiesClipboard)
|
"MainWindow", "Copy address to clipboard"), self.on_action_YourIdentitiesClipboard)
|
||||||
self.actionYourIdentitiesSendToAddress = self.ui.addressContextMenuToolbar.addAction(_translate(
|
|
||||||
"MainWindow", "Send message to this address"), self.on_action_YourIdentitiesSendToAddress)
|
|
||||||
self.actionSpecialAddressBehavior = self.ui.addressContextMenuToolbar.addAction(_translate(
|
self.actionSpecialAddressBehavior = self.ui.addressContextMenuToolbar.addAction(_translate(
|
||||||
"MainWindow", "Special address behavior..."), self.on_action_SpecialAddressBehaviorDialog)
|
"MainWindow", "Special address behavior..."), self.on_action_SpecialAddressBehaviorDialog)
|
||||||
self.ui.tableWidgetYourIdentities.setContextMenuPolicy(
|
self.ui.tableWidgetYourIdentities.setContextMenuPolicy(
|
||||||
|
@ -285,8 +293,9 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.popMenuIdentities.addAction(self.actionNewAddress)
|
self.popMenuIdentities.addAction(self.actionNewAddress)
|
||||||
self.popMenuIdentities.addAction(self.actionNewChan)
|
self.popMenuIdentities.addAction(self.actionNewChan)
|
||||||
self.popMenuIdentities.addSeparator()
|
self.popMenuIdentities.addSeparator()
|
||||||
|
self.popMenuIdentities.addAction(self.actionYourIdentitiesSendFromAddress)
|
||||||
|
self.popMenuIdentities.addAction(self.actionYourIdentitiesSendToChan)
|
||||||
self.popMenuIdentities.addAction(self.actionYourIdentitiesClipboard)
|
self.popMenuIdentities.addAction(self.actionYourIdentitiesClipboard)
|
||||||
self.popMenuIdentities.addAction(self.actionYourIdentitiesSendToAddress)
|
|
||||||
self.popMenuIdentities.addSeparator()
|
self.popMenuIdentities.addSeparator()
|
||||||
self.popMenuIdentities.addAction(self.actionEnable)
|
self.popMenuIdentities.addAction(self.actionEnable)
|
||||||
self.popMenuIdentities.addAction(self.actionDisable)
|
self.popMenuIdentities.addAction(self.actionDisable)
|
||||||
|
@ -2460,58 +2469,74 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# We could also select upwards, but then our problem would be with the topmost message.
|
# We could also select upwards, but then our problem would be with the topmost message.
|
||||||
# here.clearSelection() manages to mark the message as read again.
|
# here.clearSelection() manages to mark the message as read again.
|
||||||
|
|
||||||
def on_action_InboxReplyChan(self):
|
|
||||||
replyToChan = True
|
|
||||||
self.on_action_InboxReplyGeneric(replyToChan)
|
|
||||||
|
|
||||||
def on_action_InboxReply(self):
|
def on_action_InboxReply(self):
|
||||||
replyToChan = False
|
here = self.ui.tableWidgetInbox
|
||||||
self.on_action_InboxReplyGeneric(replyToChan)
|
newFromAddressColumn = 0
|
||||||
|
newToAddressColumn = 1
|
||||||
|
self.on_action_InboxReplyGeneric(here, newFromAddressColumn, newToAddressColumn)
|
||||||
|
|
||||||
def on_action_InboxReplyGeneric(self, replyToChan):
|
def on_action_InboxReplyChan(self):
|
||||||
currentInboxRow = self.ui.tableWidgetInbox.currentRow()
|
here = self.ui.tableWidgetInbox
|
||||||
toAddressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(
|
newFromAddressColumn = 0
|
||||||
currentInboxRow, 0).data(Qt.UserRole).toPyObject())
|
newToAddressColumn = 0
|
||||||
fromAddressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(
|
self.on_action_InboxReplyGeneric(here, newFromAddressColumn, newToAddressColumn)
|
||||||
currentInboxRow, 1).data(Qt.UserRole).toPyObject())
|
|
||||||
if replyToChan:
|
def on_action_SentSendAnother(self):
|
||||||
toAddressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(
|
here = self.ui.tableWidgetSent
|
||||||
currentInboxRow, 0).data(Qt.UserRole).toPyObject())
|
newFromAddressColumn = 1
|
||||||
if toAddressAtCurrentInboxRow == self.str_broadcast_subscribers:
|
newToAddressColumn = 0
|
||||||
|
self.on_action_InboxReplyGeneric(here, newFromAddressColumn, newToAddressColumn)
|
||||||
|
|
||||||
|
def on_action_InboxReplyGeneric(self, here, newFromAddressColumn, newToAddressColumn):
|
||||||
|
currentInboxRow = here.currentRow()
|
||||||
|
newFromAddress = str(here.item(
|
||||||
|
currentInboxRow, newFromAddressColumn).data(Qt.UserRole).toPyObject())
|
||||||
|
newToAddress = str(here.item(
|
||||||
|
currentInboxRow, newToAddressColumn).data(Qt.UserRole).toPyObject())
|
||||||
|
if newFromAddress == self.str_broadcast_subscribers:
|
||||||
self.ui.labelFrom.setText('')
|
self.ui.labelFrom.setText('')
|
||||||
elif not shared.config.has_section(toAddressAtCurrentInboxRow):
|
elif not shared.config.has_section(newFromAddress):
|
||||||
QtGui.QMessageBox.information(self, _translate("MainWindow", "Address is gone"), _translate(
|
QtGui.QMessageBox.information(self, _translate("MainWindow", "Address is gone"), _translate(
|
||||||
"MainWindow", "Bitmessage cannot find your address %1. Perhaps you removed it?").arg(toAddressAtCurrentInboxRow), QMessageBox.Ok)
|
"MainWindow", "Bitmessage cannot find your address %1. Perhaps you removed it?").arg(newFromAddress), QMessageBox.Ok)
|
||||||
self.ui.labelFrom.setText('')
|
self.ui.labelFrom.setText('')
|
||||||
elif not shared.config.getboolean(toAddressAtCurrentInboxRow, 'enabled'):
|
elif not shared.config.getboolean(newFromAddress, 'enabled'):
|
||||||
QtGui.QMessageBox.information(self, _translate("MainWindow", "Address disabled"), _translate(
|
QtGui.QMessageBox.information(self, _translate("MainWindow", "Address disabled"), _translate(
|
||||||
"MainWindow", "Error: The address from which you are trying to send is disabled. You\'ll have to enable it on the \'Your Identities\' tab before using it."), QMessageBox.Ok)
|
"MainWindow", "Error: The address from which you are trying to send is disabled. You\'ll have to enable it on the \'Your Identities\' tab before using it."), QMessageBox.Ok)
|
||||||
self.ui.labelFrom.setText('')
|
self.ui.labelFrom.setText('')
|
||||||
else:
|
else:
|
||||||
self.ui.labelFrom.setText(toAddressAtCurrentInboxRow)
|
self.ui.labelFrom.setText(newFromAddress)
|
||||||
self.setBroadcastEnablementDependingOnWhetherThisIsAChanAddress(toAddressAtCurrentInboxRow)
|
self.setBroadcastEnablementDependingOnWhetherThisIsAChanAddress(newFromAddress)
|
||||||
self.ui.lineEditTo.setText(str(fromAddressAtCurrentInboxRow))
|
self.ui.lineEditTo.setText(str(newToAddress))
|
||||||
self.ui.comboBoxSendFrom.setCurrentIndex(0)
|
self.ui.comboBoxSendFrom.setCurrentIndex(0)
|
||||||
# self.ui.comboBoxSendFrom.setEditText(str(self.ui.tableWidgetInbox.item(currentInboxRow,0).text))
|
# self.ui.comboBoxSendFrom.setEditText(str(here.item(currentInboxRow,0).text))
|
||||||
self.ui.textEditMessage.setText('\n\n------------------------------------------------------\n' + self.ui.tableWidgetInbox.item(
|
self.ui.textEditMessage.setText('\n\n------------------------------------------------------\n' + here.item(
|
||||||
currentInboxRow, 2).data(Qt.UserRole).toPyObject())
|
currentInboxRow, 2).data(Qt.UserRole).toPyObject())
|
||||||
if self.ui.tableWidgetInbox.item(currentInboxRow, 2).text()[0:3] in ['Re:', 'RE:']:
|
if here.item(currentInboxRow, 2).text()[0:3] in ['Re:', 'RE:']:
|
||||||
self.ui.lineEditSubject.setText(
|
self.ui.lineEditSubject.setText(
|
||||||
self.ui.tableWidgetInbox.item(currentInboxRow, 2).text())
|
here.item(currentInboxRow, 2).text())
|
||||||
else:
|
else:
|
||||||
self.ui.lineEditSubject.setText(
|
self.ui.lineEditSubject.setText(
|
||||||
'Re: ' + self.ui.tableWidgetInbox.item(currentInboxRow, 2).text())
|
'Re: ' + here.item(currentInboxRow, 2).text())
|
||||||
self.ui.radioButtonSpecific.setChecked(True)
|
self.ui.radioButtonSpecific.setChecked(True)
|
||||||
self.ui.tabWidget.setCurrentIndex(1)
|
self.ui.tabWidget.setCurrentIndex(1)
|
||||||
|
|
||||||
|
def on_action_SentAddRecipientToAddressBook(self):
|
||||||
|
thisTableWidget = self.ui.tableWidgetSent
|
||||||
|
thisColumn = 0
|
||||||
|
self.on_action_AddToAddressBook(thisTableWidget,thisColumn)
|
||||||
|
|
||||||
def on_action_InboxAddSenderToAddressBook(self):
|
def on_action_InboxAddSenderToAddressBook(self):
|
||||||
currentInboxRow = self.ui.tableWidgetInbox.currentRow()
|
thisTableWidget = self.ui.tableWidgetInbox
|
||||||
# self.ui.tableWidgetInbox.item(currentRow,1).data(Qt.UserRole).toPyObject()
|
thisColumn = 1
|
||||||
addressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(
|
self.on_action_AddToAddressBook(thisTableWidget,thisColumn)
|
||||||
currentInboxRow, 1).data(Qt.UserRole).toPyObject())
|
|
||||||
|
def on_action_AddToAddressBook(self,thisTableWidget,thisColumn):
|
||||||
|
currentRow = thisTableWidget.currentRow()
|
||||||
|
addressAtCurrentRow = str(thisTableWidget.item(
|
||||||
|
currentRow, thisColumn).data(Qt.UserRole).toPyObject())
|
||||||
# Let's make sure that it isn't already in the address book
|
# Let's make sure that it isn't already in the address book
|
||||||
shared.sqlLock.acquire()
|
shared.sqlLock.acquire()
|
||||||
t = (addressAtCurrentInboxRow,)
|
t = (addressAtCurrentRow,)
|
||||||
shared.sqlSubmitQueue.put(
|
shared.sqlSubmitQueue.put(
|
||||||
'''select * from addressbook where address=?''')
|
'''select * from addressbook where address=?''')
|
||||||
shared.sqlSubmitQueue.put(t)
|
shared.sqlSubmitQueue.put(t)
|
||||||
|
@ -2522,12 +2547,12 @@ class MyForm(QtGui.QMainWindow):
|
||||||
newItem = QtGui.QTableWidgetItem(
|
newItem = QtGui.QTableWidgetItem(
|
||||||
'--New entry. Change label in Address Book.--')
|
'--New entry. Change label in Address Book.--')
|
||||||
self.ui.tableWidgetAddressBook.setItem(0, 0, newItem)
|
self.ui.tableWidgetAddressBook.setItem(0, 0, newItem)
|
||||||
newItem = QtGui.QTableWidgetItem(addressAtCurrentInboxRow)
|
newItem = QtGui.QTableWidgetItem(addressAtCurrentRow)
|
||||||
newItem.setFlags(
|
newItem.setFlags(
|
||||||
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||||
self.ui.tableWidgetAddressBook.setItem(0, 1, newItem)
|
self.ui.tableWidgetAddressBook.setItem(0, 1, newItem)
|
||||||
t = ('--New entry. Change label in Address Book.--',
|
t = ('--New entry. Change label in Address Book.--',
|
||||||
addressAtCurrentInboxRow)
|
addressAtCurrentRow)
|
||||||
shared.sqlLock.acquire()
|
shared.sqlLock.acquire()
|
||||||
shared.sqlSubmitQueue.put(
|
shared.sqlSubmitQueue.put(
|
||||||
'''INSERT INTO addressbook VALUES (?,?)''')
|
'''INSERT INTO addressbook VALUES (?,?)''')
|
||||||
|
@ -2568,20 +2593,28 @@ class MyForm(QtGui.QMainWindow):
|
||||||
else:
|
else:
|
||||||
self.ui.tableWidgetInbox.selectRow(currentRow - 1)
|
self.ui.tableWidgetInbox.selectRow(currentRow - 1)
|
||||||
|
|
||||||
|
def on_action_SentSaveMessageAs(self):
|
||||||
|
thisTableWidget = self.ui.tableWidgetSent
|
||||||
|
self.on_action_SaveMessageAs(thisTableWidget)
|
||||||
|
|
||||||
def on_action_InboxSaveMessageAs(self):
|
def on_action_InboxSaveMessageAs(self):
|
||||||
currentInboxRow = self.ui.tableWidgetInbox.currentRow()
|
thisTableWidget = self.ui.tableWidgetInbox
|
||||||
|
self.on_action_SaveMessageAs(thisTableWidget)
|
||||||
|
|
||||||
|
def on_action_SaveMessageAs(self, thisTableWidget):
|
||||||
|
currentRow = thisTableWidget.currentRow()
|
||||||
try:
|
try:
|
||||||
subjectAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(currentInboxRow,2).text())
|
subjectAtcurrentRow = str(thisTableWidget.item(currentRow,2).text())
|
||||||
except:
|
except:
|
||||||
subjectAtCurrentInboxRow = ''
|
subjectAtcurrentRow = ''
|
||||||
defaultFilename = "".join(x for x in subjectAtCurrentInboxRow if x.isalnum()) + '.txt'
|
defaultFilename = "".join(x for x in subjectAtcurrentRow if x.isalnum()) + '.txt'
|
||||||
data = self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject()
|
data = thisTableWidget.item(currentRow,2).data(Qt.UserRole).toPyObject()
|
||||||
filename = QFileDialog.getSaveFileName(self, _translate("MainWindow","Save As..."), defaultFilename, "Text files (*.txt);;All files (*.*)")
|
filename = QFileDialog.getSaveFileName(self, _translate("MainWindow","Save As..."), defaultFilename, "Text files (*.txt);;All files (*.*)")
|
||||||
if filename == '':
|
if filename == '':
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
f = open(filename, 'w')
|
f = open(filename, 'w')
|
||||||
f.write( self.ui.tableWidgetInbox.item(currentInboxRow,2).data(Qt.UserRole).toPyObject() )
|
f.write( thisTableWidget.item(currentRow,2).data(Qt.UserRole).toPyObject() )
|
||||||
f.close()
|
f.close()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
sys.stderr.write('Write error: '+ e)
|
sys.stderr.write('Write error: '+ e)
|
||||||
|
@ -2638,65 +2671,65 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# Copy address to clipboard
|
# Copy address to clipboard
|
||||||
|
|
||||||
def on_action_InboxClipboardRecipient(self):
|
def on_action_InboxClipboardRecipient(self):
|
||||||
here = self.ui.tableWidgetInbox
|
thisTableWidget = self.ui.tableWidgetInbox
|
||||||
address_column = 0
|
address_column = 0
|
||||||
useData = True
|
useData = True
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_InboxClipboardSender(self):
|
def on_action_InboxClipboardSender(self):
|
||||||
here = self.ui.tableWidgetInbox
|
thisTableWidget = self.ui.tableWidgetInbox
|
||||||
address_column = 1
|
address_column = 1
|
||||||
useData = True
|
useData = True
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_SentClipboardRecipient(self):
|
def on_action_SentClipboardRecipient(self):
|
||||||
here = self.ui.tableWidgetSent
|
thisTableWidget = self.ui.tableWidgetSent
|
||||||
address_column = 0
|
address_column = 0
|
||||||
useData = False
|
useData = False
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_SentClipboardSender(self):
|
def on_action_SentClipboardSender(self):
|
||||||
here = self.ui.tableWidgetSent
|
thisTableWidget = self.ui.tableWidgetSent
|
||||||
address_column = 1
|
address_column = 1
|
||||||
useData = False
|
useData = False
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_YourIdentitiesClipboard(self):
|
def on_action_YourIdentitiesClipboard(self):
|
||||||
here = self.ui.tableWidgetYourIdentities
|
thisTableWidget = self.ui.tableWidgetYourIdentities
|
||||||
address_column = 1
|
address_column = 1
|
||||||
useData = False
|
useData = False
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_SubscriptionsClipboard(self):
|
def on_action_SubscriptionsClipboard(self):
|
||||||
here = self.ui.tableWidgetSubscriptions
|
thisTableWidget = self.ui.tableWidgetSubscriptions
|
||||||
address_column = 1
|
address_column = 1
|
||||||
useData = False
|
useData = False
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_AddressBookClipboard(self):
|
def on_action_AddressBookClipboard(self):
|
||||||
here = self.ui.tableWidgetAddressBook
|
thisTableWidget = self.ui.tableWidgetAddressBook
|
||||||
address_column = 1
|
address_column = 1
|
||||||
useData = False
|
useData = False
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_BlacklistClipboard(self):
|
def on_action_BlacklistClipboard(self):
|
||||||
here = self.ui.tableWidgetBlacklist
|
thisTableWidget = self.ui.tableWidgetBlacklist
|
||||||
address_column = 1
|
address_column = 1
|
||||||
useData = False
|
useData = False
|
||||||
self.on_action_Clipboard(here,address_column,useData)
|
self.on_action_Clipboard(thisTableWidget,address_column,useData)
|
||||||
|
|
||||||
def on_action_Clipboard(self, here,address_column,useData):
|
def on_action_Clipboard(self, thisTableWidget,address_column,useData):
|
||||||
listOfSelectedRows = {}
|
listOfSelectedRows = {}
|
||||||
for i in range(len(here.selectedIndexes())):
|
for i in range(len(thisTableWidget.selectedIndexes())):
|
||||||
listOfSelectedRows[
|
listOfSelectedRows[
|
||||||
here.selectedIndexes()[i].row()] = 0
|
thisTableWidget.selectedIndexes()[i].row()] = 0
|
||||||
addressesArray = []
|
addressesArray = []
|
||||||
for currentRow in listOfSelectedRows:
|
for currentRow in listOfSelectedRows:
|
||||||
if useData:
|
if useData:
|
||||||
addressesArray += [str(here.item(currentRow, address_column
|
addressesArray += [str(thisTableWidget.item(currentRow, address_column
|
||||||
).data(Qt.UserRole).toPyObject())]
|
).data(Qt.UserRole).toPyObject())]
|
||||||
else:
|
else:
|
||||||
addressesArray += [str(here.item(
|
addressesArray += [str(thisTableWidget.item(
|
||||||
currentRow, address_column).text())]
|
currentRow, address_column).text())]
|
||||||
clipboard = QtGui.QApplication.clipboard()
|
clipboard = QtGui.QApplication.clipboard()
|
||||||
clipboard.setText('; '.join(addressesArray))
|
clipboard.setText('; '.join(addressesArray))
|
||||||
|
@ -2751,7 +2784,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
useData = True
|
useData = True
|
||||||
self.on_action_SendToAddress(here,address_column,useData)
|
self.on_action_SendToAddress(here,address_column,useData)
|
||||||
|
|
||||||
def on_action_YourIdentitiesSendToAddress(self):
|
def on_action_YourIdentitiesSendToChan(self):
|
||||||
here = self.ui.tableWidgetYourIdentities
|
here = self.ui.tableWidgetYourIdentities
|
||||||
address_column = 1
|
address_column = 1
|
||||||
useData = False
|
useData = False
|
||||||
|
@ -2834,6 +2867,10 @@ class MyForm(QtGui.QMainWindow):
|
||||||
if len(added) > 0:
|
if len(added) > 0:
|
||||||
self.ui.tabWidget.setCurrentIndex(1)
|
self.ui.tabWidget.setCurrentIndex(1)
|
||||||
|
|
||||||
|
def on_action_YourIdentitiesSendFromAddress(self):
|
||||||
|
###
|
||||||
|
pass
|
||||||
|
|
||||||
def on_action_AddressBookSubscribe(self):
|
def on_action_AddressBookSubscribe(self):
|
||||||
listOfSelectedRows = {}
|
listOfSelectedRows = {}
|
||||||
for i in range(len(self.ui.tableWidgetAddressBook.selectedIndexes())):
|
for i in range(len(self.ui.tableWidgetAddressBook.selectedIndexes())):
|
||||||
|
@ -3063,20 +3100,9 @@ class MyForm(QtGui.QMainWindow):
|
||||||
shared.config.write(configfile)
|
shared.config.write(configfile)
|
||||||
shared.reloadMyAddressHashes()
|
shared.reloadMyAddressHashes()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def on_context_menuYourIdentities(self, point):
|
|
||||||
# disable certain context menu items for multiselection
|
|
||||||
is_singleselection = len(self.ui.tableWidgetYourIdentities.selectedIndexes())/3 <= 1 # divide by three because there are three columns
|
|
||||||
self.actionNewAddress.setEnabled(is_singleselection)
|
|
||||||
self.actionNewChan.setEnabled(is_singleselection)
|
|
||||||
self.actionSpecialAddressBehavior.setEnabled(is_singleselection)
|
|
||||||
self.popMenuIdentities.exec_(
|
|
||||||
self.ui.tableWidgetYourIdentities.mapToGlobal(point))
|
|
||||||
|
|
||||||
def on_context_menuInbox(self, point):
|
def on_context_menuInbox(self, point):
|
||||||
# divide by four because there are four columns
|
# single or multi selction
|
||||||
is_singleselection = len(self.ui.tableWidgetInbox.selectedIndexes())/4 <= 1
|
is_singleselection = len(self.ui.tableWidgetInbox.selectedIndexes())/4 <= 1 # divide by four because there are four columns
|
||||||
# disable certain context menu items for multiselection
|
# disable certain context menu items for multiselection
|
||||||
self.actionReply.setEnabled(is_singleselection==True)
|
self.actionReply.setEnabled(is_singleselection==True)
|
||||||
self.actionReplyChan.setEnabled(is_singleselection==True)
|
self.actionReplyChan.setEnabled(is_singleselection==True)
|
||||||
|
@ -3085,12 +3111,14 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# disable certain context menu items for single selction
|
# disable certain context menu items for single selction
|
||||||
self.actionSendtoSender.setEnabled(is_singleselection==False)
|
self.actionSendtoSender.setEnabled(is_singleselection==False)
|
||||||
self.actionSendtoRecipient.setEnabled(is_singleselection==False)
|
self.actionSendtoRecipient.setEnabled(is_singleselection==False)
|
||||||
|
# check whether recipient is a chan for "reply to chan"
|
||||||
if is_singleselection:
|
if is_singleselection:
|
||||||
currentRow = self.ui.tableWidgetInbox.selectedIndexes()[0].row()
|
currentRow = self.ui.tableWidgetInbox.selectedIndexes()[0].row()
|
||||||
possibleChanAddress = str(self.ui.tableWidgetInbox.item(
|
possibleChanAddress = str(self.ui.tableWidgetInbox.item(
|
||||||
currentRow, 0).data(Qt.UserRole).toPyObject())
|
currentRow, 0).data(Qt.UserRole).toPyObject())
|
||||||
isChan = shared.safeConfigGetBoolean(addBMIfNotPresent(possibleChanAddress), 'chan')
|
isChan = shared.safeConfigGetBoolean(addBMIfNotPresent(possibleChanAddress), 'chan')
|
||||||
self.actionReplyChan.setEnabled(isChan)
|
self.actionReplyChan.setEnabled(isChan)
|
||||||
|
# pop up
|
||||||
self.popMenuInbox.exec_(self.ui.tableWidgetInbox.mapToGlobal(point))
|
self.popMenuInbox.exec_(self.ui.tableWidgetInbox.mapToGlobal(point))
|
||||||
|
|
||||||
def on_context_menuSent(self, point):
|
def on_context_menuSent(self, point):
|
||||||
|
@ -3109,8 +3137,26 @@ class MyForm(QtGui.QMainWindow):
|
||||||
status, = row
|
status, = row
|
||||||
if status == 'toodifficult':
|
if status == 'toodifficult':
|
||||||
self.popMenuSent.addAction(self.actionForceSend)
|
self.popMenuSent.addAction(self.actionForceSend)
|
||||||
|
# single or multi selction
|
||||||
|
is_singleselection = len(self.ui.tableWidgetSent.selectedIndexes())/4 <= 1 # divide by four because there are four columns
|
||||||
|
# disable certain context menu items for multiselection
|
||||||
|
self.actionSendAnother.setEnabled(is_singleselection==True)
|
||||||
|
self.actionSentSaveMessageAs.setEnabled(is_singleselection==True)
|
||||||
|
self.actionSentAddRecipientToAddressBook.setEnabled(is_singleselection==True) # cannot handle multiselection yet
|
||||||
|
# pop up
|
||||||
self.popMenuSent.exec_(self.ui.tableWidgetSent.mapToGlobal(point))
|
self.popMenuSent.exec_(self.ui.tableWidgetSent.mapToGlobal(point))
|
||||||
|
|
||||||
|
def on_context_menuYourIdentities(self, point):
|
||||||
|
# disable certain context menu items for multiselection
|
||||||
|
is_singleselection = len(self.ui.tableWidgetYourIdentities.selectedIndexes())/3 <= 1 # divide by three because there are three columns
|
||||||
|
self.actionNewAddress.setEnabled(is_singleselection)
|
||||||
|
self.actionNewChan.setEnabled(is_singleselection)
|
||||||
|
self.actionYourIdentitiesSendFromAddress.setEnabled(is_singleselection)
|
||||||
|
self.actionSpecialAddressBehavior.setEnabled(is_singleselection)
|
||||||
|
self.popMenuIdentities.exec_(
|
||||||
|
self.ui.tableWidgetYourIdentities.mapToGlobal(point))
|
||||||
|
|
||||||
|
|
||||||
def inboxSearchLineEditPressed(self):
|
def inboxSearchLineEditPressed(self):
|
||||||
searchKeyword = self.ui.inboxSearchLineEdit.text().toUtf8().data()
|
searchKeyword = self.ui.inboxSearchLineEdit.text().toUtf8().data()
|
||||||
searchOption = self.ui.inboxSearchOptionCB.currentText().toUtf8().data()
|
searchOption = self.ui.inboxSearchOptionCB.currentText().toUtf8().data()
|
||||||
|
|
Reference in New Issue
Block a user