Quick fix for refactoring artifact in blacklist module (#1138)

This commit is contained in:
Dmitri Bogomolov 2018-02-17 14:36:09 +02:00
parent 634a49cd6d
commit a3436fef9c
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -56,9 +56,10 @@ class Blacklist(QtGui.QWidget, RetranslateMixin):
def click_pushButtonAddBlacklist(self):
self.NewBlacklistDialogInstance = AddAddressDialog(self)
if self.NewBlacklistDialogInstance.exec_():
if self.NewBlacklistDialogInstance.ui.labelAddressCheck.text() == _translate("MainWindow", "Address is valid."):
if self.NewBlacklistDialogInstance.labelAddressCheck.text() == \
_translate("MainWindow", "Address is valid."):
address = addBMIfNotPresent(str(
self.NewBlacklistDialogInstance.ui.lineEditAddress.text()))
self.NewBlacklistDialogInstance.lineEditAddress.text()))
# First we must check to see if the address is already in the
# address book. The user cannot add it again or else it will
# cause problems when updating and deleting the entry.
@ -72,7 +73,7 @@ class Blacklist(QtGui.QWidget, RetranslateMixin):
self.tableWidgetBlacklist.setSortingEnabled(False)
self.tableWidgetBlacklist.insertRow(0)
newItem = QtGui.QTableWidgetItem(unicode(
self.NewBlacklistDialogInstance.ui.newAddressLabel.text().toUtf8(), 'utf-8'))
self.NewBlacklistDialogInstance.lineEditLabel.text().toUtf8(), 'utf-8'))
newItem.setIcon(avatarize(address))
self.tableWidgetBlacklist.setItem(0, 0, newItem)
newItem = QtGui.QTableWidgetItem(address)
@ -80,7 +81,7 @@ class Blacklist(QtGui.QWidget, RetranslateMixin):
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
self.tableWidgetBlacklist.setItem(0, 1, newItem)
self.tableWidgetBlacklist.setSortingEnabled(True)
t = (str(self.NewBlacklistDialogInstance.ui.newAddressLabel.text().toUtf8()), address, True)
t = (str(self.NewBlacklistDialogInstance.lineEditLabel.text().toUtf8()), address, True)
if BMConfigParser().get('bitmessagesettings', 'blackwhitelist') == 'black':
sql = '''INSERT INTO blacklist VALUES (?,?,?)'''
else: