blacklist rendering edit fix

Editing of blacklist labels affected the rerendering, because it emits
the changed signal too, and it caused an exception because the address
field was missing at that time. This works around both.
This commit is contained in:
Peter Šurda 2016-02-13 00:09:42 +01:00
parent 2f6c36cab2
commit d2b9c16d5f
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -3977,12 +3977,13 @@ class MyForm(settingsmixin.SMainWindow):
def tableWidgetBlacklistItemChanged(self, item):
if item.column() == 0:
addressitem = self.ui.tableWidgetBlacklist.item(item.row(), 1)
if self.ui.radioButtonBlacklist.isChecked():
sqlExecute('''UPDATE blacklist SET label=? WHERE address=?''',
str(item.text()), str(addressitem.text()))
else:
sqlExecute('''UPDATE whitelist SET label=? WHERE address=?''',
str(item.text()), str(addressitem.text()))
if isinstance(addressitem, QTableWidgetItem):
if self.ui.radioButtonBlacklist.isChecked():
sqlExecute('''UPDATE blacklist SET label=? WHERE address=?''',
str(item.text()), str(addressitem.text()))
else:
sqlExecute('''UPDATE whitelist SET label=? WHERE address=?''',
str(item.text()), str(addressitem.text()))
def updateStatusBar(self, data):
if data != "":