fix complains from flake8; part 2
This commit is contained in:
parent
ab9fc0b390
commit
bcf02ff9bb
|
@ -1,2 +1,2 @@
|
|||
#!/bin/sh
|
||||
autopep8 --in-place --recursive src src/bitmessageqt
|
||||
autopep8 --in-place --recursive --max-line-length=119 src src/bitmessageqt
|
||||
|
|
2
run-flake8.sh
Executable file
2
run-flake8.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
flake8 --max-line-length=119 --config=setup.cfg src/*.py src/network/*.py src/storage/*.py src/bitmessageqt/*.py
|
|
@ -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,9 +613,11 @@ 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 = QtWidgets.QMessageBox.question(
|
||||
self, 'Message', displayMsg, QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
reply = QMessageBox.question(
|
||||
self, 'Message', displayMsg,
|
||||
QMessageBox.StandardButton.Yes,
|
||||
QMessageBox.StandardButton.No)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
config.remove_section(addressInKeysFile)
|
||||
config.save()
|
||||
|
||||
|
@ -1502,11 +1504,11 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
def click_actionManageKeys(self):
|
||||
if 'darwin' in sys.platform or 'linux' in sys.platform:
|
||||
if state.appdata == '':
|
||||
# reply = QtWidgets.QMessageBox.information(self, 'keys.dat?','You
|
||||
# reply = 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 = QtWidgets.QMessageBox.information(
|
||||
reply = QMessageBox.information(
|
||||
self,
|
||||
'keys.dat?',
|
||||
_translate(
|
||||
|
@ -1514,10 +1516,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."
|
||||
),
|
||||
QtWidgets.QMessageBox.StandardButton.Ok)
|
||||
QMessageBox.StandardButton.Ok)
|
||||
|
||||
else:
|
||||
QtWidgets.QMessageBox.information(
|
||||
QMessageBox.information(
|
||||
self,
|
||||
'keys.dat?',
|
||||
_translate(
|
||||
|
@ -1526,10 +1528,10 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
"\n {0} \n"
|
||||
"It is important that you back up this file."
|
||||
).format(state.appdata),
|
||||
QtWidgets.QMessageBox.StandardButton.Ok)
|
||||
QMessageBox.StandardButton.Ok)
|
||||
elif sys.platform == 'win32' or sys.platform == 'win64':
|
||||
if state.appdata == '':
|
||||
reply = QtWidgets.QMessageBox.question(
|
||||
reply = QMessageBox.question(
|
||||
self,
|
||||
_translate("MainWindow", "Open keys.dat?"),
|
||||
_translate(
|
||||
|
@ -1538,10 +1540,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.)"),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
QMessageBox.StandardButton.Yes,
|
||||
QMessageBox.StandardButton.No)
|
||||
else:
|
||||
reply = QtWidgets.QMessageBox.question(
|
||||
reply = QMessageBox.question(
|
||||
self,
|
||||
_translate("MainWindow", "Open keys.dat?"),
|
||||
_translate(
|
||||
|
@ -1549,18 +1551,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),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
openKeysFile()
|
||||
|
||||
# menu button 'delete all treshed messages'
|
||||
def click_actionDeleteAllTrashedMessages(self):
|
||||
if QtWidgets.QMessageBox.question(
|
||||
if QMessageBox.question(
|
||||
self,
|
||||
_translate("MainWindow", "Delete trash?"),
|
||||
_translate("MainWindow", "Are you sure you want to delete all trashed messages?"),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No) == QtWidgets.QMessageBox.StandardButton.No:
|
||||
QMessageBox.StandardButton.Yes,
|
||||
QMessageBox.StandardButton.No) == QMessageBox.StandardButton.No:
|
||||
return
|
||||
sqlStoredProcedure('deleteandvacuume')
|
||||
self.rerenderTabTreeMessages()
|
||||
|
@ -1587,7 +1589,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
dialog = dialogs.RegenerateAddressesDialog(self)
|
||||
if dialog.exec():
|
||||
if dialog.lineEditPassphrase.text() == "":
|
||||
QtWidgets.QMessageBox.about(
|
||||
QMessageBox.about(
|
||||
self, _translate("MainWindow", "bad passphrase"),
|
||||
_translate(
|
||||
"MainWindow",
|
||||
|
@ -1600,7 +1602,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
addressVersionNumber = int(
|
||||
dialog.lineEditAddressVersionNumber.text())
|
||||
except:
|
||||
QtWidgets.QMessageBox.about(
|
||||
QMessageBox.about(
|
||||
self,
|
||||
_translate("MainWindow", "Bad address version number"),
|
||||
_translate(
|
||||
|
@ -1610,7 +1612,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
))
|
||||
return
|
||||
if addressVersionNumber < 3 or addressVersionNumber > 4:
|
||||
QtWidgets.QMessageBox.about(
|
||||
QMessageBox.about(
|
||||
self,
|
||||
_translate("MainWindow", "Bad address version number"),
|
||||
_translate(
|
||||
|
@ -1666,7 +1668,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 not 'darwin' in sys.platform:
|
||||
if config.getboolean('bitmessagesettings', 'minimizetotray') and 'darwin' not in sys.platform:
|
||||
QtCore.QTimer.singleShot(0, self.appIndicatorHide)
|
||||
elif event.oldState() & QtCore.Qt.WindowState.WindowMinimized:
|
||||
# The window state has just been changed to
|
||||
|
@ -1899,7 +1901,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
|
||||
def displayAlert(self, title, text, exitAfterUserClicksOk):
|
||||
self.updateStatusBar(text)
|
||||
QtWidgets.QMessageBox.critical(self, title, text, QtWidgets.QMessageBox.StandardButton.Ok)
|
||||
QMessageBox.critical(self, title, text, QMessageBox.StandardButton.Ok)
|
||||
if exitAfterUserClicksOk:
|
||||
os._exit(0)
|
||||
|
||||
|
@ -1975,7 +1977,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
self.rerenderTabTreeSubscriptions()
|
||||
|
||||
def click_pushButtonTTL(self):
|
||||
QtWidgets.QMessageBox.information(
|
||||
QMessageBox.information(
|
||||
self,
|
||||
'Time To Live',
|
||||
_translate(
|
||||
|
@ -1984,7 +1986,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."""),
|
||||
QtWidgets.QMessageBox.StandardButton.Ok)
|
||||
QMessageBox.StandardButton.Ok)
|
||||
|
||||
def click_pushButtonClear(self):
|
||||
self.ui.lineEditSubject.setText("")
|
||||
|
@ -1997,7 +1999,9 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
self.ui.textEditMessageBroadcast.clear()
|
||||
|
||||
def click_pushButtonSend(self):
|
||||
encoding = 3 if QtWidgets.QApplication.queryKeyboardModifiers() & QtCore.Qt.KeyboardModifier.ShiftModifier else 2
|
||||
encoding = 2
|
||||
if QtWidgets.QApplication.queryKeyboardModifiers() & QtCore.Qt.KeyboardModifier.ShiftModifier:
|
||||
encoding = 3
|
||||
|
||||
self.statusbar.clearMessage()
|
||||
|
||||
|
@ -2027,7 +2031,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
users can send messages of any length.
|
||||
"""
|
||||
if len(message) > (2 ** 18 - 500):
|
||||
QtWidgets.QMessageBox.about(
|
||||
QMessageBox.about(
|
||||
self, _translate("MainWindow", "Message too long"),
|
||||
_translate(
|
||||
"MainWindow",
|
||||
|
@ -2059,14 +2063,15 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
subject = acct.subject
|
||||
toAddress = acct.toAddress
|
||||
else:
|
||||
if QtWidgets.QMessageBox.question(
|
||||
if 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?"),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No) != QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
QMessageBox.StandardButton.Yes
|
||||
| QMessageBox.StandardButton.No) != QMessageBox.StandardButton.Yes:
|
||||
continue
|
||||
email = acct.getLabel()
|
||||
if email[-14:] != "@mailchuck.com": # attempt register
|
||||
|
@ -2163,7 +2168,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
toAddress = addBMIfNotPresent(toAddress)
|
||||
|
||||
if addressVersionNumber > 4 or addressVersionNumber <= 1:
|
||||
QtWidgets.QMessageBox.about(
|
||||
QMessageBox.about(
|
||||
self,
|
||||
_translate("MainWindow", "Address version number"),
|
||||
_translate(
|
||||
|
@ -2173,7 +2178,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
).format(toAddress, str(addressVersionNumber)))
|
||||
continue
|
||||
if streamNumber > 1 or streamNumber == 0:
|
||||
QtWidgets.QMessageBox.about(
|
||||
QMessageBox.about(
|
||||
self,
|
||||
_translate("MainWindow", "Stream number"),
|
||||
_translate(
|
||||
|
@ -2582,13 +2587,13 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
self.ui.textEditMessage.setFocus()
|
||||
|
||||
def on_action_MarkAllRead(self):
|
||||
if QtWidgets.QMessageBox.question(
|
||||
if QMessageBox.question(
|
||||
self, "Marking all messages as read?",
|
||||
_translate(
|
||||
"MainWindow",
|
||||
"Are you sure you would like to mark all messages read?"
|
||||
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
|
||||
) != QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
|
||||
) != QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
tableWidget = self.getCurrentMessagelist()
|
||||
|
||||
|
@ -2599,7 +2604,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
msgids = []
|
||||
for i in range(0, idCount):
|
||||
msgids.append(tableWidget.item(i, 3).data())
|
||||
for col in xrange(tableWidget.columnCount()):
|
||||
for col in range(tableWidget.columnCount()):
|
||||
tableWidget.item(i, col).setUnread(False)
|
||||
|
||||
markread = sqlExecuteChunked(
|
||||
|
@ -2616,7 +2621,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
def network_switch(self):
|
||||
dontconnect_option = not config.safeGetBoolean(
|
||||
'bitmessagesettings', 'dontconnect')
|
||||
reply = QtWidgets.QMessageBox.question(
|
||||
reply = QMessageBox.question(
|
||||
self, _translate("MainWindow", "Disconnecting")
|
||||
if dontconnect_option else _translate("MainWindow", "Connecting"),
|
||||
_translate(
|
||||
|
@ -2625,9 +2630,9 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
) if dontconnect_option else _translate(
|
||||
"MainWindow",
|
||||
"Bitmessage will now start connecting to network. Are you sure?"
|
||||
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.Cancel,
|
||||
QtWidgets.QMessageBox.StandardButton.Cancel)
|
||||
if reply != QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.Cancel,
|
||||
QMessageBox.StandardButton.Cancel)
|
||||
if reply != QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
config.set(
|
||||
'bitmessagesettings', 'dontconnect', str(dontconnect_option))
|
||||
|
@ -2654,7 +2659,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 = QtWidgets.QMessageBox.question(
|
||||
reply = QMessageBox.question(
|
||||
self, _translate("MainWindow", "Proof of work pending"),
|
||||
_translate(
|
||||
"MainWindow",
|
||||
|
@ -2668,15 +2673,15 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
) + "\n\n"
|
||||
+ _translate(
|
||||
"MainWindow", "Wait until these tasks finish?"),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
|
||||
| QtWidgets.QMessageBox.StandardButton.Cancel, QtWidgets.QMessageBox.StandardButton.Cancel)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
|
||||
| QMessageBox.StandardButton.Cancel, QMessageBox.StandardButton.Cancel)
|
||||
if reply == QMessageBox.StandardButton.No:
|
||||
waitForPow = False
|
||||
elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
|
||||
elif reply == QMessageBox.StandardButton.Cancel:
|
||||
return
|
||||
|
||||
if pendingDownload() > 0:
|
||||
reply = QtWidgets.QMessageBox.question(
|
||||
reply = QMessageBox.question(
|
||||
self, _translate("MainWindow", "Synchronisation pending"),
|
||||
_translate(
|
||||
"MainWindow",
|
||||
|
@ -2686,16 +2691,16 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
" synchronisation finishes?", None,
|
||||
pendingDownload()
|
||||
),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
|
||||
| QtWidgets.QMessageBox.StandardButton.Cancel, QtWidgets.QMessageBox.StandardButton.Cancel)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
|
||||
| QMessageBox.StandardButton.Cancel, QMessageBox.StandardButton.Cancel)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
self.wait = waitForSync = True
|
||||
elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
|
||||
elif reply == QMessageBox.StandardButton.Cancel:
|
||||
return
|
||||
|
||||
if state.statusIconColor == 'red' and not config.safeGetBoolean(
|
||||
'bitmessagesettings', 'dontconnect'):
|
||||
reply = QtWidgets.QMessageBox.question(
|
||||
reply = QMessageBox.question(
|
||||
self, _translate("MainWindow", "Not connected"),
|
||||
_translate(
|
||||
"MainWindow",
|
||||
|
@ -2703,12 +2708,12 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
" quit now, it may cause delivery delays. Wait until"
|
||||
" connected and the synchronisation finishes?"
|
||||
),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
|
||||
| QtWidgets.QMessageBox.StandardButton.Cancel, QtWidgets.QMessageBox.StandardButton.Cancel)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
|
||||
| QMessageBox.StandardButton.Cancel, QMessageBox.StandardButton.Cancel)
|
||||
if reply == QMessageBox.StandardButton.Yes:
|
||||
waitForConnection = True
|
||||
self.wait = waitForSync = True
|
||||
elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
|
||||
elif reply == QMessageBox.StandardButton.Cancel:
|
||||
return
|
||||
|
||||
self.quitAccepted = True
|
||||
|
@ -2850,7 +2855,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
|
||||
lines = messageText.split('\n')
|
||||
totalLines = len(lines)
|
||||
for i in xrange(totalLines):
|
||||
for i in range(totalLines):
|
||||
if 'Message ostensibly from ' in lines[i]:
|
||||
lines[i] = '<p style="font-size: 12px; color: grey;">%s</span></p>' % (
|
||||
lines[i])
|
||||
|
@ -2916,7 +2921,8 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
# Wrap and quote lines/paragraphs new to this message.
|
||||
else:
|
||||
return quoteWrapper.fill(line)
|
||||
return '\n'.join([quote_line(l) for l in message.splitlines()]) + '\n\n'
|
||||
return '\n'.join(
|
||||
[quote_line(line) for line in message.splitlines()]) + '\n\n'
|
||||
|
||||
def setSendFromComboBox(self, address=None):
|
||||
if address is None:
|
||||
|
@ -2986,23 +2992,23 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
)
|
||||
# toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow
|
||||
elif not config.has_section(toAddressAtCurrentInboxRow):
|
||||
QtWidgets.QMessageBox.information(
|
||||
QMessageBox.information(
|
||||
self, _translate("MainWindow", "Address is gone"),
|
||||
_translate(
|
||||
"MainWindow",
|
||||
"Bitmessage cannot find your address {0}. Perhaps you"
|
||||
" removed it?"
|
||||
).format(toAddressAtCurrentInboxRow), QtWidgets.QMessageBox.StandardButton.Ok)
|
||||
).format(toAddressAtCurrentInboxRow), QMessageBox.StandardButton.Ok)
|
||||
elif not config.getboolean(
|
||||
toAddressAtCurrentInboxRow, 'enabled'):
|
||||
QtWidgets.QMessageBox.information(
|
||||
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."
|
||||
), QtWidgets.QMessageBox.StandardButton.Ok)
|
||||
), QMessageBox.StandardButton.Ok)
|
||||
else:
|
||||
self.setBroadcastEnablementDependingOnWhetherThisIsAMailingListAddress(toAddressAtCurrentInboxRow)
|
||||
broadcast_tab_index = self.ui.tabWidgetSend.indexOf(
|
||||
|
@ -3148,8 +3154,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)
|
||||
|
@ -3356,7 +3362,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
self.click_pushButtonAddSubscription()
|
||||
|
||||
def on_action_SubscriptionsDelete(self):
|
||||
if QtWidgets.QMessageBox.question(
|
||||
if QMessageBox.question(
|
||||
self, "Delete subscription?",
|
||||
_translate(
|
||||
"MainWindow",
|
||||
|
@ -3367,8 +3373,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?"
|
||||
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
|
||||
) != QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
|
||||
) != QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
address = self.getCurrentAccount()
|
||||
sqlExecute('''DELETE FROM subscriptions WHERE address=?''',
|
||||
|
@ -3591,7 +3597,7 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
if account.type == AccountMixin.NORMAL:
|
||||
return # maybe in the future
|
||||
elif account.type == AccountMixin.CHAN:
|
||||
if QtWidgets.QMessageBox.question(
|
||||
if QMessageBox.question(
|
||||
self, "Delete channel?",
|
||||
_translate(
|
||||
"MainWindow",
|
||||
|
@ -3602,8 +3608,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?"
|
||||
), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
|
||||
) == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
|
||||
) == QMessageBox.StandardButton.Yes:
|
||||
config.remove_section(str(account.address))
|
||||
else:
|
||||
return
|
||||
|
@ -3739,11 +3745,11 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
if exists | (len(current_files) > 0):
|
||||
displayMsg = _translate(
|
||||
"MainWindow", "Do you really want to remove this avatar?")
|
||||
overwrite = QtWidgets.QMessageBox.question(
|
||||
overwrite = QMessageBox.question(
|
||||
self, 'Message', displayMsg,
|
||||
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No)
|
||||
else:
|
||||
overwrite = QtWidgets.QMessageBox.StandardButton.No
|
||||
overwrite = QMessageBox.StandardButton.No
|
||||
else:
|
||||
# ask whether to overwrite old avatar
|
||||
if exists | (len(current_files) > 0):
|
||||
|
@ -3751,15 +3757,15 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
"MainWindow",
|
||||
"You have already set an avatar for this address."
|
||||
" Do you really want to overwrite it?")
|
||||
overwrite = QtWidgets.QMessageBox.question(
|
||||
overwrite = QMessageBox.question(
|
||||
self, 'Message', displayMsg,
|
||||
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No)
|
||||
else:
|
||||
overwrite = QtWidgets.QMessageBox.StandardButton.No
|
||||
overwrite = QMessageBox.StandardButton.No
|
||||
|
||||
# copy the image file to the appdata folder
|
||||
if (not exists) | (overwrite == QtWidgets.QMessageBox.StandardButton.Yes):
|
||||
if overwrite == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
if (not exists) | (overwrite == QMessageBox.StandardButton.Yes):
|
||||
if overwrite == QMessageBox.StandardButton.Yes:
|
||||
for file in current_files:
|
||||
QtCore.QFile.remove(file)
|
||||
QtCore.QFile.remove(destination)
|
||||
|
@ -3809,15 +3815,15 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
pattern = destfile.lower()
|
||||
for item in os.listdir(destdir):
|
||||
if item.lower() == pattern:
|
||||
overwrite = QtWidgets.QMessageBox.question(
|
||||
overwrite = 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?"),
|
||||
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No
|
||||
) == QtWidgets.QMessageBox.StandardButton.Yes
|
||||
QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No
|
||||
) == QMessageBox.StandardButton.Yes
|
||||
if overwrite:
|
||||
QtCore.QFile.remove(os.path.join(destdir, item))
|
||||
break
|
||||
|
|
|
@ -5,7 +5,7 @@ Dialogs that work with BM address.
|
|||
|
||||
import hashlib
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtGui, QtWidgets
|
||||
|
||||
import queues
|
||||
import bitmessageqt.widgets as widgets
|
||||
|
|
|
@ -608,22 +608,41 @@ 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"))
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Custom dialog classes
|
||||
"""
|
||||
# pylint: disable=too-few-public-methods
|
||||
from PyQt6 import QtGui, QtWidgets
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
import paths
|
||||
import bitmessageqt.widgets as widgets
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import glob
|
||||
import os
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
import paths
|
||||
from bmconfigparser import config
|
||||
|
|
|
@ -38,7 +38,9 @@ class MessageView(QtWidgets.QTextBrowser):
|
|||
|
||||
def mousePressEvent(self, event):
|
||||
"""Mouse press button event handler"""
|
||||
if event.button() == QtCore.Qt.MouseButton.LeftButton and self.html and self.html.has_html and self.cursorForPosition(
|
||||
b = event.button()
|
||||
lb = QtCore.Qt.MouseButton.LeftButton
|
||||
if b == lb and self.html and self.html.has_html and self.cursorForPosition(
|
||||
event.pos()).block().blockNumber() == 0:
|
||||
if self.mode == MessageView.MODE_PLAIN:
|
||||
self.showHTML()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python2.7
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtGui, QtWidgets
|
||||
|
||||
|
||||
class MigrationWizardIntroPage(QtWidgets.QWizardPage):
|
||||
|
@ -8,7 +8,8 @@ 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()
|
||||
|
|
|
@ -4,11 +4,12 @@ src/bitmessageqt/newchandialog.py
|
|||
|
||||
"""
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
import bitmessageqt.widgets as widgets
|
||||
from addresses import addBMIfNotPresent
|
||||
from .addressvalidator import AddressValidator, PassPhraseValidator
|
||||
# XXX unresolved
|
||||
# from .addressvalidator import AddressValidator, PassPhraseValidator
|
||||
from queues import (
|
||||
addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue)
|
||||
from tr import _translate
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
from os import path
|
||||
from PyQt6 import QtGui, QtWidgets
|
||||
from debug import logger
|
||||
from PyQt6 import QtWidgets
|
||||
import bitmessageqt.widgets as widgets
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ src/settingsmixin.py
|
|||
|
||||
"""
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class SettingsMixin(object):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"""Status bar Module"""
|
||||
|
||||
from time import time
|
||||
from PyQt6 import QtGui, QtWidgets
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
|
||||
class BMStatusBar(QtWidgets.QStatusBar):
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from PyQt6 import uic
|
||||
import os.path
|
||||
import paths
|
||||
import sys
|
||||
|
||||
|
||||
def resource_path(resFile):
|
||||
|
|
Reference in New Issue
Block a user