Revert "fix complains from flake8; part 2"

This reverts commit bcf02ff9bb.
This commit is contained in:
Kashiko Koibumi 2024-05-17 11:51:03 +09:00
parent 416463f8b7
commit 1077548eb6
No known key found for this signature in database
GPG Key ID: 8F06E069E37C40C4
14 changed files with 108 additions and 136 deletions

View File

@ -1,2 +1,2 @@
#!/bin/sh
autopep8 --in-place --recursive --max-line-length=119 src src/bitmessageqt
autopep8 --in-place --recursive src src/bitmessageqt

View File

@ -1,2 +0,0 @@
#!/bin/sh
flake8 --max-line-length=119 --config=setup.cfg src/*.py src/network/*.py src/storage/*.py src/bitmessageqt/*.py

View File

@ -16,8 +16,8 @@ from datetime import datetime, timedelta
from sqlite3 import register_adapter
from PyQt6 import QtCore, QtGui, QtWidgets
from PyQt6.QtWidgets import QMessageBox
from PyQt6.QtNetwork import QLocalSocket, QLocalServer
import shared
import state
from debug import logger
@ -613,11 +613,9 @@ class MyForm(settingsmixin.SMainWindow):
"One of your addresses, {0}, is an old version 1 address. "
"Version 1 addresses are no longer supported. "
"May we delete it now?").format(addressInKeysFile)
reply = QMessageBox.question(
self, 'Message', displayMsg,
QMessageBox.StandardButton.Yes,
QMessageBox.StandardButton.No)
if reply == QMessageBox.StandardButton.Yes:
reply = QtWidgets.QMessageBox.question(
self, 'Message', displayMsg, QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
config.remove_section(addressInKeysFile)
config.save()
@ -1504,11 +1502,11 @@ class MyForm(settingsmixin.SMainWindow):
def click_actionManageKeys(self):
if 'darwin' in sys.platform or 'linux' in sys.platform:
if state.appdata == '':
# reply = QMessageBox.information(self, 'keys.dat?','You
# reply = QtWidgets.QMessageBox.information(self, 'keys.dat?','You
# may manage your keys by editing the keys.dat file stored in
# the same directory as this program. It is important that you
# back up this file.', QMessageBox.StandardButton.Ok)
reply = QMessageBox.information(
reply = QtWidgets.QMessageBox.information(
self,
'keys.dat?',
_translate(
@ -1516,10 +1514,10 @@ class MyForm(settingsmixin.SMainWindow):
"You may manage your keys by editing the keys.dat file stored in the same directory"
"as this program. It is important that you back up this file."
),
QMessageBox.StandardButton.Ok)
QtWidgets.QMessageBox.StandardButton.Ok)
else:
QMessageBox.information(
QtWidgets.QMessageBox.information(
self,
'keys.dat?',
_translate(
@ -1528,10 +1526,10 @@ class MyForm(settingsmixin.SMainWindow):
"\n {0} \n"
"It is important that you back up this file."
).format(state.appdata),
QMessageBox.StandardButton.Ok)
QtWidgets.QMessageBox.StandardButton.Ok)
elif sys.platform == 'win32' or sys.platform == 'win64':
if state.appdata == '':
reply = QMessageBox.question(
reply = QtWidgets.QMessageBox.question(
self,
_translate("MainWindow", "Open keys.dat?"),
_translate(
@ -1540,10 +1538,10 @@ class MyForm(settingsmixin.SMainWindow):
"this program. It is important that you back up this file. "
"Would you like to open the file now? "
"(Be sure to close Bitmessage before making any changes.)"),
QMessageBox.StandardButton.Yes,
QMessageBox.StandardButton.No)
QtWidgets.QMessageBox.StandardButton.Yes,
QtWidgets.QMessageBox.StandardButton.No)
else:
reply = QMessageBox.question(
reply = QtWidgets.QMessageBox.question(
self,
_translate("MainWindow", "Open keys.dat?"),
_translate(
@ -1551,18 +1549,18 @@ class MyForm(settingsmixin.SMainWindow):
"You may manage your keys by editing the keys.dat file stored in\n {0} \n"
"It is important that you back up this file. Would you like to open the file now?"
"(Be sure to close Bitmessage before making any changes.)").format(state.appdata),
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No)
if reply == QMessageBox.StandardButton.Yes:
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
openKeysFile()
# menu button 'delete all treshed messages'
def click_actionDeleteAllTrashedMessages(self):
if QMessageBox.question(
if QtWidgets.QMessageBox.question(
self,
_translate("MainWindow", "Delete trash?"),
_translate("MainWindow", "Are you sure you want to delete all trashed messages?"),
QMessageBox.StandardButton.Yes,
QMessageBox.StandardButton.No) == QMessageBox.StandardButton.No:
QtWidgets.QMessageBox.StandardButton.Yes,
QtWidgets.QMessageBox.StandardButton.No) == QtWidgets.QMessageBox.StandardButton.No:
return
sqlStoredProcedure('deleteandvacuume')
self.rerenderTabTreeMessages()
@ -1589,7 +1587,7 @@ class MyForm(settingsmixin.SMainWindow):
dialog = dialogs.RegenerateAddressesDialog(self)
if dialog.exec():
if dialog.lineEditPassphrase.text() == "":
QMessageBox.about(
QtWidgets.QMessageBox.about(
self, _translate("MainWindow", "bad passphrase"),
_translate(
"MainWindow",
@ -1602,7 +1600,7 @@ class MyForm(settingsmixin.SMainWindow):
addressVersionNumber = int(
dialog.lineEditAddressVersionNumber.text())
except:
QMessageBox.about(
QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Bad address version number"),
_translate(
@ -1612,7 +1610,7 @@ class MyForm(settingsmixin.SMainWindow):
))
return
if addressVersionNumber < 3 or addressVersionNumber > 4:
QMessageBox.about(
QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Bad address version number"),
_translate(
@ -1668,7 +1666,7 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.blackwhitelist.init_blacklist_popup_menu(False)
if event.type() == QtCore.QEvent.Type.WindowStateChange:
if self.windowState() & QtCore.Qt.WindowState.WindowMinimized:
if config.getboolean('bitmessagesettings', 'minimizetotray') and 'darwin' not in sys.platform:
if config.getboolean('bitmessagesettings', 'minimizetotray') and not 'darwin' in sys.platform:
QtCore.QTimer.singleShot(0, self.appIndicatorHide)
elif event.oldState() & QtCore.Qt.WindowState.WindowMinimized:
# The window state has just been changed to
@ -1901,7 +1899,7 @@ class MyForm(settingsmixin.SMainWindow):
def displayAlert(self, title, text, exitAfterUserClicksOk):
self.updateStatusBar(text)
QMessageBox.critical(self, title, text, QMessageBox.StandardButton.Ok)
QtWidgets.QMessageBox.critical(self, title, text, QtWidgets.QMessageBox.StandardButton.Ok)
if exitAfterUserClicksOk:
os._exit(0)
@ -1977,7 +1975,7 @@ class MyForm(settingsmixin.SMainWindow):
self.rerenderTabTreeSubscriptions()
def click_pushButtonTTL(self):
QMessageBox.information(
QtWidgets.QMessageBox.information(
self,
'Time To Live',
_translate(
@ -1986,7 +1984,7 @@ class MyForm(settingsmixin.SMainWindow):
,it will resend the message automatically. The longer the Time-To-Live, the
more work your computer must do to send the message.
A Time-To-Live of four or five days is often appropriate."""),
QMessageBox.StandardButton.Ok)
QtWidgets.QMessageBox.StandardButton.Ok)
def click_pushButtonClear(self):
self.ui.lineEditSubject.setText("")
@ -1999,9 +1997,7 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.textEditMessageBroadcast.clear()
def click_pushButtonSend(self):
encoding = 2
if QtWidgets.QApplication.queryKeyboardModifiers() & QtCore.Qt.KeyboardModifier.ShiftModifier:
encoding = 3
encoding = 3 if QtWidgets.QApplication.queryKeyboardModifiers() & QtCore.Qt.KeyboardModifier.ShiftModifier else 2
self.statusbar.clearMessage()
@ -2031,7 +2027,7 @@ class MyForm(settingsmixin.SMainWindow):
users can send messages of any length.
"""
if len(message) > (2 ** 18 - 500):
QMessageBox.about(
QtWidgets.QMessageBox.about(
self, _translate("MainWindow", "Message too long"),
_translate(
"MainWindow",
@ -2063,15 +2059,14 @@ class MyForm(settingsmixin.SMainWindow):
subject = acct.subject
toAddress = acct.toAddress
else:
if QMessageBox.question(
if QtWidgets.QMessageBox.question(
self,
"Sending an email?",
_translate(
"MainWindow",
"You are trying to send an email instead of a bitmessage. "
"This requires registering with a gateway. Attempt to register?"),
QMessageBox.StandardButton.Yes
| QMessageBox.StandardButton.No) != QMessageBox.StandardButton.Yes:
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No) != QtWidgets.QMessageBox.StandardButton.Yes:
continue
email = acct.getLabel()
if email[-14:] != "@mailchuck.com": # attempt register
@ -2168,7 +2163,7 @@ class MyForm(settingsmixin.SMainWindow):
toAddress = addBMIfNotPresent(toAddress)
if addressVersionNumber > 4 or addressVersionNumber <= 1:
QMessageBox.about(
QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Address version number"),
_translate(
@ -2178,7 +2173,7 @@ class MyForm(settingsmixin.SMainWindow):
).format(toAddress, str(addressVersionNumber)))
continue
if streamNumber > 1 or streamNumber == 0:
QMessageBox.about(
QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Stream number"),
_translate(
@ -2587,13 +2582,13 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.textEditMessage.setFocus()
def on_action_MarkAllRead(self):
if QMessageBox.question(
if QtWidgets.QMessageBox.question(
self, "Marking all messages as read?",
_translate(
"MainWindow",
"Are you sure you would like to mark all messages read?"
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
) != QMessageBox.StandardButton.Yes:
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
) != QtWidgets.QMessageBox.StandardButton.Yes:
return
tableWidget = self.getCurrentMessagelist()
@ -2604,7 +2599,7 @@ class MyForm(settingsmixin.SMainWindow):
msgids = []
for i in range(0, idCount):
msgids.append(tableWidget.item(i, 3).data())
for col in range(tableWidget.columnCount()):
for col in xrange(tableWidget.columnCount()):
tableWidget.item(i, col).setUnread(False)
markread = sqlExecuteChunked(
@ -2621,7 +2616,7 @@ class MyForm(settingsmixin.SMainWindow):
def network_switch(self):
dontconnect_option = not config.safeGetBoolean(
'bitmessagesettings', 'dontconnect')
reply = QMessageBox.question(
reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Disconnecting")
if dontconnect_option else _translate("MainWindow", "Connecting"),
_translate(
@ -2630,9 +2625,9 @@ class MyForm(settingsmixin.SMainWindow):
) if dontconnect_option else _translate(
"MainWindow",
"Bitmessage will now start connecting to network. Are you sure?"
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.Cancel,
QMessageBox.StandardButton.Cancel)
if reply != QMessageBox.StandardButton.Yes:
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.Cancel,
QtWidgets.QMessageBox.StandardButton.Cancel)
if reply != QtWidgets.QMessageBox.StandardButton.Yes:
return
config.set(
'bitmessagesettings', 'dontconnect', str(dontconnect_option))
@ -2659,7 +2654,7 @@ class MyForm(settingsmixin.SMainWindow):
# C PoW currently doesn't support interrupting and OpenCL is untested
if getPowType() == "python" and (powQueueSize() > 0 or pendingUpload() > 0):
reply = QMessageBox.question(
reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Proof of work pending"),
_translate(
"MainWindow",
@ -2673,15 +2668,15 @@ class MyForm(settingsmixin.SMainWindow):
) + "\n\n"
+ _translate(
"MainWindow", "Wait until these tasks finish?"),
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
| QMessageBox.StandardButton.Cancel, QMessageBox.StandardButton.Cancel)
if reply == QMessageBox.StandardButton.No:
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
| QtWidgets.QMessageBox.StandardButton.Cancel, QtWidgets.QMessageBox.StandardButton.Cancel)
if reply == QtWidgets.QMessageBox.StandardButton.No:
waitForPow = False
elif reply == QMessageBox.StandardButton.Cancel:
elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
return
if pendingDownload() > 0:
reply = QMessageBox.question(
reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Synchronisation pending"),
_translate(
"MainWindow",
@ -2691,16 +2686,16 @@ class MyForm(settingsmixin.SMainWindow):
" synchronisation finishes?", None,
pendingDownload()
),
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
| QMessageBox.StandardButton.Cancel, QMessageBox.StandardButton.Cancel)
if reply == QMessageBox.StandardButton.Yes:
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
| QtWidgets.QMessageBox.StandardButton.Cancel, QtWidgets.QMessageBox.StandardButton.Cancel)
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
self.wait = waitForSync = True
elif reply == QMessageBox.StandardButton.Cancel:
elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
return
if state.statusIconColor == 'red' and not config.safeGetBoolean(
'bitmessagesettings', 'dontconnect'):
reply = QMessageBox.question(
reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Not connected"),
_translate(
"MainWindow",
@ -2708,12 +2703,12 @@ class MyForm(settingsmixin.SMainWindow):
" quit now, it may cause delivery delays. Wait until"
" connected and the synchronisation finishes?"
),
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
| QMessageBox.StandardButton.Cancel, QMessageBox.StandardButton.Cancel)
if reply == QMessageBox.StandardButton.Yes:
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
| QtWidgets.QMessageBox.StandardButton.Cancel, QtWidgets.QMessageBox.StandardButton.Cancel)
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
waitForConnection = True
self.wait = waitForSync = True
elif reply == QMessageBox.StandardButton.Cancel:
elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
return
self.quitAccepted = True
@ -2855,7 +2850,7 @@ class MyForm(settingsmixin.SMainWindow):
lines = messageText.split('\n')
totalLines = len(lines)
for i in range(totalLines):
for i in xrange(totalLines):
if 'Message ostensibly from ' in lines[i]:
lines[i] = '<p style="font-size: 12px; color: grey;">%s</span></p>' % (
lines[i])
@ -2921,8 +2916,7 @@ class MyForm(settingsmixin.SMainWindow):
# Wrap and quote lines/paragraphs new to this message.
else:
return quoteWrapper.fill(line)
return '\n'.join(
[quote_line(line) for line in message.splitlines()]) + '\n\n'
return '\n'.join([quote_line(l) for l in message.splitlines()]) + '\n\n'
def setSendFromComboBox(self, address=None):
if address is None:
@ -2992,23 +2986,23 @@ class MyForm(settingsmixin.SMainWindow):
)
# toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow
elif not config.has_section(toAddressAtCurrentInboxRow):
QMessageBox.information(
QtWidgets.QMessageBox.information(
self, _translate("MainWindow", "Address is gone"),
_translate(
"MainWindow",
"Bitmessage cannot find your address {0}. Perhaps you"
" removed it?"
).format(toAddressAtCurrentInboxRow), QMessageBox.StandardButton.Ok)
).format(toAddressAtCurrentInboxRow), QtWidgets.QMessageBox.StandardButton.Ok)
elif not config.getboolean(
toAddressAtCurrentInboxRow, 'enabled'):
QMessageBox.information(
QtWidgets.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.StandardButton.Ok)
), QtWidgets.QMessageBox.StandardButton.Ok)
else:
self.setBroadcastEnablementDependingOnWhetherThisIsAMailingListAddress(toAddressAtCurrentInboxRow)
broadcast_tab_index = self.ui.tabWidgetSend.indexOf(
@ -3154,8 +3148,8 @@ class MyForm(settingsmixin.SMainWindow):
idCount = len(inventoryHashesToTrash)
sqlExecuteChunked(
("DELETE FROM inbox" if folder == "trash" or shifted else
"UPDATE inbox SET folder='trash', read=1")
+ " WHERE msgid IN ({0})", idCount, *inventoryHashesToTrash)
"UPDATE inbox SET folder='trash', read=1") +
" WHERE msgid IN ({0})", idCount, *inventoryHashesToTrash)
tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1)
tableWidget.setUpdatesEnabled(True)
self.propagateUnreadCount(folder)
@ -3362,7 +3356,7 @@ class MyForm(settingsmixin.SMainWindow):
self.click_pushButtonAddSubscription()
def on_action_SubscriptionsDelete(self):
if QMessageBox.question(
if QtWidgets.QMessageBox.question(
self, "Delete subscription?",
_translate(
"MainWindow",
@ -3373,8 +3367,8 @@ class MyForm(settingsmixin.SMainWindow):
" messages, but you can still view messages you"
" already received.\n\nAre you sure you want to"
" delete the subscription?"
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
) != QMessageBox.StandardButton.Yes:
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
) != QtWidgets.QMessageBox.StandardButton.Yes:
return
address = self.getCurrentAccount()
sqlExecute('''DELETE FROM subscriptions WHERE address=?''',
@ -3597,7 +3591,7 @@ class MyForm(settingsmixin.SMainWindow):
if account.type == AccountMixin.NORMAL:
return # maybe in the future
elif account.type == AccountMixin.CHAN:
if QMessageBox.question(
if QtWidgets.QMessageBox.question(
self, "Delete channel?",
_translate(
"MainWindow",
@ -3608,8 +3602,8 @@ class MyForm(settingsmixin.SMainWindow):
" messages, but you can still view messages you"
" already received.\n\nAre you sure you want to"
" delete the channel?"
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
) == QMessageBox.StandardButton.Yes:
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
) == QtWidgets.QMessageBox.StandardButton.Yes:
config.remove_section(str(account.address))
else:
return
@ -3745,11 +3739,11 @@ class MyForm(settingsmixin.SMainWindow):
if exists | (len(current_files) > 0):
displayMsg = _translate(
"MainWindow", "Do you really want to remove this avatar?")
overwrite = QMessageBox.question(
overwrite = QtWidgets.QMessageBox.question(
self, 'Message', displayMsg,
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No)
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
else:
overwrite = QMessageBox.StandardButton.No
overwrite = QtWidgets.QMessageBox.StandardButton.No
else:
# ask whether to overwrite old avatar
if exists | (len(current_files) > 0):
@ -3757,15 +3751,15 @@ class MyForm(settingsmixin.SMainWindow):
"MainWindow",
"You have already set an avatar for this address."
" Do you really want to overwrite it?")
overwrite = QMessageBox.question(
overwrite = QtWidgets.QMessageBox.question(
self, 'Message', displayMsg,
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No)
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
else:
overwrite = QMessageBox.StandardButton.No
overwrite = QtWidgets.QMessageBox.StandardButton.No
# copy the image file to the appdata folder
if (not exists) | (overwrite == QMessageBox.StandardButton.Yes):
if overwrite == QMessageBox.StandardButton.Yes:
if (not exists) | (overwrite == QtWidgets.QMessageBox.StandardButton.Yes):
if overwrite == QtWidgets.QMessageBox.StandardButton.Yes:
for file in current_files:
QtCore.QFile.remove(file)
QtCore.QFile.remove(destination)
@ -3815,15 +3809,15 @@ class MyForm(settingsmixin.SMainWindow):
pattern = destfile.lower()
for item in os.listdir(destdir):
if item.lower() == pattern:
overwrite = QMessageBox.question(
overwrite = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Message"),
_translate(
"MainWindow",
"You have already set a notification sound"
" for this address book entry."
" Do you really want to overwrite it?"),
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No
) == QMessageBox.StandardButton.Yes
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No
) == QtWidgets.QMessageBox.StandardButton.Yes
if overwrite:
QtCore.QFile.remove(os.path.join(destdir, item))
break

View File

@ -5,7 +5,7 @@ Dialogs that work with BM address.
import hashlib
from PyQt6 import QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
import queues
import bitmessageqt.widgets as widgets

View File

@ -608,41 +608,22 @@ class Ui_MainWindow(object):
self.label_3.setText(_translate("MainWindow", "Subject:"))
self.label_2.setText(_translate("MainWindow", "From:"))
self.label.setText(_translate("MainWindow", "To:"))
self.textEditMessage.setHtml(
_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\""
" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" />"
"<style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style="
"\" font-family:\'Droid Sans\'; font-size:9pt;"
" font-weight:400; font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px;"
" margin-bottom:0px; margin-left:0px; margin-right:0px;"
" -qt-block-indent:0; text-indent:0px; font-family:"
"\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
self.tabWidgetSend.setTabText(
self.tabWidgetSend.indexOf(self.sendDirect),
_translate("MainWindow", "Send ordinary Message"))
self.textEditMessage.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Droid Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.sendDirect),
_translate("MainWindow", "Send ordinary Message"))
self.label_8.setText(_translate("MainWindow", "From:"))
self.label_7.setText(_translate("MainWindow", "Subject:"))
self.textEditMessageBroadcast.setHtml(
_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//"
"DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/"
"strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" />"
"<style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:"
"\'Droid Sans\'; font-size:9pt; font-weight:400;"
" font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px;"
" margin-bottom:0px; margin-left:0px; margin-right:0px;"
" -qt-block-indent:0; text-indent:0px; font-family:"
"\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
self.tabWidgetSend.setTabText(
self.tabWidgetSend.indexOf(self.sendBroadcast),
_translate("MainWindow", "Send Message to your Subscribers"))
self.textEditMessageBroadcast.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Droid Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.sendBroadcast),
_translate("MainWindow", "Send Message to your Subscribers"))
self.pushButtonTTL.setText(_translate("MainWindow", "TTL:"))
self.pushButtonClear.setText(_translate("MainWindow", "Clear"))
self.pushButtonSend.setText(_translate("MainWindow", "Send"))

View File

@ -2,7 +2,7 @@
Custom dialog classes
"""
# pylint: disable=too-few-public-methods
from PyQt6 import QtWidgets
from PyQt6 import QtGui, QtWidgets
import paths
import bitmessageqt.widgets as widgets

View File

@ -3,7 +3,7 @@
import glob
import os
from PyQt6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
import paths
from bmconfigparser import config

View File

@ -38,9 +38,7 @@ class MessageView(QtWidgets.QTextBrowser):
def mousePressEvent(self, event):
"""Mouse press button event handler"""
b = event.button()
lb = QtCore.Qt.MouseButton.LeftButton
if b == lb and self.html and self.html.has_html and self.cursorForPosition(
if event.button() == QtCore.Qt.MouseButton.LeftButton and self.html and self.html.has_html and self.cursorForPosition(
event.pos()).block().blockNumber() == 0:
if self.mode == MessageView.MODE_PLAIN:
self.showHTML()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2.7
from PyQt6 import QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class MigrationWizardIntroPage(QtWidgets.QWizardPage):
@ -8,8 +8,7 @@ class MigrationWizardIntroPage(QtWidgets.QWizardPage):
self.setTitle("Migrating configuration")
label = QtGui.QLabel("This wizard will help you to migrate your configuration. "
"You can still keep using PyBitMessage"
" once you migrate, the changes are backwards compatible.")
"You can still keep using PyBitMessage once you migrate, the changes are backwards compatible.")
label.setWordWrap(True)
layout = QtGui.QVBoxLayout()

View File

@ -4,12 +4,11 @@ src/bitmessageqt/newchandialog.py
"""
from PyQt6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
import bitmessageqt.widgets as widgets
from addresses import addBMIfNotPresent
# XXX unresolved
# from .addressvalidator import AddressValidator, PassPhraseValidator
from .addressvalidator import AddressValidator, PassPhraseValidator
from queues import (
addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue)
from tr import _translate

View File

@ -1,4 +1,6 @@
from PyQt6 import QtWidgets
from os import path
from PyQt6 import QtGui, QtWidgets
from debug import logger
import bitmessageqt.widgets as widgets

View File

@ -5,7 +5,7 @@ src/settingsmixin.py
"""
from PyQt6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class SettingsMixin(object):

View File

@ -2,7 +2,7 @@
"""Status bar Module"""
from time import time
from PyQt6 import QtWidgets
from PyQt6 import QtGui, QtWidgets
class BMStatusBar(QtWidgets.QStatusBar):

View File

@ -1,6 +1,7 @@
from PyQt6 import uic
import os.path
import paths
import sys
def resource_path(resFile):