diff --git a/.gitignore b/.gitignore
index fc331499e..8a6557622 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,5 @@ coverage.xml
**coverage.json
.buildozer
.tox
+*.swp
+typescript
diff --git a/src/addresses.py b/src/addresses.py
index 885c1f649..6859a9ca0 100644
--- a/src/addresses.py
+++ b/src/addresses.py
@@ -187,7 +187,7 @@ def decodeAddress(address):
integer = decodeBase58(address)
if integer == 0:
status = 'invalidcharacters'
- return status, 0, 0, ''
+ return status, 0, 0, b''
# after converting to hex, the string will be prepended
# with a 0x and appended with a L in python2
hexdata = hex(integer)[2:].rstrip('L')
@@ -200,23 +200,23 @@ def decodeAddress(address):
if checksum != double_sha512(data[:-4])[0:4]:
status = 'checksumfailed'
- return status, 0, 0, ''
+ return status, 0, 0, b''
try:
addressVersionNumber, bytesUsedByVersionNumber = decodeVarint(data[:9])
except varintDecodeError as e:
logger.error(str(e))
status = 'varintmalformed'
- return status, 0, 0, ''
+ return status, 0, 0, b''
if addressVersionNumber > 4:
logger.error('cannot decode address version numbers this high')
status = 'versiontoohigh'
- return status, 0, 0, ''
+ return status, 0, 0, b''
elif addressVersionNumber == 0:
logger.error('cannot decode address version numbers of zero.')
status = 'versiontoohigh'
- return status, 0, 0, ''
+ return status, 0, 0, b''
try:
streamNumber, bytesUsedByStreamNumber = \
@@ -224,7 +224,7 @@ def decodeAddress(address):
except varintDecodeError as e:
logger.error(str(e))
status = 'varintmalformed'
- return status, 0, 0, ''
+ return status, 0, 0, b''
status = 'success'
if addressVersionNumber == 1:
@@ -242,21 +242,21 @@ def decodeAddress(address):
return status, addressVersionNumber, streamNumber, \
b'\x00\x00' + embeddedRipeData
elif len(embeddedRipeData) < 18:
- return 'ripetooshort', 0, 0, ''
+ return 'ripetooshort', 0, 0, b''
elif len(embeddedRipeData) > 20:
- return 'ripetoolong', 0, 0, ''
- return 'otherproblem', 0, 0, ''
+ return 'ripetoolong', 0, 0, b''
+ return 'otherproblem', 0, 0, b''
elif addressVersionNumber == 4:
embeddedRipeData = \
data[bytesUsedByVersionNumber + bytesUsedByStreamNumber:-4]
if embeddedRipeData[0:1] == b'\x00':
# In order to enforce address non-malleability, encoded
# RIPE data must have NULL bytes removed from the front
- return 'encodingproblem', 0, 0, ''
+ return 'encodingproblem', 0, 0, b''
elif len(embeddedRipeData) > 20:
- return 'ripetoolong', 0, 0, ''
+ return 'ripetoolong', 0, 0, b''
elif len(embeddedRipeData) < 4:
- return 'ripetooshort', 0, 0, ''
+ return 'ripetooshort', 0, 0, b''
x00string = b'\x00' * (20 - len(embeddedRipeData))
return status, addressVersionNumber, streamNumber, \
x00string + embeddedRipeData
diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py
index 9acd1278a..826ad8885 100755
--- a/src/bitmessagemain.py
+++ b/src/bitmessagemain.py
@@ -325,7 +325,7 @@ def daemonize():
if not sys.platform.startswith('win'):
si = open(os.devnull, 'r')
so = open(os.devnull, 'a+')
- se = open(os.devnull, 'a+', 0)
+ se = open(os.devnull, 'ab+', 0)
os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())
diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py
index 40113b5ad..5ab7a4d0c 100644
--- a/src/bitmessageqt/__init__.py
+++ b/src/bitmessageqt/__init__.py
@@ -15,45 +15,45 @@
from datetime import datetime, timedelta
from sqlite3 import register_adapter
-from PyQt4 import QtCore, QtGui
-from PyQt4.QtNetwork import QLocalSocket, QLocalServer
+from PyQt6 import QtCore, QtGui, QtWidgets
+from PyQt6.QtNetwork import QLocalSocket, QLocalServer
import shared
import state
from debug import logger
from tr import _translate
-from account import (
+from .account import (
accountClass, getSortedSubscriptions,
BMAccount, GatewayAccount, MailchuckAccount, AccountColor)
from addresses import decodeAddress, addBMIfNotPresent
-from bitmessageui import Ui_MainWindow
+from .bitmessageui import Ui_MainWindow
from bmconfigparser import config
import namecoin
-from messageview import MessageView
-from migrationwizard import Ui_MigrationWizard
-from foldertree import (
+from .messageview import MessageView
+from .migrationwizard import Ui_MigrationWizard
+from .foldertree import (
AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget,
MessageList_AddressWidget, MessageList_SubjectWidget,
Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress,
MessageList_TimeWidget)
-import settingsmixin
-import support
+import bitmessageqt.settingsmixin as settingsmixin
+import bitmessageqt.support as support
from helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure
import helper_addressbook
import helper_search
import l10n
-from utils import str_broadcast_subscribers, avatarize
-import dialogs
+from .utils import str_broadcast_subscribers, avatarize
+import bitmessageqt.dialogs as dialogs
from network.stats import pendingDownload, pendingUpload
-from uisignaler import UISignaler
+from .uisignaler import UISignaler
import paths
from proofofwork import getPowType
import queues
import shutdown
-from statusbar import BMStatusBar
-import sound
+from .statusbar import BMStatusBar
+import bitmessageqt.sound as sound
# This is needed for tray icon
-import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import
+import bitmessageqt.bitmessage_icons_rc as bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import
import helper_sent
try:
@@ -99,12 +99,12 @@ def change_translation(self, newlocale=None):
newlocale = l10n.getTranslationLanguage()
try:
if not self.qmytranslator.isEmpty():
- QtGui.QApplication.removeTranslator(self.qmytranslator)
+ QtWidgets.QApplication.removeTranslator(self.qmytranslator)
except:
pass
try:
if not self.qsystranslator.isEmpty():
- QtGui.QApplication.removeTranslator(self.qsystranslator)
+ QtWidgets.QApplication.removeTranslator(self.qsystranslator)
except:
pass
@@ -112,7 +112,7 @@ def change_translation(self, newlocale=None):
translationpath = os.path.join(
paths.codePath(), 'translations', 'bitmessage_' + newlocale)
self.qmytranslator.load(translationpath)
- QtGui.QApplication.installTranslator(self.qmytranslator)
+ QtWidgets.QApplication.installTranslator(self.qmytranslator)
self.qsystranslator = QtCore.QTranslator()
if paths.frozen:
@@ -120,10 +120,10 @@ def change_translation(self, newlocale=None):
paths.codePath(), 'translations', 'qt_' + newlocale)
else:
translationpath = os.path.join(
- str(QtCore.QLibraryInfo.location(
- QtCore.QLibraryInfo.TranslationsPath)), 'qt_' + newlocale)
+ str(QtCore.QLibraryInfo.path(
+ QtCore.QLibraryInfo.LibraryPath.TranslationsPath)), 'qt_' + newlocale)
self.qsystranslator.load(translationpath)
- QtGui.QApplication.installTranslator(self.qsystranslator)
+ QtWidgets.QApplication.installTranslator(self.qsystranslator)
# TODO: move this block into l10n
# FIXME: shouldn't newlocale be used here?
@@ -148,50 +148,27 @@ def change_translation(self, newlocale=None):
logger.error("Failed to set locale to %s", lang, exc_info=True)
def init_file_menu(self):
- QtCore.QObject.connect(self.ui.actionExit, QtCore.SIGNAL(
- "triggered()"), self.quit)
- QtCore.QObject.connect(self.ui.actionNetworkSwitch, QtCore.SIGNAL(
- "triggered()"), self.network_switch)
- QtCore.QObject.connect(self.ui.actionManageKeys, QtCore.SIGNAL(
- "triggered()"), self.click_actionManageKeys)
- QtCore.QObject.connect(self.ui.actionDeleteAllTrashedMessages,
- QtCore.SIGNAL(
- "triggered()"),
- self.click_actionDeleteAllTrashedMessages)
- QtCore.QObject.connect(self.ui.actionRegenerateDeterministicAddresses,
- QtCore.SIGNAL(
- "triggered()"),
- self.click_actionRegenerateDeterministicAddresses)
- QtCore.QObject.connect(
- self.ui.pushButtonAddChan,
- QtCore.SIGNAL("clicked()"),
- self.click_actionJoinChan) # also used for creating chans.
- QtCore.QObject.connect(self.ui.pushButtonNewAddress, QtCore.SIGNAL(
- "clicked()"), self.click_NewAddressDialog)
- QtCore.QObject.connect(self.ui.pushButtonAddAddressBook, QtCore.SIGNAL(
- "clicked()"), self.click_pushButtonAddAddressBook)
- QtCore.QObject.connect(self.ui.pushButtonAddSubscription, QtCore.SIGNAL(
- "clicked()"), self.click_pushButtonAddSubscription)
- QtCore.QObject.connect(self.ui.pushButtonTTL, QtCore.SIGNAL(
- "clicked()"), self.click_pushButtonTTL)
- QtCore.QObject.connect(self.ui.pushButtonClear, QtCore.SIGNAL(
- "clicked()"), self.click_pushButtonClear)
- QtCore.QObject.connect(self.ui.pushButtonSend, QtCore.SIGNAL(
- "clicked()"), self.click_pushButtonSend)
- QtCore.QObject.connect(self.ui.pushButtonFetchNamecoinID, QtCore.SIGNAL(
- "clicked()"), self.click_pushButtonFetchNamecoinID)
- QtCore.QObject.connect(self.ui.actionSettings, QtCore.SIGNAL(
- "triggered()"), self.click_actionSettings)
- QtCore.QObject.connect(self.ui.actionAbout, QtCore.SIGNAL(
- "triggered()"), self.click_actionAbout)
- QtCore.QObject.connect(self.ui.actionSupport, QtCore.SIGNAL(
- "triggered()"), self.click_actionSupport)
- QtCore.QObject.connect(self.ui.actionHelp, QtCore.SIGNAL(
- "triggered()"), self.click_actionHelp)
+ self.ui.actionExit.triggered.connect(self.quit)
+ self.ui.actionNetworkSwitch.triggered.connect(self.network_switch)
+ self.ui.actionManageKeys.triggered.connect(self.click_actionManageKeys)
+ self.ui.actionDeleteAllTrashedMessages.triggered.connect(self.click_actionDeleteAllTrashedMessages)
+ self.ui.actionRegenerateDeterministicAddresses.triggered.connect(self.click_actionRegenerateDeterministicAddresses)
+ self.ui.pushButtonAddChan.clicked.connect(self.click_actionJoinChan) # also used for creating chans.
+ self.ui.pushButtonNewAddress.clicked.connect(self.click_NewAddressDialog)
+ self.ui.pushButtonAddAddressBook.clicked.connect(self.click_pushButtonAddAddressBook)
+ self.ui.pushButtonAddSubscription.clicked.connect(self.click_pushButtonAddSubscription)
+ self.ui.pushButtonTTL.clicked.connect(self.click_pushButtonTTL)
+ self.ui.pushButtonClear.clicked.connect(self.click_pushButtonClear)
+ self.ui.pushButtonSend.clicked.connect(self.click_pushButtonSend)
+ self.ui.pushButtonFetchNamecoinID.clicked.connect(self.click_pushButtonFetchNamecoinID)
+ self.ui.actionSettings.triggered.connect(self.click_actionSettings)
+ self.ui.actionAbout.triggered.connect(self.click_actionAbout)
+ self.ui.actionSupport.triggered.connect(self.click_actionSupport)
+ self.ui.actionHelp.triggered.connect(self.click_actionHelp)
def init_inbox_popup_menu(self, connectSignal=True):
# Popup menu for the Inbox tab
- self.ui.inboxContextMenuToolbar = QtGui.QToolBar()
+ self.ui.inboxContextMenuToolbar = QtWidgets.QToolBar()
# Actions
self.actionReply = self.ui.inboxContextMenuToolbar.addAction(_translate(
"MainWindow", "Reply to sender"), self.on_action_InboxReply)
@@ -225,27 +202,21 @@ def init_inbox_popup_menu(self, connectSignal=True):
# contextmenu messagelists
self.ui.tableWidgetInbox.setContextMenuPolicy(
- QtCore.Qt.CustomContextMenu)
+ QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal:
- self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
- 'customContextMenuRequested(const QPoint&)'),
- self.on_context_menuInbox)
+ self.ui.tableWidgetInbox.customContextMenuRequested.connect(self.on_context_menuInbox)
self.ui.tableWidgetInboxSubscriptions.setContextMenuPolicy(
- QtCore.Qt.CustomContextMenu)
+ QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal:
- self.connect(self.ui.tableWidgetInboxSubscriptions, QtCore.SIGNAL(
- 'customContextMenuRequested(const QPoint&)'),
- self.on_context_menuInbox)
+ self.ui.tableWidgetInboxSubscriptions.customContextMenuRequested.connect(self.on_context_menuInbox)
self.ui.tableWidgetInboxChans.setContextMenuPolicy(
- QtCore.Qt.CustomContextMenu)
+ QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal:
- self.connect(self.ui.tableWidgetInboxChans, QtCore.SIGNAL(
- 'customContextMenuRequested(const QPoint&)'),
- self.on_context_menuInbox)
+ self.ui.tableWidgetInboxChans.customContextMenuRequested.connect(self.on_context_menuInbox)
def init_identities_popup_menu(self, connectSignal=True):
# Popup menu for the Your Identities tab
- self.ui.addressContextMenuToolbarYourIdentities = QtGui.QToolBar()
+ self.ui.addressContextMenuToolbarYourIdentities = QtWidgets.QToolBar()
# Actions
self.actionNewYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction(_translate(
"MainWindow", "New"), self.on_action_YourIdentitiesNew)
@@ -277,11 +248,9 @@ def init_identities_popup_menu(self, connectSignal=True):
self.on_action_MarkAllRead)
self.ui.treeWidgetYourIdentities.setContextMenuPolicy(
- QtCore.Qt.CustomContextMenu)
+ QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal:
- self.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL(
- 'customContextMenuRequested(const QPoint&)'),
- self.on_context_menuYourIdentities)
+ self.ui.treeWidgetYourIdentities.customContextMenuRequested.connect(self.on_context_menuYourIdentities)
# load all gui.menu plugins with prefix 'address'
self.menu_plugins = {'address': []}
@@ -327,15 +296,13 @@ def init_chan_popup_menu(self, connectSignal=True):
self.on_action_SpecialAddressBehaviorDialog)
self.ui.treeWidgetChans.setContextMenuPolicy(
- QtCore.Qt.CustomContextMenu)
+ QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal:
- self.connect(self.ui.treeWidgetChans, QtCore.SIGNAL(
- 'customContextMenuRequested(const QPoint&)'),
- self.on_context_menuChan)
+ self.ui.treeWidgetChans.customContextMenuRequested.connect(self.on_context_menuChan)
def init_addressbook_popup_menu(self, connectSignal=True):
# Popup menu for the Address Book page
- self.ui.addressBookContextMenuToolbar = QtGui.QToolBar()
+ self.ui.addressBookContextMenuToolbar = QtWidgets.QToolBar()
# Actions
self.actionAddressBookSend = self.ui.addressBookContextMenuToolbar.addAction(
_translate(
@@ -364,11 +331,9 @@ def init_addressbook_popup_menu(self, connectSignal=True):
_translate(
"MainWindow", "Delete"), self.on_action_AddressBookDelete)
self.ui.tableWidgetAddressBook.setContextMenuPolicy(
- QtCore.Qt.CustomContextMenu)
+ QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal:
- self.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL(
- 'customContextMenuRequested(const QPoint&)'),
- self.on_context_menuAddressBook)
+ self.ui.tableWidgetAddressBook.customContextMenuRequested.connect(self.on_context_menuAddressBook)
def init_subscriptions_popup_menu(self, connectSignal=True):
# Actions
@@ -393,11 +358,9 @@ def init_subscriptions_popup_menu(self, connectSignal=True):
_translate("MainWindow", "Send message to this address"),
self.on_action_Send)
self.ui.treeWidgetSubscriptions.setContextMenuPolicy(
- QtCore.Qt.CustomContextMenu)
+ QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal:
- self.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL(
- 'customContextMenuRequested(const QPoint&)'),
- self.on_context_menuSubscriptions)
+ self.ui.treeWidgetSubscriptions.customContextMenuRequested.connect(self.on_context_menuSubscriptions)
def init_sent_popup_menu(self, connectSignal=True):
# Actions
@@ -414,19 +377,19 @@ def init_sent_popup_menu(self, connectSignal=True):
self.actionSentReply = self.ui.sentContextMenuToolbar.addAction(
_translate("MainWindow", "Send update"),
self.on_action_SentReply)
- # self.popMenuSent = QtGui.QMenu( self )
+ # self.popMenuSent = QtWidgets.QMenu( self )
# self.popMenuSent.addAction( self.actionSentClipboard )
# self.popMenuSent.addAction( self.actionTrashSentMessage )
def rerenderTabTreeSubscriptions(self):
treeWidget = self.ui.treeWidgetSubscriptions
folders = Ui_FolderWidget.folderWeight.keys()
- folders.remove("new")
+ Ui_FolderWidget.folderWeight.pop("new", None)
# sort ascending when creating
if treeWidget.topLevelItemCount() == 0:
treeWidget.header().setSortIndicator(
- 0, QtCore.Qt.AscendingOrder)
+ 0, QtCore.Qt.SortOrder.AscendingOrder)
# init dictionary
db = getSortedSubscriptions(True)
@@ -468,7 +431,7 @@ def rerenderTabTreeSubscriptions(self):
# add missing folders
if len(db[toAddress]) > 0:
j = 0
- for f, c in db[toAddress].iteritems():
+ for f, c in db[toAddress].items():
try:
subwidget = Ui_FolderWidget(widget, j, toAddress, f, c['count'])
except KeyError:
@@ -517,7 +480,7 @@ def rerenderTabTree(self, tab):
# sort ascending when creating
if treeWidget.topLevelItemCount() == 0:
treeWidget.header().setSortIndicator(
- 0, QtCore.Qt.AscendingOrder)
+ 0, QtCore.Qt.SortOrder.AscendingOrder)
# init dictionary
db = {}
enabled = {}
@@ -552,6 +515,8 @@ def rerenderTabTree(self, tab):
"GROUP BY toaddress, folder")
for row in queryreturn:
toaddress, folder, cnt = row
+ toaddress = toaddress.decode('utf-8', 'replace')
+ folder = folder.decode('utf-8', 'replace')
total += cnt
if toaddress in db and folder in db[toaddress]:
db[toaddress][folder] = cnt
@@ -598,7 +563,7 @@ def rerenderTabTree(self, tab):
# add missing folders
if len(db[toAddress]) > 0:
j = 0
- for f, c in db[toAddress].iteritems():
+ for f, c in db[toAddress].items():
if toAddress is not None and tab == 'messages' and folder == "new":
continue
subwidget = Ui_FolderWidget(widget, j, toAddress, f, c)
@@ -627,7 +592,7 @@ def rerenderTabTree(self, tab):
treeWidget.setSortingEnabled(True)
def __init__(self, parent=None):
- QtGui.QWidget.__init__(self, parent)
+ QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
@@ -646,12 +611,12 @@ def __init__(self, parent=None):
if addressVersionNumber == 1:
displayMsg = _translate(
"MainWindow",
- "One of your addresses, %1, is an old version 1 address. "
+ "One of your addresses, {0}, is an old version 1 address. "
"Version 1 addresses are no longer supported. "
- "May we delete it now?").arg(addressInKeysFile)
- reply = QtGui.QMessageBox.question(
- self, 'Message', displayMsg, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
- if reply == QtGui.QMessageBox.Yes:
+ "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:
config.remove_section(addressInKeysFile)
config.save()
@@ -695,65 +660,44 @@ def __init__(self, parent=None):
self.rerenderSubscriptions()
# Initialize the inbox search
- QtCore.QObject.connect(self.ui.inboxSearchLineEdit, QtCore.SIGNAL(
- "returnPressed()"), self.inboxSearchLineEditReturnPressed)
- QtCore.QObject.connect(self.ui.inboxSearchLineEditSubscriptions, QtCore.SIGNAL(
- "returnPressed()"), self.inboxSearchLineEditReturnPressed)
- QtCore.QObject.connect(self.ui.inboxSearchLineEditChans, QtCore.SIGNAL(
- "returnPressed()"), self.inboxSearchLineEditReturnPressed)
- QtCore.QObject.connect(self.ui.inboxSearchLineEdit, QtCore.SIGNAL(
- "textChanged(QString)"), self.inboxSearchLineEditUpdated)
- QtCore.QObject.connect(self.ui.inboxSearchLineEditSubscriptions, QtCore.SIGNAL(
- "textChanged(QString)"), self.inboxSearchLineEditUpdated)
- QtCore.QObject.connect(self.ui.inboxSearchLineEditChans, QtCore.SIGNAL(
- "textChanged(QString)"), self.inboxSearchLineEditUpdated)
+ self.ui.inboxSearchLineEdit.returnPressed.connect(self.inboxSearchLineEditReturnPressed)
+ self.ui.inboxSearchLineEditSubscriptions.returnPressed.connect(self.inboxSearchLineEditReturnPressed)
+ self.ui.inboxSearchLineEditChans.returnPressed.connect(self.inboxSearchLineEditReturnPressed)
+ self.ui.inboxSearchLineEdit.textChanged.connect(self.inboxSearchLineEditUpdated)
+ self.ui.inboxSearchLineEditSubscriptions.textChanged.connect(self.inboxSearchLineEditUpdated)
+ self.ui.inboxSearchLineEditChans.textChanged.connect(self.inboxSearchLineEditUpdated)
# Initialize addressbook
- QtCore.QObject.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL(
- "itemChanged(QTableWidgetItem *)"), self.tableWidgetAddressBookItemChanged)
+ self.ui.tableWidgetAddressBook.itemChanged.connect(self.tableWidgetAddressBookItemChanged)
# This is necessary for the completer to work if multiple recipients
- QtCore.QObject.connect(self.ui.lineEditTo, QtCore.SIGNAL(
- "cursorPositionChanged(int, int)"), self.ui.lineEditTo.completer().onCursorPositionChanged)
+ self.ui.lineEditTo.cursorPositionChanged.connect(self.ui.lineEditTo.completer().onCursorPositionChanged)
# show messages from message list
- QtCore.QObject.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
- "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked)
- QtCore.QObject.connect(self.ui.tableWidgetInboxSubscriptions, QtCore.SIGNAL(
- "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked)
- QtCore.QObject.connect(self.ui.tableWidgetInboxChans, QtCore.SIGNAL(
- "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked)
+ self.ui.tableWidgetInbox.itemSelectionChanged.connect(self.tableWidgetInboxItemClicked)
+ self.ui.tableWidgetInboxSubscriptions.itemSelectionChanged.connect(self.tableWidgetInboxItemClicked)
+ self.ui.tableWidgetInboxChans.itemSelectionChanged.connect(self.tableWidgetInboxItemClicked)
# tree address lists
- QtCore.QObject.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL(
- "itemSelectionChanged ()"), self.treeWidgetItemClicked)
- QtCore.QObject.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL(
- "itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged)
- QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL(
- "itemSelectionChanged ()"), self.treeWidgetItemClicked)
- QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL(
- "itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged)
- QtCore.QObject.connect(self.ui.treeWidgetChans, QtCore.SIGNAL(
- "itemSelectionChanged ()"), self.treeWidgetItemClicked)
- QtCore.QObject.connect(self.ui.treeWidgetChans, QtCore.SIGNAL(
- "itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged)
- QtCore.QObject.connect(
- self.ui.tabWidget, QtCore.SIGNAL("currentChanged(int)"),
- self.tabWidgetCurrentChanged
- )
+ self.ui.treeWidgetYourIdentities.itemSelectionChanged.connect(self.treeWidgetItemClicked)
+ self.ui.treeWidgetYourIdentities.itemChanged.connect(self.treeWidgetItemChanged)
+ self.ui.treeWidgetSubscriptions.itemSelectionChanged.connect(self.treeWidgetItemClicked)
+ self.ui.treeWidgetSubscriptions.itemChanged.connect(self.treeWidgetItemChanged)
+ self.ui.treeWidgetChans.itemSelectionChanged.connect(self.treeWidgetItemClicked)
+ self.ui.treeWidgetChans.itemChanged.connect(self.treeWidgetItemChanged)
+ self.ui.tabWidget.currentChanged.connect(self.tabWidgetCurrentChanged)
# Put the colored icon on the status bar
# self.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png"))
self.setStatusBar(BMStatusBar())
self.statusbar = self.statusBar()
- self.pushButtonStatusIcon = QtGui.QPushButton(self)
+ self.pushButtonStatusIcon = QtWidgets.QPushButton(self)
self.pushButtonStatusIcon.setText('')
self.pushButtonStatusIcon.setIcon(
QtGui.QIcon(':/newPrefix/images/redicon.png'))
self.pushButtonStatusIcon.setFlat(True)
self.statusbar.insertPermanentWidget(0, self.pushButtonStatusIcon)
- QtCore.QObject.connect(self.pushButtonStatusIcon, QtCore.SIGNAL(
- "clicked()"), self.click_pushButtonStatusIcon)
+ self.pushButtonStatusIcon.clicked.connect(self.click_pushButtonStatusIcon)
self.unreadCount = 0
@@ -767,39 +711,21 @@ def __init__(self, parent=None):
self.UISignalThread = UISignaler.get()
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "writeNewAddressToTable(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)"), self.writeNewAddressToTable)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "updateStatusBar(PyQt_PyObject)"), self.updateStatusBar)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "updateSentItemStatusByToAddress(PyQt_PyObject,PyQt_PyObject)"), self.updateSentItemStatusByToAddress)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"), self.updateSentItemStatusByAckdata)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "displayNewInboxMessage(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)"),
- self.displayNewInboxMessage)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "displayNewSentMessage(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,"
- "PyQt_PyObject,PyQt_PyObject)"),
- self.displayNewSentMessage)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "setStatusIcon(PyQt_PyObject)"), self.setStatusIcon)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "changedInboxUnread(PyQt_PyObject)"), self.changedInboxUnread)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "rerenderMessagelistFromLabels()"), self.rerenderMessagelistFromLabels)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "rerenderMessgelistToLabels()"), self.rerenderMessagelistToLabels)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "rerenderAddressBook()"), self.rerenderAddressBook)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "rerenderSubscriptions()"), self.rerenderSubscriptions)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "removeInboxRowByMsgid(PyQt_PyObject)"), self.removeInboxRowByMsgid)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "newVersionAvailable(PyQt_PyObject)"), self.newVersionAvailable)
- QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
- "displayAlert(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)"), self.displayAlert)
+ self.UISignalThread.writeNewAddressToTable.connect(self.writeNewAddressToTable)
+ self.UISignalThread.updateStatusBar.connect(self.updateStatusBar)
+ self.UISignalThread.updateSentItemStatusByToAddress.connect(self.updateSentItemStatusByToAddress)
+ self.UISignalThread.updateSentItemStatusByAckdata.connect(self.updateSentItemStatusByAckdata)
+ self.UISignalThread.displayNewInboxMessage.connect(self.displayNewInboxMessage)
+ self.UISignalThread.displayNewSentMessage.connect(self.displayNewSentMessage)
+ self.UISignalThread.setStatusIcon.connect(self.setStatusIcon)
+ self.UISignalThread.changedInboxUnread.connect(self.changedInboxUnread)
+ self.UISignalThread.rerenderMessagelistFromLabels.connect(self.rerenderMessagelistFromLabels)
+ self.UISignalThread.rerenderMessagelistToLabels.connect(self.rerenderMessagelistToLabels)
+ self.UISignalThread.rerenderAddressBook.connect(self.rerenderAddressBook)
+ self.UISignalThread.rerenderSubscriptions.connect(self.rerenderSubscriptions)
+ self.UISignalThread.removeInboxRowByMsgid.connect(self.removeInboxRowByMsgid)
+ self.UISignalThread.newVersionAvailable.connect(self.newVersionAvailable)
+ self.UISignalThread.displayAlert.connect(self.displayAlert)
self.UISignalThread.start()
# Key press in tree view
@@ -832,11 +758,10 @@ def __init__(self, parent=None):
TTL = 3600
elif TTL > 28*24*60*60: # 28 days
TTL = 28*24*60*60
- self.ui.horizontalSliderTTL.setSliderPosition((TTL - 3600) ** (1/3.199))
+ self.ui.horizontalSliderTTL.setSliderPosition(int((TTL - 3600) ** (1/3.199)))
self.updateHumanFriendlyTTLDescription(TTL)
- QtCore.QObject.connect(self.ui.horizontalSliderTTL, QtCore.SIGNAL(
- "valueChanged(int)"), self.updateTTL)
+ self.ui.horizontalSliderTTL.valueChanged.connect(self.updateTTL)
self.initSettings()
self.resetNamecoinConnection()
@@ -898,9 +823,9 @@ def updateHumanFriendlyTTLDescription(self, TTL):
if numberOfHours < 48:
self.ui.labelHumanFriendlyTTLDescription.setText(
- _translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, numberOfHours) +
+ _translate("MainWindow", "%n hour(s)", None, numberOfHours) +
", " +
- _translate("MainWindow", "not recommended for chans", None, QtCore.QCoreApplication.CodecForTr)
+ _translate("MainWindow", "not recommended for chans", None)
)
stylesheet = "QLabel { color : red; }"
font.setBold(True)
@@ -911,7 +836,6 @@ def updateHumanFriendlyTTLDescription(self, TTL):
"MainWindow",
"%n day(s)",
None,
- QtCore.QCoreApplication.CodecForTr,
numberOfDays))
font.setBold(False)
self.ui.labelHumanFriendlyTTLDescription.setStyleSheet(stylesheet)
@@ -925,7 +849,7 @@ def appIndicatorShowOrHideWindow(self):
else:
self.show()
self.setWindowState(
- self.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
+ self.windowState() & ~QtCore.Qt.WindowState.WindowMinimized | QtCore.Qt.WindowState.WindowActive)
self.raise_()
self.activateWindow()
@@ -1044,6 +968,8 @@ def propagateUnreadCount(self, folder=None, widget=None):
normalUnread = {}
broadcastsUnread = {}
for addr, fld, count in queryReturn:
+ addr = addr.decode('utf-8', 'replace')
+ fld = fld.decode('utf-8', 'replace')
try:
normalUnread[addr][fld] = count
except KeyError:
@@ -1075,7 +1001,7 @@ def propagateUnreadCount(self, folder=None, widget=None):
for i in range(root.childCount()):
addressItem = root.child(i)
if addressItem.type == AccountMixin.ALL:
- newCount = sum(totalUnread.itervalues())
+ newCount = sum(totalUnread.values())
self.drawTrayIcon(self.currentTrayIconFileName, newCount)
else:
try:
@@ -1083,7 +1009,7 @@ def propagateUnreadCount(self, folder=None, widget=None):
broadcastsUnread
if addressItem.type == AccountMixin.SUBSCRIPTION
else normalUnread
- )[addressItem.address].itervalues())
+ )[addressItem.address].values())
except KeyError:
newCount = 0
if newCount != addressItem.unreadCount:
@@ -1140,20 +1066,20 @@ def addMessageListItemSent(
elif status == 'msgsent':
statusText = _translate(
"MainWindow",
- "Message sent. Waiting for acknowledgement. Sent at %1"
- ).arg(l10n.formatTimestamp(lastactiontime))
+ "Message sent. Waiting for acknowledgement. Sent at {0}"
+ ).format(l10n.formatTimestamp(lastactiontime))
elif status == 'msgsentnoackexpected':
statusText = _translate(
- "MainWindow", "Message sent. Sent at %1"
- ).arg(l10n.formatTimestamp(lastactiontime))
+ "MainWindow", "Message sent. Sent at {0}"
+ ).format(l10n.formatTimestamp(lastactiontime))
elif status == 'doingmsgpow':
statusText = _translate(
"MainWindow", "Doing work necessary to send message.")
elif status == 'ackreceived':
statusText = _translate(
"MainWindow",
- "Acknowledgement of the message received %1"
- ).arg(l10n.formatTimestamp(lastactiontime))
+ "Acknowledgement of the message received {0}"
+ ).format(l10n.formatTimestamp(lastactiontime))
elif status == 'broadcastqueued':
statusText = _translate(
"MainWindow", "Broadcast queued.")
@@ -1161,36 +1087,36 @@ def addMessageListItemSent(
statusText = _translate(
"MainWindow", "Doing work necessary to send broadcast.")
elif status == 'broadcastsent':
- statusText = _translate("MainWindow", "Broadcast on %1").arg(
+ statusText = _translate("MainWindow", "Broadcast on {0}").format(
l10n.formatTimestamp(lastactiontime))
elif status == 'toodifficult':
statusText = _translate(
"MainWindow",
"Problem: The work demanded by the recipient is more"
- " difficult than you are willing to do. %1"
- ).arg(l10n.formatTimestamp(lastactiontime))
+ " difficult than you are willing to do. {0}"
+ ).format(l10n.formatTimestamp(lastactiontime))
elif status == 'badkey':
statusText = _translate(
"MainWindow",
"Problem: The recipient\'s encryption key is no good."
- " Could not encrypt message. %1"
- ).arg(l10n.formatTimestamp(lastactiontime))
+ " Could not encrypt message. {0}"
+ ).format(l10n.formatTimestamp(lastactiontime))
elif status == 'forcepow':
statusText = _translate(
"MainWindow",
"Forced difficulty override. Send should start soon.")
else:
statusText = _translate(
- "MainWindow", "Unknown status: %1 %2").arg(status).arg(
+ "MainWindow", "Unknown status: {0} {1}").format(status,
l10n.formatTimestamp(lastactiontime))
items = [
MessageList_AddressWidget(
- toAddress, unicode(acct.toLabel, 'utf-8')),
+ toAddress, acct.toLabel),
MessageList_AddressWidget(
- fromAddress, unicode(acct.fromLabel, 'utf-8')),
+ fromAddress, acct.fromLabel),
MessageList_SubjectWidget(
- str(subject), unicode(acct.subject, 'utf-8', 'replace')),
+ subject, acct.subject),
MessageList_TimeWidget(
statusText, False, lastactiontime, ackdata)]
self.addMessageListItem(tableWidget, items)
@@ -1211,11 +1137,11 @@ def addMessageListItemInbox(
items = [
MessageList_AddressWidget(
- toAddress, unicode(acct.toLabel, 'utf-8'), not read),
+ toAddress, acct.toLabel, not read),
MessageList_AddressWidget(
- fromAddress, unicode(acct.fromLabel, 'utf-8'), not read),
+ fromAddress, acct.fromLabel, not read),
MessageList_SubjectWidget(
- str(subject), unicode(acct.subject, 'utf-8', 'replace'),
+ subject, acct.subject,
not read),
MessageList_TimeWidget(
l10n.formatTimestamp(received), not read, received, msgid)
@@ -1243,10 +1169,17 @@ def loadSent(self, tableWidget, account, where="", what=""):
xAddress, account, "sent", where, what, False)
for row in queryreturn:
+ r = []
+ r.append(row[0].decode('utf-8', 'replace')) # toaddress
+ r.append(row[1].decode('utf-8', 'replace')) # fromaddress
+ r.append(row[2].decode('utf-8', 'replace')) # subject
+ r.append(row[3].decode('utf-8', 'replace')) # status
+ r.append(row[4]) # ackdata
+ r.append(row[5]) # lastactiontime
self.addMessageListItemSent(tableWidget, *row)
tableWidget.horizontalHeader().setSortIndicator(
- 3, QtCore.Qt.DescendingOrder)
+ 3, QtCore.Qt.SortOrder.DescendingOrder)
tableWidget.setSortingEnabled(True)
tableWidget.horizontalHeaderItem(3).setText(
_translate("MainWindow", "Sent"))
@@ -1284,12 +1217,16 @@ def loadMessagelist(
for row in queryreturn:
toAddress, fromAddress, subject, _, msgid, received, read = row
+ toAddress = toAddress.decode('utf-8', 'replace')
+ fromAddress = fromAddress.decode('utf-8', 'replace')
+ subject = subject.decode('utf-8', 'replace')
+ received = received.decode('utf-8', 'replace')
self.addMessageListItemInbox(
tableWidget, toAddress, fromAddress, subject,
msgid, received, read)
tableWidget.horizontalHeader().setSortIndicator(
- 3, QtCore.Qt.DescendingOrder)
+ 3, QtCore.Qt.SortOrder.DescendingOrder)
tableWidget.setSortingEnabled(True)
tableWidget.selectRow(0)
tableWidget.horizontalHeaderItem(3).setText(
@@ -1299,11 +1236,9 @@ def loadMessagelist(
# create application indicator
def appIndicatorInit(self, app):
self.initTrayIcon("can-icon-24px-red.png", app)
- traySignal = "activated(QSystemTrayIcon::ActivationReason)"
- QtCore.QObject.connect(self.tray, QtCore.SIGNAL(
- traySignal), self.__icon_activated)
+ self.tray.activated.connect(self.__icon_activated)
- m = QtGui.QMenu()
+ m = QtWidgets.QMenu()
self.actionStatus = QtGui.QAction(_translate(
"MainWindow", "Not Connected"), m, checkable=False)
@@ -1369,6 +1304,7 @@ def getUnread(self):
SELECT msgid, toaddress, read FROM inbox where folder='inbox'
''')
for msgid, toAddress, read in queryreturn:
+ toAddress = toAddress.decode('utf-8', 'replace')
if not read:
# increment the unread subscriptions if True (1)
@@ -1447,7 +1383,7 @@ def _choose_ext(basename):
# Adapters and converters for QT <-> sqlite
def sqlInit(self):
- register_adapter(QtCore.QByteArray, str)
+ register_adapter(QtCore.QByteArray, bytes)
def indicatorInit(self):
"""
@@ -1466,12 +1402,13 @@ def _noop_update(*args, **kwargs):
# initialise the message notifier
def notifierInit(self):
def _simple_notify(
- title, subtitle, category, label=None, icon=None):
- self.tray.showMessage(title, subtitle, 1, 2000)
+ title, subtitle, category, label=None, icon=QtWidgets.QSystemTrayIcon.MessageIcon.Information):
+ self.tray.showMessage(title, subtitle, icon, 2000)
self._notifier = _simple_notify
# does nothing if isAvailable returns false
- self._player = QtGui.QSound.play
+ # XXX unresolved
+ #self._player = QtGui.QSound.play
if not get_plugins:
return
@@ -1484,7 +1421,9 @@ def _simple_notify(
self._theme_player = get_plugin('notification.sound', 'theme')
- if not QtGui.QSound.isAvailable():
+ # XXX unresolved
+ #if not QtGui.QSound.isAvailable():
+ if not False:
_plugin = get_plugin(
'notification.sound', 'file', fallback='file.fallback')
if _plugin:
@@ -1493,10 +1432,10 @@ def _simple_notify(
logger.warning("No notification.sound plugin found")
def notifierShow(
- self, title, subtitle, category, label=None, icon=None):
+ self, title, subtitle, category, label=None, icon=QtWidgets.QSystemTrayIcon.MessageIcon.Information):
self.playSound(category, label)
self._notifier(
- unicode(title), unicode(subtitle), category, label, icon)
+ title, subtitle, category, label, icon)
# tree
def treeWidgetKeyPressEvent(self, event):
@@ -1505,10 +1444,10 @@ def treeWidgetKeyPressEvent(self, event):
# addressbook
def addressbookKeyPressEvent(self, event):
"""Handle keypress event in addressbook widget"""
- if event.key() == QtCore.Qt.Key_Delete:
+ if event.key() == QtCore.Qt.Key.Key_Delete:
self.on_action_AddressBookDelete()
else:
- return QtGui.QTableWidget.keyPressEvent(
+ return QtWidgets.QTableWidget.keyPressEvent(
self.ui.tableWidgetAddressBook, event)
# inbox / sent
@@ -1522,32 +1461,32 @@ def textEditKeyPressEvent(self, event):
def handleKeyPress(self, event, focus=None):
"""This method handles keypress events for all widgets on MyForm"""
messagelist = self.getCurrentMessagelist()
- if event.key() == QtCore.Qt.Key_Delete:
- if isinstance(focus, (MessageView, QtGui.QTableWidget)):
+ if event.key() == QtCore.Qt.Key.Key_Delete:
+ if isinstance(focus, (MessageView, QtWidgets.QTableWidget)):
folder = self.getCurrentFolder()
if folder == "sent":
self.on_action_SentTrash()
else:
self.on_action_InboxTrash()
event.ignore()
- elif QtGui.QApplication.queryKeyboardModifiers() == QtCore.Qt.NoModifier:
- if event.key() == QtCore.Qt.Key_N:
+ elif QtWidgets.QApplication.queryKeyboardModifiers() == QtCore.Qt.KeyboardModifier.NoModifier:
+ if event.key() == QtCore.Qt.Key.Key_N:
currentRow = messagelist.currentRow()
if currentRow < messagelist.rowCount() - 1:
messagelist.selectRow(currentRow + 1)
event.ignore()
- elif event.key() == QtCore.Qt.Key_P:
+ elif event.key() == QtCore.Qt.Key.Key_P:
currentRow = messagelist.currentRow()
if currentRow > 0:
messagelist.selectRow(currentRow - 1)
event.ignore()
- elif event.key() == QtCore.Qt.Key_R:
+ elif event.key() == QtCore.Qt.Key.Key_R:
if messagelist == self.ui.tableWidgetInboxChans:
self.on_action_InboxReplyChan()
else:
self.on_action_InboxReply()
event.ignore()
- elif event.key() == QtCore.Qt.Key_C:
+ elif event.key() == QtCore.Qt.Key.Key_C:
currentAddress = self.getCurrentAccount()
if currentAddress:
self.setSendFromComboBox(currentAddress)
@@ -1559,7 +1498,7 @@ def handleKeyPress(self, event, focus=None):
)
self.ui.lineEditTo.setFocus()
event.ignore()
- elif event.key() == QtCore.Qt.Key_F:
+ elif event.key() == QtCore.Qt.Key.Key_F:
try:
self.getCurrentSearchLine(retObj=True).setFocus()
except AttributeError:
@@ -1569,20 +1508,20 @@ def handleKeyPress(self, event, focus=None):
return
if isinstance(focus, MessageView):
return MessageView.keyPressEvent(focus, event)
- if isinstance(focus, QtGui.QTableWidget):
- return QtGui.QTableWidget.keyPressEvent(focus, event)
- if isinstance(focus, QtGui.QTreeWidget):
- return QtGui.QTreeWidget.keyPressEvent(focus, event)
+ if isinstance(focus, QtWidgets.QTableWidget):
+ return QtWidgets.QTableWidget.keyPressEvent(focus, event)
+ if isinstance(focus, QtWidgets.QTreeWidget):
+ return QtWidgets.QTreeWidget.keyPressEvent(focus, event)
# menu button 'manage keys'
def click_actionManageKeys(self):
if 'darwin' in sys.platform or 'linux' in sys.platform:
if state.appdata == '':
- # reply = QtGui.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.Ok)
- reply = QtGui.QMessageBox.information(
+ # back up this file.', QMessageBox.StandardButton.Ok)
+ reply = QtWidgets.QMessageBox.information(
self,
'keys.dat?',
_translate(
@@ -1590,22 +1529,22 @@ def click_actionManageKeys(self):
"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."
),
- QtGui.QMessageBox.Ok)
+ QtWidgets.QMessageBox.StandardButton.Ok)
else:
- QtGui.QMessageBox.information(
+ QtWidgets.QMessageBox.information(
self,
'keys.dat?',
_translate(
"MainWindow",
"You may manage your keys by editing the keys.dat file stored in"
- "\n %1 \n"
+ "\n {0} \n"
"It is important that you back up this file."
- ).arg(state.appdata),
- QtGui.QMessageBox.Ok)
+ ).format(state.appdata),
+ QtWidgets.QMessageBox.StandardButton.Ok)
elif sys.platform == 'win32' or sys.platform == 'win64':
if state.appdata == '':
- reply = QtGui.QMessageBox.question(
+ reply = QtWidgets.QMessageBox.question(
self,
_translate("MainWindow", "Open keys.dat?"),
_translate(
@@ -1614,29 +1553,29 @@ def click_actionManageKeys(self):
"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.)"),
- QtGui.QMessageBox.Yes,
- QtGui.QMessageBox.No)
+ QtWidgets.QMessageBox.StandardButton.Yes,
+ QtWidgets.QMessageBox.StandardButton.No)
else:
- reply = QtGui.QMessageBox.question(
+ reply = QtWidgets.QMessageBox.question(
self,
_translate("MainWindow", "Open keys.dat?"),
_translate(
"MainWindow",
- "You may manage your keys by editing the keys.dat file stored in\n %1 \n"
+ "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.)").arg(state.appdata),
- QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
- if reply == QtGui.QMessageBox.Yes:
+ "(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:
openKeysFile()
# menu button 'delete all treshed messages'
def click_actionDeleteAllTrashedMessages(self):
- if QtGui.QMessageBox.question(
+ if QtWidgets.QMessageBox.question(
self,
_translate("MainWindow", "Delete trash?"),
_translate("MainWindow", "Are you sure you want to delete all trashed messages?"),
- QtGui.QMessageBox.Yes,
- QtGui.QMessageBox.No) == QtGui.QMessageBox.No:
+ QtWidgets.QMessageBox.StandardButton.Yes,
+ QtWidgets.QMessageBox.StandardButton.No) == QtWidgets.QMessageBox.StandardButton.No:
return
sqlStoredProcedure('deleteandvacuume')
self.rerenderTabTreeMessages()
@@ -1661,9 +1600,9 @@ def click_actionDeleteAllTrashedMessages(self):
# menu button 'regenerate deterministic addresses'
def click_actionRegenerateDeterministicAddresses(self):
dialog = dialogs.RegenerateAddressesDialog(self)
- if dialog.exec_():
+ if dialog.exec():
if dialog.lineEditPassphrase.text() == "":
- QtGui.QMessageBox.about(
+ QtWidgets.QMessageBox.about(
self, _translate("MainWindow", "bad passphrase"),
_translate(
"MainWindow",
@@ -1676,7 +1615,7 @@ def click_actionRegenerateDeterministicAddresses(self):
addressVersionNumber = int(
dialog.lineEditAddressVersionNumber.text())
except:
- QtGui.QMessageBox.about(
+ QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Bad address version number"),
_translate(
@@ -1686,7 +1625,7 @@ def click_actionRegenerateDeterministicAddresses(self):
))
return
if addressVersionNumber < 3 or addressVersionNumber > 4:
- QtGui.QMessageBox.about(
+ QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Bad address version number"),
_translate(
@@ -1699,7 +1638,7 @@ def click_actionRegenerateDeterministicAddresses(self):
addressVersionNumber, streamNumberForAddress,
"regenerated deterministic address",
dialog.spinBoxNumberOfAddressesToMake.value(),
- dialog.lineEditPassphrase.text().toUtf8(),
+ dialog.lineEditPassphrase.text(),
dialog.checkBoxEighteenByteRipe.isChecked()
))
self.ui.tabWidget.setCurrentIndex(
@@ -1712,7 +1651,7 @@ def click_actionJoinChan(self):
def showConnectDialog(self):
dialog = dialogs.ConnectDialog(self)
- if dialog.exec_():
+ if dialog.exec():
if dialog.radioButtonConnectNow.isChecked():
self.ui.updateNetworkSwitchMenuLabel(False)
config.remove_option(
@@ -1725,13 +1664,13 @@ def showConnectDialog(self):
def showMigrationWizard(self, level):
self.migrationWizardInstance = Ui_MigrationWizard(["a"])
- if self.migrationWizardInstance.exec_():
+ if self.migrationWizardInstance.exec():
pass
else:
pass
def changeEvent(self, event):
- if event.type() == QtCore.QEvent.LanguageChange:
+ if event.type() == QtCore.QEvent.Type.LanguageChange:
self.ui.retranslateUi(self)
self.init_inbox_popup_menu(False)
self.init_identities_popup_menu(False)
@@ -1740,17 +1679,17 @@ def changeEvent(self, event):
self.init_subscriptions_popup_menu(False)
self.init_sent_popup_menu(False)
self.ui.blackwhitelist.init_blacklist_popup_menu(False)
- if event.type() == QtCore.QEvent.WindowStateChange:
- if self.windowState() & QtCore.Qt.WindowMinimized:
+ 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:
QtCore.QTimer.singleShot(0, self.appIndicatorHide)
- elif event.oldState() & QtCore.Qt.WindowMinimized:
+ elif event.oldState() & QtCore.Qt.WindowState.WindowMinimized:
# The window state has just been changed to
# Normal/Maximised/FullScreen
pass
def __icon_activated(self, reason):
- if reason == QtGui.QSystemTrayIcon.Trigger:
+ if reason == QtWidgets.QSystemTrayIcon.ActivationReason.Trigger:
self.actionShow.setChecked(not self.actionShow.isChecked())
self.appIndicatorShowOrHideWindow()
@@ -1820,7 +1759,7 @@ def setStatusIcon(self, color):
def initTrayIcon(self, iconFileName, app):
self.currentTrayIconFileName = iconFileName
- self.tray = QtGui.QSystemTrayIcon(
+ self.tray = QtWidgets.QSystemTrayIcon(
self.calcTrayIcon(iconFileName, self.findInboxUnreadCount()), app)
def setTrayIconFile(self, iconFileName):
@@ -1833,7 +1772,7 @@ def calcTrayIcon(self, iconFileName, inboxUnreadCount):
# choose font and calculate font parameters
fontName = "Lucida"
fontSize = 10
- font = QtGui.QFont(fontName, fontSize, QtGui.QFont.Bold)
+ font = QtGui.QFont(fontName, fontSize, QtGui.QFont.Weight.Bold)
fontMetrics = QtGui.QFontMetrics(font)
# text
txt = str(inboxUnreadCount)
@@ -1846,14 +1785,15 @@ def calcTrayIcon(self, iconFileName, inboxUnreadCount):
if rect.width() > 20:
txt = "+"
fontSize = 15
- font = QtGui.QFont(fontName, fontSize, QtGui.QFont.Bold)
+ font = QtGui.QFont(fontName, fontSize, QtGui.QFont.Weight.Bold)
fontMetrics = QtGui.QFontMetrics(font)
rect = fontMetrics.boundingRect(txt)
# draw text
painter = QtGui.QPainter()
painter.begin(pixmap)
- painter.setPen(
- QtGui.QPen(QtGui.QColor(255, 0, 0), QtCore.Qt.SolidPattern))
+ pen = QtGui.QPen(QtGui.QColor(255, 0, 0))
+ pen.setBrush(QtGui.QBrush(QtCore.Qt.BrushStyle.SolidPattern))
+ painter.setPen(pen)
painter.setFont(font)
painter.drawText(24-rect.right()-marginX, -rect.top()+marginY, txt)
painter.end()
@@ -1896,7 +1836,7 @@ def updateSentItemStatusByToAddress(self, toAddress, textToDisplay):
continue
for i in range(sent.rowCount()):
- rowAddress = sent.item(i, 0).data(QtCore.Qt.UserRole)
+ rowAddress = sent.item(i, 0).data(QtCore.Qt.ItemDataRole.UserRole)
if toAddress == rowAddress:
sent.item(i, 3).setToolTip(textToDisplay)
try:
@@ -1923,7 +1863,7 @@ def updateSentItemStatusByAckdata(self, ackdata, textToDisplay):
if self.getCurrentFolder(treeWidget) != "sent":
continue
for i in range(sent.rowCount()):
- toAddress = sent.item(i, 0).data(QtCore.Qt.UserRole)
+ toAddress = sent.item(i, 0).data(QtCore.Qt.ItemDataRole.UserRole)
tableAckdata = sent.item(i, 3).data()
status, addressVersionNumber, streamNumber, ripe = decodeAddress(
toAddress)
@@ -1967,14 +1907,14 @@ def newVersionAvailable(self, version):
self.notifiedNewVersion = ".".join(str(n) for n in version)
self.updateStatusBar(_translate(
"MainWindow",
- "New version of PyBitmessage is available: %1. Download it"
+ "New version of PyBitmessage is available: {0}. Download it"
" from https://github.com/Bitmessage/PyBitmessage/releases/latest"
- ).arg(self.notifiedNewVersion)
+ ).format(self.notifiedNewVersion)
)
def displayAlert(self, title, text, exitAfterUserClicksOk):
self.updateStatusBar(text)
- QtGui.QMessageBox.critical(self, title, text, QtGui.QMessageBox.Ok)
+ QtWidgets.QMessageBox.critical(self, title, text, QtWidgets.QMessageBox.StandardButton.Ok)
if exitAfterUserClicksOk:
os._exit(0)
@@ -1995,9 +1935,9 @@ def rerenderMessagelistToLabels(self):
def rerenderAddressBook(self):
def addRow (address, label, type):
self.ui.tableWidgetAddressBook.insertRow(0)
- newItem = Ui_AddressBookWidgetItemLabel(address, unicode(label, 'utf-8'), type)
+ newItem = Ui_AddressBookWidgetItemLabel(address, label, type)
self.ui.tableWidgetAddressBook.setItem(0, 0, newItem)
- newItem = Ui_AddressBookWidgetItemAddress(address, unicode(label, 'utf-8'), type)
+ newItem = Ui_AddressBookWidgetItemAddress(address, label, type)
self.ui.tableWidgetAddressBook.setItem(0, 1, newItem)
oldRows = {}
@@ -2006,7 +1946,7 @@ def addRow (address, label, type):
oldRows[item.address] = [item.label, item.type, i]
if self.ui.tableWidgetAddressBook.rowCount() == 0:
- self.ui.tableWidgetAddressBook.horizontalHeader().setSortIndicator(0, QtCore.Qt.AscendingOrder)
+ self.ui.tableWidgetAddressBook.horizontalHeader().setSortIndicator(0, QtCore.Qt.SortOrder.AscendingOrder)
if self.ui.tableWidgetAddressBook.isSortingEnabled():
self.ui.tableWidgetAddressBook.setSortingEnabled(False)
@@ -2015,6 +1955,8 @@ def addRow (address, label, type):
queryreturn = sqlQuery('SELECT label, address FROM subscriptions WHERE enabled = 1')
for row in queryreturn:
label, address = row
+ label = label.decode('utf-8', 'replace')
+ address = address.decode('utf-8', 'replace')
newRows[address] = [label, AccountMixin.SUBSCRIPTION]
# chans
for address in config.addresses(True):
@@ -2025,6 +1967,8 @@ def addRow (address, label, type):
queryreturn = sqlQuery('SELECT * FROM addressbook')
for row in queryreturn:
label, address = row
+ label = label.decode('utf-8', 'replace')
+ address = address.decode('utf-8', 'replace')
newRows[address] = [label, AccountMixin.NORMAL]
completerList = []
@@ -2038,11 +1982,11 @@ def addRow (address, label, type):
self.ui.tableWidgetAddressBook.removeRow(oldRows[address][2])
for address in newRows:
addRow(address, newRows[address][0], newRows[address][1])
- completerList.append(unicode(newRows[address][0], encoding="UTF-8") + " <" + address + ">")
+ completerList.append(newRows[address][0] + " <" + address + ">")
# sort
self.ui.tableWidgetAddressBook.sortByColumn(
- 0, QtCore.Qt.AscendingOrder)
+ 0, QtCore.Qt.SortOrder.AscendingOrder)
self.ui.tableWidgetAddressBook.setSortingEnabled(True)
self.ui.lineEditTo.completer().model().setStringList(completerList)
@@ -2050,7 +1994,7 @@ def rerenderSubscriptions(self):
self.rerenderTabTreeSubscriptions()
def click_pushButtonTTL(self):
- QtGui.QMessageBox.information(
+ QtWidgets.QMessageBox.information(
self,
'Time To Live',
_translate(
@@ -2059,16 +2003,20 @@ def click_pushButtonTTL(self):
,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."""),
- QtGui.QMessageBox.Ok)
+ QtWidgets.QMessageBox.StandardButton.Ok)
def click_pushButtonClear(self):
self.ui.lineEditSubject.setText("")
self.ui.lineEditTo.setText("")
- self.ui.textEditMessage.reset()
+ self.ui.textEditMessage.clear()
self.ui.comboBoxSendFrom.setCurrentIndex(0)
+ self.ui.comboBoxSendFromBroadcast.setCurrentIndex(0)
+ self.ui.lineEditSubjectBroadcast.setText('')
+ self.ui.textEditMessageBroadcast.clear()
+
def click_pushButtonSend(self):
- encoding = 3 if QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ShiftModifier else 2
+ encoding = 3 if QtWidgets.QApplication.queryKeyboardModifiers() & QtCore.Qt.KeyboardModifier.ShiftModifier else 2
self.statusbar.clearMessage()
@@ -2076,22 +2024,20 @@ def click_pushButtonSend(self):
self.ui.tabWidgetSend.indexOf(self.ui.sendDirect):
# message to specific people
sendMessageToPeople = True
- fromAddress = str(self.ui.comboBoxSendFrom.itemData(
+ fromAddress = self.ui.comboBoxSendFrom.itemData(
self.ui.comboBoxSendFrom.currentIndex(),
- QtCore.Qt.UserRole).toString())
- toAddresses = str(self.ui.lineEditTo.text().toUtf8())
- subject = str(self.ui.lineEditSubject.text().toUtf8())
- message = str(
- self.ui.textEditMessage.document().toPlainText().toUtf8())
+ QtCore.Qt.ItemDataRole.UserRole)
+ toAddresses = self.ui.lineEditTo.text()
+ subject = self.ui.lineEditSubject.text()
+ message = self.ui.textEditMessage.document().toPlainText()
else:
# broadcast message
sendMessageToPeople = False
- fromAddress = str(self.ui.comboBoxSendFromBroadcast.itemData(
+ fromAddress = self.ui.comboBoxSendFromBroadcast.itemData(
self.ui.comboBoxSendFromBroadcast.currentIndex(),
- QtCore.Qt.UserRole).toString())
- subject = str(self.ui.lineEditSubjectBroadcast.text().toUtf8())
- message = str(
- self.ui.textEditMessageBroadcast.document().toPlainText().toUtf8())
+ QtCore.Qt.ItemDataRole.UserRole)
+ subject = self.ui.lineEditSubjectBroadcast.text()
+ message = self.ui.textEditMessageBroadcast.document().toPlainText()
"""
The whole network message must fit in 2^18 bytes.
Let's assume 500 bytes of overhead. If someone wants to get that
@@ -2100,14 +2046,14 @@ def click_pushButtonSend(self):
users can send messages of any length.
"""
if len(message) > (2 ** 18 - 500):
- QtGui.QMessageBox.about(
+ QtWidgets.QMessageBox.about(
self, _translate("MainWindow", "Message too long"),
_translate(
"MainWindow",
"The message that you are trying to send is too long"
- " by %1 bytes. (The maximum is 261644 bytes). Please"
+ " by {0} bytes. (The maximum is 261644 bytes). Please"
" cut it down before sending."
- ).arg(len(message) - (2 ** 18 - 500)))
+ ).format(len(message) - (2 ** 18 - 500)))
return
acct = accountClass(fromAddress)
@@ -2132,14 +2078,14 @@ def click_pushButtonSend(self):
subject = acct.subject
toAddress = acct.toAddress
else:
- if QtGui.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?"),
- QtGui.QMessageBox.Yes|QtGui.QMessageBox.No) != QtGui.QMessageBox.Yes:
+ QtWidgets.QMessageBox.StandardButton.Yes|QtWidgets.QMessageBox.StandardButton.No) != QtWidgets.QMessageBox.StandardButton.Yes:
continue
email = acct.getLabel()
if email[-14:] != "@mailchuck.com": # attempt register
@@ -2156,15 +2102,15 @@ def click_pushButtonSend(self):
"MainWindow",
"Error: Your account wasn't registered at"
" an email gateway. Sending registration"
- " now as %1, please wait for the registration"
+ " now as {0}, please wait for the registration"
" to be processed before retrying sending."
- ).arg(email)
+ ).format(email)
)
return
status, addressVersionNumber, streamNumber = decodeAddress(toAddress)[:3]
if status != 'success':
try:
- toAddress = unicode(toAddress, 'utf-8', 'ignore')
+ toAddress = toAddress
except:
pass
logger.error('Error: Could not decode recipient address ' + toAddress + ':' + status)
@@ -2173,58 +2119,58 @@ def click_pushButtonSend(self):
self.updateStatusBar(_translate(
"MainWindow",
"Error: Bitmessage addresses start with"
- " BM- Please check the recipient address %1"
- ).arg(toAddress))
+ " BM- Please check the recipient address {0}"
+ ).format(toAddress))
elif status == 'checksumfailed':
self.updateStatusBar(_translate(
"MainWindow",
- "Error: The recipient address %1 is not"
+ "Error: The recipient address {0} is not"
" typed or copied correctly. Please check it."
- ).arg(toAddress))
+ ).format(toAddress))
elif status == 'invalidcharacters':
self.updateStatusBar(_translate(
"MainWindow",
- "Error: The recipient address %1 contains"
+ "Error: The recipient address {0} contains"
" invalid characters. Please check it."
- ).arg(toAddress))
+ ).format(toAddress))
elif status == 'versiontoohigh':
self.updateStatusBar(_translate(
"MainWindow",
"Error: The version of the recipient address"
- " %1 is too high. Either you need to upgrade"
+ " {0} is too high. Either you need to upgrade"
" your Bitmessage software or your"
" acquaintance is being clever."
- ).arg(toAddress))
+ ).format(toAddress))
elif status == 'ripetooshort':
self.updateStatusBar(_translate(
"MainWindow",
"Error: Some data encoded in the recipient"
- " address %1 is too short. There might be"
+ " address {0} is too short. There might be"
" something wrong with the software of"
" your acquaintance."
- ).arg(toAddress))
+ ).format(toAddress))
elif status == 'ripetoolong':
self.updateStatusBar(_translate(
"MainWindow",
"Error: Some data encoded in the recipient"
- " address %1 is too long. There might be"
+ " address {0} is too long. There might be"
" something wrong with the software of"
" your acquaintance."
- ).arg(toAddress))
+ ).format(toAddress))
elif status == 'varintmalformed':
self.updateStatusBar(_translate(
"MainWindow",
"Error: Some data encoded in the recipient"
- " address %1 is malformed. There might be"
+ " address {0} is malformed. There might be"
" something wrong with the software of"
" your acquaintance."
- ).arg(toAddress))
+ ).format(toAddress))
else:
self.updateStatusBar(_translate(
"MainWindow",
"Error: Something is wrong with the"
- " recipient address %1."
- ).arg(toAddress))
+ " recipient address {0}."
+ ).format(toAddress))
elif fromAddress == '':
self.updateStatusBar(_translate(
"MainWindow",
@@ -2236,24 +2182,24 @@ def click_pushButtonSend(self):
toAddress = addBMIfNotPresent(toAddress)
if addressVersionNumber > 4 or addressVersionNumber <= 1:
- QtGui.QMessageBox.about(
+ QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Address version number"),
_translate(
"MainWindow",
- "Concerning the address %1, Bitmessage cannot understand address version numbers"
- " of %2. Perhaps upgrade Bitmessage to the latest version."
- ).arg(toAddress).arg(str(addressVersionNumber)))
+ "Concerning the address {0}, Bitmessage cannot understand address version numbers"
+ " of {1}. Perhaps upgrade Bitmessage to the latest version."
+ ).format(toAddress, str(addressVersionNumber)))
continue
if streamNumber > 1 or streamNumber == 0:
- QtGui.QMessageBox.about(
+ QtWidgets.QMessageBox.about(
self,
_translate("MainWindow", "Stream number"),
_translate(
"MainWindow",
- "Concerning the address %1, Bitmessage cannot handle stream numbers of %2."
+ "Concerning the address {0}, Bitmessage cannot handle stream numbers of {1}."
" Perhaps upgrade Bitmessage to the latest version."
- ).arg(toAddress).arg(str(streamNumber)))
+ ).format(toAddress, str(streamNumber)))
continue
self.statusbar.clearMessage()
if state.statusIconColor == 'red':
@@ -2273,6 +2219,7 @@ def click_pushButtonSend(self):
if queryreturn != []:
for row in queryreturn:
toLabel, = row
+ toLabel = toLabel.decode('utf-8', 'replace')
self.displayNewSentMessage(
toAddress, toLabel, fromAddress, subject, message, ackdata)
@@ -2317,7 +2264,7 @@ def click_pushButtonSend(self):
self.ui.comboBoxSendFromBroadcast.setCurrentIndex(0)
self.ui.lineEditSubjectBroadcast.setText('')
- self.ui.textEditMessageBroadcast.reset()
+ self.ui.textEditMessageBroadcast.clear()
self.ui.tabWidget.setCurrentIndex(
self.ui.tabWidget.indexOf(self.ui.send)
)
@@ -2338,11 +2285,11 @@ def click_pushButtonLoadFromAddressBook(self):
))
def click_pushButtonFetchNamecoinID(self):
- identities = str(self.ui.lineEditTo.text().toUtf8()).split(";")
+ identities = self.ui.lineEditTo.text().split(";")
err, addr = self.namecoin.query(identities[-1].strip())
if err is not None:
self.updateStatusBar(
- _translate("MainWindow", "Error: %1").arg(err))
+ _translate("MainWindow", "Error: {0}").format(err))
else:
identities[-1] = addr
self.ui.lineEditTo.setText("; ".join(identities))
@@ -2368,17 +2315,17 @@ def rerenderComboBoxSendFrom(self):
addressInKeysFile, 'enabled')
isMaillinglist = config.safeGetBoolean(addressInKeysFile, 'mailinglist')
if isEnabled and not isMaillinglist:
- label = unicode(config.get(addressInKeysFile, 'label'), 'utf-8', 'ignore').strip()
+ label = config.get(addressInKeysFile, 'label').strip()
if label == "":
label = addressInKeysFile
self.ui.comboBoxSendFrom.addItem(avatarize(addressInKeysFile), label, addressInKeysFile)
-# self.ui.comboBoxSendFrom.model().sort(1, Qt.AscendingOrder)
+# self.ui.comboBoxSendFrom.model().sort(1, QtCore.Qt.SortOrder.AscendingOrder)
for i in range(self.ui.comboBoxSendFrom.count()):
- address = str(self.ui.comboBoxSendFrom.itemData(
- i, QtCore.Qt.UserRole).toString())
+ address = self.ui.comboBoxSendFrom.itemData(
+ i, QtCore.Qt.ItemDataRole.UserRole)
self.ui.comboBoxSendFrom.setItemData(
i, AccountColor(address).accountColor(),
- QtCore.Qt.ForegroundRole)
+ QtCore.Qt.ItemDataRole.ForegroundRole)
self.ui.comboBoxSendFrom.insertItem(0, '', '')
if(self.ui.comboBoxSendFrom.count() == 2):
self.ui.comboBoxSendFrom.setCurrentIndex(1)
@@ -2392,16 +2339,16 @@ def rerenderComboBoxSendFromBroadcast(self):
addressInKeysFile, 'enabled')
isChan = config.safeGetBoolean(addressInKeysFile, 'chan')
if isEnabled and not isChan:
- label = unicode(config.get(addressInKeysFile, 'label'), 'utf-8', 'ignore').strip()
+ label = config.get(addressInKeysFile, 'label').strip()
if label == "":
label = addressInKeysFile
self.ui.comboBoxSendFromBroadcast.addItem(avatarize(addressInKeysFile), label, addressInKeysFile)
for i in range(self.ui.comboBoxSendFromBroadcast.count()):
- address = str(self.ui.comboBoxSendFromBroadcast.itemData(
- i, QtCore.Qt.UserRole).toString())
+ address = self.ui.comboBoxSendFromBroadcast.itemData(
+ i, QtCore.Qt.ItemDataRole.UserRole)
self.ui.comboBoxSendFromBroadcast.setItemData(
i, AccountColor(address).accountColor(),
- QtCore.Qt.ForegroundRole)
+ QtCore.Qt.ItemDataRole.ForegroundRole)
self.ui.comboBoxSendFromBroadcast.insertItem(0, '', '')
if(self.ui.comboBoxSendFromBroadcast.count() == 2):
self.ui.comboBoxSendFromBroadcast.setCurrentIndex(1)
@@ -2497,8 +2444,8 @@ def displayNewInboxMessage(
'bitmessagesettings', 'showtraynotifications'):
self.notifierShow(
_translate("MainWindow", "New Message"),
- _translate("MainWindow", "From %1").arg(
- unicode(acct.fromLabel, 'utf-8')),
+ _translate("MainWindow", "From {0}").format(
+ acct.fromLabel),
sound.SOUND_UNKNOWN
)
if self.getCurrentAccount() is not None and (
@@ -2513,7 +2460,7 @@ def displayNewInboxMessage(
if acct.feedback != GatewayAccount.ALL_OK:
if acct.feedback == GatewayAccount.REGISTRATION_DENIED:
dialogs.EmailGatewayDialog(
- self, config, acct).exec_()
+ self, config, acct).exec()
# possible other branches?
except AttributeError:
pass
@@ -2521,7 +2468,7 @@ def displayNewInboxMessage(
def click_pushButtonAddAddressBook(self, dialog=None):
if not dialog:
dialog = dialogs.AddAddressDialog(self)
- dialog.exec_()
+ dialog.exec()
try:
address, label = dialog.data
except AttributeError:
@@ -2566,7 +2513,7 @@ def addSubscription(self, address, label):
def click_pushButtonAddSubscription(self):
dialog = dialogs.NewSubscriptionDialog(self)
- dialog.exec_()
+ dialog.exec()
try:
address, label = dialog.data
except AttributeError:
@@ -2595,19 +2542,19 @@ def click_pushButtonAddSubscription(self):
))
def click_pushButtonStatusIcon(self):
- dialogs.IconGlossaryDialog(self, config=config).exec_()
+ dialogs.IconGlossaryDialog(self, config=config).exec()
def click_actionHelp(self):
- dialogs.HelpDialog(self).exec_()
+ dialogs.HelpDialog(self).exec()
def click_actionSupport(self):
support.createSupportMessage(self)
def click_actionAbout(self):
- dialogs.AboutDialog(self).exec_()
+ dialogs.AboutDialog(self).exec()
def click_actionSettings(self):
- dialogs.SettingsDialog(self, firstrun=self._firstrun).exec_()
+ dialogs.SettingsDialog(self, firstrun=self._firstrun).exec()
def on_action_Send(self):
"""Send message to current selected address"""
@@ -2627,7 +2574,7 @@ def on_action_SpecialAddressBehaviorDialog(self):
def on_action_EmailGatewayDialog(self):
dialog = dialogs.EmailGatewayDialog(self, config=config)
# For Modal dialogs
- dialog.exec_()
+ dialog.exec()
try:
acct = dialog.data
except AttributeError:
@@ -2655,13 +2602,13 @@ def on_action_EmailGatewayDialog(self):
self.ui.textEditMessage.setFocus()
def on_action_MarkAllRead(self):
- if QtGui.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?"
- ), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
- ) != QtGui.QMessageBox.Yes:
+ ), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
+ ) != QtWidgets.QMessageBox.StandardButton.Yes:
return
tableWidget = self.getCurrentMessagelist()
@@ -2689,7 +2636,7 @@ def click_NewAddressDialog(self):
def network_switch(self):
dontconnect_option = not config.safeGetBoolean(
'bitmessagesettings', 'dontconnect')
- reply = QtGui.QMessageBox.question(
+ reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Disconnecting")
if dontconnect_option else _translate("MainWindow", "Connecting"),
_translate(
@@ -2698,9 +2645,9 @@ def network_switch(self):
) if dontconnect_option else _translate(
"MainWindow",
"Bitmessage will now start connecting to network. Are you sure?"
- ), QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel,
- QtGui.QMessageBox.Cancel)
- if reply != QtGui.QMessageBox.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))
@@ -2727,29 +2674,29 @@ def quit(self):
# C PoW currently doesn't support interrupting and OpenCL is untested
if getPowType() == "python" and (powQueueSize() > 0 or pendingUpload() > 0):
- reply = QtGui.QMessageBox.question(
+ reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Proof of work pending"),
_translate(
"MainWindow",
"%n object(s) pending proof of work", None,
- QtCore.QCoreApplication.CodecForTr, powQueueSize()
+ powQueueSize()
) + ", " +
_translate(
"MainWindow",
"%n object(s) waiting to be distributed", None,
- QtCore.QCoreApplication.CodecForTr, pendingUpload()
+ pendingUpload()
) + "\n\n" +
_translate(
"MainWindow", "Wait until these tasks finish?"),
- QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
- | QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Cancel)
- if reply == QtGui.QMessageBox.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 == QtGui.QMessageBox.Cancel:
+ elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
return
if pendingDownload() > 0:
- reply = QtGui.QMessageBox.question(
+ reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Synchronisation pending"),
_translate(
"MainWindow",
@@ -2757,18 +2704,18 @@ def quit(self):
" %n object(s) to be downloaded. If you quit now,"
" it may cause delivery delays. Wait until the"
" synchronisation finishes?", None,
- QtCore.QCoreApplication.CodecForTr, pendingDownload()
+ pendingDownload()
),
- QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
- | QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Cancel)
- if reply == QtGui.QMessageBox.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 == QtGui.QMessageBox.Cancel:
+ elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
return
if state.statusIconColor == 'red' and not config.safeGetBoolean(
'bitmessagesettings', 'dontconnect'):
- reply = QtGui.QMessageBox.question(
+ reply = QtWidgets.QMessageBox.question(
self, _translate("MainWindow", "Not connected"),
_translate(
"MainWindow",
@@ -2776,18 +2723,18 @@ def quit(self):
" quit now, it may cause delivery delays. Wait until"
" connected and the synchronisation finishes?"
),
- QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
- | QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Cancel)
- if reply == QtGui.QMessageBox.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 == QtGui.QMessageBox.Cancel:
+ elif reply == QtWidgets.QMessageBox.StandardButton.Cancel:
return
self.quitAccepted = True
self.updateStatusBar(_translate(
- "MainWindow", "Shutting down PyBitmessage... %1%").arg(0))
+ "MainWindow", "Shutting down PyBitmessage... {0}%").format(0))
if waitForConnection:
self.updateStatusBar(_translate(
@@ -2795,7 +2742,7 @@ def quit(self):
while state.statusIconColor == 'red':
time.sleep(0.5)
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
# this probably will not work correctly, because there is a delay
@@ -2807,7 +2754,7 @@ def quit(self):
while pendingDownload() > 0:
time.sleep(0.5)
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
if waitForPow:
@@ -2821,57 +2768,57 @@ def quit(self):
maxWorkerQueue = curWorkerQueue
if curWorkerQueue > 0:
self.updateStatusBar(_translate(
- "MainWindow", "Waiting for PoW to finish... %1%"
- ).arg(50 * (maxWorkerQueue - curWorkerQueue) /
+ "MainWindow", "Waiting for PoW to finish... {0}%"
+ ).format(50 * (maxWorkerQueue - curWorkerQueue) /
maxWorkerQueue))
time.sleep(0.5)
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
self.updateStatusBar(_translate(
- "MainWindow", "Shutting down Pybitmessage... %1%").arg(50))
+ "MainWindow", "Shutting down Pybitmessage... {0}%").format(50))
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
if maxWorkerQueue > 0:
# a bit of time so that the hashHolder is populated
time.sleep(0.5)
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
# check if upload (of objects created locally) pending
self.updateStatusBar(_translate(
- "MainWindow", "Waiting for objects to be sent... %1%").arg(50))
+ "MainWindow", "Waiting for objects to be sent... {0}%").format(50))
maxPendingUpload = max(1, pendingUpload())
while pendingUpload() > 1:
self.updateStatusBar(_translate(
"MainWindow",
- "Waiting for objects to be sent... %1%"
- ).arg(int(50 + 20 * (pendingUpload() / maxPendingUpload))))
+ "Waiting for objects to be sent... {0}%"
+ ).format(int(50 + 20 * (pendingUpload() / maxPendingUpload))))
time.sleep(0.5)
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
# save state and geometry self and all widgets
self.updateStatusBar(_translate(
- "MainWindow", "Saving settings... %1%").arg(70))
+ "MainWindow", "Saving settings... {0}%").format(70))
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
self.saveSettings()
- for attr, obj in self.ui.__dict__.iteritems():
+ for attr, obj in self.ui.__dict__.items():
if hasattr(obj, "__class__") \
and isinstance(obj, settingsmixin.SettingsMixin):
saveMethod = getattr(obj, "saveSettings", None)
@@ -2879,18 +2826,18 @@ def quit(self):
obj.saveSettings()
self.updateStatusBar(_translate(
- "MainWindow", "Shutting down core... %1%").arg(80))
+ "MainWindow", "Shutting down core... {0}%").format(80))
QtCore.QCoreApplication.processEvents(
- QtCore.QEventLoop.AllEvents, 1000
+ QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 1000
)
shutdown.doCleanShutdown()
self.updateStatusBar(_translate(
- "MainWindow", "Stopping notifications... %1%").arg(90))
+ "MainWindow", "Stopping notifications... {0}%").format(90))
self.tray.hide()
self.updateStatusBar(_translate(
- "MainWindow", "Shutdown imminent... %1%").arg(100))
+ "MainWindow", "Shutdown imminent... {0}%").format(100))
logger.info("Shutdown complete")
self.close()
@@ -2920,6 +2867,7 @@ def on_action_InboxMessageForceHtml(self):
if queryreturn != []:
for row in queryreturn:
messageText, = row
+ messageText = messageText.decode('utf-8', 'replace')
lines = messageText.split('\n')
totalLines = len(lines)
@@ -2934,8 +2882,7 @@ def on_action_InboxMessageForceHtml(self):
lines[i] = '
'
content = ' '.join(lines) # To keep the whitespace between lines
content = shared.fixPotentiallyInvalidUTF8Data(content)
- content = unicode(content, 'utf-8)')
- textEdit.setHtml(QtCore.QString(content))
+ textEdit.setHtml(content)
def on_action_InboxMarkUnread(self):
tableWidget = self.getCurrentMessagelist()
@@ -3002,7 +2949,7 @@ def setSendFromComboBox(self, address=None):
self.ui.comboBoxSendFrom, self.ui.comboBoxSendFromBroadcast
):
for i in range(box.count()):
- if str(box.itemData(i).toPyObject()) == address:
+ if box.itemData(i) == address:
box.setCurrentIndex(i)
break
else:
@@ -3043,6 +2990,7 @@ def on_action_InboxReply(self, reply_type=None):
if queryreturn != []:
for row in queryreturn:
messageAtCurrentInboxRow, = row
+ messageAtCurrentInboxRow = messageAtCurrentInboxRow.decode('utf-8', 'replace')
acct.parseMessage(
toAddressAtCurrentInboxRow, fromAddressAtCurrentInboxRow,
tableWidget.item(currentInboxRow, 2).subject,
@@ -3059,23 +3007,23 @@ def on_action_InboxReply(self, reply_type=None):
)
# toAddressAtCurrentInboxRow = fromAddressAtCurrentInboxRow
elif not config.has_section(toAddressAtCurrentInboxRow):
- QtGui.QMessageBox.information(
+ QtWidgets.QMessageBox.information(
self, _translate("MainWindow", "Address is gone"),
_translate(
"MainWindow",
- "Bitmessage cannot find your address %1. Perhaps you"
+ "Bitmessage cannot find your address {0}. Perhaps you"
" removed it?"
- ).arg(toAddressAtCurrentInboxRow), QtGui.QMessageBox.Ok)
+ ).format(toAddressAtCurrentInboxRow), QtWidgets.QMessageBox.StandardButton.Ok)
elif not config.getboolean(
toAddressAtCurrentInboxRow, 'enabled'):
- QtGui.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."
- ), QtGui.QMessageBox.Ok)
+ ), QtWidgets.QMessageBox.StandardButton.Ok)
else:
self.setBroadcastEnablementDependingOnWhetherThisIsAMailingListAddress(toAddressAtCurrentInboxRow)
broadcast_tab_index = self.ui.tabWidgetSend.indexOf(
@@ -3117,7 +3065,7 @@ def on_action_InboxReply(self, reply_type=None):
self.setSendFromComboBox(toAddressAtCurrentInboxRow)
quotedText = self.quoted_text(
- unicode(messageAtCurrentInboxRow, 'utf-8', 'replace'))
+ messageAtCurrentInboxRow)
widget['message'].setPlainText(quotedText)
if acct.subject[0:3] in ('Re:', 'RE:'):
widget['subject'].setText(
@@ -3136,7 +3084,7 @@ def on_action_InboxAddSenderToAddressBook(self):
return
currentInboxRow = tableWidget.currentRow()
addressAtCurrentInboxRow = tableWidget.item(
- currentInboxRow, 1).data(QtCore.Qt.UserRole)
+ currentInboxRow, 1).data(QtCore.Qt.ItemDataRole.UserRole)
self.ui.tabWidget.setCurrentIndex(
self.ui.tabWidget.indexOf(self.ui.send)
)
@@ -3149,9 +3097,9 @@ def on_action_InboxAddSenderToBlackList(self):
return
currentInboxRow = tableWidget.currentRow()
addressAtCurrentInboxRow = tableWidget.item(
- currentInboxRow, 1).data(QtCore.Qt.UserRole)
+ currentInboxRow, 1).data(QtCore.Qt.ItemDataRole.UserRole)
recipientAddress = tableWidget.item(
- currentInboxRow, 0).data(QtCore.Qt.UserRole)
+ currentInboxRow, 0).data(QtCore.Qt.ItemDataRole.UserRole)
# Let's make sure that it isn't already in the address book
queryreturn = sqlQuery('''select * from blacklist where address=?''',
addressAtCurrentInboxRow)
@@ -3203,7 +3151,7 @@ def on_action_InboxTrash(self):
return
currentRow = 0
folder = self.getCurrentFolder()
- shifted = QtGui.QApplication.queryKeyboardModifiers() \
+ shifted = QtWidgets.QApplication.queryKeyboardModifiers() \
& QtCore.Qt.ShiftModifier
tableWidget.setUpdatesEnabled(False)
inventoryHashesToTrash = set()
@@ -3263,7 +3211,7 @@ def on_action_InboxSaveMessageAs(self):
currentInboxRow = tableWidget.currentRow()
try:
subjectAtCurrentInboxRow = str(tableWidget.item(
- currentInboxRow, 2).data(QtCore.Qt.UserRole))
+ currentInboxRow, 2).data(QtCore.Qt.ItemDataRole.UserRole))
except:
subjectAtCurrentInboxRow = ''
@@ -3274,9 +3222,10 @@ def on_action_InboxSaveMessageAs(self):
if queryreturn != []:
for row in queryreturn:
message, = row
+ message = message.decode('utf-8', 'replace')
defaultFilename = "".join(x for x in subjectAtCurrentInboxRow if x.isalnum()) + '.txt'
- filename = QtGui.QFileDialog.getSaveFileName(
+ filename = QtWidgets.QFileDialog.getSaveFileName(
self,
_translate("MainWindow","Save As..."),
defaultFilename,
@@ -3297,7 +3246,7 @@ def on_action_SentTrash(self):
if not tableWidget:
return
folder = self.getCurrentFolder()
- shifted = QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ShiftModifier
+ shifted = QtWidgets.QApplication.queryKeyboardModifiers() & QtCore.Qt.ShiftModifier
while tableWidget.selectedIndexes() != []:
currentRow = tableWidget.selectedIndexes()[0].row()
ackdataToTrash = tableWidget.item(currentRow, 3).data()
@@ -3317,7 +3266,7 @@ def on_action_SentTrash(self):
def on_action_ForceSend(self):
currentRow = self.ui.tableWidgetInbox.currentRow()
addressAtCurrentRow = self.ui.tableWidgetInbox.item(
- currentRow, 0).data(QtCore.Qt.UserRole)
+ currentRow, 0).data(QtCore.Qt.ItemDataRole.UserRole)
toRipe = decodeAddress(addressAtCurrentRow)[3]
sqlExecute(
'''UPDATE sent SET status='forcepow' WHERE toripe=? AND status='toodifficult' and folder='sent' ''',
@@ -3332,8 +3281,8 @@ def on_action_ForceSend(self):
def on_action_SentClipboard(self):
currentRow = self.ui.tableWidgetInbox.currentRow()
addressAtCurrentRow = self.ui.tableWidgetInbox.item(
- currentRow, 0).data(QtCore.Qt.UserRole)
- clipboard = QtGui.QApplication.clipboard()
+ currentRow, 0).data(QtCore.Qt.ItemDataRole.UserRole)
+ clipboard = QtWidgets.QApplication.clipboard()
clipboard.setText(str(addressAtCurrentRow))
# Group of functions for the Address Book dialog box
@@ -3358,7 +3307,7 @@ def on_action_AddressBookClipboard(self):
addresses_string = item.address
else:
addresses_string += ', ' + item.address
- clipboard = QtGui.QApplication.clipboard()
+ clipboard = QtWidgets.QApplication.clipboard()
clipboard.setText(addresses_string)
def on_action_AddressBookSend(self):
@@ -3368,8 +3317,7 @@ def on_action_AddressBookSend(self):
return self.updateStatusBar(_translate(
"MainWindow", "No addresses selected."))
- addresses_string = unicode(
- self.ui.lineEditTo.text().toUtf8(), 'utf-8')
+ addresses_string = self.ui.lineEditTo.text()
for item in selected_items:
address_string = item.accountString()
if not addresses_string:
@@ -3400,7 +3348,7 @@ def on_action_AddressBookSubscribe(self):
)
def on_context_menuAddressBook(self, point):
- self.popMenuAddressBook = QtGui.QMenu(self)
+ self.popMenuAddressBook = QtWidgets.QMenu(self)
self.popMenuAddressBook.addAction(self.actionAddressBookSend)
self.popMenuAddressBook.addAction(self.actionAddressBookClipboard)
self.popMenuAddressBook.addAction(self.actionAddressBookSubscribe)
@@ -3422,7 +3370,7 @@ def on_context_menuAddressBook(self, point):
self.popMenuAddressBook.addSeparator()
for plugin in self.menu_plugins['address']:
self.popMenuAddressBook.addAction(plugin)
- self.popMenuAddressBook.exec_(
+ self.popMenuAddressBook.exec(
self.ui.tableWidgetAddressBook.mapToGlobal(point))
# Group of functions for the Subscriptions dialog box
@@ -3430,7 +3378,7 @@ def on_action_SubscriptionsNew(self):
self.click_pushButtonAddSubscription()
def on_action_SubscriptionsDelete(self):
- if QtGui.QMessageBox.question(
+ if QtWidgets.QMessageBox.question(
self, "Delete subscription?",
_translate(
"MainWindow",
@@ -3441,8 +3389,8 @@ def on_action_SubscriptionsDelete(self):
" messages, but you can still view messages you"
" already received.\n\nAre you sure you want to"
" delete the subscription?"
- ), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
- ) != QtGui.QMessageBox.Yes:
+ ), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
+ ) != QtWidgets.QMessageBox.StandardButton.Yes:
return
address = self.getCurrentAccount()
sqlExecute('''DELETE FROM subscriptions WHERE address=?''',
@@ -3454,7 +3402,7 @@ def on_action_SubscriptionsDelete(self):
def on_action_SubscriptionsClipboard(self):
address = self.getCurrentAccount()
- clipboard = QtGui.QApplication.clipboard()
+ clipboard = QtWidgets.QApplication.clipboard()
clipboard.setText(str(address))
def on_action_SubscriptionsEnable(self):
@@ -3479,7 +3427,7 @@ def on_action_SubscriptionsDisable(self):
def on_context_menuSubscriptions(self, point):
currentItem = self.getCurrentItem()
- self.popMenuSubscriptions = QtGui.QMenu(self)
+ self.popMenuSubscriptions = QtWidgets.QMenu(self)
if isinstance(currentItem, Ui_AddressWidget):
self.popMenuSubscriptions.addAction(self.actionsubscriptionsNew)
self.popMenuSubscriptions.addAction(self.actionsubscriptionsDelete)
@@ -3503,7 +3451,7 @@ def on_context_menuSubscriptions(self, point):
self.popMenuSubscriptions.addAction(self.actionMarkAllRead)
if self.popMenuSubscriptions.isEmpty():
return
- self.popMenuSubscriptions.exec_(
+ self.popMenuSubscriptions.exec(
self.ui.treeWidgetSubscriptions.mapToGlobal(point))
def widgetConvert(self, widget):
@@ -3609,7 +3557,7 @@ def getCurrentSearchLine(self, currentIndex=None, retObj=False):
if currentIndex >= 0 and currentIndex < len(messagelistList):
return (
messagelistList[currentIndex] if retObj
- else messagelistList[currentIndex].text().toUtf8().data())
+ else messagelistList[currentIndex].text())
def getCurrentSearchOption(self, currentIndex=None):
if currentIndex is None:
@@ -3665,7 +3613,7 @@ def on_action_YourIdentitiesDelete(self):
if account.type == AccountMixin.NORMAL:
return # maybe in the future
elif account.type == AccountMixin.CHAN:
- if QtGui.QMessageBox.question(
+ if QtWidgets.QMessageBox.question(
self, "Delete channel?",
_translate(
"MainWindow",
@@ -3676,8 +3624,8 @@ def on_action_YourIdentitiesDelete(self):
" messages, but you can still view messages you"
" already received.\n\nAre you sure you want to"
" delete the channel?"
- ), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
- ) == QtGui.QMessageBox.Yes:
+ ), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
+ ) == QtWidgets.QMessageBox.StandardButton.Yes:
config.remove_section(str(account.address))
else:
return
@@ -3718,7 +3666,7 @@ def disableIdentity(self, address):
def on_action_Clipboard(self):
address = self.getCurrentAccount()
- clipboard = QtGui.QApplication.clipboard()
+ clipboard = QtWidgets.QApplication.clipboard()
clipboard.setText(str(address))
def on_action_ClipboardMessagelist(self):
@@ -3730,20 +3678,20 @@ def on_action_ClipboardMessagelist(self):
currentColumn = 0 if currentFolder == "sent" else 1
if currentFolder == "sent":
- myAddress = tableWidget.item(currentRow, 1).data(QtCore.Qt.UserRole)
- otherAddress = tableWidget.item(currentRow, 0).data(QtCore.Qt.UserRole)
+ myAddress = tableWidget.item(currentRow, 1).data(QtCore.Qt.ItemDataRole.UserRole)
+ otherAddress = tableWidget.item(currentRow, 0).data(QtCore.Qt.ItemDataRole.UserRole)
else:
- myAddress = tableWidget.item(currentRow, 0).data(QtCore.Qt.UserRole)
- otherAddress = tableWidget.item(currentRow, 1).data(QtCore.Qt.UserRole)
+ myAddress = tableWidget.item(currentRow, 0).data(QtCore.Qt.ItemDataRole.UserRole)
+ otherAddress = tableWidget.item(currentRow, 1).data(QtCore.Qt.ItemDataRole.UserRole)
account = accountClass(myAddress)
if isinstance(account, GatewayAccount) and otherAddress == account.relayAddress and (
(currentColumn in [0, 2] and self.getCurrentFolder() == "sent") or
(currentColumn in [1, 2] and self.getCurrentFolder() != "sent")):
text = str(tableWidget.item(currentRow, currentColumn).label)
else:
- text = tableWidget.item(currentRow, currentColumn).data(QtCore.Qt.UserRole)
+ text = tableWidget.item(currentRow, currentColumn).data(QtCore.Qt.ItemDataRole.UserRole)
- clipboard = QtGui.QApplication.clipboard()
+ clipboard = QtWidgets.QApplication.clipboard()
clipboard.setText(text)
# set avatar functions
@@ -3801,7 +3749,7 @@ def setAvatar(self, addressAtCurrentRow):
current_files += [upper]
filters[0:0] = ['Image files (' + ' '.join(all_images_filter) + ')']
filters[1:1] = ['All files (*.*)']
- sourcefile = QtGui.QFileDialog.getOpenFileName(
+ sourcefile = QtWidgets.QFileDialog.getOpenFileName(
self, _translate("MainWindow", "Set avatar..."),
filter=';;'.join(filters)
)
@@ -3813,11 +3761,11 @@ def setAvatar(self, addressAtCurrentRow):
if exists | (len(current_files) > 0):
displayMsg = _translate(
"MainWindow", "Do you really want to remove this avatar?")
- overwrite = QtGui.QMessageBox.question(
+ overwrite = QtWidgets.QMessageBox.question(
self, 'Message', displayMsg,
- QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
+ QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
else:
- overwrite = QtGui.QMessageBox.No
+ overwrite = QtWidgets.QMessageBox.StandardButton.No
else:
# ask whether to overwrite old avatar
if exists | (len(current_files) > 0):
@@ -3825,15 +3773,15 @@ def setAvatar(self, addressAtCurrentRow):
"MainWindow",
"You have already set an avatar for this address."
" Do you really want to overwrite it?")
- overwrite = QtGui.QMessageBox.question(
+ overwrite = QtWidgets.QMessageBox.question(
self, 'Message', displayMsg,
- QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
+ QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
else:
- overwrite = QtGui.QMessageBox.No
+ overwrite = QtWidgets.QMessageBox.StandardButton.No
# copy the image file to the appdata folder
- if (not exists) | (overwrite == QtGui.QMessageBox.Yes):
- if overwrite == QtGui.QMessageBox.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)
@@ -3861,20 +3809,20 @@ def on_action_AddressBookSetSound(self):
self.setAddressSound(widget.item(widget.currentRow(), 0).text())
def setAddressSound(self, addr):
- filters = [unicode(_translate(
+ filters = [_translate(
"MainWindow", "Sound files (%s)" %
' '.join(['*%s%s' % (os.extsep, ext) for ext in sound.extensions])
- ))]
- sourcefile = unicode(QtGui.QFileDialog.getOpenFileName(
+ )]
+ sourcefile = QtWidgets.QFileDialog.getOpenFileName(
self, _translate("MainWindow", "Set notification sound..."),
filter=';;'.join(filters)
- ))
+ )
if not sourcefile:
return
destdir = os.path.join(state.appdata, 'sounds')
- destfile = unicode(addr) + os.path.splitext(sourcefile)[-1]
+ destfile = addr + os.path.splitext(sourcefile)[-1]
destination = os.path.join(destdir, destfile)
if sourcefile == destination:
@@ -3883,15 +3831,15 @@ def setAddressSound(self, addr):
pattern = destfile.lower()
for item in os.listdir(destdir):
if item.lower() == pattern:
- overwrite = QtGui.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?"),
- QtGui.QMessageBox.Yes, QtGui.QMessageBox.No
- ) == QtGui.QMessageBox.Yes
+ QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No
+ ) == QtWidgets.QMessageBox.StandardButton.Yes
if overwrite:
QtCore.QFile.remove(os.path.join(destdir, item))
break
@@ -3902,7 +3850,7 @@ def setAddressSound(self, addr):
def on_context_menuYourIdentities(self, point):
currentItem = self.getCurrentItem()
- self.popMenuYourIdentities = QtGui.QMenu(self)
+ self.popMenuYourIdentities = QtWidgets.QMenu(self)
if isinstance(currentItem, Ui_AddressWidget):
self.popMenuYourIdentities.addAction(self.actionNewYourIdentities)
self.popMenuYourIdentities.addSeparator()
@@ -3926,13 +3874,13 @@ def on_context_menuYourIdentities(self, point):
self.popMenuYourIdentities.addAction(self.actionMarkAllRead)
if self.popMenuYourIdentities.isEmpty():
return
- self.popMenuYourIdentities.exec_(
+ self.popMenuYourIdentities.exec(
self.ui.treeWidgetYourIdentities.mapToGlobal(point))
# TODO make one popMenu
def on_context_menuChan(self, point):
currentItem = self.getCurrentItem()
- self.popMenu = QtGui.QMenu(self)
+ self.popMenu = QtWidgets.QMenu(self)
if isinstance(currentItem, Ui_AddressWidget):
self.popMenu.addAction(self.actionNew)
self.popMenu.addAction(self.actionDelete)
@@ -3955,7 +3903,7 @@ def on_context_menuChan(self, point):
self.popMenu.addAction(self.actionMarkAllRead)
if self.popMenu.isEmpty():
return
- self.popMenu.exec_(
+ self.popMenu.exec(
self.ui.treeWidgetChans.mapToGlobal(point))
def on_context_menuInbox(self, point):
@@ -3968,13 +3916,13 @@ def on_context_menuInbox(self, point):
self.on_context_menuSent(point)
return
- self.popMenuInbox = QtGui.QMenu(self)
+ self.popMenuInbox = QtWidgets.QMenu(self)
self.popMenuInbox.addAction(self.actionForceHtml)
self.popMenuInbox.addAction(self.actionMarkUnread)
self.popMenuInbox.addSeparator()
currentRow = tableWidget.currentRow()
account = accountClass(
- tableWidget.item(currentRow, 0).data(QtCore.Qt.UserRole))
+ tableWidget.item(currentRow, 0).data(QtCore.Qt.ItemDataRole.UserRole))
if account.type == AccountMixin.CHAN:
self.popMenuInbox.addAction(self.actionReplyChan)
@@ -3999,11 +3947,11 @@ def on_context_menuInbox(self, point):
self.popMenuInbox.addAction(self.actionUndeleteTrashedMessage)
else:
self.popMenuInbox.addAction(self.actionTrashInboxMessage)
- self.popMenuInbox.exec_(tableWidget.mapToGlobal(point))
+ self.popMenuInbox.exec(tableWidget.mapToGlobal(point))
def on_context_menuSent(self, point):
currentRow = self.ui.tableWidgetInbox.currentRow()
- self.popMenuSent = QtGui.QMenu(self)
+ self.popMenuSent = QtWidgets.QMenu(self)
self.popMenuSent.addAction(self.actionSentClipboard)
self._contact_selected = self.ui.tableWidgetInbox.item(currentRow, 0)
# preloaded gui.menu plugins with prefix 'address'
@@ -4020,14 +3968,14 @@ def on_context_menuSent(self, point):
queryreturn = sqlQuery('''SELECT status FROM sent where ackdata=?''', ackData)
for row in queryreturn:
status, = row
+ status = status.decode('utf-8', 'replace')
if status == 'toodifficult':
self.popMenuSent.addAction(self.actionForceSend)
- self.popMenuSent.exec_(self.ui.tableWidgetInbox.mapToGlobal(point))
+ self.popMenuSent.exec(self.ui.tableWidgetInbox.mapToGlobal(point))
def inboxSearchLineEditUpdated(self, text):
# dynamic search for too short text is slow
- text = text.toUtf8()
if 0 < len(text) < 3:
return
messagelist = self.getCurrentMessagelist()
@@ -4084,7 +4032,7 @@ def treeWidgetItemChanged(self, item, column):
if item.type == AccountMixin.ALL:
return
- newLabel = unicode(item.text(0), 'utf-8', 'ignore')
+ newLabel = item.text(0)
oldLabel = item.defaultLabel()
# unchanged, do not do anything either
@@ -4124,6 +4072,7 @@ def tableWidgetInboxItemClicked(self):
try:
message = queryreturn[-1][0]
+ message = message.decode('utf-8', 'replace')
except NameError:
message = ""
except IndexError:
@@ -4155,7 +4104,7 @@ def tableWidgetAddressBookItemChanged(self, item):
self.rerenderMessagelistToLabels()
completerList = self.ui.lineEditTo.completer().model().stringList()
for i in range(len(completerList)):
- if unicode(completerList[i]).endswith(" <" + item.address + ">"):
+ if completerList[i].endswith(" <" + item.address + ">"):
completerList[i] = item.label + " <" + item.address + ">"
self.ui.lineEditTo.completer().model().setStringList(completerList)
@@ -4209,7 +4158,7 @@ def resetNamecoinConnection(self):
def initSettings(self):
self.loadSettings()
- for attr, obj in self.ui.__dict__.iteritems():
+ for attr, obj in self.ui.__dict__.items():
if hasattr(obj, "__class__") and \
isinstance(obj, settingsmixin.SettingsMixin):
loadMethod = getattr(obj, "loadSettings", None)
@@ -4221,7 +4170,7 @@ def initSettings(self):
myapp = None
-class BitmessageQtApplication(QtGui.QApplication):
+class BitmessageQtApplication(QtWidgets.QApplication):
"""
Listener to allow our Qt form to get focus when another instance of the
application is open.
@@ -4250,7 +4199,7 @@ def __init__(self, *argv):
# Cleanup past crashed servers
if not self.is_running:
- if socket.error() == QLocalSocket.ConnectionRefusedError:
+ if socket.error() == QLocalSocket.LocalSocketError.ConnectionRefusedError:
socket.disconnectFromServer()
QLocalServer.removeServer(id)
@@ -4307,4 +4256,4 @@ def run():
QtCore.QTimer.singleShot(
30000, lambda: myapp.setStatusIcon(state.statusIconColor))
- app.exec_()
+ app.exec()
diff --git a/src/bitmessageqt/account.py b/src/bitmessageqt/account.py
index 8c82c6f64..e93bb3b35 100644
--- a/src/bitmessageqt/account.py
+++ b/src/bitmessageqt/account.py
@@ -14,7 +14,7 @@
import sys
import time
-from PyQt4 import QtGui
+from PyQt6 import QtGui
import queues
from addresses import decodeAddress
@@ -38,6 +38,8 @@ def getSortedSubscriptions(count=False):
ret = {}
for row in queryreturn:
label, address, enabled = row
+ label = label.decode('utf-8', 'replace')
+ address = address.decode('utf-8', 'replace')
ret[address] = {}
ret[address]["inbox"] = {}
ret[address]["inbox"]['label'] = label
@@ -50,6 +52,8 @@ def getSortedSubscriptions(count=False):
GROUP BY inbox.fromaddress, folder''', str_broadcast_subscribers)
for row in queryreturn:
address, folder, cnt = row
+ address = address.decode('utf-8', 'replace')
+ folder = folder.decode('utf-8', 'replace')
if folder not in ret[address]:
ret[address][folder] = {
'label': ret[address]['inbox']['label'],
@@ -137,12 +141,14 @@ def getLabel(self, address=None):
if queryreturn != []:
for row in queryreturn:
label, = row
+ label = label.decode('utf-8', 'replace')
else:
queryreturn = sqlQuery(
'''select label from subscriptions where address=?''', address)
if queryreturn != []:
for row in queryreturn:
label, = row
+ label = label.decode('utf-8', 'replace')
return label
def parseMessage(self, toAddress, fromAddress, subject, message):
@@ -150,10 +156,7 @@ def parseMessage(self, toAddress, fromAddress, subject, message):
self.toAddress = toAddress
self.fromAddress = fromAddress
- if isinstance(subject, unicode):
- self.subject = str(subject)
- else:
- self.subject = subject
+ self.subject = subject
self.message = message
self.fromLabel = self.getLabel(fromAddress)
self.toLabel = self.getLabel(toAddress)
@@ -202,11 +205,11 @@ def send(self):
sqlExecute(
'''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''',
'',
- self.toAddress,
+ self.toAddress.encode(),
ripe,
- self.fromAddress,
- self.subject,
- self.message,
+ self.fromAddress.encode(),
+ self.subject.encode(),
+ self.message.encode(),
ackdata,
int(time.time()), # sentTime (this will never change)
int(time.time()), # lastActionTime
diff --git a/src/bitmessageqt/address_dialogs.py b/src/bitmessageqt/address_dialogs.py
index bf571041a..29bfc50a5 100644
--- a/src/bitmessageqt/address_dialogs.py
+++ b/src/bitmessageqt/address_dialogs.py
@@ -5,12 +5,12 @@
import hashlib
-from PyQt4 import QtCore, QtGui
+from PyQt6 import QtCore, QtGui, QtWidgets
import queues
-import widgets
+import bitmessageqt.widgets as widgets
import state
-from account import AccountMixin, GatewayAccount, MailchuckAccount, accountClass
+from .account import AccountMixin, GatewayAccount, MailchuckAccount, accountClass
from addresses import addBMIfNotPresent, decodeAddress, encodeVarint
from bmconfigparser import config as global_config
from tr import _translate
@@ -21,10 +21,6 @@ class AddressCheckMixin(object):
def __init__(self):
self.valid = False
- QtCore.QObject.connect( # pylint: disable=no-member
- self.lineEditAddress,
- QtCore.SIGNAL("textChanged(QString)"),
- self.addressChanged)
def _onSuccess(self, addressVersion, streamNumber, ripe):
pass
@@ -79,7 +75,7 @@ def addressChanged(self, QString):
))
-class AddressDataDialog(QtGui.QDialog, AddressCheckMixin):
+class AddressDataDialog(QtWidgets.QDialog, AddressCheckMixin):
"""QDialog with Bitmessage address validation"""
def __init__(self, parent):
@@ -90,8 +86,8 @@ def accept(self):
"""Callback for QDIalog accepting value"""
if self.valid:
self.data = (
- addBMIfNotPresent(str(self.lineEditAddress.text())),
- str(self.lineEditLabel.text().toUtf8())
+ addBMIfNotPresent(self.lineEditAddress.text()),
+ self.lineEditLabel.text()
)
else:
queues.UISignalQueue.put(('updateStatusBar', _translate(
@@ -110,9 +106,10 @@ def __init__(self, parent=None, address=None):
AddressCheckMixin.__init__(self)
if address:
self.lineEditAddress.setText(address)
+ self.lineEditAddress.textChanged.connect(self.addressChanged)
-class NewAddressDialog(QtGui.QDialog):
+class NewAddressDialog(QtWidgets.QDialog):
"""QDialog for generating a new address"""
def __init__(self, parent=None):
@@ -125,7 +122,7 @@ def __init__(self, parent=None):
self.radioButtonExisting.click()
self.comboBoxExisting.addItem(address)
self.groupBoxDeterministic.setHidden(True)
- QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self))
+ QtWidgets.QWidget.resize(self, QtWidgets.QWidget.sizeHint(self))
self.show()
def accept(self):
@@ -142,7 +139,7 @@ def accept(self):
self.comboBoxExisting.currentText())[2]
queues.addressGeneratorQueue.put((
'createRandomAddress', 4, streamNumberForAddress,
- str(self.newaddresslabel.text().toUtf8()), 1, "",
+ self.newaddresslabel.text(), 1, "",
self.checkBoxEighteenByteRipe.isChecked()
))
else:
@@ -169,7 +166,7 @@ def accept(self):
'createDeterministicAddresses', 4, streamNumberForAddress,
"unused deterministic address",
self.spinBoxNumberOfAddressesToMake.value(),
- self.lineEditPassphrase.text().toUtf8(),
+ self.lineEditPassphrase.text(),
self.checkBoxEighteenByteRipe.isChecked()
))
@@ -181,6 +178,7 @@ def __init__(self, parent=None):
super(NewSubscriptionDialog, self).__init__(parent)
widgets.load('newsubscriptiondialog.ui', self)
AddressCheckMixin.__init__(self)
+ self.lineEditAddress.textChanged.connect(self.addressChanged)
def _onSuccess(self, addressVersion, streamNumber, ripe):
if addressVersion <= 3:
@@ -212,21 +210,20 @@ def _onSuccess(self, addressVersion, streamNumber, ripe):
"MainWindow",
"Display the %n recent broadcast(s) from this address.",
None,
- QtCore.QCoreApplication.CodecForTr,
count
))
-class RegenerateAddressesDialog(QtGui.QDialog):
+class RegenerateAddressesDialog(QtWidgets.QDialog):
"""QDialog for regenerating deterministic addresses"""
def __init__(self, parent=None):
super(RegenerateAddressesDialog, self).__init__(parent)
widgets.load('regenerateaddresses.ui', self)
self.groupBox.setTitle('')
- QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self))
+ QtWidgets.QWidget.resize(self, QtWidgets.QWidget.sizeHint(self))
-class SpecialAddressBehaviorDialog(QtGui.QDialog):
+class SpecialAddressBehaviorDialog(QtWidgets.QDialog):
"""
QDialog for special address behaviour (e.g. mailing list functionality)
"""
@@ -258,11 +255,9 @@ def __init__(self, parent=None, config=global_config):
else:
self.radioButtonBehaveNormalAddress.click()
mailingListName = config.safeGet(self.address, 'mailinglistname', '')
- self.lineEditMailingListName.setText(
- unicode(mailingListName, 'utf-8')
- )
+ self.lineEditMailingListName.setText(mailingListName)
- QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self))
+ QtWidgets.QWidget.resize(self, QtWidgets.QWidget.sizeHint(self))
self.show()
def accept(self):
@@ -282,7 +277,7 @@ def accept(self):
else:
self.config.set(str(self.address), 'mailinglist', 'true')
self.config.set(str(self.address), 'mailinglistname', str(
- self.lineEditMailingListName.text().toUtf8()))
+ self.lineEditMailingListName.text()))
self.parent.setCurrentItemColor(
QtGui.QColor(137, 4, 177)) # magenta
self.parent.rerenderComboBoxSendFrom()
@@ -291,7 +286,7 @@ def accept(self):
self.parent.rerenderMessagelistToLabels()
-class EmailGatewayDialog(QtGui.QDialog):
+class EmailGatewayDialog(QtWidgets.QDialog):
"""QDialog for email gateway control"""
def __init__(self, parent, config=global_config, account=None):
super(EmailGatewayDialog, self).__init__(parent)
@@ -330,7 +325,7 @@ def __init__(self, parent, config=global_config, account=None):
else:
self.acct = MailchuckAccount(address)
self.lineEditEmail.setFocus()
- QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self))
+ QtWidgets.QWidget.resize(self, QtWidgets.QWidget.sizeHint(self))
def accept(self):
"""Accept callback"""
@@ -344,7 +339,7 @@ def accept(self):
if self.radioButtonRegister.isChecked() \
or self.radioButtonRegister.isHidden():
- email = str(self.lineEditEmail.text().toUtf8())
+ email = self.lineEditEmail.text()
self.acct.register(email)
self.config.set(self.acct.fromAddress, 'label', email)
self.config.set(self.acct.fromAddress, 'gateway', 'mailchuck')
diff --git a/src/bitmessageqt/addressvalidator.py b/src/bitmessageqt/addressvalidator.py
index dc61b41cd..9785c3a2f 100644
--- a/src/bitmessageqt/addressvalidator.py
+++ b/src/bitmessageqt/addressvalidator.py
@@ -3,15 +3,15 @@
"""
# pylint: disable=too-many-branches,too-many-arguments
-from Queue import Empty
+from queue import Empty
-from PyQt4 import QtGui
+from PyQt6 import QtGui, QtWidgets
from addresses import decodeAddress, addBMIfNotPresent
from bmconfigparser import config
from queues import apiAddressGeneratorReturnQueue, addressGeneratorQueue
from tr import _translate
-from utils import str_chan
+from .utils import str_chan
class AddressPassPhraseValidatorMixin(object):
@@ -32,7 +32,7 @@ def setParams(
self.addressMandatory = addressMandatory
self.isValid = False
# save default text
- self.okButtonLabel = self.buttonBox.button(QtGui.QDialogButtonBox.Ok).text()
+ self.okButtonLabel = self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).text()
def setError(self, string):
"""Indicate that the validation is pending or failed"""
@@ -44,12 +44,12 @@ def setError(self, string):
self.feedBackObject.setText(string)
self.isValid = False
if self.buttonBox:
- self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False)
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setEnabled(False)
if string is not None and self.feedBackObject is not None:
- self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setText(
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText(
_translate("AddressValidator", "Invalid"))
else:
- self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setText(
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText(
_translate("AddressValidator", "Validating..."))
def setOK(self, string):
@@ -62,8 +62,8 @@ def setOK(self, string):
self.feedBackObject.setText(string)
self.isValid = True
if self.buttonBox:
- self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
- self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setText(self.okButtonLabel)
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setEnabled(True)
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText(self.okButtonLabel)
def checkQueue(self):
"""Validator queue loop"""
@@ -87,47 +87,47 @@ def checkQueue(self):
if not addressGeneratorReturnValue:
self.setError(_translate("AddressValidator", "Address already present as one of your identities."))
- return (QtGui.QValidator.Intermediate, 0)
+ return (QtGui.QValidator.State.Intermediate, 0)
if addressGeneratorReturnValue[0] == 'chan name does not match address':
self.setError(
_translate(
"AddressValidator",
"Although the Bitmessage address you "
"entered was valid, it doesn't match the chan name."))
- return (QtGui.QValidator.Intermediate, 0)
+ return (QtGui.QValidator.State.Intermediate, 0)
self.setOK(_translate("MainWindow", "Passphrase and address appear to be valid."))
def returnValid(self):
"""Return the value of whether the validation was successful"""
if self.isValid:
- return QtGui.QValidator.Acceptable
- return QtGui.QValidator.Intermediate
+ return QtGui.QValidator.State.Acceptable
+ return QtGui.QValidator.State.Intermediate
def validate(self, s, pos):
"""Top level validator method"""
if self.addressObject is None:
address = None
else:
- address = str(self.addressObject.text().toUtf8())
+ address = self.addressObject.text()
if address == "":
address = None
if self.passPhraseObject is None:
passPhrase = ""
else:
- passPhrase = str(self.passPhraseObject.text().toUtf8())
+ passPhrase = self.passPhraseObject.text()
if passPhrase == "":
passPhrase = None
# no chan name
if passPhrase is None:
self.setError(_translate("AddressValidator", "Chan name/passphrase needed. You didn't enter a chan name."))
- return (QtGui.QValidator.Intermediate, pos)
+ return (QtGui.QValidator.State.Intermediate, pos)
if self.addressMandatory or address is not None:
# check if address already exists:
if address in config.addresses():
self.setError(_translate("AddressValidator", "Address already present as one of your identities."))
- return (QtGui.QValidator.Intermediate, pos)
+ return (QtGui.QValidator.State.Intermediate, pos)
# version too high
if decodeAddress(address)[0] == 'versiontoohigh':
@@ -138,29 +138,29 @@ def validate(self, s, pos):
" address might be valid, its version number"
" is too new for us to handle. Perhaps you need"
" to upgrade Bitmessage."))
- return (QtGui.QValidator.Intermediate, pos)
+ return (QtGui.QValidator.State.Intermediate, pos)
# invalid
if decodeAddress(address)[0] != 'success':
self.setError(_translate("AddressValidator", "The Bitmessage address is not valid."))
- return (QtGui.QValidator.Intermediate, pos)
+ return (QtGui.QValidator.State.Intermediate, pos)
# this just disables the OK button without changing the feedback text
# but only if triggered by textEdited, not by clicking the Ok button
- if not self.buttonBox.button(QtGui.QDialogButtonBox.Ok).hasFocus():
+ if not self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).hasFocus():
self.setError(None)
# check through generator
if address is None:
- addressGeneratorQueue.put(('createChan', 4, 1, str_chan + ' ' + str(passPhrase), passPhrase, False))
+ addressGeneratorQueue.put(('createChan', 4, 1, str_chan + ' ' + passPhrase, passPhrase, False))
else:
addressGeneratorQueue.put(
('joinChan', addBMIfNotPresent(address),
"{} {}".format(str_chan, passPhrase), passPhrase, False))
- if self.buttonBox.button(QtGui.QDialogButtonBox.Ok).hasFocus():
+ if self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).hasFocus():
return (self.returnValid(), pos)
- return (QtGui.QValidator.Intermediate, pos)
+ return (QtGui.QValidator.State.Intermediate, pos)
def checkData(self):
"""Validator Qt signal interface"""
diff --git a/src/bitmessageqt/bitmessage_icons_rc.py b/src/bitmessageqt/bitmessage_icons_rc.py
index bb0a02c02..a06fd964f 100644
--- a/src/bitmessageqt/bitmessage_icons_rc.py
+++ b/src/bitmessageqt/bitmessage_icons_rc.py
@@ -7,9 +7,9 @@
#
# WARNING! All changes made in this file will be lost!
-from PyQt4 import QtCore
+from PyQt6 import QtCore
-qt_resource_data = "\
+qt_resource_data = b"\
\x00\x00\x03\x66\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
@@ -1534,7 +1534,7 @@
\x82\
"
-qt_resource_name = "\
+qt_resource_name = b"\
\x00\x09\
\x0c\x78\x54\x88\
\x00\x6e\
@@ -1639,7 +1639,7 @@
\x00\x70\x00\x6e\x00\x67\
"
-qt_resource_struct = "\
+qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x18\x00\x02\x00\x00\x00\x15\x00\x00\x00\x03\
diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py
index 961fc0939..2d4ce3eea 100644
--- a/src/bitmessageqt/bitmessageui.py
+++ b/src/bitmessageqt/bitmessageui.py
@@ -1,59 +1,37 @@
-# -*- coding: utf-8 -*-
-
# Form implementation generated from reading ui file 'bitmessageui.ui'
#
-# Created: Mon Mar 23 22:18:07 2015
-# by: PyQt4 UI code generator 4.10.4
+# Created by: PyQt6 UI code generator 6.4.2
#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-from bmconfigparser import config
-from foldertree import AddressBookCompleter
-from messageview import MessageView
-from messagecompose import MessageCompose
-import settingsmixin
-from networkstatus import NetworkStatus
-from blacklist import Blacklist
-
-try:
- _fromUtf8 = QtCore.QString.fromUtf8
-except AttributeError:
- def _fromUtf8(s):
- return s
+# WARNING: Any manual changes made to this file will be lost when pyuic6 is
+# run again. Do not edit this file unless you know what you are doing.
-try:
- _encoding = QtGui.QApplication.UnicodeUTF8
-
- def _translate(context, text, disambig, encoding=QtCore.QCoreApplication.CodecForTr, n=None):
- if n is None:
- return QtGui.QApplication.translate(context, text, disambig, _encoding)
- else:
- return QtGui.QApplication.translate(context, text, disambig, _encoding, n)
-except AttributeError:
- def _translate(context, text, disambig, encoding=QtCore.QCoreApplication.CodecForTr, n=None):
- if n is None:
- return QtGui.QApplication.translate(context, text, disambig)
- else:
- return QtGui.QApplication.translate(context, text, disambig, QtCore.QCoreApplication.CodecForTr, n)
+from PyQt6 import QtCore, QtGui, QtWidgets
+from bmconfigparser import config
+from .foldertree import AddressBookCompleter
+from .messageview import MessageView
+from .messagecompose import MessageCompose
+import bitmessageqt.settingsmixin as settingsmixin
+from .networkstatus import NetworkStatus
+from .blacklist import Blacklist
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
- MainWindow.setObjectName(_fromUtf8("MainWindow"))
+ MainWindow.setObjectName("MainWindow")
MainWindow.resize(885, 580)
+ self.MainDock = QtWidgets.QDockWidget(parent=MainWindow)
+ self.MainDock.setGeometry(QtCore.QRect(0, 0, 885, 580))
icon = QtGui.QIcon()
- icon.addPixmap(
- QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-24px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off
- )
- MainWindow.setWindowIcon(icon)
- MainWindow.setTabShape(QtGui.QTabWidget.Rounded)
- self.centralwidget = QtGui.QWidget(MainWindow)
- self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
- self.gridLayout_10 = QtGui.QGridLayout(self.centralwidget)
- self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10"))
- self.tabWidget = QtGui.QTabWidget(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
+ icon.addPixmap(QtGui.QPixmap(":/newPrefix/images/can-icon-24px.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
+ self.MainDock.setWindowIcon(icon)
+ self.MainDock.setObjectName("MainDock")
+ self.centralwidget = QtWidgets.QWidget()
+ self.centralwidget.setObjectName("centralwidget")
+ self.gridLayout_10 = QtWidgets.QGridLayout(self.centralwidget)
+ self.gridLayout_10.setObjectName("gridLayout_10")
+ self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget)
+ self.tabWidget.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
+ sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
@@ -63,75 +41,62 @@ def setupUi(self, MainWindow):
font = QtGui.QFont()
font.setPointSize(9)
self.tabWidget.setFont(font)
- self.tabWidget.setTabPosition(QtGui.QTabWidget.North)
- self.tabWidget.setTabShape(QtGui.QTabWidget.Rounded)
- self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
- self.inbox = QtGui.QWidget()
- self.inbox.setObjectName(_fromUtf8("inbox"))
- self.gridLayout = QtGui.QGridLayout(self.inbox)
- self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
- self.horizontalSplitter_3 = settingsmixin.SSplitter()
- self.horizontalSplitter_3.setObjectName(_fromUtf8("horizontalSplitter_3"))
- self.verticalSplitter_12 = settingsmixin.SSplitter()
- self.verticalSplitter_12.setObjectName(_fromUtf8("verticalSplitter_12"))
- self.verticalSplitter_12.setOrientation(QtCore.Qt.Vertical)
- self.treeWidgetYourIdentities = settingsmixin.STreeWidget(self.inbox)
- self.treeWidgetYourIdentities.setObjectName(_fromUtf8("treeWidgetYourIdentities"))
- self.treeWidgetYourIdentities.resize(200, self.treeWidgetYourIdentities.height())
+ self.tabWidget.setTabPosition(QtWidgets.QTabWidget.TabPosition.North)
+ self.tabWidget.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
+ self.tabWidget.setObjectName("tabWidget")
+ self.inbox = QtWidgets.QWidget()
+ self.inbox.setObjectName("inbox")
+ self.gridLayout = QtWidgets.QGridLayout(self.inbox)
+ self.gridLayout.setObjectName("gridLayout")
+ self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
+ self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+ self.verticalLayout_12 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_12.setObjectName("verticalLayout_12")
+ self.treeWidgetYourIdentities = QtWidgets.QTreeWidget(parent=self.inbox)
+ self.treeWidgetYourIdentities.setMaximumSize(QtCore.QSize(200, 16777215))
+ self.treeWidgetYourIdentities.setObjectName("treeWidgetYourIdentities")
icon1 = QtGui.QIcon()
- icon1.addPixmap(
- QtGui.QPixmap(_fromUtf8(":/newPrefix/images/identities.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
- )
+ icon1.addPixmap(QtGui.QPixmap(":/newPrefix/images/identities.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
self.treeWidgetYourIdentities.headerItem().setIcon(0, icon1)
- self.verticalSplitter_12.addWidget(self.treeWidgetYourIdentities)
- self.pushButtonNewAddress = QtGui.QPushButton(self.inbox)
- self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress"))
- self.pushButtonNewAddress.resize(200, self.pushButtonNewAddress.height())
- self.verticalSplitter_12.addWidget(self.pushButtonNewAddress)
- self.verticalSplitter_12.setStretchFactor(0, 1)
- self.verticalSplitter_12.setStretchFactor(1, 0)
- self.verticalSplitter_12.setCollapsible(0, False)
- self.verticalSplitter_12.setCollapsible(1, False)
- self.verticalSplitter_12.handle(1).setEnabled(False)
- self.horizontalSplitter_3.addWidget(self.verticalSplitter_12)
- self.verticalSplitter_7 = settingsmixin.SSplitter()
- self.verticalSplitter_7.setObjectName(_fromUtf8("verticalSplitter_7"))
- self.verticalSplitter_7.setOrientation(QtCore.Qt.Vertical)
- self.horizontalSplitterSearch = QtGui.QSplitter()
- self.horizontalSplitterSearch.setObjectName(_fromUtf8("horizontalSplitterSearch"))
- self.inboxSearchLineEdit = QtGui.QLineEdit(self.inbox)
- self.inboxSearchLineEdit.setObjectName(_fromUtf8("inboxSearchLineEdit"))
- self.horizontalSplitterSearch.addWidget(self.inboxSearchLineEdit)
- self.inboxSearchOption = QtGui.QComboBox(self.inbox)
- self.inboxSearchOption.setObjectName(_fromUtf8("inboxSearchOption"))
- self.inboxSearchOption.addItem(_fromUtf8(""))
- self.inboxSearchOption.addItem(_fromUtf8(""))
- self.inboxSearchOption.addItem(_fromUtf8(""))
- self.inboxSearchOption.addItem(_fromUtf8(""))
- self.inboxSearchOption.addItem(_fromUtf8(""))
- self.inboxSearchOption.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
- self.inboxSearchOption.setCurrentIndex(3)
- self.horizontalSplitterSearch.addWidget(self.inboxSearchOption)
- self.horizontalSplitterSearch.handle(1).setEnabled(False)
- self.horizontalSplitterSearch.setStretchFactor(0, 1)
- self.horizontalSplitterSearch.setStretchFactor(1, 0)
- self.verticalSplitter_7.addWidget(self.horizontalSplitterSearch)
- self.tableWidgetInbox = settingsmixin.STableWidget(self.inbox)
- self.tableWidgetInbox.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
+ self.verticalLayout_12.addWidget(self.treeWidgetYourIdentities)
+ self.pushButtonNewAddress = QtWidgets.QPushButton(parent=self.inbox)
+ self.pushButtonNewAddress.setMaximumSize(QtCore.QSize(200, 16777215))
+ self.pushButtonNewAddress.setObjectName("pushButtonNewAddress")
+ self.verticalLayout_12.addWidget(self.pushButtonNewAddress)
+ self.horizontalLayout_3.addLayout(self.verticalLayout_12)
+ self.verticalLayout_7 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_7.setObjectName("verticalLayout_7")
+ self.horizontalLayoutSearch = QtWidgets.QHBoxLayout()
+ self.horizontalLayoutSearch.setContentsMargins(-1, 0, -1, -1)
+ self.horizontalLayoutSearch.setObjectName("horizontalLayoutSearch")
+ self.inboxSearchLineEdit = QtWidgets.QLineEdit(parent=self.inbox)
+ self.inboxSearchLineEdit.setObjectName("inboxSearchLineEdit")
+ self.horizontalLayoutSearch.addWidget(self.inboxSearchLineEdit)
+ self.inboxSearchOption = QtWidgets.QComboBox(parent=self.inbox)
+ self.inboxSearchOption.setObjectName("inboxSearchOption")
+ self.inboxSearchOption.addItem("")
+ self.inboxSearchOption.addItem("")
+ self.inboxSearchOption.addItem("")
+ self.inboxSearchOption.addItem("")
+ self.inboxSearchOption.addItem("")
+ self.horizontalLayoutSearch.addWidget(self.inboxSearchOption)
+ self.verticalLayout_7.addLayout(self.horizontalLayoutSearch)
+ self.tableWidgetInbox = QtWidgets.QTableWidget(parent=self.inbox)
+ self.tableWidgetInbox.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
self.tableWidgetInbox.setAlternatingRowColors(True)
- self.tableWidgetInbox.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
- self.tableWidgetInbox.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
+ self.tableWidgetInbox.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
+ self.tableWidgetInbox.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInbox.setWordWrap(False)
- self.tableWidgetInbox.setObjectName(_fromUtf8("tableWidgetInbox"))
+ self.tableWidgetInbox.setObjectName("tableWidgetInbox")
self.tableWidgetInbox.setColumnCount(4)
self.tableWidgetInbox.setRowCount(0)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(0, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(1, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(2, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(3, item)
self.tableWidgetInbox.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInbox.horizontalHeader().setDefaultSectionSize(200)
@@ -141,158 +106,130 @@ def setupUi(self, MainWindow):
self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInbox.verticalHeader().setVisible(False)
self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26)
- self.verticalSplitter_7.addWidget(self.tableWidgetInbox)
- self.textEditInboxMessage = MessageView(self.inbox)
+ self.verticalLayout_7.addWidget(self.tableWidgetInbox)
+ self.textEditInboxMessage = MessageView(parent=self.inbox)
self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessage.setReadOnly(True)
- self.textEditInboxMessage.setObjectName(_fromUtf8("textEditInboxMessage"))
- self.verticalSplitter_7.addWidget(self.textEditInboxMessage)
- self.verticalSplitter_7.setStretchFactor(0, 0)
- self.verticalSplitter_7.setStretchFactor(1, 1)
- self.verticalSplitter_7.setStretchFactor(2, 2)
- self.verticalSplitter_7.setCollapsible(0, False)
- self.verticalSplitter_7.setCollapsible(1, False)
- self.verticalSplitter_7.setCollapsible(2, False)
- self.verticalSplitter_7.handle(1).setEnabled(False)
- self.horizontalSplitter_3.addWidget(self.verticalSplitter_7)
- self.horizontalSplitter_3.setStretchFactor(0, 0)
- self.horizontalSplitter_3.setStretchFactor(1, 1)
- self.horizontalSplitter_3.setCollapsible(0, False)
- self.horizontalSplitter_3.setCollapsible(1, False)
- self.gridLayout.addWidget(self.horizontalSplitter_3)
+ self.textEditInboxMessage.setObjectName("textEditInboxMessage")
+ self.verticalLayout_7.addWidget(self.textEditInboxMessage)
+ self.horizontalLayout_3.addLayout(self.verticalLayout_7)
+ self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.tabWidget.addTab(self.inbox, icon2, _fromUtf8(""))
- self.send = QtGui.QWidget()
- self.send.setObjectName(_fromUtf8("send"))
- self.gridLayout_7 = QtGui.QGridLayout(self.send)
- self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7"))
- self.horizontalSplitter = settingsmixin.SSplitter()
- self.horizontalSplitter.setObjectName(_fromUtf8("horizontalSplitter"))
- self.verticalSplitter_2 = settingsmixin.SSplitter()
- self.verticalSplitter_2.setObjectName(_fromUtf8("verticalSplitter_2"))
- self.verticalSplitter_2.setOrientation(QtCore.Qt.Vertical)
- self.tableWidgetAddressBook = settingsmixin.STableWidget(self.send)
+ icon2.addPixmap(QtGui.QPixmap(":/newPrefix/images/inbox.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
+ self.tabWidget.addTab(self.inbox, icon2, "")
+ self.send = QtWidgets.QWidget()
+ self.send.setObjectName("send")
+ self.gridLayout_7 = QtWidgets.QGridLayout(self.send)
+ self.gridLayout_7.setObjectName("gridLayout_7")
+ self.horizontalLayout = QtWidgets.QHBoxLayout()
+ self.horizontalLayout.setObjectName("horizontalLayout")
+ self.verticalLayout_2 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.tableWidgetAddressBook = QtWidgets.QTableWidget(parent=self.send)
+ self.tableWidgetAddressBook.setMaximumSize(QtCore.QSize(200, 16777215))
self.tableWidgetAddressBook.setAlternatingRowColors(True)
- self.tableWidgetAddressBook.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
- self.tableWidgetAddressBook.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
- self.tableWidgetAddressBook.setObjectName(_fromUtf8("tableWidgetAddressBook"))
+ self.tableWidgetAddressBook.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
+ self.tableWidgetAddressBook.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
+ self.tableWidgetAddressBook.setObjectName("tableWidgetAddressBook")
self.tableWidgetAddressBook.setColumnCount(2)
self.tableWidgetAddressBook.setRowCount(0)
- self.tableWidgetAddressBook.resize(200, self.tableWidgetAddressBook.height())
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
icon3 = QtGui.QIcon()
- icon3.addPixmap(
- QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
- )
+ icon3.addPixmap(QtGui.QPixmap(":/newPrefix/images/addressbook.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
item.setIcon(icon3)
self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetAddressBook.setHorizontalHeaderItem(1, item)
self.tableWidgetAddressBook.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetAddressBook.horizontalHeader().setDefaultSectionSize(200)
self.tableWidgetAddressBook.horizontalHeader().setHighlightSections(False)
self.tableWidgetAddressBook.horizontalHeader().setStretchLastSection(True)
self.tableWidgetAddressBook.verticalHeader().setVisible(False)
- self.verticalSplitter_2.addWidget(self.tableWidgetAddressBook)
+ self.verticalLayout_2.addWidget(self.tableWidgetAddressBook)
self.addressBookCompleter = AddressBookCompleter()
- self.addressBookCompleter.setCompletionMode(QtGui.QCompleter.PopupCompletion)
- self.addressBookCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
- self.addressBookCompleterModel = QtGui.QStringListModel()
+ self.addressBookCompleter.setCompletionMode(QtWidgets.QCompleter.CompletionMode.PopupCompletion)
+ self.addressBookCompleter.setCaseSensitivity(QtCore.Qt.CaseSensitivity.CaseInsensitive)
+ self.addressBookCompleterModel = QtCore.QStringListModel()
self.addressBookCompleter.setModel(self.addressBookCompleterModel)
- self.pushButtonAddAddressBook = QtGui.QPushButton(self.send)
- self.pushButtonAddAddressBook.setObjectName(_fromUtf8("pushButtonAddAddressBook"))
- self.pushButtonAddAddressBook.resize(200, self.pushButtonAddAddressBook.height())
- self.verticalSplitter_2.addWidget(self.pushButtonAddAddressBook)
- self.pushButtonFetchNamecoinID = QtGui.QPushButton(self.send)
- self.pushButtonFetchNamecoinID.resize(200, self.pushButtonFetchNamecoinID.height())
- self.pushButtonFetchNamecoinID.setObjectName(_fromUtf8("pushButtonFetchNamecoinID"))
- self.verticalSplitter_2.addWidget(self.pushButtonFetchNamecoinID)
- self.verticalSplitter_2.setStretchFactor(0, 1)
- self.verticalSplitter_2.setStretchFactor(1, 0)
- self.verticalSplitter_2.setStretchFactor(2, 0)
- self.verticalSplitter_2.setCollapsible(0, False)
- self.verticalSplitter_2.setCollapsible(1, False)
- self.verticalSplitter_2.setCollapsible(2, False)
- self.verticalSplitter_2.handle(1).setEnabled(False)
- self.verticalSplitter_2.handle(2).setEnabled(False)
- self.horizontalSplitter.addWidget(self.verticalSplitter_2)
- self.verticalSplitter = settingsmixin.SSplitter()
- self.verticalSplitter.setObjectName(_fromUtf8("verticalSplitter"))
- self.verticalSplitter.setOrientation(QtCore.Qt.Vertical)
- self.tabWidgetSend = QtGui.QTabWidget(self.send)
- self.tabWidgetSend.setObjectName(_fromUtf8("tabWidgetSend"))
- self.sendDirect = QtGui.QWidget()
- self.sendDirect.setObjectName(_fromUtf8("sendDirect"))
- self.gridLayout_8 = QtGui.QGridLayout(self.sendDirect)
- self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8"))
- self.verticalSplitter_5 = settingsmixin.SSplitter()
- self.verticalSplitter_5.setObjectName(_fromUtf8("verticalSplitter_5"))
- self.verticalSplitter_5.setOrientation(QtCore.Qt.Vertical)
- self.gridLayout_2 = QtGui.QGridLayout()
- self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
- self.label_3 = QtGui.QLabel(self.sendDirect)
- self.label_3.setObjectName(_fromUtf8("label_3"))
+ self.pushButtonAddAddressBook = QtWidgets.QPushButton(parent=self.send)
+ self.pushButtonAddAddressBook.setMaximumSize(QtCore.QSize(200, 16777215))
+ self.pushButtonAddAddressBook.setObjectName("pushButtonAddAddressBook")
+ self.verticalLayout_2.addWidget(self.pushButtonAddAddressBook)
+ self.pushButtonFetchNamecoinID = QtWidgets.QPushButton(parent=self.send)
+ self.pushButtonFetchNamecoinID.setMaximumSize(QtCore.QSize(200, 16777215))
+ font = QtGui.QFont()
+ font.setPointSize(9)
+ self.pushButtonFetchNamecoinID.setFont(font)
+ self.pushButtonFetchNamecoinID.setObjectName("pushButtonFetchNamecoinID")
+ self.verticalLayout_2.addWidget(self.pushButtonFetchNamecoinID)
+ self.horizontalLayout.addLayout(self.verticalLayout_2)
+ self.verticalLayout = QtWidgets.QVBoxLayout()
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.tabWidgetSend = QtWidgets.QTabWidget(parent=self.send)
+ self.tabWidgetSend.setObjectName("tabWidgetSend")
+ self.sendDirect = QtWidgets.QWidget()
+ self.sendDirect.setObjectName("sendDirect")
+ self.gridLayout_8 = QtWidgets.QGridLayout(self.sendDirect)
+ self.gridLayout_8.setObjectName("gridLayout_8")
+ self.verticalLayout_5 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_5.setObjectName("verticalLayout_5")
+ self.gridLayout_2 = QtWidgets.QGridLayout()
+ self.gridLayout_2.setObjectName("gridLayout_2")
+ self.label_3 = QtWidgets.QLabel(parent=self.sendDirect)
+ self.label_3.setObjectName("label_3")
self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1)
- self.label_2 = QtGui.QLabel(self.sendDirect)
- self.label_2.setObjectName(_fromUtf8("label_2"))
+ self.label_2 = QtWidgets.QLabel(parent=self.sendDirect)
+ self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1)
- self.lineEditSubject = QtGui.QLineEdit(self.sendDirect)
- self.lineEditSubject.setText(_fromUtf8(""))
- self.lineEditSubject.setObjectName(_fromUtf8("lineEditSubject"))
+ self.lineEditSubject = QtWidgets.QLineEdit(parent=self.sendDirect)
+ self.lineEditSubject.setText("")
+ self.lineEditSubject.setObjectName("lineEditSubject")
self.gridLayout_2.addWidget(self.lineEditSubject, 2, 1, 1, 1)
- self.label = QtGui.QLabel(self.sendDirect)
- self.label.setObjectName(_fromUtf8("label"))
+ self.label = QtWidgets.QLabel(parent=self.sendDirect)
+ self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)
- self.comboBoxSendFrom = QtGui.QComboBox(self.sendDirect)
+ self.comboBoxSendFrom = QtWidgets.QComboBox(parent=self.sendDirect)
self.comboBoxSendFrom.setMinimumSize(QtCore.QSize(300, 0))
- self.comboBoxSendFrom.setObjectName(_fromUtf8("comboBoxSendFrom"))
+ self.comboBoxSendFrom.setObjectName("comboBoxSendFrom")
self.gridLayout_2.addWidget(self.comboBoxSendFrom, 0, 1, 1, 1)
- self.lineEditTo = QtGui.QLineEdit(self.sendDirect)
- self.lineEditTo.setObjectName(_fromUtf8("lineEditTo"))
+ self.lineEditTo = QtWidgets.QLineEdit(parent=self.sendDirect)
+ self.lineEditTo.setObjectName("lineEditTo")
self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1)
self.lineEditTo.setCompleter(self.addressBookCompleter)
- self.gridLayout_2_Widget = QtGui.QWidget()
- self.gridLayout_2_Widget.setLayout(self.gridLayout_2)
- self.verticalSplitter_5.addWidget(self.gridLayout_2_Widget)
- self.textEditMessage = MessageCompose(self.sendDirect)
- self.textEditMessage.setObjectName(_fromUtf8("textEditMessage"))
- self.verticalSplitter_5.addWidget(self.textEditMessage)
- self.verticalSplitter_5.setStretchFactor(0, 0)
- self.verticalSplitter_5.setStretchFactor(1, 1)
- self.verticalSplitter_5.setCollapsible(0, False)
- self.verticalSplitter_5.setCollapsible(1, False)
- self.verticalSplitter_5.handle(1).setEnabled(False)
- self.gridLayout_8.addWidget(self.verticalSplitter_5, 0, 0, 1, 1)
- self.tabWidgetSend.addTab(self.sendDirect, _fromUtf8(""))
- self.sendBroadcast = QtGui.QWidget()
- self.sendBroadcast.setObjectName(_fromUtf8("sendBroadcast"))
- self.gridLayout_9 = QtGui.QGridLayout(self.sendBroadcast)
- self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9"))
+ self.verticalLayout_5.addLayout(self.gridLayout_2)
+ self.textEditMessage = QtWidgets.QTextEdit(parent=self.sendDirect)
+ self.textEditMessage.setObjectName("textEditMessage")
+ self.verticalLayout_5.addWidget(self.textEditMessage)
+ self.gridLayout_8.addLayout(self.verticalLayout_5, 0, 0, 1, 1)
+ self.tabWidgetSend.addTab(self.sendDirect, "")
+ self.sendBroadcast = QtWidgets.QWidget()
+ self.sendBroadcast.setObjectName("sendBroadcast")
+ self.gridLayout_9 = QtWidgets.QGridLayout(self.sendBroadcast)
+ self.gridLayout_9.setObjectName("gridLayout_9")
self.verticalSplitter_6 = settingsmixin.SSplitter()
- self.verticalSplitter_6.setObjectName(_fromUtf8("verticalSplitter_6"))
- self.verticalSplitter_6.setOrientation(QtCore.Qt.Vertical)
- self.gridLayout_5 = QtGui.QGridLayout()
- self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
- self.label_8 = QtGui.QLabel(self.sendBroadcast)
- self.label_8.setObjectName(_fromUtf8("label_8"))
+ self.verticalSplitter_6.setObjectName("verticalSplitter_6")
+ self.verticalSplitter_6.setOrientation(QtCore.Qt.Orientation.Vertical)
+ self.gridLayout_5 = QtWidgets.QGridLayout()
+ self.gridLayout_5.setObjectName("gridLayout_5")
+ self.label_8 = QtWidgets.QLabel(self.sendBroadcast)
+ self.label_8.setObjectName("label_8")
self.gridLayout_5.addWidget(self.label_8, 0, 0, 1, 1)
- self.lineEditSubjectBroadcast = QtGui.QLineEdit(self.sendBroadcast)
- self.lineEditSubjectBroadcast.setText(_fromUtf8(""))
- self.lineEditSubjectBroadcast.setObjectName(_fromUtf8("lineEditSubjectBroadcast"))
+ self.lineEditSubjectBroadcast = QtWidgets.QLineEdit(self.sendBroadcast)
+ self.lineEditSubjectBroadcast.setText("")
+ self.lineEditSubjectBroadcast.setObjectName("lineEditSubjectBroadcast")
self.gridLayout_5.addWidget(self.lineEditSubjectBroadcast, 1, 1, 1, 1)
- self.label_7 = QtGui.QLabel(self.sendBroadcast)
- self.label_7.setObjectName(_fromUtf8("label_7"))
+ self.label_7 = QtWidgets.QLabel(self.sendBroadcast)
+ self.label_7.setObjectName("label_7")
self.gridLayout_5.addWidget(self.label_7, 1, 0, 1, 1)
- self.comboBoxSendFromBroadcast = QtGui.QComboBox(self.sendBroadcast)
+ self.comboBoxSendFromBroadcast = QtWidgets.QComboBox(self.sendBroadcast)
self.comboBoxSendFromBroadcast.setMinimumSize(QtCore.QSize(300, 0))
- self.comboBoxSendFromBroadcast.setObjectName(_fromUtf8("comboBoxSendFromBroadcast"))
+ self.comboBoxSendFromBroadcast.setObjectName("comboBoxSendFromBroadcast")
self.gridLayout_5.addWidget(self.comboBoxSendFromBroadcast, 0, 1, 1, 1)
- self.gridLayout_5_Widget = QtGui.QWidget()
+ self.gridLayout_5_Widget = QtWidgets.QWidget()
self.gridLayout_5_Widget.setLayout(self.gridLayout_5)
self.verticalSplitter_6.addWidget(self.gridLayout_5_Widget)
self.textEditMessageBroadcast = MessageCompose(self.sendBroadcast)
- self.textEditMessageBroadcast.setObjectName(_fromUtf8("textEditMessageBroadcast"))
+ self.textEditMessageBroadcast.setObjectName("textEditMessageBroadcast")
self.verticalSplitter_6.addWidget(self.textEditMessageBroadcast)
self.verticalSplitter_6.setStretchFactor(0, 0)
self.verticalSplitter_6.setStretchFactor(1, 1)
@@ -300,143 +237,120 @@ def setupUi(self, MainWindow):
self.verticalSplitter_6.setCollapsible(1, False)
self.verticalSplitter_6.handle(1).setEnabled(False)
self.gridLayout_9.addWidget(self.verticalSplitter_6, 0, 0, 1, 1)
- self.tabWidgetSend.addTab(self.sendBroadcast, _fromUtf8(""))
- self.verticalSplitter.addWidget(self.tabWidgetSend)
- self.tTLContainer = QtGui.QWidget()
- self.tTLContainer.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
- self.horizontalLayout_5 = QtGui.QHBoxLayout()
- self.tTLContainer.setLayout(self.horizontalLayout_5)
- self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
- self.pushButtonTTL = QtGui.QPushButton(self.send)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
+ self.tabWidgetSend.addTab(self.sendBroadcast, "")
+ self.verticalLayout.addWidget(self.tabWidgetSend)
+ self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
+ self.horizontalLayout_5.setObjectName("horizontalLayout_5")
+ self.pushButtonTTL = QtWidgets.QPushButton(parent=self.send)
+ sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButtonTTL.sizePolicy().hasHeightForWidth())
self.pushButtonTTL.setSizePolicy(sizePolicy)
+ self.pushButtonTTL.setMaximumSize(QtCore.QSize(32, 16777215))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
+ brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
+ palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
+ brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
+ palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(120, 120, 120))
- brush.setStyle(QtCore.Qt.SolidPattern)
- palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
+ brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
+ palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
self.pushButtonTTL.setPalette(palette)
font = QtGui.QFont()
font.setUnderline(True)
self.pushButtonTTL.setFont(font)
self.pushButtonTTL.setFlat(True)
- self.pushButtonTTL.setObjectName(_fromUtf8("pushButtonTTL"))
- self.horizontalLayout_5.addWidget(self.pushButtonTTL, 0, QtCore.Qt.AlignRight)
- self.horizontalSliderTTL = QtGui.QSlider(self.send)
- self.horizontalSliderTTL.setMinimumSize(QtCore.QSize(70, 0))
- self.horizontalSliderTTL.setOrientation(QtCore.Qt.Horizontal)
+ self.pushButtonTTL.setObjectName("pushButtonTTL")
+ self.horizontalLayout_5.addWidget(self.pushButtonTTL)
+ self.horizontalSliderTTL = QtWidgets.QSlider(parent=self.send)
+ self.horizontalSliderTTL.setMinimumSize(QtCore.QSize(35, 0))
+ self.horizontalSliderTTL.setMaximumSize(QtCore.QSize(70, 16777215))
+ self.horizontalSliderTTL.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.horizontalSliderTTL.setInvertedAppearance(False)
self.horizontalSliderTTL.setInvertedControls(False)
- self.horizontalSliderTTL.setObjectName(_fromUtf8("horizontalSliderTTL"))
- self.horizontalLayout_5.addWidget(self.horizontalSliderTTL, 0, QtCore.Qt.AlignLeft)
- self.labelHumanFriendlyTTLDescription = QtGui.QLabel(self.send)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
+ self.horizontalSliderTTL.setObjectName("horizontalSliderTTL")
+ self.horizontalLayout_5.addWidget(self.horizontalSliderTTL)
+ self.labelHumanFriendlyTTLDescription = QtWidgets.QLabel(parent=self.send)
+ sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.labelHumanFriendlyTTLDescription.sizePolicy().hasHeightForWidth())
self.labelHumanFriendlyTTLDescription.setSizePolicy(sizePolicy)
self.labelHumanFriendlyTTLDescription.setMinimumSize(QtCore.QSize(45, 0))
- self.labelHumanFriendlyTTLDescription.setObjectName(_fromUtf8("labelHumanFriendlyTTLDescription"))
- self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription, 1, QtCore.Qt.AlignLeft)
- self.pushButtonClear = QtGui.QPushButton(self.send)
- self.pushButtonClear.setObjectName(_fromUtf8("pushButtonClear"))
- self.horizontalLayout_5.addWidget(self.pushButtonClear, 0, QtCore.Qt.AlignRight)
- self.pushButtonSend = QtGui.QPushButton(self.send)
- self.pushButtonSend.setObjectName(_fromUtf8("pushButtonSend"))
- self.horizontalLayout_5.addWidget(self.pushButtonSend, 0, QtCore.Qt.AlignRight)
- self.horizontalSliderTTL.setMaximumSize(QtCore.QSize(105, self.pushButtonSend.height()))
- self.verticalSplitter.addWidget(self.tTLContainer)
- self.tTLContainer.adjustSize()
- self.verticalSplitter.setStretchFactor(1, 0)
- self.verticalSplitter.setStretchFactor(0, 1)
- self.verticalSplitter.setCollapsible(0, False)
- self.verticalSplitter.setCollapsible(1, False)
- self.verticalSplitter.handle(1).setEnabled(False)
- self.horizontalSplitter.addWidget(self.verticalSplitter)
- self.horizontalSplitter.setStretchFactor(0, 0)
- self.horizontalSplitter.setStretchFactor(1, 1)
- self.horizontalSplitter.setCollapsible(0, False)
- self.horizontalSplitter.setCollapsible(1, False)
- self.gridLayout_7.addWidget(self.horizontalSplitter, 0, 0, 1, 1)
+ self.labelHumanFriendlyTTLDescription.setMaximumSize(QtCore.QSize(45, 16777215))
+ self.labelHumanFriendlyTTLDescription.setObjectName("labelHumanFriendlyTTLDescription")
+ self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription)
+ self.pushButtonClear = QtWidgets.QPushButton(parent=self.send)
+ self.pushButtonClear.setObjectName("pushButtonClear")
+ self.horizontalLayout_5.addWidget(self.pushButtonClear, 0, QtCore.Qt.AlignmentFlag.AlignRight)
+ self.pushButtonSend = QtWidgets.QPushButton(parent=self.send)
+ self.pushButtonSend.setMaximumSize(QtCore.QSize(16777215, 16777215))
+ self.pushButtonSend.setObjectName("pushButtonSend")
+ self.horizontalLayout_5.addWidget(self.pushButtonSend)
+ self.verticalLayout.addLayout(self.horizontalLayout_5)
+ self.horizontalLayout.addLayout(self.verticalLayout)
+ self.gridLayout_7.addLayout(self.horizontalLayout, 0, 0, 1, 1)
icon4 = QtGui.QIcon()
- icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.tabWidget.addTab(self.send, icon4, _fromUtf8(""))
- self.subscriptions = QtGui.QWidget()
- self.subscriptions.setObjectName(_fromUtf8("subscriptions"))
- self.gridLayout_3 = QtGui.QGridLayout(self.subscriptions)
- self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
- self.horizontalSplitter_4 = settingsmixin.SSplitter()
- self.horizontalSplitter_4.setObjectName(_fromUtf8("horizontalSplitter_4"))
- self.verticalSplitter_3 = settingsmixin.SSplitter()
- self.verticalSplitter_3.setObjectName(_fromUtf8("verticalSplitter_3"))
- self.verticalSplitter_3.setOrientation(QtCore.Qt.Vertical)
- self.treeWidgetSubscriptions = settingsmixin.STreeWidget(self.subscriptions)
+ icon4.addPixmap(QtGui.QPixmap(":/newPrefix/images/send.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
+ self.tabWidget.addTab(self.send, icon4, "")
+ self.subscriptions = QtWidgets.QWidget()
+ self.subscriptions.setObjectName("subscriptions")
+ self.gridLayout_3 = QtWidgets.QGridLayout(self.subscriptions)
+ self.gridLayout_3.setObjectName("gridLayout_3")
+ self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
+ self.horizontalLayout_4.setObjectName("horizontalLayout_4")
+ self.verticalLayout_3 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.treeWidgetSubscriptions = QtWidgets.QTreeWidget(parent=self.subscriptions)
+ self.treeWidgetSubscriptions.setMaximumSize(QtCore.QSize(200, 16777215))
self.treeWidgetSubscriptions.setAlternatingRowColors(True)
- self.treeWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
- self.treeWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
- self.treeWidgetSubscriptions.setObjectName(_fromUtf8("treeWidgetSubscriptions"))
- self.treeWidgetSubscriptions.resize(200, self.treeWidgetSubscriptions.height())
+ self.treeWidgetSubscriptions.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
+ self.treeWidgetSubscriptions.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
+ self.treeWidgetSubscriptions.setObjectName("treeWidgetSubscriptions")
icon5 = QtGui.QIcon()
- icon5.addPixmap(
- QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
- )
+ icon5.addPixmap(QtGui.QPixmap(":/newPrefix/images/subscriptions.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
self.treeWidgetSubscriptions.headerItem().setIcon(0, icon5)
- self.verticalSplitter_3.addWidget(self.treeWidgetSubscriptions)
- self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions)
- self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription"))
- self.pushButtonAddSubscription.resize(200, self.pushButtonAddSubscription.height())
- self.verticalSplitter_3.addWidget(self.pushButtonAddSubscription)
- self.verticalSplitter_3.setStretchFactor(0, 1)
- self.verticalSplitter_3.setStretchFactor(1, 0)
- self.verticalSplitter_3.setCollapsible(0, False)
- self.verticalSplitter_3.setCollapsible(1, False)
- self.verticalSplitter_3.handle(1).setEnabled(False)
- self.horizontalSplitter_4.addWidget(self.verticalSplitter_3)
- self.verticalSplitter_4 = settingsmixin.SSplitter()
- self.verticalSplitter_4.setObjectName(_fromUtf8("verticalSplitter_4"))
- self.verticalSplitter_4.setOrientation(QtCore.Qt.Vertical)
- self.horizontalSplitter_2 = QtGui.QSplitter()
- self.horizontalSplitter_2.setObjectName(_fromUtf8("horizontalSplitter_2"))
- self.inboxSearchLineEditSubscriptions = QtGui.QLineEdit(self.subscriptions)
- self.inboxSearchLineEditSubscriptions.setObjectName(_fromUtf8("inboxSearchLineEditSubscriptions"))
- self.horizontalSplitter_2.addWidget(self.inboxSearchLineEditSubscriptions)
- self.inboxSearchOptionSubscriptions = QtGui.QComboBox(self.subscriptions)
- self.inboxSearchOptionSubscriptions.setObjectName(_fromUtf8("inboxSearchOptionSubscriptions"))
- self.inboxSearchOptionSubscriptions.addItem(_fromUtf8(""))
- self.inboxSearchOptionSubscriptions.addItem(_fromUtf8(""))
- self.inboxSearchOptionSubscriptions.addItem(_fromUtf8(""))
- self.inboxSearchOptionSubscriptions.addItem(_fromUtf8(""))
- self.inboxSearchOptionSubscriptions.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
- self.inboxSearchOptionSubscriptions.setCurrentIndex(2)
- self.horizontalSplitter_2.addWidget(self.inboxSearchOptionSubscriptions)
- self.horizontalSplitter_2.handle(1).setEnabled(False)
- self.horizontalSplitter_2.setStretchFactor(0, 1)
- self.horizontalSplitter_2.setStretchFactor(1, 0)
- self.verticalSplitter_4.addWidget(self.horizontalSplitter_2)
- self.tableWidgetInboxSubscriptions = settingsmixin.STableWidget(self.subscriptions)
- self.tableWidgetInboxSubscriptions.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
+ self.verticalLayout_3.addWidget(self.treeWidgetSubscriptions)
+ self.pushButtonAddSubscription = QtWidgets.QPushButton(parent=self.subscriptions)
+ self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215))
+ self.pushButtonAddSubscription.setObjectName("pushButtonAddSubscription")
+ self.verticalLayout_3.addWidget(self.pushButtonAddSubscription)
+ self.horizontalLayout_4.addLayout(self.verticalLayout_3)
+ self.verticalLayout_4 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_4.setObjectName("verticalLayout_4")
+ self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
+ self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.inboxSearchLineEditSubscriptions = QtWidgets.QLineEdit(parent=self.subscriptions)
+ self.inboxSearchLineEditSubscriptions.setObjectName("inboxSearchLineEditSubscriptions")
+ self.horizontalLayout_2.addWidget(self.inboxSearchLineEditSubscriptions)
+ self.inboxSearchOptionSubscriptions = QtWidgets.QComboBox(parent=self.subscriptions)
+ self.inboxSearchOptionSubscriptions.setObjectName("inboxSearchOptionSubscriptions")
+ self.inboxSearchOptionSubscriptions.addItem("")
+ self.inboxSearchOptionSubscriptions.addItem("")
+ self.inboxSearchOptionSubscriptions.addItem("")
+ self.inboxSearchOptionSubscriptions.addItem("")
+ self.inboxSearchOptionSubscriptions.addItem("")
+ self.horizontalLayout_2.addWidget(self.inboxSearchOptionSubscriptions)
+ self.verticalLayout_4.addLayout(self.horizontalLayout_2)
+ self.tableWidgetInboxSubscriptions = QtWidgets.QTableWidget(parent=self.subscriptions)
+ self.tableWidgetInboxSubscriptions.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True)
- self.tableWidgetInboxSubscriptions.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
- self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
+ self.tableWidgetInboxSubscriptions.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
+ self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInboxSubscriptions.setWordWrap(False)
- self.tableWidgetInboxSubscriptions.setObjectName(_fromUtf8("tableWidgetInboxSubscriptions"))
+ self.tableWidgetInboxSubscriptions.setObjectName("tableWidgetInboxSubscriptions")
self.tableWidgetInboxSubscriptions.setColumnCount(4)
self.tableWidgetInboxSubscriptions.setRowCount(0)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(0, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(1, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(2, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(3, item)
self.tableWidgetInboxSubscriptions.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInboxSubscriptions.horizontalHeader().setDefaultSectionSize(200)
@@ -446,101 +360,74 @@ def setupUi(self, MainWindow):
self.tableWidgetInboxSubscriptions.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInboxSubscriptions.verticalHeader().setVisible(False)
self.tableWidgetInboxSubscriptions.verticalHeader().setDefaultSectionSize(26)
- self.verticalSplitter_4.addWidget(self.tableWidgetInboxSubscriptions)
- self.textEditInboxMessageSubscriptions = MessageView(self.subscriptions)
+ self.verticalLayout_4.addWidget(self.tableWidgetInboxSubscriptions)
+ self.textEditInboxMessageSubscriptions = MessageView(parent=self.subscriptions)
self.textEditInboxMessageSubscriptions.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessageSubscriptions.setReadOnly(True)
- self.textEditInboxMessageSubscriptions.setObjectName(_fromUtf8("textEditInboxMessageSubscriptions"))
- self.verticalSplitter_4.addWidget(self.textEditInboxMessageSubscriptions)
- self.verticalSplitter_4.setStretchFactor(0, 0)
- self.verticalSplitter_4.setStretchFactor(1, 1)
- self.verticalSplitter_4.setStretchFactor(2, 2)
- self.verticalSplitter_4.setCollapsible(0, False)
- self.verticalSplitter_4.setCollapsible(1, False)
- self.verticalSplitter_4.setCollapsible(2, False)
- self.verticalSplitter_4.handle(1).setEnabled(False)
- self.horizontalSplitter_4.addWidget(self.verticalSplitter_4)
- self.horizontalSplitter_4.setStretchFactor(0, 0)
- self.horizontalSplitter_4.setStretchFactor(1, 1)
- self.horizontalSplitter_4.setCollapsible(0, False)
- self.horizontalSplitter_4.setCollapsible(1, False)
- self.gridLayout_3.addWidget(self.horizontalSplitter_4, 0, 0, 1, 1)
+ self.textEditInboxMessageSubscriptions.setObjectName("textEditInboxMessageSubscriptions")
+ self.verticalLayout_4.addWidget(self.textEditInboxMessageSubscriptions)
+ self.horizontalLayout_4.addLayout(self.verticalLayout_4)
+ self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 1)
icon6 = QtGui.QIcon()
- icon6.addPixmap(
- QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off
- )
- self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8(""))
- self.chans = QtGui.QWidget()
- self.chans.setObjectName(_fromUtf8("chans"))
- self.gridLayout_4 = QtGui.QGridLayout(self.chans)
- self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
- self.horizontalSplitter_7 = settingsmixin.SSplitter()
- self.horizontalSplitter_7.setObjectName(_fromUtf8("horizontalSplitter_7"))
- self.verticalSplitter_17 = settingsmixin.SSplitter()
- self.verticalSplitter_17.setObjectName(_fromUtf8("verticalSplitter_17"))
- self.verticalSplitter_17.setOrientation(QtCore.Qt.Vertical)
- self.treeWidgetChans = settingsmixin.STreeWidget(self.chans)
- self.treeWidgetChans.setFrameShadow(QtGui.QFrame.Sunken)
+ icon6.addPixmap(QtGui.QPixmap(":/newPrefix/images/subscriptions.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
+ self.tabWidget.addTab(self.subscriptions, icon6, "")
+ self.chans = QtWidgets.QWidget()
+ self.chans.setObjectName("chans")
+ self.gridLayout_4 = QtWidgets.QGridLayout(self.chans)
+ self.gridLayout_4.setObjectName("gridLayout_4")
+ self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
+ self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+ self.verticalLayout_17 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_17.setObjectName("verticalLayout_17")
+ self.treeWidgetChans = QtWidgets.QTreeWidget(parent=self.chans)
+ self.treeWidgetChans.setMaximumSize(QtCore.QSize(200, 16777215))
+ self.treeWidgetChans.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
self.treeWidgetChans.setLineWidth(1)
self.treeWidgetChans.setAlternatingRowColors(True)
- self.treeWidgetChans.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
- self.treeWidgetChans.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
- self.treeWidgetChans.setObjectName(_fromUtf8("treeWidgetChans"))
- self.treeWidgetChans.resize(200, self.treeWidgetChans.height())
+ self.treeWidgetChans.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
+ self.treeWidgetChans.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
+ self.treeWidgetChans.setObjectName("treeWidgetChans")
icon7 = QtGui.QIcon()
- icon7.addPixmap(
- QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
- )
+ icon7.addPixmap(QtGui.QPixmap(":/newPrefix/images/can-icon-16px.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
self.treeWidgetChans.headerItem().setIcon(0, icon7)
- self.verticalSplitter_17.addWidget(self.treeWidgetChans)
- self.pushButtonAddChan = QtGui.QPushButton(self.chans)
- self.pushButtonAddChan.setObjectName(_fromUtf8("pushButtonAddChan"))
- self.pushButtonAddChan.resize(200, self.pushButtonAddChan.height())
- self.verticalSplitter_17.addWidget(self.pushButtonAddChan)
- self.verticalSplitter_17.setStretchFactor(0, 1)
- self.verticalSplitter_17.setStretchFactor(1, 0)
- self.verticalSplitter_17.setCollapsible(0, False)
- self.verticalSplitter_17.setCollapsible(1, False)
- self.verticalSplitter_17.handle(1).setEnabled(False)
- self.horizontalSplitter_7.addWidget(self.verticalSplitter_17)
- self.verticalSplitter_8 = settingsmixin.SSplitter()
- self.verticalSplitter_8.setObjectName(_fromUtf8("verticalSplitter_8"))
- self.verticalSplitter_8.setOrientation(QtCore.Qt.Vertical)
- self.horizontalSplitter_6 = QtGui.QSplitter()
- self.horizontalSplitter_6.setObjectName(_fromUtf8("horizontalSplitter_6"))
- self.inboxSearchLineEditChans = QtGui.QLineEdit(self.chans)
- self.inboxSearchLineEditChans.setObjectName(_fromUtf8("inboxSearchLineEditChans"))
- self.horizontalSplitter_6.addWidget(self.inboxSearchLineEditChans)
- self.inboxSearchOptionChans = QtGui.QComboBox(self.chans)
- self.inboxSearchOptionChans.setObjectName(_fromUtf8("inboxSearchOptionChans"))
- self.inboxSearchOptionChans.addItem(_fromUtf8(""))
- self.inboxSearchOptionChans.addItem(_fromUtf8(""))
- self.inboxSearchOptionChans.addItem(_fromUtf8(""))
- self.inboxSearchOptionChans.addItem(_fromUtf8(""))
- self.inboxSearchOptionChans.addItem(_fromUtf8(""))
- self.inboxSearchOptionChans.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
- self.inboxSearchOptionChans.setCurrentIndex(3)
- self.horizontalSplitter_6.addWidget(self.inboxSearchOptionChans)
- self.horizontalSplitter_6.handle(1).setEnabled(False)
- self.horizontalSplitter_6.setStretchFactor(0, 1)
- self.horizontalSplitter_6.setStretchFactor(1, 0)
- self.verticalSplitter_8.addWidget(self.horizontalSplitter_6)
- self.tableWidgetInboxChans = settingsmixin.STableWidget(self.chans)
- self.tableWidgetInboxChans.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
+ self.verticalLayout_17.addWidget(self.treeWidgetChans)
+ self.pushButtonAddChan = QtWidgets.QPushButton(parent=self.chans)
+ self.pushButtonAddChan.setMaximumSize(QtCore.QSize(200, 16777215))
+ self.pushButtonAddChan.setObjectName("pushButtonAddChan")
+ self.verticalLayout_17.addWidget(self.pushButtonAddChan)
+ self.horizontalLayout_7.addLayout(self.verticalLayout_17)
+ self.verticalLayout_8 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_8.setObjectName("verticalLayout_8")
+ self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
+ self.horizontalLayout_6.setObjectName("horizontalLayout_6")
+ self.inboxSearchLineEditChans = QtWidgets.QLineEdit(parent=self.chans)
+ self.inboxSearchLineEditChans.setObjectName("inboxSearchLineEditChans")
+ self.horizontalLayout_6.addWidget(self.inboxSearchLineEditChans)
+ self.inboxSearchOptionChans = QtWidgets.QComboBox(parent=self.chans)
+ self.inboxSearchOptionChans.setObjectName("inboxSearchOptionChans")
+ self.inboxSearchOptionChans.addItem("")
+ self.inboxSearchOptionChans.addItem("")
+ self.inboxSearchOptionChans.addItem("")
+ self.inboxSearchOptionChans.addItem("")
+ self.inboxSearchOptionChans.addItem("")
+ self.horizontalLayout_6.addWidget(self.inboxSearchOptionChans)
+ self.verticalLayout_8.addLayout(self.horizontalLayout_6)
+ self.tableWidgetInboxChans = QtWidgets.QTableWidget(parent=self.chans)
+ self.tableWidgetInboxChans.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
self.tableWidgetInboxChans.setAlternatingRowColors(True)
- self.tableWidgetInboxChans.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
- self.tableWidgetInboxChans.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
+ self.tableWidgetInboxChans.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
+ self.tableWidgetInboxChans.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInboxChans.setWordWrap(False)
- self.tableWidgetInboxChans.setObjectName(_fromUtf8("tableWidgetInboxChans"))
+ self.tableWidgetInboxChans.setObjectName("tableWidgetInboxChans")
self.tableWidgetInboxChans.setColumnCount(4)
self.tableWidgetInboxChans.setRowCount(0)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(0, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(1, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(2, item)
- item = QtGui.QTableWidgetItem()
+ item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(3, item)
self.tableWidgetInboxChans.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInboxChans.horizontalHeader().setDefaultSectionSize(200)
@@ -550,31 +437,19 @@ def setupUi(self, MainWindow):
self.tableWidgetInboxChans.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInboxChans.verticalHeader().setVisible(False)
self.tableWidgetInboxChans.verticalHeader().setDefaultSectionSize(26)
- self.verticalSplitter_8.addWidget(self.tableWidgetInboxChans)
- self.textEditInboxMessageChans = MessageView(self.chans)
+ self.verticalLayout_8.addWidget(self.tableWidgetInboxChans)
+ self.textEditInboxMessageChans = MessageView(parent=self.chans)
self.textEditInboxMessageChans.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessageChans.setReadOnly(True)
- self.textEditInboxMessageChans.setObjectName(_fromUtf8("textEditInboxMessageChans"))
- self.verticalSplitter_8.addWidget(self.textEditInboxMessageChans)
- self.verticalSplitter_8.setStretchFactor(0, 0)
- self.verticalSplitter_8.setStretchFactor(1, 1)
- self.verticalSplitter_8.setStretchFactor(2, 2)
- self.verticalSplitter_8.setCollapsible(0, False)
- self.verticalSplitter_8.setCollapsible(1, False)
- self.verticalSplitter_8.setCollapsible(2, False)
- self.verticalSplitter_8.handle(1).setEnabled(False)
- self.horizontalSplitter_7.addWidget(self.verticalSplitter_8)
- self.horizontalSplitter_7.setStretchFactor(0, 0)
- self.horizontalSplitter_7.setStretchFactor(1, 1)
- self.horizontalSplitter_7.setCollapsible(0, False)
- self.horizontalSplitter_7.setCollapsible(1, False)
- self.gridLayout_4.addWidget(self.horizontalSplitter_7, 0, 0, 1, 1)
+ self.textEditInboxMessageChans.setObjectName("textEditInboxMessageChans")
+ self.verticalLayout_8.addWidget(self.textEditInboxMessageChans)
+ self.horizontalLayout_7.addLayout(self.verticalLayout_8)
+ self.gridLayout_4.addLayout(self.horizontalLayout_7, 0, 0, 1, 1)
icon8 = QtGui.QIcon()
- icon8.addPixmap(
- QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off
- )
- self.tabWidget.addTab(self.chans, icon8, _fromUtf8(""))
+ icon8.addPixmap(QtGui.QPixmap(":/newPrefix/images/can-icon-16px.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
+ self.tabWidget.addTab(self.chans, icon8, "")
self.blackwhitelist = Blacklist()
+ self.blackwhitelist.setObjectName("blackwhitelist")
self.tabWidget.addTab(self.blackwhitelist, QtGui.QIcon(":/newPrefix/images/blacklist.png"), "")
# Initialize the Blacklist or Whitelist
if config.get('bitmessagesettings', 'blackwhitelist') == 'white':
@@ -584,63 +459,64 @@ def setupUi(self, MainWindow):
self.networkstatus = NetworkStatus()
self.tabWidget.addTab(self.networkstatus, QtGui.QIcon(":/newPrefix/images/networkstatus.png"), "")
self.gridLayout_10.addWidget(self.tabWidget, 0, 0, 1, 1)
- MainWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(MainWindow)
+ self.MainDock.setWidget(self.centralwidget)
+ MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea.AllDockWidgetAreas, self.MainDock)
+ self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 885, 27))
- self.menubar.setObjectName(_fromUtf8("menubar"))
- self.menuFile = QtGui.QMenu(self.menubar)
- self.menuFile.setObjectName(_fromUtf8("menuFile"))
- self.menuSettings = QtGui.QMenu(self.menubar)
- self.menuSettings.setObjectName(_fromUtf8("menuSettings"))
- self.menuHelp = QtGui.QMenu(self.menubar)
- self.menuHelp.setObjectName(_fromUtf8("menuHelp"))
+ self.menubar.setObjectName("menubar")
+ self.menuFile = QtWidgets.QMenu(parent=self.menubar)
+ self.menuFile.setObjectName("menuFile")
+ self.menuSettings = QtWidgets.QMenu(parent=self.menubar)
+ self.menuSettings.setObjectName("menuSettings")
+ self.menuHelp = QtWidgets.QMenu(parent=self.menubar)
+ self.menuHelp.setObjectName("menuHelp")
MainWindow.setMenuBar(self.menubar)
- self.statusbar = QtGui.QStatusBar(MainWindow)
+ self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setMaximumSize(QtCore.QSize(16777215, 22))
- self.statusbar.setObjectName(_fromUtf8("statusbar"))
+ self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
- self.actionImport_keys = QtGui.QAction(MainWindow)
- self.actionImport_keys.setObjectName(_fromUtf8("actionImport_keys"))
- self.actionManageKeys = QtGui.QAction(MainWindow)
+ self.actionImport_keys = QtGui.QAction(parent=MainWindow)
+ self.actionImport_keys.setObjectName("actionImport_keys")
+ self.actionManageKeys = QtGui.QAction(parent=MainWindow)
self.actionManageKeys.setCheckable(False)
self.actionManageKeys.setEnabled(True)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("dialog-password"))
+ self.actionNetworkSwitch = QtGui.QAction(parent=MainWindow)
+ self.actionNetworkSwitch.setObjectName("actionNetworkSwitch")
+ icon = QtGui.QIcon.fromTheme("dialog-password")
self.actionManageKeys.setIcon(icon)
- self.actionManageKeys.setObjectName(_fromUtf8("actionManageKeys"))
- self.actionNetworkSwitch = QtGui.QAction(MainWindow)
- self.actionNetworkSwitch.setObjectName(_fromUtf8("actionNetworkSwitch"))
- self.actionExit = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("application-exit"))
+ self.actionManageKeys.setObjectName("actionManageKeys")
+ self.actionExit = QtGui.QAction(parent=MainWindow)
+ icon = QtGui.QIcon.fromTheme("application-exit")
self.actionExit.setIcon(icon)
- self.actionExit.setObjectName(_fromUtf8("actionExit"))
- self.actionHelp = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("help-contents"))
+ self.actionExit.setObjectName("actionExit")
+ self.actionHelp = QtGui.QAction(parent=MainWindow)
+ icon = QtGui.QIcon.fromTheme("help-contents")
self.actionHelp.setIcon(icon)
- self.actionHelp.setObjectName(_fromUtf8("actionHelp"))
+ self.actionHelp.setObjectName("actionHelp")
self.actionSupport = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("help-support"))
+ icon = QtGui.QIcon.fromTheme("help-support")
self.actionSupport.setIcon(icon)
- self.actionSupport.setObjectName(_fromUtf8("actionSupport"))
- self.actionAbout = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("help-about"))
+ self.actionSupport.setObjectName("actionSupport")
+ self.actionAbout = QtGui.QAction(parent=MainWindow)
+ icon = QtGui.QIcon.fromTheme("help-about")
self.actionAbout.setIcon(icon)
- self.actionAbout.setObjectName(_fromUtf8("actionAbout"))
- self.actionSettings = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("document-properties"))
+ self.actionAbout.setObjectName("actionAbout")
+ self.actionSettings = QtGui.QAction(parent=MainWindow)
+ icon = QtGui.QIcon.fromTheme("document-properties")
self.actionSettings.setIcon(icon)
- self.actionSettings.setObjectName(_fromUtf8("actionSettings"))
- self.actionRegenerateDeterministicAddresses = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("view-refresh"))
+ self.actionSettings.setObjectName("actionSettings")
+ self.actionRegenerateDeterministicAddresses = QtGui.QAction(parent=MainWindow)
+ icon = QtGui.QIcon.fromTheme("view-refresh")
self.actionRegenerateDeterministicAddresses.setIcon(icon)
- self.actionRegenerateDeterministicAddresses.setObjectName(_fromUtf8("actionRegenerateDeterministicAddresses"))
- self.actionDeleteAllTrashedMessages = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("user-trash"))
+ self.actionRegenerateDeterministicAddresses.setObjectName("actionRegenerateDeterministicAddresses")
+ self.actionDeleteAllTrashedMessages = QtGui.QAction(parent=MainWindow)
+ icon = QtGui.QIcon.fromTheme("user-trash")
self.actionDeleteAllTrashedMessages.setIcon(icon)
- self.actionDeleteAllTrashedMessages.setObjectName(_fromUtf8("actionDeleteAllTrashedMessages"))
- self.actionJoinChan = QtGui.QAction(MainWindow)
- icon = QtGui.QIcon.fromTheme(_fromUtf8("contact-new"))
+ self.actionDeleteAllTrashedMessages.setObjectName("actionDeleteAllTrashedMessages")
+ self.actionJoinChan = QtGui.QAction(parent=MainWindow)
+ icon = QtGui.QIcon.fromTheme("contact-new")
self.actionJoinChan.setIcon(icon)
- self.actionJoinChan.setObjectName(_fromUtf8("actionJoinChan"))
+ self.actionJoinChan.setObjectName("actionJoinChan")
self.menuFile.addAction(self.actionManageKeys)
self.menuFile.addAction(self.actionDeleteAllTrashedMessages)
self.menuFile.addAction(self.actionRegenerateDeterministicAddresses)
@@ -667,18 +543,21 @@ def setupUi(self, MainWindow):
MainWindow.setTabOrder(self.comboBoxSendFrom, self.lineEditTo)
MainWindow.setTabOrder(self.lineEditTo, self.lineEditSubject)
MainWindow.setTabOrder(self.lineEditSubject, self.textEditMessage)
- MainWindow.setTabOrder(self.textEditMessage, self.pushButtonAddSubscription)
+ MainWindow.setTabOrder(self.textEditMessage, self.pushButtonSend)
+ MainWindow.setTabOrder(self.pushButtonSend, self.pushButtonAddSubscription)
# Popup menu actions container for the Sent page
# pylint: disable=attribute-defined-outside-init
- self.sentContextMenuToolbar = QtGui.QToolBar()
+ self.sentContextMenuToolbar = QtWidgets.QToolBar()
# Popup menu actions container for chans tree
- self.addressContextMenuToolbar = QtGui.QToolBar()
+ self.addressContextMenuToolbar = QtWidgets.QToolBar()
# Popup menu actions container for subscriptions tree
- self.subscriptionsContextMenuToolbar = QtGui.QToolBar()
+ self.subscriptionsContextMenuToolbar = QtWidgets.QToolBar()
def updateNetworkSwitchMenuLabel(self, dontconnect=None):
+ _translate = QtCore.QCoreApplication.translate
if dontconnect is None:
+ _translate = QtCore.QCoreApplication.translate
dontconnect = config.safeGetBoolean(
'bitmessagesettings', 'dontconnect')
self.actionNetworkSwitch.setText(
@@ -688,130 +567,105 @@ def updateNetworkSwitchMenuLabel(self, dontconnect=None):
)
def retranslateUi(self, MainWindow):
- MainWindow.setWindowTitle(_translate("MainWindow", "Bitmessage", None))
- self.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities", None))
- self.pushButtonNewAddress.setText(_translate("MainWindow", "New Identity", None))
- self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None))
- self.inboxSearchOption.setItemText(0, _translate("MainWindow", "All", None))
- self.inboxSearchOption.setItemText(1, _translate("MainWindow", "To", None))
- self.inboxSearchOption.setItemText(2, _translate("MainWindow", "From", None))
- self.inboxSearchOption.setItemText(3, _translate("MainWindow", "Subject", None))
- self.inboxSearchOption.setItemText(4, _translate("MainWindow", "Message", None))
+ _translate = QtCore.QCoreApplication.translate
+ self.MainDock.setWindowTitle(_translate("MainWindow", "Bitmessage"))
+ self.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities"))
+ self.pushButtonNewAddress.setText(_translate("MainWindow", "New Indentitiy"))
+ self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search"))
+ self.inboxSearchOption.setItemText(0, _translate("MainWindow", "All"))
+ self.inboxSearchOption.setItemText(1, _translate("MainWindow", "To"))
+ self.inboxSearchOption.setItemText(2, _translate("MainWindow", "From"))
+ self.inboxSearchOption.setItemText(3, _translate("MainWindow", "Subject"))
+ self.inboxSearchOption.setItemText(4, _translate("MainWindow", "Message"))
self.tableWidgetInbox.setSortingEnabled(True)
item = self.tableWidgetInbox.horizontalHeaderItem(0)
- item.setText(_translate("MainWindow", "To", None))
+ item.setText(_translate("MainWindow", "To"))
item = self.tableWidgetInbox.horizontalHeaderItem(1)
- item.setText(_translate("MainWindow", "From", None))
+ item.setText(_translate("MainWindow", "From"))
item = self.tableWidgetInbox.horizontalHeaderItem(2)
- item.setText(_translate("MainWindow", "Subject", None))
+ item.setText(_translate("MainWindow", "Subject"))
item = self.tableWidgetInbox.horizontalHeaderItem(3)
- item.setText(_translate("MainWindow", "Received", None))
- self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages", None))
+ item.setText(_translate("MainWindow", "Received"))
+ self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages"))
self.tableWidgetAddressBook.setSortingEnabled(True)
item = self.tableWidgetAddressBook.horizontalHeaderItem(0)
- item.setText(_translate("MainWindow", "Address book", None))
+ item.setText(_translate("MainWindow", "Address book"))
item = self.tableWidgetAddressBook.horizontalHeaderItem(1)
- item.setText(_translate("MainWindow", "Address", None))
- self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact", None))
- self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID", None))
- self.label_3.setText(_translate("MainWindow", "Subject:", None))
- self.label_2.setText(_translate("MainWindow", "From:", None))
- self.label.setText(_translate("MainWindow", "To:", None))
- self.tabWidgetSend.setTabText(
- self.tabWidgetSend.indexOf(self.sendDirect), _translate("MainWindow", "Send ordinary Message", None)
- )
- self.label_8.setText(_translate("MainWindow", "From:", None))
- self.label_7.setText(_translate("MainWindow", "Subject:", None))
- self.tabWidgetSend.setTabText(
- self.tabWidgetSend.indexOf(self.sendBroadcast),
- _translate("MainWindow", "Send Message to your Subscribers", None)
- )
- self.pushButtonTTL.setText(_translate("MainWindow", "TTL:", None))
- hours = 48
- try:
- hours = int(config.getint('bitmessagesettings', 'ttl') / 60 / 60)
- except:
- pass
- self.labelHumanFriendlyTTLDescription.setText(
- _translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, hours)
- )
- self.pushButtonClear.setText(_translate("MainWindow", "Clear", None))
- self.pushButtonSend.setText(_translate("MainWindow", "Send", None))
- self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None))
- self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions", None))
- self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription", None))
- self.inboxSearchLineEditSubscriptions.setPlaceholderText(_translate("MainWindow", "Search", None))
- self.inboxSearchOptionSubscriptions.setItemText(0, _translate("MainWindow", "All", None))
- self.inboxSearchOptionSubscriptions.setItemText(1, _translate("MainWindow", "From", None))
- self.inboxSearchOptionSubscriptions.setItemText(2, _translate("MainWindow", "Subject", None))
- self.inboxSearchOptionSubscriptions.setItemText(3, _translate("MainWindow", "Message", None))
+ item.setText(_translate("MainWindow", "Address"))
+ self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact"))
+ self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID"))
+ 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", "\n"
+"