(self, replyType = None)
| 2969 | self.on_action_InboxReply(self.REPLY_TYPE_CHAN) |
| 2970 | |
| 2971 | def on_action_InboxReply(self, replyType = None): |
| 2972 | tableWidget = self.getCurrentMessagelist() |
| 2973 | if not tableWidget: |
| 2974 | return |
| 2975 | |
| 2976 | if replyType is None: |
| 2977 | replyType = self.REPLY_TYPE_SENDER |
| 2978 | |
| 2979 | # save this to return back after reply is done |
| 2980 | self.replyFromTab = self.ui.tabWidget.currentIndex() |
| 2981 | |
| 2982 | currentInboxRow = tableWidget.currentRow() |
| 2983 | toAddressAtCurrentInboxRow = tableWidget.item( |
| 2984 | currentInboxRow, 0).address |
| 2985 | acct = accountClass(toAddressAtCurrentInboxRow) |
| 2986 | fromAddressAtCurrentInboxRow = tableWidget.item( |
| 2987 | currentInboxRow, 1).address |
| 2988 | msgid = str(tableWidget.item( |
| 2989 | currentInboxRow, 3).data(QtCore.Qt.UserRole).toPyObject()) |
| 2990 | queryreturn = sqlQuery( |
| 2991 | '''select message from inbox where msgid=?''', msgid) |
| 2992 | if queryreturn != []: |
| 2993 | for row in queryreturn: |
| 2994 | messageAtCurrentInboxRow, = row |
| 2995 | acct.parseMessage(toAddressAtCurrentInboxRow, fromAddressAtCurrentInboxRow, tableWidget.item(currentInboxRow, 2).subject, messageAtCurrentInboxRow) |
| 2996 | widget = { |
| 2997 | 'subject': self.ui.lineEditSubject, |
| 2998 | 'from': self.ui.comboBoxSendFrom, |
| 2999 | 'message': self.ui.textEditMessage |
| 3000 | } |
| 3001 | if toAddressAtCurrentInboxRow == str_broadcast_subscribers: |
| 3002 | self.ui.tabWidgetSend.setCurrentIndex( |
| 3003 | self.ui.tabWidgetSend.indexOf(self.ui.sendDirect) |
| 3004 | ) |
| 3005 | # toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow |
| 3006 | elif not BMConfigParser().has_section(toAddressAtCurrentInboxRow): |
| 3007 | QtGui.QMessageBox.information(self, _translate("MainWindow", "Address is gone"), _translate( |
| 3008 | "MainWindow", "Bitmessage cannot find your address %1. Perhaps you removed it?").arg(toAddressAtCurrentInboxRow), QtGui.QMessageBox.Ok) |
| 3009 | elif not BMConfigParser().getboolean(toAddressAtCurrentInboxRow, 'enabled'): |
| 3010 | QtGui.QMessageBox.information(self, _translate("MainWindow", "Address disabled"), _translate( |
| 3011 | "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."), QtGui.QMessageBox.Ok) |
| 3012 | else: |
| 3013 | self.setBroadcastEnablementDependingOnWhetherThisIsAMailingListAddress(toAddressAtCurrentInboxRow) |
| 3014 | broadcast_tab_index = self.ui.tabWidgetSend.indexOf( |
| 3015 | self.ui.sendBroadcast |
| 3016 | ) |
| 3017 | if self.ui.tabWidgetSend.currentIndex() == broadcast_tab_index: |
| 3018 | widget = { |
| 3019 | 'subject': self.ui.lineEditSubjectBroadcast, |
| 3020 | 'from': self.ui.comboBoxSendFromBroadcast, |
| 3021 | 'message': self.ui.textEditMessageBroadcast |
| 3022 | } |
| 3023 | self.ui.tabWidgetSend.setCurrentIndex(broadcast_tab_index) |
| 3024 | toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow |
| 3025 | if fromAddressAtCurrentInboxRow == tableWidget.item(currentInboxRow, 1).label or ( |
| 3026 | isinstance(acct, GatewayAccount) and fromAddressAtCurrentInboxRow == acct.relayAddress): |
| 3027 | self.ui.lineEditTo.setText(str(acct.fromAddress)) |
| 3028 | else: |
no test coverage detected