From faeaad212db9db12154bd735832c31fdc99210fd Mon Sep 17 00:00:00 2001 From: mailchuck Date: Wed, 14 Oct 2015 23:38:34 +0200 Subject: [PATCH] Replies to mailing lists Attempt to fix #49. Will close after positive feedback. --- src/bitmessageqt/__init__.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 29b410d4..fa6d77ca 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2151,13 +2151,13 @@ class MyForm(QtGui.QMainWindow): self.statusBar().showMessage(_translate( "MainWindow", "Fetched address from namecoin identity.")) - def setBroadcastEnablementDependingOnWhetherThisIsAChanAddress(self, address): + def setBroadcastEnablementDependingOnWhetherThisIsAMailingListAddress(self, address): # If this is a chan then don't let people broadcast because no one # should subscribe to chan addresses. - if shared.safeConfigGetBoolean(str(address), 'chan'): - self.ui.tabWidgetSend.setCurrentIndex(0) - else: + if shared.safeConfigGetBoolean(str(address), 'mailinglist'): self.ui.tabWidgetSend.setCurrentIndex(1) + else: + self.ui.tabWidgetSend.setCurrentIndex(0) def rerenderComboBoxSendFrom(self): self.ui.comboBoxSendFrom.clear() @@ -2866,13 +2866,8 @@ class MyForm(QtGui.QMainWindow): 'message': self.ui.textEditMessage } if toAddressAtCurrentInboxRow == str_broadcast_subscribers: - widget = { - 'subject': self.ui.lineEditSubjectBroadcast, - 'from': self.ui.comboBoxSendFromBroadcast, - 'message': self.ui.textEditMessageBroadcast - } - self.ui.tabWidgetSend.setCurrentIndex(1) - toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow + self.ui.tabWidgetSend.setCurrentIndex(0) +# toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow elif not shared.config.has_section(toAddressAtCurrentInboxRow): 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) @@ -2880,8 +2875,15 @@ class MyForm(QtGui.QMainWindow): 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) else: - #self.setBroadcastEnablementDependingOnWhetherThisIsAChanAddress(toAddressAtCurrentInboxRow) - self.ui.tabWidgetSend.setCurrentIndex(0) + self.setBroadcastEnablementDependingOnWhetherThisIsAMailingListAddress(toAddressAtCurrentInboxRow) + if self.ui.tabWidgetSend.currentIndex() == 1: + widget = { + 'subject': self.ui.lineEditSubjectBroadcast, + 'from': self.ui.comboBoxSendFromBroadcast, + 'message': self.ui.textEditMessageBroadcast + } + self.ui.tabWidgetSend.setCurrentIndex(1) + toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow self.ui.lineEditTo.setText(str(acct.fromAddress))