Blacklist object has no .statusBar() method - use UISignalQueue.put()

This commit is contained in:
Dmitri Bogomolov 2019-06-03 12:18:15 +03:00
parent 38e5d93272
commit fbf5bcc74c
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
1 changed files with 15 additions and 4 deletions

View File

@ -6,6 +6,7 @@ from addresses import addBMIfNotPresent
from bmconfigparser import BMConfigParser
from dialogs import AddAddressDialog
from helper_sql import sqlExecute, sqlQuery
from queues import UISignalQueue
from retranslateui import RetranslateMixin
from utils import avatarize
from uisignaler import UISignaler
@ -88,11 +89,21 @@ class Blacklist(QtGui.QWidget, RetranslateMixin):
sql = '''INSERT INTO whitelist VALUES (?,?,?)'''
sqlExecute(sql, *t)
else:
self.statusBar().showMessage(_translate(
"MainWindow", "Error: You cannot add the same address to your list twice. Perhaps rename the existing one if you want."))
UISignalQueue.put((
'updateStatusBar',
_translate(
"MainWindow",
"Error: You cannot add the same address to your"
" list twice. Perhaps rename the existing one"
" if you want.")
))
else:
self.statusBar().showMessage(_translate(
"MainWindow", "The address you entered was invalid. Ignoring it."))
UISignalQueue.put((
'updateStatusBar',
_translate(
"MainWindow",
"The address you entered was invalid. Ignoring it.")
))
def tableWidgetBlacklistItemChanged(self, item):
if item.column() == 0: