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

View File

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