try to migrate to Python3 + PyQt6

This commit is contained in:
Kashiko Koibumi 2024-05-13 08:06:24 +09:00
parent 3b36676793
commit 6dfecbe361
No known key found for this signature in database
GPG Key ID: 8F06E069E37C40C4
52 changed files with 1817 additions and 1087 deletions

View File

@ -15,45 +15,45 @@ import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
from sqlite3 import register_adapter from sqlite3 import register_adapter
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
from PyQt4.QtNetwork import QLocalSocket, QLocalServer from PyQt6.QtNetwork import QLocalSocket, QLocalServer
import shared import shared
import state import state
from debug import logger from debug import logger
from tr import _translate from tr import _translate
from account import ( from .account import (
accountClass, getSortedSubscriptions, accountClass, getSortedSubscriptions,
BMAccount, GatewayAccount, MailchuckAccount, AccountColor) BMAccount, GatewayAccount, MailchuckAccount, AccountColor)
from addresses import decodeAddress, addBMIfNotPresent from addresses import decodeAddress, addBMIfNotPresent
from bitmessageui import Ui_MainWindow from .bitmessageui import Ui_MainWindow
from bmconfigparser import config from bmconfigparser import config
import namecoin import namecoin
from messageview import MessageView from .messageview import MessageView
from migrationwizard import Ui_MigrationWizard from .migrationwizard import Ui_MigrationWizard
from foldertree import ( from .foldertree import (
AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget, AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget,
MessageList_AddressWidget, MessageList_SubjectWidget, MessageList_AddressWidget, MessageList_SubjectWidget,
Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress, Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress,
MessageList_TimeWidget) MessageList_TimeWidget)
import settingsmixin import bitmessageqt.settingsmixin
import support import bitmessageqt.support
from helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure from helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure
import helper_addressbook import helper_addressbook
import helper_search import helper_search
import l10n import l10n
from utils import str_broadcast_subscribers, avatarize from .utils import str_broadcast_subscribers, avatarize
import dialogs import bitmessageqt.dialogs
from network.stats import pendingDownload, pendingUpload from network.stats import pendingDownload, pendingUpload
from uisignaler import UISignaler from .uisignaler import UISignaler
import paths import paths
from proofofwork import getPowType from proofofwork import getPowType
import queues import queues
import shutdown import shutdown
from statusbar import BMStatusBar from .statusbar import BMStatusBar
import sound import bitmessageqt.sound
# This is needed for tray icon # This is needed for tray icon
import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import import bitmessageqt.bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import
import helper_sent import helper_sent
try: try:
@ -112,7 +112,7 @@ class MyForm(settingsmixin.SMainWindow):
translationpath = os.path.join( translationpath = os.path.join(
paths.codePath(), 'translations', 'bitmessage_' + newlocale) paths.codePath(), 'translations', 'bitmessage_' + newlocale)
self.qmytranslator.load(translationpath) self.qmytranslator.load(translationpath)
QtGui.QApplication.installTranslator(self.qmytranslator) QtWidgets.QApplication.installTranslator(self.qmytranslator)
self.qsystranslator = QtCore.QTranslator() self.qsystranslator = QtCore.QTranslator()
if paths.frozen: if paths.frozen:
@ -120,10 +120,10 @@ class MyForm(settingsmixin.SMainWindow):
paths.codePath(), 'translations', 'qt_' + newlocale) paths.codePath(), 'translations', 'qt_' + newlocale)
else: else:
translationpath = os.path.join( translationpath = os.path.join(
str(QtCore.QLibraryInfo.location( str(QtCore.QLibraryInfo.path(
QtCore.QLibraryInfo.TranslationsPath)), 'qt_' + newlocale) QtCore.QLibraryInfo.LibraryPath.TranslationsPath)), 'qt_' + newlocale)
self.qsystranslator.load(translationpath) self.qsystranslator.load(translationpath)
QtGui.QApplication.installTranslator(self.qsystranslator) QtWidgets.QApplication.installTranslator(self.qsystranslator)
# TODO: move this block into l10n # TODO: move this block into l10n
# FIXME: shouldn't newlocale be used here? # FIXME: shouldn't newlocale be used here?
@ -148,50 +148,27 @@ class MyForm(settingsmixin.SMainWindow):
logger.error("Failed to set locale to %s", lang, exc_info=True) logger.error("Failed to set locale to %s", lang, exc_info=True)
def init_file_menu(self): def init_file_menu(self):
QtCore.QObject.connect(self.ui.actionExit, QtCore.SIGNAL( self.ui.actionExit.triggered.connect(self.quit)
"triggered()"), self.quit) self.ui.actionNetworkSwitch.triggered.connect(self.network_switch)
QtCore.QObject.connect(self.ui.actionNetworkSwitch, QtCore.SIGNAL( self.ui.actionManageKeys.triggered.connect(self.click_actionManageKeys)
"triggered()"), self.network_switch) self.ui.actionDeleteAllTrashedMessages.triggered.connect(self.click_actionDeleteAllTrashedMessages)
QtCore.QObject.connect(self.ui.actionManageKeys, QtCore.SIGNAL( self.ui.actionRegenerateDeterministicAddresses.triggered.connect(self.click_actionRegenerateDeterministicAddresses)
"triggered()"), self.click_actionManageKeys) self.ui.pushButtonAddChan.clicked.connect(self.click_actionJoinChan) # also used for creating chans.
QtCore.QObject.connect(self.ui.actionDeleteAllTrashedMessages, self.ui.pushButtonNewAddress.clicked.connect(self.click_NewAddressDialog)
QtCore.SIGNAL( self.ui.pushButtonAddAddressBook.clicked.connect(self.click_pushButtonAddAddressBook)
"triggered()"), self.ui.pushButtonAddSubscription.clicked.connect(self.click_pushButtonAddSubscription)
self.click_actionDeleteAllTrashedMessages) self.ui.pushButtonTTL.clicked.connect(self.click_pushButtonTTL)
QtCore.QObject.connect(self.ui.actionRegenerateDeterministicAddresses, self.ui.pushButtonClear.clicked.connect(self.click_pushButtonClear)
QtCore.SIGNAL( self.ui.pushButtonSend.clicked.connect(self.click_pushButtonSend)
"triggered()"), self.ui.pushButtonFetchNamecoinID.clicked.connect(self.click_pushButtonFetchNamecoinID)
self.click_actionRegenerateDeterministicAddresses) self.ui.actionSettings.triggered.connect(self.click_actionSettings)
QtCore.QObject.connect( self.ui.actionAbout.triggered.connect(self.click_actionAbout)
self.ui.pushButtonAddChan, self.ui.actionSupport.triggered.connect(self.click_actionSupport)
QtCore.SIGNAL("clicked()"), self.ui.actionHelp.triggered.connect(self.click_actionHelp)
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)
def init_inbox_popup_menu(self, connectSignal=True): def init_inbox_popup_menu(self, connectSignal=True):
# Popup menu for the Inbox tab # Popup menu for the Inbox tab
self.ui.inboxContextMenuToolbar = QtGui.QToolBar() self.ui.inboxContextMenuToolbar = QtWidgets.QToolBar()
# Actions # Actions
self.actionReply = self.ui.inboxContextMenuToolbar.addAction(_translate( self.actionReply = self.ui.inboxContextMenuToolbar.addAction(_translate(
"MainWindow", "Reply to sender"), self.on_action_InboxReply) "MainWindow", "Reply to sender"), self.on_action_InboxReply)
@ -225,27 +202,21 @@ class MyForm(settingsmixin.SMainWindow):
# contextmenu messagelists # contextmenu messagelists
self.ui.tableWidgetInbox.setContextMenuPolicy( self.ui.tableWidgetInbox.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL( self.ui.tableWidgetInbox.customContextMenuRequested.connect(self.on_context_menuInbox)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
self.ui.tableWidgetInboxSubscriptions.setContextMenuPolicy( self.ui.tableWidgetInboxSubscriptions.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.tableWidgetInboxSubscriptions, QtCore.SIGNAL( self.ui.tableWidgetInboxSubscriptions.customContextMenuRequested.connect(self.on_context_menuInbox)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
self.ui.tableWidgetInboxChans.setContextMenuPolicy( self.ui.tableWidgetInboxChans.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.tableWidgetInboxChans, QtCore.SIGNAL( self.ui.tableWidgetInboxChans.customContextMenuRequested.connect(self.on_context_menuInbox)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox)
def init_identities_popup_menu(self, connectSignal=True): def init_identities_popup_menu(self, connectSignal=True):
# Popup menu for the Your Identities tab # Popup menu for the Your Identities tab
self.ui.addressContextMenuToolbarYourIdentities = QtGui.QToolBar() self.ui.addressContextMenuToolbarYourIdentities = QtWidgets.QToolBar()
# Actions # Actions
self.actionNewYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction(_translate( self.actionNewYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction(_translate(
"MainWindow", "New"), self.on_action_YourIdentitiesNew) "MainWindow", "New"), self.on_action_YourIdentitiesNew)
@ -277,11 +248,9 @@ class MyForm(settingsmixin.SMainWindow):
self.on_action_MarkAllRead) self.on_action_MarkAllRead)
self.ui.treeWidgetYourIdentities.setContextMenuPolicy( self.ui.treeWidgetYourIdentities.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL( self.ui.treeWidgetYourIdentities.customContextMenuRequested.connect(self.on_context_menuYourIdentities)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuYourIdentities)
# load all gui.menu plugins with prefix 'address' # load all gui.menu plugins with prefix 'address'
self.menu_plugins = {'address': []} self.menu_plugins = {'address': []}
@ -327,15 +296,13 @@ class MyForm(settingsmixin.SMainWindow):
self.on_action_SpecialAddressBehaviorDialog) self.on_action_SpecialAddressBehaviorDialog)
self.ui.treeWidgetChans.setContextMenuPolicy( self.ui.treeWidgetChans.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.treeWidgetChans, QtCore.SIGNAL( self.ui.treeWidgetChans.customContextMenuRequested.connect(self.on_context_menuChan)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuChan)
def init_addressbook_popup_menu(self, connectSignal=True): def init_addressbook_popup_menu(self, connectSignal=True):
# Popup menu for the Address Book page # Popup menu for the Address Book page
self.ui.addressBookContextMenuToolbar = QtGui.QToolBar() self.ui.addressBookContextMenuToolbar = QtWidgets.QToolBar()
# Actions # Actions
self.actionAddressBookSend = self.ui.addressBookContextMenuToolbar.addAction( self.actionAddressBookSend = self.ui.addressBookContextMenuToolbar.addAction(
_translate( _translate(
@ -364,11 +331,9 @@ class MyForm(settingsmixin.SMainWindow):
_translate( _translate(
"MainWindow", "Delete"), self.on_action_AddressBookDelete) "MainWindow", "Delete"), self.on_action_AddressBookDelete)
self.ui.tableWidgetAddressBook.setContextMenuPolicy( self.ui.tableWidgetAddressBook.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL( self.ui.tableWidgetAddressBook.customContextMenuRequested.connect(self.on_context_menuAddressBook)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuAddressBook)
def init_subscriptions_popup_menu(self, connectSignal=True): def init_subscriptions_popup_menu(self, connectSignal=True):
# Actions # Actions
@ -393,11 +358,9 @@ class MyForm(settingsmixin.SMainWindow):
_translate("MainWindow", "Send message to this address"), _translate("MainWindow", "Send message to this address"),
self.on_action_Send) self.on_action_Send)
self.ui.treeWidgetSubscriptions.setContextMenuPolicy( self.ui.treeWidgetSubscriptions.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( self.ui.treeWidgetSubscriptions.customContextMenuRequested.connect(self.on_context_menuSubscriptions)
'customContextMenuRequested(const QPoint&)'),
self.on_context_menuSubscriptions)
def init_sent_popup_menu(self, connectSignal=True): def init_sent_popup_menu(self, connectSignal=True):
# Actions # Actions
@ -421,12 +384,12 @@ class MyForm(settingsmixin.SMainWindow):
def rerenderTabTreeSubscriptions(self): def rerenderTabTreeSubscriptions(self):
treeWidget = self.ui.treeWidgetSubscriptions treeWidget = self.ui.treeWidgetSubscriptions
folders = Ui_FolderWidget.folderWeight.keys() folders = Ui_FolderWidget.folderWeight.keys()
folders.remove("new") Ui_FolderWidget.folderWeight.pop("new", None)
# sort ascending when creating # sort ascending when creating
if treeWidget.topLevelItemCount() == 0: if treeWidget.topLevelItemCount() == 0:
treeWidget.header().setSortIndicator( treeWidget.header().setSortIndicator(
0, QtCore.Qt.AscendingOrder) 0, QtCore.Qt.SortOrder.AscendingOrder)
# init dictionary # init dictionary
db = getSortedSubscriptions(True) db = getSortedSubscriptions(True)
@ -468,7 +431,7 @@ class MyForm(settingsmixin.SMainWindow):
# add missing folders # add missing folders
if len(db[toAddress]) > 0: if len(db[toAddress]) > 0:
j = 0 j = 0
for f, c in db[toAddress].iteritems(): for f, c in db[toAddress].items():
try: try:
subwidget = Ui_FolderWidget(widget, j, toAddress, f, c['count']) subwidget = Ui_FolderWidget(widget, j, toAddress, f, c['count'])
except KeyError: except KeyError:
@ -517,7 +480,7 @@ class MyForm(settingsmixin.SMainWindow):
# sort ascending when creating # sort ascending when creating
if treeWidget.topLevelItemCount() == 0: if treeWidget.topLevelItemCount() == 0:
treeWidget.header().setSortIndicator( treeWidget.header().setSortIndicator(
0, QtCore.Qt.AscendingOrder) 0, QtCore.Qt.SortOrder.AscendingOrder)
# init dictionary # init dictionary
db = {} db = {}
enabled = {} enabled = {}
@ -598,7 +561,7 @@ class MyForm(settingsmixin.SMainWindow):
# add missing folders # add missing folders
if len(db[toAddress]) > 0: if len(db[toAddress]) > 0:
j = 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": if toAddress is not None and tab == 'messages' and folder == "new":
continue continue
subwidget = Ui_FolderWidget(widget, j, toAddress, f, c) subwidget = Ui_FolderWidget(widget, j, toAddress, f, c)
@ -627,7 +590,7 @@ class MyForm(settingsmixin.SMainWindow):
treeWidget.setSortingEnabled(True) treeWidget.setSortingEnabled(True)
def __init__(self, parent=None): def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent) QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow() self.ui = Ui_MainWindow()
self.ui.setupUi(self) self.ui.setupUi(self)
@ -695,65 +658,44 @@ class MyForm(settingsmixin.SMainWindow):
self.rerenderSubscriptions() self.rerenderSubscriptions()
# Initialize the inbox search # Initialize the inbox search
QtCore.QObject.connect(self.ui.inboxSearchLineEdit, QtCore.SIGNAL( self.ui.inboxSearchLineEdit.returnPressed.connect(self.inboxSearchLineEditReturnPressed)
"returnPressed()"), self.inboxSearchLineEditReturnPressed) self.ui.inboxSearchLineEditSubscriptions.returnPressed.connect(self.inboxSearchLineEditReturnPressed)
QtCore.QObject.connect(self.ui.inboxSearchLineEditSubscriptions, QtCore.SIGNAL( self.ui.inboxSearchLineEditChans.returnPressed.connect(self.inboxSearchLineEditReturnPressed)
"returnPressed()"), self.inboxSearchLineEditReturnPressed) self.ui.inboxSearchLineEdit.textChanged.connect(self.inboxSearchLineEditUpdated)
QtCore.QObject.connect(self.ui.inboxSearchLineEditChans, QtCore.SIGNAL( self.ui.inboxSearchLineEditSubscriptions.textChanged.connect(self.inboxSearchLineEditUpdated)
"returnPressed()"), self.inboxSearchLineEditReturnPressed) self.ui.inboxSearchLineEditChans.textChanged.connect(self.inboxSearchLineEditUpdated)
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)
# Initialize addressbook # Initialize addressbook
QtCore.QObject.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL( self.ui.tableWidgetAddressBook.itemChanged.connect(self.tableWidgetAddressBookItemChanged)
"itemChanged(QTableWidgetItem *)"), self.tableWidgetAddressBookItemChanged)
# This is necessary for the completer to work if multiple recipients # This is necessary for the completer to work if multiple recipients
QtCore.QObject.connect(self.ui.lineEditTo, QtCore.SIGNAL( self.ui.lineEditTo.cursorPositionChanged.connect(self.ui.lineEditTo.completer().onCursorPositionChanged)
"cursorPositionChanged(int, int)"), self.ui.lineEditTo.completer().onCursorPositionChanged)
# show messages from message list # show messages from message list
QtCore.QObject.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL( self.ui.tableWidgetInbox.itemSelectionChanged.connect(self.tableWidgetInboxItemClicked)
"itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) self.ui.tableWidgetInboxSubscriptions.itemSelectionChanged.connect(self.tableWidgetInboxItemClicked)
QtCore.QObject.connect(self.ui.tableWidgetInboxSubscriptions, QtCore.SIGNAL( self.ui.tableWidgetInboxChans.itemSelectionChanged.connect(self.tableWidgetInboxItemClicked)
"itemSelectionChanged ()"), self.tableWidgetInboxItemClicked)
QtCore.QObject.connect(self.ui.tableWidgetInboxChans, QtCore.SIGNAL(
"itemSelectionChanged ()"), self.tableWidgetInboxItemClicked)
# tree address lists # tree address lists
QtCore.QObject.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL( self.ui.treeWidgetYourIdentities.itemSelectionChanged.connect(self.treeWidgetItemClicked)
"itemSelectionChanged ()"), self.treeWidgetItemClicked) self.ui.treeWidgetYourIdentities.itemChanged.connect(self.treeWidgetItemChanged)
QtCore.QObject.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL( self.ui.treeWidgetSubscriptions.itemSelectionChanged.connect(self.treeWidgetItemClicked)
"itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged) self.ui.treeWidgetSubscriptions.itemChanged.connect(self.treeWidgetItemChanged)
QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( self.ui.treeWidgetChans.itemSelectionChanged.connect(self.treeWidgetItemClicked)
"itemSelectionChanged ()"), self.treeWidgetItemClicked) self.ui.treeWidgetChans.itemChanged.connect(self.treeWidgetItemChanged)
QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( self.ui.tabWidget.currentChanged.connect(self.tabWidgetCurrentChanged)
"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
)
# Put the colored icon on the status bar # Put the colored icon on the status bar
# self.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png")) # self.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png"))
self.setStatusBar(BMStatusBar()) self.setStatusBar(BMStatusBar())
self.statusbar = self.statusBar() self.statusbar = self.statusBar()
self.pushButtonStatusIcon = QtGui.QPushButton(self) self.pushButtonStatusIcon = QtWidgets.QPushButton(self)
self.pushButtonStatusIcon.setText('') self.pushButtonStatusIcon.setText('')
self.pushButtonStatusIcon.setIcon( self.pushButtonStatusIcon.setIcon(
QtGui.QIcon(':/newPrefix/images/redicon.png')) QtGui.QIcon(':/newPrefix/images/redicon.png'))
self.pushButtonStatusIcon.setFlat(True) self.pushButtonStatusIcon.setFlat(True)
self.statusbar.insertPermanentWidget(0, self.pushButtonStatusIcon) self.statusbar.insertPermanentWidget(0, self.pushButtonStatusIcon)
QtCore.QObject.connect(self.pushButtonStatusIcon, QtCore.SIGNAL( self.pushButtonStatusIcon.clicked.connect(self.click_pushButtonStatusIcon)
"clicked()"), self.click_pushButtonStatusIcon)
self.unreadCount = 0 self.unreadCount = 0
@ -767,39 +709,21 @@ class MyForm(settingsmixin.SMainWindow):
self.UISignalThread = UISignaler.get() self.UISignalThread = UISignaler.get()
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.writeNewAddressToTable.connect(self.writeNewAddressToTable)
"writeNewAddressToTable(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)"), self.writeNewAddressToTable) self.UISignalThread.updateStatusBar.connect(self.updateStatusBar)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.updateSentItemStatusByToAddress.connect(self.updateSentItemStatusByToAddress)
"updateStatusBar(PyQt_PyObject)"), self.updateStatusBar) self.UISignalThread.updateSentItemStatusByAckdata.connect(self.updateSentItemStatusByAckdata)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.displayNewInboxMessage.connect(self.displayNewInboxMessage)
"updateSentItemStatusByToAddress(PyQt_PyObject,PyQt_PyObject)"), self.updateSentItemStatusByToAddress) self.UISignalThread.displayNewSentMessage.connect(self.displayNewSentMessage)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.setStatusIcon.connect(self.setStatusIcon)
"updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"), self.updateSentItemStatusByAckdata) self.UISignalThread.changedInboxUnread.connect(self.changedInboxUnread)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.rerenderMessagelistFromLabels.connect(self.rerenderMessagelistFromLabels)
"displayNewInboxMessage(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)"), self.UISignalThread.rerenderMessagelistToLabels.connect(self.rerenderMessagelistToLabels)
self.displayNewInboxMessage) self.UISignalThread.rerenderAddressBook.connect(self.rerenderAddressBook)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.rerenderSubscriptions.connect(self.rerenderSubscriptions)
"displayNewSentMessage(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject," self.UISignalThread.removeInboxRowByMsgid.connect(self.removeInboxRowByMsgid)
"PyQt_PyObject,PyQt_PyObject)"), self.UISignalThread.newVersionAvailable.connect(self.newVersionAvailable)
self.displayNewSentMessage) self.UISignalThread.displayAlert.connect(self.displayAlert)
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.start() self.UISignalThread.start()
# Key press in tree view # Key press in tree view
@ -832,11 +756,10 @@ class MyForm(settingsmixin.SMainWindow):
TTL = 3600 TTL = 3600
elif TTL > 28*24*60*60: # 28 days elif TTL > 28*24*60*60: # 28 days
TTL = 28*24*60*60 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) self.updateHumanFriendlyTTLDescription(TTL)
QtCore.QObject.connect(self.ui.horizontalSliderTTL, QtCore.SIGNAL( self.ui.horizontalSliderTTL.valueChanged.connect(self.updateTTL)
"valueChanged(int)"), self.updateTTL)
self.initSettings() self.initSettings()
self.resetNamecoinConnection() self.resetNamecoinConnection()
@ -898,9 +821,9 @@ class MyForm(settingsmixin.SMainWindow):
if numberOfHours < 48: if numberOfHours < 48:
self.ui.labelHumanFriendlyTTLDescription.setText( 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; }" stylesheet = "QLabel { color : red; }"
font.setBold(True) font.setBold(True)
@ -911,7 +834,6 @@ class MyForm(settingsmixin.SMainWindow):
"MainWindow", "MainWindow",
"%n day(s)", "%n day(s)",
None, None,
QtCore.QCoreApplication.CodecForTr,
numberOfDays)) numberOfDays))
font.setBold(False) font.setBold(False)
self.ui.labelHumanFriendlyTTLDescription.setStyleSheet(stylesheet) self.ui.labelHumanFriendlyTTLDescription.setStyleSheet(stylesheet)
@ -1186,11 +1108,11 @@ class MyForm(settingsmixin.SMainWindow):
items = [ items = [
MessageList_AddressWidget( MessageList_AddressWidget(
toAddress, unicode(acct.toLabel, 'utf-8')), toAddress, str(acct.toLabel, 'utf-8')),
MessageList_AddressWidget( MessageList_AddressWidget(
fromAddress, unicode(acct.fromLabel, 'utf-8')), fromAddress, str(acct.fromLabel, 'utf-8')),
MessageList_SubjectWidget( MessageList_SubjectWidget(
str(subject), unicode(acct.subject, 'utf-8', 'replace')), str(subject), str(acct.subject, 'utf-8', 'replace')),
MessageList_TimeWidget( MessageList_TimeWidget(
statusText, False, lastactiontime, ackdata)] statusText, False, lastactiontime, ackdata)]
self.addMessageListItem(tableWidget, items) self.addMessageListItem(tableWidget, items)
@ -1211,11 +1133,11 @@ class MyForm(settingsmixin.SMainWindow):
items = [ items = [
MessageList_AddressWidget( MessageList_AddressWidget(
toAddress, unicode(acct.toLabel, 'utf-8'), not read), toAddress, str(acct.toLabel, 'utf-8'), not read),
MessageList_AddressWidget( MessageList_AddressWidget(
fromAddress, unicode(acct.fromLabel, 'utf-8'), not read), fromAddress, str(acct.fromLabel, 'utf-8'), not read),
MessageList_SubjectWidget( MessageList_SubjectWidget(
str(subject), unicode(acct.subject, 'utf-8', 'replace'), str(subject), str(acct.subject, 'utf-8', 'replace'),
not read), not read),
MessageList_TimeWidget( MessageList_TimeWidget(
l10n.formatTimestamp(received), not read, received, msgid) l10n.formatTimestamp(received), not read, received, msgid)
@ -1299,11 +1221,9 @@ class MyForm(settingsmixin.SMainWindow):
# create application indicator # create application indicator
def appIndicatorInit(self, app): def appIndicatorInit(self, app):
self.initTrayIcon("can-icon-24px-red.png", app) self.initTrayIcon("can-icon-24px-red.png", app)
traySignal = "activated(QSystemTrayIcon::ActivationReason)" self.tray.activated.connect(self.__icon_activated);
QtCore.QObject.connect(self.tray, QtCore.SIGNAL(
traySignal), self.__icon_activated)
m = QtGui.QMenu() m = QtWidgets.QMenu()
self.actionStatus = QtGui.QAction(_translate( self.actionStatus = QtGui.QAction(_translate(
"MainWindow", "Not Connected"), m, checkable=False) "MainWindow", "Not Connected"), m, checkable=False)
@ -1471,7 +1391,8 @@ class MyForm(settingsmixin.SMainWindow):
self._notifier = _simple_notify self._notifier = _simple_notify
# does nothing if isAvailable returns false # does nothing if isAvailable returns false
self._player = QtGui.QSound.play # XXX unresolved
#self._player = QtGui.QSound.play
if not get_plugins: if not get_plugins:
return return
@ -1484,7 +1405,9 @@ class MyForm(settingsmixin.SMainWindow):
self._theme_player = get_plugin('notification.sound', 'theme') 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( _plugin = get_plugin(
'notification.sound', 'file', fallback='file.fallback') 'notification.sound', 'file', fallback='file.fallback')
if _plugin: if _plugin:
@ -1496,7 +1419,7 @@ class MyForm(settingsmixin.SMainWindow):
self, title, subtitle, category, label=None, icon=None): self, title, subtitle, category, label=None, icon=None):
self.playSound(category, label) self.playSound(category, label)
self._notifier( self._notifier(
unicode(title), unicode(subtitle), category, label, icon) str(title), str(subtitle), category, label, icon)
# tree # tree
def treeWidgetKeyPressEvent(self, event): def treeWidgetKeyPressEvent(self, event):
@ -1712,7 +1635,7 @@ class MyForm(settingsmixin.SMainWindow):
def showConnectDialog(self): def showConnectDialog(self):
dialog = dialogs.ConnectDialog(self) dialog = dialogs.ConnectDialog(self)
if dialog.exec_(): if dialog.exec():
if dialog.radioButtonConnectNow.isChecked(): if dialog.radioButtonConnectNow.isChecked():
self.ui.updateNetworkSwitchMenuLabel(False) self.ui.updateNetworkSwitchMenuLabel(False)
config.remove_option( config.remove_option(
@ -1820,7 +1743,7 @@ class MyForm(settingsmixin.SMainWindow):
def initTrayIcon(self, iconFileName, app): def initTrayIcon(self, iconFileName, app):
self.currentTrayIconFileName = iconFileName self.currentTrayIconFileName = iconFileName
self.tray = QtGui.QSystemTrayIcon( self.tray = QtWidgets.QSystemTrayIcon(
self.calcTrayIcon(iconFileName, self.findInboxUnreadCount()), app) self.calcTrayIcon(iconFileName, self.findInboxUnreadCount()), app)
def setTrayIconFile(self, iconFileName): def setTrayIconFile(self, iconFileName):
@ -1995,9 +1918,9 @@ class MyForm(settingsmixin.SMainWindow):
def rerenderAddressBook(self): def rerenderAddressBook(self):
def addRow (address, label, type): def addRow (address, label, type):
self.ui.tableWidgetAddressBook.insertRow(0) 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) 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) self.ui.tableWidgetAddressBook.setItem(0, 1, newItem)
oldRows = {} oldRows = {}
@ -2006,7 +1929,7 @@ class MyForm(settingsmixin.SMainWindow):
oldRows[item.address] = [item.label, item.type, i] oldRows[item.address] = [item.label, item.type, i]
if self.ui.tableWidgetAddressBook.rowCount() == 0: 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(): if self.ui.tableWidgetAddressBook.isSortingEnabled():
self.ui.tableWidgetAddressBook.setSortingEnabled(False) self.ui.tableWidgetAddressBook.setSortingEnabled(False)
@ -2038,11 +1961,11 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.tableWidgetAddressBook.removeRow(oldRows[address][2]) self.ui.tableWidgetAddressBook.removeRow(oldRows[address][2])
for address in newRows: for address in newRows:
addRow(address, newRows[address][0], newRows[address][1]) 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 # sort
self.ui.tableWidgetAddressBook.sortByColumn( self.ui.tableWidgetAddressBook.sortByColumn(
0, QtCore.Qt.AscendingOrder) 0, QtCore.Qt.SortOrder.AscendingOrder)
self.ui.tableWidgetAddressBook.setSortingEnabled(True) self.ui.tableWidgetAddressBook.setSortingEnabled(True)
self.ui.lineEditTo.completer().model().setStringList(completerList) self.ui.lineEditTo.completer().model().setStringList(completerList)
@ -2164,7 +2087,7 @@ class MyForm(settingsmixin.SMainWindow):
status, addressVersionNumber, streamNumber = decodeAddress(toAddress)[:3] status, addressVersionNumber, streamNumber = decodeAddress(toAddress)[:3]
if status != 'success': if status != 'success':
try: try:
toAddress = unicode(toAddress, 'utf-8', 'ignore') toAddress = str(toAddress, 'utf-8', 'ignore')
except: except:
pass pass
logger.error('Error: Could not decode recipient address ' + toAddress + ':' + status) logger.error('Error: Could not decode recipient address ' + toAddress + ':' + status)
@ -2368,11 +2291,11 @@ class MyForm(settingsmixin.SMainWindow):
addressInKeysFile, 'enabled') addressInKeysFile, 'enabled')
isMaillinglist = config.safeGetBoolean(addressInKeysFile, 'mailinglist') isMaillinglist = config.safeGetBoolean(addressInKeysFile, 'mailinglist')
if isEnabled and not isMaillinglist: if isEnabled and not isMaillinglist:
label = unicode(config.get(addressInKeysFile, 'label'), 'utf-8', 'ignore').strip() label = str(config.get(addressInKeysFile, 'label'), 'utf-8', 'ignore').strip()
if label == "": if label == "":
label = addressInKeysFile label = addressInKeysFile
self.ui.comboBoxSendFrom.addItem(avatarize(addressInKeysFile), 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()): for i in range(self.ui.comboBoxSendFrom.count()):
address = str(self.ui.comboBoxSendFrom.itemData( address = str(self.ui.comboBoxSendFrom.itemData(
i, QtCore.Qt.UserRole).toString()) i, QtCore.Qt.UserRole).toString())
@ -2392,7 +2315,7 @@ class MyForm(settingsmixin.SMainWindow):
addressInKeysFile, 'enabled') addressInKeysFile, 'enabled')
isChan = config.safeGetBoolean(addressInKeysFile, 'chan') isChan = config.safeGetBoolean(addressInKeysFile, 'chan')
if isEnabled and not isChan: if isEnabled and not isChan:
label = unicode(config.get(addressInKeysFile, 'label'), 'utf-8', 'ignore').strip() label = str(config.get(addressInKeysFile, 'label'), 'utf-8', 'ignore').strip()
if label == "": if label == "":
label = addressInKeysFile label = addressInKeysFile
self.ui.comboBoxSendFromBroadcast.addItem(avatarize(addressInKeysFile), label, addressInKeysFile) self.ui.comboBoxSendFromBroadcast.addItem(avatarize(addressInKeysFile), label, addressInKeysFile)
@ -2498,7 +2421,7 @@ class MyForm(settingsmixin.SMainWindow):
self.notifierShow( self.notifierShow(
_translate("MainWindow", "New Message"), _translate("MainWindow", "New Message"),
_translate("MainWindow", "From %1").arg( _translate("MainWindow", "From %1").arg(
unicode(acct.fromLabel, 'utf-8')), str(acct.fromLabel, 'utf-8')),
sound.SOUND_UNKNOWN sound.SOUND_UNKNOWN
) )
if self.getCurrentAccount() is not None and ( if self.getCurrentAccount() is not None and (
@ -2732,12 +2655,12 @@ class MyForm(settingsmixin.SMainWindow):
_translate( _translate(
"MainWindow", "MainWindow",
"%n object(s) pending proof of work", None, "%n object(s) pending proof of work", None,
QtCore.QCoreApplication.CodecForTr, powQueueSize() powQueueSize()
) + ", " + ) + ", " +
_translate( _translate(
"MainWindow", "MainWindow",
"%n object(s) waiting to be distributed", None, "%n object(s) waiting to be distributed", None,
QtCore.QCoreApplication.CodecForTr, pendingUpload() pendingUpload()
) + "\n\n" + ) + "\n\n" +
_translate( _translate(
"MainWindow", "Wait until these tasks finish?"), "MainWindow", "Wait until these tasks finish?"),
@ -2871,7 +2794,7 @@ class MyForm(settingsmixin.SMainWindow):
QtCore.QEventLoop.AllEvents, 1000 QtCore.QEventLoop.AllEvents, 1000
) )
self.saveSettings() self.saveSettings()
for attr, obj in self.ui.__dict__.iteritems(): for attr, obj in self.ui.__dict__.items():
if hasattr(obj, "__class__") \ if hasattr(obj, "__class__") \
and isinstance(obj, settingsmixin.SettingsMixin): and isinstance(obj, settingsmixin.SettingsMixin):
saveMethod = getattr(obj, "saveSettings", None) saveMethod = getattr(obj, "saveSettings", None)
@ -2934,7 +2857,7 @@ class MyForm(settingsmixin.SMainWindow):
lines[i] = '<br><br>' lines[i] = '<br><br>'
content = ' '.join(lines) # To keep the whitespace between lines content = ' '.join(lines) # To keep the whitespace between lines
content = shared.fixPotentiallyInvalidUTF8Data(content) content = shared.fixPotentiallyInvalidUTF8Data(content)
content = unicode(content, 'utf-8)') content = str(content, 'utf-8)')
textEdit.setHtml(QtCore.QString(content)) textEdit.setHtml(QtCore.QString(content))
def on_action_InboxMarkUnread(self): def on_action_InboxMarkUnread(self):
@ -3117,7 +3040,7 @@ class MyForm(settingsmixin.SMainWindow):
self.setSendFromComboBox(toAddressAtCurrentInboxRow) self.setSendFromComboBox(toAddressAtCurrentInboxRow)
quotedText = self.quoted_text( quotedText = self.quoted_text(
unicode(messageAtCurrentInboxRow, 'utf-8', 'replace')) str(messageAtCurrentInboxRow, 'utf-8', 'replace'))
widget['message'].setPlainText(quotedText) widget['message'].setPlainText(quotedText)
if acct.subject[0:3] in ('Re:', 'RE:'): if acct.subject[0:3] in ('Re:', 'RE:'):
widget['subject'].setText( widget['subject'].setText(
@ -3368,7 +3291,7 @@ class MyForm(settingsmixin.SMainWindow):
return self.updateStatusBar(_translate( return self.updateStatusBar(_translate(
"MainWindow", "No addresses selected.")) "MainWindow", "No addresses selected."))
addresses_string = unicode( addresses_string = str(
self.ui.lineEditTo.text().toUtf8(), 'utf-8') self.ui.lineEditTo.text().toUtf8(), 'utf-8')
for item in selected_items: for item in selected_items:
address_string = item.accountString() address_string = item.accountString()
@ -3861,11 +3784,11 @@ class MyForm(settingsmixin.SMainWindow):
self.setAddressSound(widget.item(widget.currentRow(), 0).text()) self.setAddressSound(widget.item(widget.currentRow(), 0).text())
def setAddressSound(self, addr): def setAddressSound(self, addr):
filters = [unicode(_translate( filters = [str(_translate(
"MainWindow", "Sound files (%s)" % "MainWindow", "Sound files (%s)" %
' '.join(['*%s%s' % (os.extsep, ext) for ext in sound.extensions]) ' '.join(['*%s%s' % (os.extsep, ext) for ext in sound.extensions])
))] ))]
sourcefile = unicode(QtGui.QFileDialog.getOpenFileName( sourcefile = str(QtGui.QFileDialog.getOpenFileName(
self, _translate("MainWindow", "Set notification sound..."), self, _translate("MainWindow", "Set notification sound..."),
filter=';;'.join(filters) filter=';;'.join(filters)
)) ))
@ -3874,7 +3797,7 @@ class MyForm(settingsmixin.SMainWindow):
return return
destdir = os.path.join(state.appdata, 'sounds') destdir = os.path.join(state.appdata, 'sounds')
destfile = unicode(addr) + os.path.splitext(sourcefile)[-1] destfile = str(addr) + os.path.splitext(sourcefile)[-1]
destination = os.path.join(destdir, destfile) destination = os.path.join(destdir, destfile)
if sourcefile == destination: if sourcefile == destination:
@ -4084,7 +4007,7 @@ class MyForm(settingsmixin.SMainWindow):
if item.type == AccountMixin.ALL: if item.type == AccountMixin.ALL:
return return
newLabel = unicode(item.text(0), 'utf-8', 'ignore') newLabel = str(item.text(0), 'utf-8', 'ignore')
oldLabel = item.defaultLabel() oldLabel = item.defaultLabel()
# unchanged, do not do anything either # unchanged, do not do anything either
@ -4155,7 +4078,7 @@ class MyForm(settingsmixin.SMainWindow):
self.rerenderMessagelistToLabels() self.rerenderMessagelistToLabels()
completerList = self.ui.lineEditTo.completer().model().stringList() completerList = self.ui.lineEditTo.completer().model().stringList()
for i in range(len(completerList)): for i in range(len(completerList)):
if unicode(completerList[i]).endswith(" <" + item.address + ">"): if str(completerList[i]).endswith(" <" + item.address + ">"):
completerList[i] = item.label + " <" + item.address + ">" completerList[i] = item.label + " <" + item.address + ">"
self.ui.lineEditTo.completer().model().setStringList(completerList) self.ui.lineEditTo.completer().model().setStringList(completerList)
@ -4209,7 +4132,7 @@ class MyForm(settingsmixin.SMainWindow):
def initSettings(self): def initSettings(self):
self.loadSettings() self.loadSettings()
for attr, obj in self.ui.__dict__.iteritems(): for attr, obj in self.ui.__dict__.items():
if hasattr(obj, "__class__") and \ if hasattr(obj, "__class__") and \
isinstance(obj, settingsmixin.SettingsMixin): isinstance(obj, settingsmixin.SettingsMixin):
loadMethod = getattr(obj, "loadSettings", None) loadMethod = getattr(obj, "loadSettings", None)
@ -4221,7 +4144,7 @@ app = None
myapp = None myapp = None
class BitmessageQtApplication(QtGui.QApplication): class BitmessageQtApplication(QtWidgets.QApplication):
""" """
Listener to allow our Qt form to get focus when another instance of the Listener to allow our Qt form to get focus when another instance of the
application is open. application is open.
@ -4250,7 +4173,7 @@ class BitmessageQtApplication(QtGui.QApplication):
# Cleanup past crashed servers # Cleanup past crashed servers
if not self.is_running: if not self.is_running:
if socket.error() == QLocalSocket.ConnectionRefusedError: if socket.error() == QLocalSocket.LocalSocketError.ConnectionRefusedError:
socket.disconnectFromServer() socket.disconnectFromServer()
QLocalServer.removeServer(id) QLocalServer.removeServer(id)
@ -4307,4 +4230,4 @@ def run():
QtCore.QTimer.singleShot( QtCore.QTimer.singleShot(
30000, lambda: myapp.setStatusIcon(state.statusIconColor)) 30000, lambda: myapp.setStatusIcon(state.statusIconColor))
app.exec_() app.exec()

View File

@ -14,7 +14,7 @@ import re
import sys import sys
import time import time
from PyQt4 import QtGui from PyQt6 import QtGui
import queues import queues
from addresses import decodeAddress from addresses import decodeAddress

View File

@ -5,12 +5,12 @@ Dialogs that work with BM address.
import hashlib import hashlib
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
import queues import queues
import widgets import bitmessageqt.widgets
import state import state
from account import AccountMixin, GatewayAccount, MailchuckAccount, accountClass from .account import AccountMixin, GatewayAccount, MailchuckAccount, accountClass
from addresses import addBMIfNotPresent, decodeAddress, encodeVarint from addresses import addBMIfNotPresent, decodeAddress, encodeVarint
from bmconfigparser import config as global_config from bmconfigparser import config as global_config
from tr import _translate from tr import _translate
@ -79,7 +79,7 @@ class AddressCheckMixin(object):
)) ))
class AddressDataDialog(QtGui.QDialog, AddressCheckMixin): class AddressDataDialog(QtWidgets.QDialog, AddressCheckMixin):
"""QDialog with Bitmessage address validation""" """QDialog with Bitmessage address validation"""
def __init__(self, parent): def __init__(self, parent):
@ -112,7 +112,7 @@ class AddAddressDialog(AddressDataDialog):
self.lineEditAddress.setText(address) self.lineEditAddress.setText(address)
class NewAddressDialog(QtGui.QDialog): class NewAddressDialog(QtWidgets.QDialog):
"""QDialog for generating a new address""" """QDialog for generating a new address"""
def __init__(self, parent=None): def __init__(self, parent=None):
@ -212,12 +212,11 @@ class NewSubscriptionDialog(AddressDataDialog):
"MainWindow", "MainWindow",
"Display the %n recent broadcast(s) from this address.", "Display the %n recent broadcast(s) from this address.",
None, None,
QtCore.QCoreApplication.CodecForTr,
count count
)) ))
class RegenerateAddressesDialog(QtGui.QDialog): class RegenerateAddressesDialog(QtWidgets.QDialog):
"""QDialog for regenerating deterministic addresses""" """QDialog for regenerating deterministic addresses"""
def __init__(self, parent=None): def __init__(self, parent=None):
super(RegenerateAddressesDialog, self).__init__(parent) super(RegenerateAddressesDialog, self).__init__(parent)
@ -226,7 +225,7 @@ class RegenerateAddressesDialog(QtGui.QDialog):
QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self))
class SpecialAddressBehaviorDialog(QtGui.QDialog): class SpecialAddressBehaviorDialog(QtWidgets.QDialog):
""" """
QDialog for special address behaviour (e.g. mailing list functionality) QDialog for special address behaviour (e.g. mailing list functionality)
""" """
@ -291,7 +290,7 @@ class SpecialAddressBehaviorDialog(QtGui.QDialog):
self.parent.rerenderMessagelistToLabels() self.parent.rerenderMessagelistToLabels()
class EmailGatewayDialog(QtGui.QDialog): class EmailGatewayDialog(QtWidgets.QDialog):
"""QDialog for email gateway control""" """QDialog for email gateway control"""
def __init__(self, parent, config=global_config, account=None): def __init__(self, parent, config=global_config, account=None):
super(EmailGatewayDialog, self).__init__(parent) super(EmailGatewayDialog, self).__init__(parent)

View File

@ -3,15 +3,15 @@ Address validator module.
""" """
# pylint: disable=too-many-branches,too-many-arguments # pylint: disable=too-many-branches,too-many-arguments
from Queue import Empty from queue import Empty
from PyQt4 import QtGui from PyQt6 import QtGui
from addresses import decodeAddress, addBMIfNotPresent from addresses import decodeAddress, addBMIfNotPresent
from bmconfigparser import config from bmconfigparser import config
from queues import apiAddressGeneratorReturnQueue, addressGeneratorQueue from queues import apiAddressGeneratorReturnQueue, addressGeneratorQueue
from tr import _translate from tr import _translate
from utils import str_chan from .utils import str_chan
class AddressPassPhraseValidatorMixin(object): class AddressPassPhraseValidatorMixin(object):

View File

@ -7,9 +7,9 @@
# #
# WARNING! All changes made in this file will be lost! # 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\ \x00\x00\x03\x66\
\x89\ \x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
@ -1534,7 +1534,7 @@ qt_resource_data = "\
\x82\ \x82\
" "
qt_resource_name = "\ qt_resource_name = b"\
\x00\x09\ \x00\x09\
\x0c\x78\x54\x88\ \x0c\x78\x54\x88\
\x00\x6e\ \x00\x6e\
@ -1639,7 +1639,7 @@ qt_resource_name = "\
\x00\x70\x00\x6e\x00\x67\ \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\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \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\ \x00\x00\x00\x18\x00\x02\x00\x00\x00\x15\x00\x00\x00\x03\

View File

@ -0,0 +1,119 @@
--- bitmessageui.py.orig 2024-05-12 18:57:04.429581050 +0900
+++ bitmessageui.py 2024-05-12 19:50:49.951776910 +0900
@@ -7,7 +7,8 @@
from PyQt6 import QtCore, QtGui, QtWidgets
-
+from bmconfigparser import config
+from .foldertree import AddressBookCompleter
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
@@ -137,6 +138,11 @@
self.tableWidgetAddressBook.horizontalHeader().setStretchLastSection(True)
self.tableWidgetAddressBook.verticalHeader().setVisible(False)
self.verticalLayout_2.addWidget(self.tableWidgetAddressBook)
+ self.addressBookCompleter = AddressBookCompleter()
+ 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 = QtWidgets.QPushButton(parent=self.send)
self.pushButtonAddAddressBook.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonAddAddressBook.setObjectName("pushButtonAddAddressBook")
@@ -181,6 +187,7 @@
self.lineEditTo = QtWidgets.QLineEdit(parent=self.tab)
self.lineEditTo.setObjectName("lineEditTo")
self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1)
+ self.lineEditTo.setCompleter(self.addressBookCompleter)
self.verticalLayout_5.addLayout(self.gridLayout_2)
self.textEditMessage = QtWidgets.QTextEdit(parent=self.tab)
self.textEditMessage.setObjectName("textEditMessage")
@@ -260,6 +267,9 @@
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")
@@ -546,6 +556,8 @@
self.actionManageKeys = QtGui.QAction(parent=MainWindow)
self.actionManageKeys.setCheckable(False)
self.actionManageKeys.setEnabled(True)
+ self.actionNetworkSwitch = QtGui.QAction(parent=MainWindow)
+ self.actionNetworkSwitch.setObjectName("actionNetworkSwitch")
icon = QtGui.QIcon.fromTheme("dialog-password")
self.actionManageKeys.setIcon(icon)
self.actionManageKeys.setObjectName("actionManageKeys")
@@ -557,6 +569,10 @@
icon = QtGui.QIcon.fromTheme("help-contents")
self.actionHelp.setIcon(icon)
self.actionHelp.setObjectName("actionHelp")
+ self.actionSupport = QtGui.QAction(MainWindow)
+ icon = QtGui.QIcon.fromTheme("help-support")
+ self.actionSupport.setIcon(icon)
+ self.actionSupport.setObjectName("actionSupport")
self.actionAbout = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("help-about")
self.actionAbout.setIcon(icon)
@@ -580,9 +596,11 @@
self.menuFile.addAction(self.actionManageKeys)
self.menuFile.addAction(self.actionDeleteAllTrashedMessages)
self.menuFile.addAction(self.actionRegenerateDeterministicAddresses)
+ self.menuFile.addAction(self.actionNetworkSwitch)
self.menuFile.addAction(self.actionExit)
self.menuSettings.addAction(self.actionSettings)
self.menuHelp.addAction(self.actionHelp)
+ self.menuHelp.addAction(self.actionSupport)
self.menuHelp.addAction(self.actionAbout)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuSettings.menuAction())
@@ -606,6 +624,25 @@
MainWindow.setTabOrder(self.tableWidgetBlacklist, self.tableWidgetConnectionCount)
MainWindow.setTabOrder(self.tableWidgetConnectionCount, self.pushButtonStatusIcon)
+ # Popup menu actions container for the Sent page
+ # pylint: disable=attribute-defined-outside-init
+ self.sentContextMenuToolbar = QtWidgets.QToolBar()
+ # Popup menu actions container for chans tree
+ self.addressContextMenuToolbar = QtWidgets.QToolBar()
+ # Popup menu actions container for subscriptions tree
+ self.subscriptionsContextMenuToolbar = QtWidgets.QToolBar()
+
+ def updateNetworkSwitchMenuLabel(self, dontconnect=None):
+ if dontconnect is None:
+ _translate = QtCore.QCoreApplication.translate
+ dontconnect = config.safeGetBoolean(
+ 'bitmessagesettings', 'dontconnect')
+ self.actionNetworkSwitch.setText(
+ _translate("MainWindow", "Go online", None)
+ if dontconnect else
+ _translate("MainWindow", "Go offline", None)
+ )
+
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Bitmessage"))
@@ -653,6 +690,7 @@
self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.tab_2), _translate("MainWindow", "Send Message to your Subscribers"))
self.pushButtonTTL.setText(_translate("MainWindow", "TTL:"))
self.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "X days"))
+ self.pushButtonClear.setText(_translate("MainWindow", "Clear"))
self.pushButtonSend.setText(_translate("MainWindow", "Send"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send"))
self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions"))
@@ -722,8 +760,10 @@
self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q"))
self.actionHelp.setText(_translate("MainWindow", "Help"))
self.actionHelp.setShortcut(_translate("MainWindow", "F1"))
+ self.actionSupport.setText(_translate("MainWindow", "Contact support"))
self.actionAbout.setText(_translate("MainWindow", "About"))
self.actionSettings.setText(_translate("MainWindow", "Settings"))
self.actionRegenerateDeterministicAddresses.setText(_translate("MainWindow", "Regenerate deterministic addresses"))
self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages"))
self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan"))
+ self.updateNetworkSwitchMenuLabel()

View File

@ -1,59 +1,31 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'bitmessageui.ui' # Form implementation generated from reading ui file 'bitmessageui.ui'
# #
# Created: Mon Mar 23 22:18:07 2015 # Created by: PyQt6 UI code generator 6.4.2
# by: PyQt4 UI code generator 4.10.4
# #
# WARNING! All changes made in this file will be lost! # 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.
from PyQt4 import QtCore, QtGui
from PyQt6 import QtCore, QtGui, QtWidgets
from bmconfigparser import config from bmconfigparser import config
from foldertree import AddressBookCompleter 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
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)
class Ui_MainWindow(object): class Ui_MainWindow(object):
def setupUi(self, MainWindow): 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 = QtGui.QIcon()
icon.addPixmap( icon.addPixmap(QtGui.QPixmap(":/newPrefix/images/can-icon-24px.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-24px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off self.MainDock.setWindowIcon(icon)
) self.MainDock.setObjectName("MainDock")
MainWindow.setWindowIcon(icon) self.centralwidget = QtWidgets.QWidget()
MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget.setObjectName("centralwidget")
self.centralwidget = QtGui.QWidget(MainWindow) self.gridLayout_10 = QtWidgets.QGridLayout(self.centralwidget)
self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.gridLayout_10.setObjectName("gridLayout_10")
self.gridLayout_10 = QtGui.QGridLayout(self.centralwidget) self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget)
self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) self.tabWidget.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
self.tabWidget = QtGui.QTabWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
@ -63,75 +35,62 @@ class Ui_MainWindow(object):
font = QtGui.QFont() font = QtGui.QFont()
font.setPointSize(9) font.setPointSize(9)
self.tabWidget.setFont(font) self.tabWidget.setFont(font)
self.tabWidget.setTabPosition(QtGui.QTabWidget.North) self.tabWidget.setTabPosition(QtWidgets.QTabWidget.TabPosition.North)
self.tabWidget.setTabShape(QtGui.QTabWidget.Rounded) self.tabWidget.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
self.tabWidget.setObjectName(_fromUtf8("tabWidget")) self.tabWidget.setObjectName("tabWidget")
self.inbox = QtGui.QWidget() self.inbox = QtWidgets.QWidget()
self.inbox.setObjectName(_fromUtf8("inbox")) self.inbox.setObjectName("inbox")
self.gridLayout = QtGui.QGridLayout(self.inbox) self.gridLayout = QtWidgets.QGridLayout(self.inbox)
self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.gridLayout.setObjectName("gridLayout")
self.horizontalSplitter_3 = settingsmixin.SSplitter() self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalSplitter_3.setObjectName(_fromUtf8("horizontalSplitter_3")) self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.verticalSplitter_12 = settingsmixin.SSplitter() self.verticalLayout_12 = QtWidgets.QVBoxLayout()
self.verticalSplitter_12.setObjectName(_fromUtf8("verticalSplitter_12")) self.verticalLayout_12.setObjectName("verticalLayout_12")
self.verticalSplitter_12.setOrientation(QtCore.Qt.Vertical) self.treeWidgetYourIdentities = QtWidgets.QTreeWidget(parent=self.inbox)
self.treeWidgetYourIdentities = settingsmixin.STreeWidget(self.inbox) self.treeWidgetYourIdentities.setMaximumSize(QtCore.QSize(200, 16777215))
self.treeWidgetYourIdentities.setObjectName(_fromUtf8("treeWidgetYourIdentities")) self.treeWidgetYourIdentities.setObjectName("treeWidgetYourIdentities")
self.treeWidgetYourIdentities.resize(200, self.treeWidgetYourIdentities.height())
icon1 = QtGui.QIcon() icon1 = QtGui.QIcon()
icon1.addPixmap( icon1.addPixmap(QtGui.QPixmap(":/newPrefix/images/identities.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/identities.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
self.treeWidgetYourIdentities.headerItem().setIcon(0, icon1) self.treeWidgetYourIdentities.headerItem().setIcon(0, icon1)
self.verticalSplitter_12.addWidget(self.treeWidgetYourIdentities) self.verticalLayout_12.addWidget(self.treeWidgetYourIdentities)
self.pushButtonNewAddress = QtGui.QPushButton(self.inbox) self.pushButtonNewAddress = QtWidgets.QPushButton(parent=self.inbox)
self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress")) self.pushButtonNewAddress.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonNewAddress.resize(200, self.pushButtonNewAddress.height()) self.pushButtonNewAddress.setObjectName("pushButtonNewAddress")
self.verticalSplitter_12.addWidget(self.pushButtonNewAddress) self.verticalLayout_12.addWidget(self.pushButtonNewAddress)
self.verticalSplitter_12.setStretchFactor(0, 1) self.horizontalLayout_3.addLayout(self.verticalLayout_12)
self.verticalSplitter_12.setStretchFactor(1, 0) self.verticalLayout_7 = QtWidgets.QVBoxLayout()
self.verticalSplitter_12.setCollapsible(0, False) self.verticalLayout_7.setObjectName("verticalLayout_7")
self.verticalSplitter_12.setCollapsible(1, False) self.horizontalLayoutSearch = QtWidgets.QHBoxLayout()
self.verticalSplitter_12.handle(1).setEnabled(False) self.horizontalLayoutSearch.setContentsMargins(-1, 0, -1, -1)
self.horizontalSplitter_3.addWidget(self.verticalSplitter_12) self.horizontalLayoutSearch.setObjectName("horizontalLayoutSearch")
self.verticalSplitter_7 = settingsmixin.SSplitter() self.inboxSearchLineEdit = QtWidgets.QLineEdit(parent=self.inbox)
self.verticalSplitter_7.setObjectName(_fromUtf8("verticalSplitter_7")) self.inboxSearchLineEdit.setObjectName("inboxSearchLineEdit")
self.verticalSplitter_7.setOrientation(QtCore.Qt.Vertical) self.horizontalLayoutSearch.addWidget(self.inboxSearchLineEdit)
self.horizontalSplitterSearch = QtGui.QSplitter() self.inboxSearchOption = QtWidgets.QComboBox(parent=self.inbox)
self.horizontalSplitterSearch.setObjectName(_fromUtf8("horizontalSplitterSearch")) self.inboxSearchOption.setObjectName("inboxSearchOption")
self.inboxSearchLineEdit = QtGui.QLineEdit(self.inbox) self.inboxSearchOption.addItem("")
self.inboxSearchLineEdit.setObjectName(_fromUtf8("inboxSearchLineEdit")) self.inboxSearchOption.addItem("")
self.horizontalSplitterSearch.addWidget(self.inboxSearchLineEdit) self.inboxSearchOption.addItem("")
self.inboxSearchOption = QtGui.QComboBox(self.inbox) self.inboxSearchOption.addItem("")
self.inboxSearchOption.setObjectName(_fromUtf8("inboxSearchOption")) self.inboxSearchOption.addItem("")
self.inboxSearchOption.addItem(_fromUtf8("")) self.horizontalLayoutSearch.addWidget(self.inboxSearchOption)
self.inboxSearchOption.addItem(_fromUtf8("")) self.verticalLayout_7.addLayout(self.horizontalLayoutSearch)
self.inboxSearchOption.addItem(_fromUtf8("")) self.tableWidgetInbox = QtWidgets.QTableWidget(parent=self.inbox)
self.inboxSearchOption.addItem(_fromUtf8("")) self.tableWidgetInbox.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
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.tableWidgetInbox.setAlternatingRowColors(True) self.tableWidgetInbox.setAlternatingRowColors(True)
self.tableWidgetInbox.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.tableWidgetInbox.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetInbox.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tableWidgetInbox.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInbox.setWordWrap(False) self.tableWidgetInbox.setWordWrap(False)
self.tableWidgetInbox.setObjectName(_fromUtf8("tableWidgetInbox")) self.tableWidgetInbox.setObjectName("tableWidgetInbox")
self.tableWidgetInbox.setColumnCount(4) self.tableWidgetInbox.setColumnCount(4)
self.tableWidgetInbox.setRowCount(0) self.tableWidgetInbox.setRowCount(0)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(0, item) self.tableWidgetInbox.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(1, item) self.tableWidgetInbox.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(2, item) self.tableWidgetInbox.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(3, item) self.tableWidgetInbox.setHorizontalHeaderItem(3, item)
self.tableWidgetInbox.horizontalHeader().setCascadingSectionResizes(True) self.tableWidgetInbox.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInbox.horizontalHeader().setDefaultSectionSize(200) self.tableWidgetInbox.horizontalHeader().setDefaultSectionSize(200)
@ -141,302 +100,243 @@ class Ui_MainWindow(object):
self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True) self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInbox.verticalHeader().setVisible(False) self.tableWidgetInbox.verticalHeader().setVisible(False)
self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26) self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26)
self.verticalSplitter_7.addWidget(self.tableWidgetInbox) self.verticalLayout_7.addWidget(self.tableWidgetInbox)
self.textEditInboxMessage = MessageView(self.inbox) self.textEditInboxMessage = QtWidgets.QTextEdit(parent=self.inbox)
self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessage.setReadOnly(True) self.textEditInboxMessage.setReadOnly(True)
self.textEditInboxMessage.setObjectName(_fromUtf8("textEditInboxMessage")) self.textEditInboxMessage.setObjectName("textEditInboxMessage")
self.verticalSplitter_7.addWidget(self.textEditInboxMessage) self.verticalLayout_7.addWidget(self.textEditInboxMessage)
self.verticalSplitter_7.setStretchFactor(0, 0) self.horizontalLayout_3.addLayout(self.verticalLayout_7)
self.verticalSplitter_7.setStretchFactor(1, 1) self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 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)
icon2 = QtGui.QIcon() icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon2.addPixmap(QtGui.QPixmap(":/newPrefix/images/inbox.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.inbox, icon2, _fromUtf8("")) self.tabWidget.addTab(self.inbox, icon2, "")
self.send = QtGui.QWidget() self.send = QtWidgets.QWidget()
self.send.setObjectName(_fromUtf8("send")) self.send.setObjectName("send")
self.gridLayout_7 = QtGui.QGridLayout(self.send) self.gridLayout_7 = QtWidgets.QGridLayout(self.send)
self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) self.gridLayout_7.setObjectName("gridLayout_7")
self.horizontalSplitter = settingsmixin.SSplitter() self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalSplitter.setObjectName(_fromUtf8("horizontalSplitter")) self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalSplitter_2 = settingsmixin.SSplitter() self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalSplitter_2.setObjectName(_fromUtf8("verticalSplitter_2")) self.verticalLayout_2.setObjectName("verticalLayout_2")
self.verticalSplitter_2.setOrientation(QtCore.Qt.Vertical) self.tableWidgetAddressBook = QtWidgets.QTableWidget(parent=self.send)
self.tableWidgetAddressBook = settingsmixin.STableWidget(self.send) self.tableWidgetAddressBook.setMaximumSize(QtCore.QSize(200, 16777215))
self.tableWidgetAddressBook.setAlternatingRowColors(True) self.tableWidgetAddressBook.setAlternatingRowColors(True)
self.tableWidgetAddressBook.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.tableWidgetAddressBook.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetAddressBook.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tableWidgetAddressBook.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetAddressBook.setObjectName(_fromUtf8("tableWidgetAddressBook")) self.tableWidgetAddressBook.setObjectName("tableWidgetAddressBook")
self.tableWidgetAddressBook.setColumnCount(2) self.tableWidgetAddressBook.setColumnCount(2)
self.tableWidgetAddressBook.setRowCount(0) self.tableWidgetAddressBook.setRowCount(0)
self.tableWidgetAddressBook.resize(200, self.tableWidgetAddressBook.height()) item = QtWidgets.QTableWidgetItem()
item = QtGui.QTableWidgetItem()
icon3 = QtGui.QIcon() icon3 = QtGui.QIcon()
icon3.addPixmap( icon3.addPixmap(QtGui.QPixmap(":/newPrefix/images/addressbook.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
item.setIcon(icon3) item.setIcon(icon3)
self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item) self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetAddressBook.setHorizontalHeaderItem(1, item) self.tableWidgetAddressBook.setHorizontalHeaderItem(1, item)
self.tableWidgetAddressBook.horizontalHeader().setCascadingSectionResizes(True) self.tableWidgetAddressBook.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetAddressBook.horizontalHeader().setDefaultSectionSize(200) self.tableWidgetAddressBook.horizontalHeader().setDefaultSectionSize(200)
self.tableWidgetAddressBook.horizontalHeader().setHighlightSections(False) self.tableWidgetAddressBook.horizontalHeader().setHighlightSections(False)
self.tableWidgetAddressBook.horizontalHeader().setStretchLastSection(True) self.tableWidgetAddressBook.horizontalHeader().setStretchLastSection(True)
self.tableWidgetAddressBook.verticalHeader().setVisible(False) self.tableWidgetAddressBook.verticalHeader().setVisible(False)
self.verticalSplitter_2.addWidget(self.tableWidgetAddressBook) self.verticalLayout_2.addWidget(self.tableWidgetAddressBook)
self.addressBookCompleter = AddressBookCompleter() self.addressBookCompleter = AddressBookCompleter()
self.addressBookCompleter.setCompletionMode(QtGui.QCompleter.PopupCompletion) self.addressBookCompleter.setCompletionMode(QtWidgets.QCompleter.CompletionMode.PopupCompletion)
self.addressBookCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive) self.addressBookCompleter.setCaseSensitivity(QtCore.Qt.CaseSensitivity.CaseInsensitive)
self.addressBookCompleterModel = QtGui.QStringListModel() self.addressBookCompleterModel = QtCore.QStringListModel()
self.addressBookCompleter.setModel(self.addressBookCompleterModel) self.addressBookCompleter.setModel(self.addressBookCompleterModel)
self.pushButtonAddAddressBook = QtGui.QPushButton(self.send) self.pushButtonAddAddressBook = QtWidgets.QPushButton(parent=self.send)
self.pushButtonAddAddressBook.setObjectName(_fromUtf8("pushButtonAddAddressBook")) self.pushButtonAddAddressBook.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonAddAddressBook.resize(200, self.pushButtonAddAddressBook.height()) self.pushButtonAddAddressBook.setObjectName("pushButtonAddAddressBook")
self.verticalSplitter_2.addWidget(self.pushButtonAddAddressBook) self.verticalLayout_2.addWidget(self.pushButtonAddAddressBook)
self.pushButtonFetchNamecoinID = QtGui.QPushButton(self.send) self.pushButtonFetchNamecoinID = QtWidgets.QPushButton(parent=self.send)
self.pushButtonFetchNamecoinID.resize(200, self.pushButtonFetchNamecoinID.height()) self.pushButtonFetchNamecoinID.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonFetchNamecoinID.setObjectName(_fromUtf8("pushButtonFetchNamecoinID")) font = QtGui.QFont()
self.verticalSplitter_2.addWidget(self.pushButtonFetchNamecoinID) font.setPointSize(9)
self.verticalSplitter_2.setStretchFactor(0, 1) self.pushButtonFetchNamecoinID.setFont(font)
self.verticalSplitter_2.setStretchFactor(1, 0) self.pushButtonFetchNamecoinID.setObjectName("pushButtonFetchNamecoinID")
self.verticalSplitter_2.setStretchFactor(2, 0) self.verticalLayout_2.addWidget(self.pushButtonFetchNamecoinID)
self.verticalSplitter_2.setCollapsible(0, False) self.horizontalLayout.addLayout(self.verticalLayout_2)
self.verticalSplitter_2.setCollapsible(1, False) self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalSplitter_2.setCollapsible(2, False) self.verticalLayout.setObjectName("verticalLayout")
self.verticalSplitter_2.handle(1).setEnabled(False) self.tabWidgetSend = QtWidgets.QTabWidget(parent=self.send)
self.verticalSplitter_2.handle(2).setEnabled(False) self.tabWidgetSend.setObjectName("tabWidgetSend")
self.horizontalSplitter.addWidget(self.verticalSplitter_2) self.tab = QtWidgets.QWidget()
self.verticalSplitter = settingsmixin.SSplitter() self.tab.setObjectName("tab")
self.verticalSplitter.setObjectName(_fromUtf8("verticalSplitter")) self.gridLayout_8 = QtWidgets.QGridLayout(self.tab)
self.verticalSplitter.setOrientation(QtCore.Qt.Vertical) self.gridLayout_8.setObjectName("gridLayout_8")
self.tabWidgetSend = QtGui.QTabWidget(self.send) self.verticalLayout_5 = QtWidgets.QVBoxLayout()
self.tabWidgetSend.setObjectName(_fromUtf8("tabWidgetSend")) self.verticalLayout_5.setObjectName("verticalLayout_5")
self.sendDirect = QtGui.QWidget() self.gridLayout_2 = QtWidgets.QGridLayout()
self.sendDirect.setObjectName(_fromUtf8("sendDirect")) self.gridLayout_2.setObjectName("gridLayout_2")
self.gridLayout_8 = QtGui.QGridLayout(self.sendDirect) self.label_3 = QtWidgets.QLabel(parent=self.tab)
self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) self.label_3.setObjectName("label_3")
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.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1) self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1)
self.label_2 = QtGui.QLabel(self.sendDirect) self.label_2 = QtWidgets.QLabel(parent=self.tab)
self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1)
self.lineEditSubject = QtGui.QLineEdit(self.sendDirect) self.lineEditSubject = QtWidgets.QLineEdit(parent=self.tab)
self.lineEditSubject.setText(_fromUtf8("")) self.lineEditSubject.setText("")
self.lineEditSubject.setObjectName(_fromUtf8("lineEditSubject")) self.lineEditSubject.setObjectName("lineEditSubject")
self.gridLayout_2.addWidget(self.lineEditSubject, 2, 1, 1, 1) self.gridLayout_2.addWidget(self.lineEditSubject, 2, 1, 1, 1)
self.label = QtGui.QLabel(self.sendDirect) self.label = QtWidgets.QLabel(parent=self.tab)
self.label.setObjectName(_fromUtf8("label")) self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1) self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)
self.comboBoxSendFrom = QtGui.QComboBox(self.sendDirect) self.comboBoxSendFrom = QtWidgets.QComboBox(parent=self.tab)
self.comboBoxSendFrom.setMinimumSize(QtCore.QSize(300, 0)) 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.gridLayout_2.addWidget(self.comboBoxSendFrom, 0, 1, 1, 1)
self.lineEditTo = QtGui.QLineEdit(self.sendDirect) self.lineEditTo = QtWidgets.QLineEdit(parent=self.tab)
self.lineEditTo.setObjectName(_fromUtf8("lineEditTo")) self.lineEditTo.setObjectName("lineEditTo")
self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1) self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1)
self.lineEditTo.setCompleter(self.addressBookCompleter) self.lineEditTo.setCompleter(self.addressBookCompleter)
self.gridLayout_2_Widget = QtGui.QWidget() self.verticalLayout_5.addLayout(self.gridLayout_2)
self.gridLayout_2_Widget.setLayout(self.gridLayout_2) self.textEditMessage = QtWidgets.QTextEdit(parent=self.tab)
self.verticalSplitter_5.addWidget(self.gridLayout_2_Widget) self.textEditMessage.setObjectName("textEditMessage")
self.textEditMessage = MessageCompose(self.sendDirect) self.verticalLayout_5.addWidget(self.textEditMessage)
self.textEditMessage.setObjectName(_fromUtf8("textEditMessage")) self.gridLayout_8.addLayout(self.verticalLayout_5, 0, 0, 1, 1)
self.verticalSplitter_5.addWidget(self.textEditMessage) self.tabWidgetSend.addTab(self.tab, "")
self.verticalSplitter_5.setStretchFactor(0, 0) self.tab_2 = QtWidgets.QWidget()
self.verticalSplitter_5.setStretchFactor(1, 1) self.tab_2.setObjectName("tab_2")
self.verticalSplitter_5.setCollapsible(0, False) self.gridLayout_9 = QtWidgets.QGridLayout(self.tab_2)
self.verticalSplitter_5.setCollapsible(1, False) self.gridLayout_9.setObjectName("gridLayout_9")
self.verticalSplitter_5.handle(1).setEnabled(False) self.verticalLayout_6 = QtWidgets.QVBoxLayout()
self.gridLayout_8.addWidget(self.verticalSplitter_5, 0, 0, 1, 1) self.verticalLayout_6.setObjectName("verticalLayout_6")
self.tabWidgetSend.addTab(self.sendDirect, _fromUtf8("")) self.gridLayout_5 = QtWidgets.QGridLayout()
self.sendBroadcast = QtGui.QWidget() self.gridLayout_5.setObjectName("gridLayout_5")
self.sendBroadcast.setObjectName(_fromUtf8("sendBroadcast")) self.label_8 = QtWidgets.QLabel(parent=self.tab_2)
self.gridLayout_9 = QtGui.QGridLayout(self.sendBroadcast) self.label_8.setObjectName("label_8")
self.gridLayout_9.setObjectName(_fromUtf8("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.gridLayout_5.addWidget(self.label_8, 0, 0, 1, 1) self.gridLayout_5.addWidget(self.label_8, 0, 0, 1, 1)
self.lineEditSubjectBroadcast = QtGui.QLineEdit(self.sendBroadcast) self.lineEditSubjectBroadcast = QtWidgets.QLineEdit(parent=self.tab_2)
self.lineEditSubjectBroadcast.setText(_fromUtf8("")) self.lineEditSubjectBroadcast.setText("")
self.lineEditSubjectBroadcast.setObjectName(_fromUtf8("lineEditSubjectBroadcast")) self.lineEditSubjectBroadcast.setObjectName("lineEditSubjectBroadcast")
self.gridLayout_5.addWidget(self.lineEditSubjectBroadcast, 1, 1, 1, 1) self.gridLayout_5.addWidget(self.lineEditSubjectBroadcast, 1, 1, 1, 1)
self.label_7 = QtGui.QLabel(self.sendBroadcast) self.label_7 = QtWidgets.QLabel(parent=self.tab_2)
self.label_7.setObjectName(_fromUtf8("label_7")) self.label_7.setObjectName("label_7")
self.gridLayout_5.addWidget(self.label_7, 1, 0, 1, 1) self.gridLayout_5.addWidget(self.label_7, 1, 0, 1, 1)
self.comboBoxSendFromBroadcast = QtGui.QComboBox(self.sendBroadcast) self.comboBoxSendFromBroadcast = QtWidgets.QComboBox(parent=self.tab_2)
self.comboBoxSendFromBroadcast.setMinimumSize(QtCore.QSize(300, 0)) 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.addWidget(self.comboBoxSendFromBroadcast, 0, 1, 1, 1)
self.gridLayout_5_Widget = QtGui.QWidget() self.verticalLayout_6.addLayout(self.gridLayout_5)
self.gridLayout_5_Widget.setLayout(self.gridLayout_5) self.textEditMessageBroadcast = QtWidgets.QTextEdit(parent=self.tab_2)
self.verticalSplitter_6.addWidget(self.gridLayout_5_Widget) self.textEditMessageBroadcast.setObjectName("textEditMessageBroadcast")
self.textEditMessageBroadcast = MessageCompose(self.sendBroadcast) self.verticalLayout_6.addWidget(self.textEditMessageBroadcast)
self.textEditMessageBroadcast.setObjectName(_fromUtf8("textEditMessageBroadcast")) self.gridLayout_9.addLayout(self.verticalLayout_6, 0, 0, 1, 1)
self.verticalSplitter_6.addWidget(self.textEditMessageBroadcast) self.tabWidgetSend.addTab(self.tab_2, "")
self.verticalSplitter_6.setStretchFactor(0, 0) self.verticalLayout.addWidget(self.tabWidgetSend)
self.verticalSplitter_6.setStretchFactor(1, 1) self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.verticalSplitter_6.setCollapsible(0, False) self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.verticalSplitter_6.setCollapsible(1, False) self.pushButtonTTL = QtWidgets.QPushButton(parent=self.send)
self.verticalSplitter_6.handle(1).setEnabled(False) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
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)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButtonTTL.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.pushButtonTTL.sizePolicy().hasHeightForWidth())
self.pushButtonTTL.setSizePolicy(sizePolicy) self.pushButtonTTL.setSizePolicy(sizePolicy)
self.pushButtonTTL.setMaximumSize(QtCore.QSize(32, 16777215))
palette = QtGui.QPalette() palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 255)) brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
brush.setStyle(QtCore.Qt.SolidPattern) brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 255)) brush = QtGui.QBrush(QtGui.QColor(0, 0, 255))
brush.setStyle(QtCore.Qt.SolidPattern) brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120))
brush.setStyle(QtCore.Qt.SolidPattern) brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
self.pushButtonTTL.setPalette(palette) self.pushButtonTTL.setPalette(palette)
font = QtGui.QFont() font = QtGui.QFont()
font.setUnderline(True) font.setUnderline(True)
self.pushButtonTTL.setFont(font) self.pushButtonTTL.setFont(font)
self.pushButtonTTL.setFlat(True) self.pushButtonTTL.setFlat(True)
self.pushButtonTTL.setObjectName(_fromUtf8("pushButtonTTL")) self.pushButtonTTL.setObjectName("pushButtonTTL")
self.horizontalLayout_5.addWidget(self.pushButtonTTL, 0, QtCore.Qt.AlignRight) self.horizontalLayout_5.addWidget(self.pushButtonTTL)
self.horizontalSliderTTL = QtGui.QSlider(self.send) self.horizontalSliderTTL = QtWidgets.QSlider(parent=self.send)
self.horizontalSliderTTL.setMinimumSize(QtCore.QSize(70, 0)) self.horizontalSliderTTL.setMinimumSize(QtCore.QSize(35, 0))
self.horizontalSliderTTL.setOrientation(QtCore.Qt.Horizontal) self.horizontalSliderTTL.setMaximumSize(QtCore.QSize(70, 16777215))
self.horizontalSliderTTL.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.horizontalSliderTTL.setInvertedAppearance(False) self.horizontalSliderTTL.setInvertedAppearance(False)
self.horizontalSliderTTL.setInvertedControls(False) self.horizontalSliderTTL.setInvertedControls(False)
self.horizontalSliderTTL.setObjectName(_fromUtf8("horizontalSliderTTL")) self.horizontalSliderTTL.setObjectName("horizontalSliderTTL")
self.horizontalLayout_5.addWidget(self.horizontalSliderTTL, 0, QtCore.Qt.AlignLeft) self.horizontalLayout_5.addWidget(self.horizontalSliderTTL)
self.labelHumanFriendlyTTLDescription = QtGui.QLabel(self.send) self.labelHumanFriendlyTTLDescription = QtWidgets.QLabel(parent=self.send)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.labelHumanFriendlyTTLDescription.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.labelHumanFriendlyTTLDescription.sizePolicy().hasHeightForWidth())
self.labelHumanFriendlyTTLDescription.setSizePolicy(sizePolicy) self.labelHumanFriendlyTTLDescription.setSizePolicy(sizePolicy)
self.labelHumanFriendlyTTLDescription.setMinimumSize(QtCore.QSize(45, 0)) self.labelHumanFriendlyTTLDescription.setMinimumSize(QtCore.QSize(45, 0))
self.labelHumanFriendlyTTLDescription.setObjectName(_fromUtf8("labelHumanFriendlyTTLDescription")) self.labelHumanFriendlyTTLDescription.setMaximumSize(QtCore.QSize(45, 16777215))
self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription, 1, QtCore.Qt.AlignLeft) self.labelHumanFriendlyTTLDescription.setObjectName("labelHumanFriendlyTTLDescription")
self.pushButtonClear = QtGui.QPushButton(self.send) self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription)
self.pushButtonClear.setObjectName(_fromUtf8("pushButtonClear")) self.pushButtonClear = QtWidgets.QPushButton(parent=self.send)
self.horizontalLayout_5.addWidget(self.pushButtonClear, 0, QtCore.Qt.AlignRight) self.pushButtonClear.setObjectName("pushButtonClear")
self.pushButtonSend = QtGui.QPushButton(self.send) self.horizontalLayout_5.addWidget(self.pushButtonClear, 0, QtCore.Qt.AlignmentFlag.AlignRight)
self.pushButtonSend.setObjectName(_fromUtf8("pushButtonSend")) self.pushButtonSend = QtWidgets.QPushButton(parent=self.send)
self.horizontalLayout_5.addWidget(self.pushButtonSend, 0, QtCore.Qt.AlignRight) self.pushButtonSend.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.horizontalSliderTTL.setMaximumSize(QtCore.QSize(105, self.pushButtonSend.height())) self.pushButtonSend.setObjectName("pushButtonSend")
self.verticalSplitter.addWidget(self.tTLContainer) self.horizontalLayout_5.addWidget(self.pushButtonSend)
self.tTLContainer.adjustSize() self.verticalLayout.addLayout(self.horizontalLayout_5)
self.verticalSplitter.setStretchFactor(1, 0) self.horizontalLayout.addLayout(self.verticalLayout)
self.verticalSplitter.setStretchFactor(0, 1) self.gridLayout_7.addLayout(self.horizontalLayout, 0, 0, 1, 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)
icon4 = QtGui.QIcon() icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon4.addPixmap(QtGui.QPixmap(":/newPrefix/images/send.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.send, icon4, _fromUtf8("")) self.tabWidget.addTab(self.send, icon4, "")
self.subscriptions = QtGui.QWidget() self.subscriptions = QtWidgets.QWidget()
self.subscriptions.setObjectName(_fromUtf8("subscriptions")) self.subscriptions.setObjectName("subscriptions")
self.gridLayout_3 = QtGui.QGridLayout(self.subscriptions) self.gridLayout_3 = QtWidgets.QGridLayout(self.subscriptions)
self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) self.gridLayout_3.setObjectName("gridLayout_3")
self.horizontalSplitter_4 = settingsmixin.SSplitter() self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalSplitter_4.setObjectName(_fromUtf8("horizontalSplitter_4")) self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.verticalSplitter_3 = settingsmixin.SSplitter() self.verticalLayout_3 = QtWidgets.QVBoxLayout()
self.verticalSplitter_3.setObjectName(_fromUtf8("verticalSplitter_3")) self.verticalLayout_3.setObjectName("verticalLayout_3")
self.verticalSplitter_3.setOrientation(QtCore.Qt.Vertical) self.treeWidgetSubscriptions = QtWidgets.QTreeWidget(parent=self.subscriptions)
self.treeWidgetSubscriptions = settingsmixin.STreeWidget(self.subscriptions) self.treeWidgetSubscriptions.setMaximumSize(QtCore.QSize(200, 16777215))
self.treeWidgetSubscriptions.setAlternatingRowColors(True) self.treeWidgetSubscriptions.setAlternatingRowColors(True)
self.treeWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.treeWidgetSubscriptions.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
self.treeWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.treeWidgetSubscriptions.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.treeWidgetSubscriptions.setObjectName(_fromUtf8("treeWidgetSubscriptions")) self.treeWidgetSubscriptions.setObjectName("treeWidgetSubscriptions")
self.treeWidgetSubscriptions.resize(200, self.treeWidgetSubscriptions.height())
icon5 = QtGui.QIcon() icon5 = QtGui.QIcon()
icon5.addPixmap( icon5.addPixmap(QtGui.QPixmap(":/newPrefix/images/subscriptions.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
self.treeWidgetSubscriptions.headerItem().setIcon(0, icon5) self.treeWidgetSubscriptions.headerItem().setIcon(0, icon5)
self.verticalSplitter_3.addWidget(self.treeWidgetSubscriptions) self.verticalLayout_3.addWidget(self.treeWidgetSubscriptions)
self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions) self.pushButtonAddSubscription = QtWidgets.QPushButton(parent=self.subscriptions)
self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonAddSubscription.resize(200, self.pushButtonAddSubscription.height()) self.pushButtonAddSubscription.setObjectName("pushButtonAddSubscription")
self.verticalSplitter_3.addWidget(self.pushButtonAddSubscription) self.verticalLayout_3.addWidget(self.pushButtonAddSubscription)
self.verticalSplitter_3.setStretchFactor(0, 1) self.horizontalLayout_4.addLayout(self.verticalLayout_3)
self.verticalSplitter_3.setStretchFactor(1, 0) self.verticalLayout_4 = QtWidgets.QVBoxLayout()
self.verticalSplitter_3.setCollapsible(0, False) self.verticalLayout_4.setObjectName("verticalLayout_4")
self.verticalSplitter_3.setCollapsible(1, False) self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.verticalSplitter_3.handle(1).setEnabled(False) self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.horizontalSplitter_4.addWidget(self.verticalSplitter_3) self.inboxSearchLineEditSubscriptions = QtWidgets.QLineEdit(parent=self.subscriptions)
self.verticalSplitter_4 = settingsmixin.SSplitter() self.inboxSearchLineEditSubscriptions.setObjectName("inboxSearchLineEditSubscriptions")
self.verticalSplitter_4.setObjectName(_fromUtf8("verticalSplitter_4")) self.horizontalLayout_2.addWidget(self.inboxSearchLineEditSubscriptions)
self.verticalSplitter_4.setOrientation(QtCore.Qt.Vertical) self.inboxSearchOptionSubscriptions = QtWidgets.QComboBox(parent=self.subscriptions)
self.horizontalSplitter_2 = QtGui.QSplitter() self.inboxSearchOptionSubscriptions.setObjectName("inboxSearchOptionSubscriptions")
self.horizontalSplitter_2.setObjectName(_fromUtf8("horizontalSplitter_2")) self.inboxSearchOptionSubscriptions.addItem("")
self.inboxSearchLineEditSubscriptions = QtGui.QLineEdit(self.subscriptions) self.inboxSearchOptionSubscriptions.addItem("")
self.inboxSearchLineEditSubscriptions.setObjectName(_fromUtf8("inboxSearchLineEditSubscriptions")) self.inboxSearchOptionSubscriptions.addItem("")
self.horizontalSplitter_2.addWidget(self.inboxSearchLineEditSubscriptions) self.inboxSearchOptionSubscriptions.addItem("")
self.inboxSearchOptionSubscriptions = QtGui.QComboBox(self.subscriptions) self.inboxSearchOptionSubscriptions.addItem("")
self.inboxSearchOptionSubscriptions.setObjectName(_fromUtf8("inboxSearchOptionSubscriptions")) self.horizontalLayout_2.addWidget(self.inboxSearchOptionSubscriptions)
self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) self.verticalLayout_4.addLayout(self.horizontalLayout_2)
self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) self.tableWidgetInboxSubscriptions = QtWidgets.QTableWidget(parent=self.subscriptions)
self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) self.tableWidgetInboxSubscriptions.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
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.tableWidgetInboxSubscriptions.setAlternatingRowColors(True) self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True)
self.tableWidgetInboxSubscriptions.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.tableWidgetInboxSubscriptions.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInboxSubscriptions.setWordWrap(False) self.tableWidgetInboxSubscriptions.setWordWrap(False)
self.tableWidgetInboxSubscriptions.setObjectName(_fromUtf8("tableWidgetInboxSubscriptions")) self.tableWidgetInboxSubscriptions.setObjectName("tableWidgetInboxSubscriptions")
self.tableWidgetInboxSubscriptions.setColumnCount(4) self.tableWidgetInboxSubscriptions.setColumnCount(4)
self.tableWidgetInboxSubscriptions.setRowCount(0) self.tableWidgetInboxSubscriptions.setRowCount(0)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(0, item) self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(1, item) self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(2, item) self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(3, item) self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(3, item)
self.tableWidgetInboxSubscriptions.horizontalHeader().setCascadingSectionResizes(True) self.tableWidgetInboxSubscriptions.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInboxSubscriptions.horizontalHeader().setDefaultSectionSize(200) self.tableWidgetInboxSubscriptions.horizontalHeader().setDefaultSectionSize(200)
@ -446,101 +346,74 @@ class Ui_MainWindow(object):
self.tableWidgetInboxSubscriptions.horizontalHeader().setStretchLastSection(True) self.tableWidgetInboxSubscriptions.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInboxSubscriptions.verticalHeader().setVisible(False) self.tableWidgetInboxSubscriptions.verticalHeader().setVisible(False)
self.tableWidgetInboxSubscriptions.verticalHeader().setDefaultSectionSize(26) self.tableWidgetInboxSubscriptions.verticalHeader().setDefaultSectionSize(26)
self.verticalSplitter_4.addWidget(self.tableWidgetInboxSubscriptions) self.verticalLayout_4.addWidget(self.tableWidgetInboxSubscriptions)
self.textEditInboxMessageSubscriptions = MessageView(self.subscriptions) self.textEditInboxMessageSubscriptions = QtWidgets.QTextEdit(parent=self.subscriptions)
self.textEditInboxMessageSubscriptions.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessageSubscriptions.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessageSubscriptions.setReadOnly(True) self.textEditInboxMessageSubscriptions.setReadOnly(True)
self.textEditInboxMessageSubscriptions.setObjectName(_fromUtf8("textEditInboxMessageSubscriptions")) self.textEditInboxMessageSubscriptions.setObjectName("textEditInboxMessageSubscriptions")
self.verticalSplitter_4.addWidget(self.textEditInboxMessageSubscriptions) self.verticalLayout_4.addWidget(self.textEditInboxMessageSubscriptions)
self.verticalSplitter_4.setStretchFactor(0, 0) self.horizontalLayout_4.addLayout(self.verticalLayout_4)
self.verticalSplitter_4.setStretchFactor(1, 1) self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 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)
icon6 = QtGui.QIcon() icon6 = QtGui.QIcon()
icon6.addPixmap( icon6.addPixmap(QtGui.QPixmap(":/newPrefix/images/subscriptions.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off self.tabWidget.addTab(self.subscriptions, icon6, "")
) self.tab_3 = QtWidgets.QWidget()
self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8("")) self.tab_3.setObjectName("tab_3")
self.chans = QtGui.QWidget() self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_3)
self.chans.setObjectName(_fromUtf8("chans")) self.gridLayout_4.setObjectName("gridLayout_4")
self.gridLayout_4 = QtGui.QGridLayout(self.chans) self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.horizontalSplitter_7 = settingsmixin.SSplitter() self.verticalLayout_17 = QtWidgets.QVBoxLayout()
self.horizontalSplitter_7.setObjectName(_fromUtf8("horizontalSplitter_7")) self.verticalLayout_17.setObjectName("verticalLayout_17")
self.verticalSplitter_17 = settingsmixin.SSplitter() self.treeWidgetChans = QtWidgets.QTreeWidget(parent=self.tab_3)
self.verticalSplitter_17.setObjectName(_fromUtf8("verticalSplitter_17")) self.treeWidgetChans.setMaximumSize(QtCore.QSize(200, 16777215))
self.verticalSplitter_17.setOrientation(QtCore.Qt.Vertical) self.treeWidgetChans.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
self.treeWidgetChans = settingsmixin.STreeWidget(self.chans)
self.treeWidgetChans.setFrameShadow(QtGui.QFrame.Sunken)
self.treeWidgetChans.setLineWidth(1) self.treeWidgetChans.setLineWidth(1)
self.treeWidgetChans.setAlternatingRowColors(True) self.treeWidgetChans.setAlternatingRowColors(True)
self.treeWidgetChans.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.treeWidgetChans.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
self.treeWidgetChans.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.treeWidgetChans.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.treeWidgetChans.setObjectName(_fromUtf8("treeWidgetChans")) self.treeWidgetChans.setObjectName("treeWidgetChans")
self.treeWidgetChans.resize(200, self.treeWidgetChans.height())
icon7 = QtGui.QIcon() icon7 = QtGui.QIcon()
icon7.addPixmap( icon7.addPixmap(QtGui.QPixmap(":/newPrefix/images/can-icon-16px.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off
)
self.treeWidgetChans.headerItem().setIcon(0, icon7) self.treeWidgetChans.headerItem().setIcon(0, icon7)
self.verticalSplitter_17.addWidget(self.treeWidgetChans) self.verticalLayout_17.addWidget(self.treeWidgetChans)
self.pushButtonAddChan = QtGui.QPushButton(self.chans) self.pushButtonAddChan = QtWidgets.QPushButton(parent=self.tab_3)
self.pushButtonAddChan.setObjectName(_fromUtf8("pushButtonAddChan")) self.pushButtonAddChan.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonAddChan.resize(200, self.pushButtonAddChan.height()) self.pushButtonAddChan.setObjectName("pushButtonAddChan")
self.verticalSplitter_17.addWidget(self.pushButtonAddChan) self.verticalLayout_17.addWidget(self.pushButtonAddChan)
self.verticalSplitter_17.setStretchFactor(0, 1) self.horizontalLayout_7.addLayout(self.verticalLayout_17)
self.verticalSplitter_17.setStretchFactor(1, 0) self.verticalLayout_8 = QtWidgets.QVBoxLayout()
self.verticalSplitter_17.setCollapsible(0, False) self.verticalLayout_8.setObjectName("verticalLayout_8")
self.verticalSplitter_17.setCollapsible(1, False) self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
self.verticalSplitter_17.handle(1).setEnabled(False) self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.horizontalSplitter_7.addWidget(self.verticalSplitter_17) self.inboxSearchLineEditChans = QtWidgets.QLineEdit(parent=self.tab_3)
self.verticalSplitter_8 = settingsmixin.SSplitter() self.inboxSearchLineEditChans.setObjectName("inboxSearchLineEditChans")
self.verticalSplitter_8.setObjectName(_fromUtf8("verticalSplitter_8")) self.horizontalLayout_6.addWidget(self.inboxSearchLineEditChans)
self.verticalSplitter_8.setOrientation(QtCore.Qt.Vertical) self.inboxSearchOptionChans = QtWidgets.QComboBox(parent=self.tab_3)
self.horizontalSplitter_6 = QtGui.QSplitter() self.inboxSearchOptionChans.setObjectName("inboxSearchOptionChans")
self.horizontalSplitter_6.setObjectName(_fromUtf8("horizontalSplitter_6")) self.inboxSearchOptionChans.addItem("")
self.inboxSearchLineEditChans = QtGui.QLineEdit(self.chans) self.inboxSearchOptionChans.addItem("")
self.inboxSearchLineEditChans.setObjectName(_fromUtf8("inboxSearchLineEditChans")) self.inboxSearchOptionChans.addItem("")
self.horizontalSplitter_6.addWidget(self.inboxSearchLineEditChans) self.inboxSearchOptionChans.addItem("")
self.inboxSearchOptionChans = QtGui.QComboBox(self.chans) self.inboxSearchOptionChans.addItem("")
self.inboxSearchOptionChans.setObjectName(_fromUtf8("inboxSearchOptionChans")) self.horizontalLayout_6.addWidget(self.inboxSearchOptionChans)
self.inboxSearchOptionChans.addItem(_fromUtf8("")) self.verticalLayout_8.addLayout(self.horizontalLayout_6)
self.inboxSearchOptionChans.addItem(_fromUtf8("")) self.tableWidgetInboxChans = QtWidgets.QTableWidget(parent=self.tab_3)
self.inboxSearchOptionChans.addItem(_fromUtf8("")) self.tableWidgetInboxChans.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
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.tableWidgetInboxChans.setAlternatingRowColors(True) self.tableWidgetInboxChans.setAlternatingRowColors(True)
self.tableWidgetInboxChans.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.tableWidgetInboxChans.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetInboxChans.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tableWidgetInboxChans.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInboxChans.setWordWrap(False) self.tableWidgetInboxChans.setWordWrap(False)
self.tableWidgetInboxChans.setObjectName(_fromUtf8("tableWidgetInboxChans")) self.tableWidgetInboxChans.setObjectName("tableWidgetInboxChans")
self.tableWidgetInboxChans.setColumnCount(4) self.tableWidgetInboxChans.setColumnCount(4)
self.tableWidgetInboxChans.setRowCount(0) self.tableWidgetInboxChans.setRowCount(0)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(0, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(1, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(2, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem() item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(3, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(3, item)
self.tableWidgetInboxChans.horizontalHeader().setCascadingSectionResizes(True) self.tableWidgetInboxChans.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInboxChans.horizontalHeader().setDefaultSectionSize(200) self.tableWidgetInboxChans.horizontalHeader().setDefaultSectionSize(200)
@ -550,97 +423,180 @@ class Ui_MainWindow(object):
self.tableWidgetInboxChans.horizontalHeader().setStretchLastSection(True) self.tableWidgetInboxChans.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInboxChans.verticalHeader().setVisible(False) self.tableWidgetInboxChans.verticalHeader().setVisible(False)
self.tableWidgetInboxChans.verticalHeader().setDefaultSectionSize(26) self.tableWidgetInboxChans.verticalHeader().setDefaultSectionSize(26)
self.verticalSplitter_8.addWidget(self.tableWidgetInboxChans) self.verticalLayout_8.addWidget(self.tableWidgetInboxChans)
self.textEditInboxMessageChans = MessageView(self.chans) self.textEditInboxMessageChans = QtWidgets.QTextEdit(parent=self.tab_3)
self.textEditInboxMessageChans.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessageChans.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessageChans.setReadOnly(True) self.textEditInboxMessageChans.setReadOnly(True)
self.textEditInboxMessageChans.setObjectName(_fromUtf8("textEditInboxMessageChans")) self.textEditInboxMessageChans.setObjectName("textEditInboxMessageChans")
self.verticalSplitter_8.addWidget(self.textEditInboxMessageChans) self.verticalLayout_8.addWidget(self.textEditInboxMessageChans)
self.verticalSplitter_8.setStretchFactor(0, 0) self.horizontalLayout_7.addLayout(self.verticalLayout_8)
self.verticalSplitter_8.setStretchFactor(1, 1) self.gridLayout_4.addLayout(self.horizontalLayout_7, 0, 0, 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)
icon8 = QtGui.QIcon() icon8 = QtGui.QIcon()
icon8.addPixmap( icon8.addPixmap(QtGui.QPixmap(":/newPrefix/images/can-icon-16px.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off self.tabWidget.addTab(self.tab_3, icon8, "")
) self.blackwhitelist = QtWidgets.QWidget()
self.tabWidget.addTab(self.chans, icon8, _fromUtf8("")) self.blackwhitelist.setObjectName("blackwhitelist")
self.blackwhitelist = Blacklist() self.gridLayout_6 = QtWidgets.QGridLayout(self.blackwhitelist)
self.tabWidget.addTab(self.blackwhitelist, QtGui.QIcon(":/newPrefix/images/blacklist.png"), "") self.gridLayout_6.setObjectName("gridLayout_6")
# Initialize the Blacklist or Whitelist self.radioButtonBlacklist = QtWidgets.QRadioButton(parent=self.blackwhitelist)
if config.get('bitmessagesettings', 'blackwhitelist') == 'white': self.radioButtonBlacklist.setChecked(True)
self.blackwhitelist.radioButtonWhitelist.click() self.radioButtonBlacklist.setObjectName("radioButtonBlacklist")
self.blackwhitelist.rerenderBlackWhiteList() self.gridLayout_6.addWidget(self.radioButtonBlacklist, 0, 0, 1, 2)
self.radioButtonWhitelist = QtWidgets.QRadioButton(parent=self.blackwhitelist)
self.networkstatus = NetworkStatus() self.radioButtonWhitelist.setObjectName("radioButtonWhitelist")
self.tabWidget.addTab(self.networkstatus, QtGui.QIcon(":/newPrefix/images/networkstatus.png"), "") self.gridLayout_6.addWidget(self.radioButtonWhitelist, 1, 0, 1, 2)
self.pushButtonAddBlacklist = QtWidgets.QPushButton(parent=self.blackwhitelist)
self.pushButtonAddBlacklist.setObjectName("pushButtonAddBlacklist")
self.gridLayout_6.addWidget(self.pushButtonAddBlacklist, 2, 0, 1, 1)
spacerItem = QtWidgets.QSpacerItem(689, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_6.addItem(spacerItem, 2, 1, 1, 1)
self.tableWidgetBlacklist = QtWidgets.QTableWidget(parent=self.blackwhitelist)
self.tableWidgetBlacklist.setAlternatingRowColors(True)
self.tableWidgetBlacklist.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
self.tableWidgetBlacklist.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetBlacklist.setObjectName("tableWidgetBlacklist")
self.tableWidgetBlacklist.setColumnCount(2)
self.tableWidgetBlacklist.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetBlacklist.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetBlacklist.setHorizontalHeaderItem(1, item)
self.tableWidgetBlacklist.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetBlacklist.horizontalHeader().setDefaultSectionSize(400)
self.tableWidgetBlacklist.horizontalHeader().setHighlightSections(False)
self.tableWidgetBlacklist.horizontalHeader().setSortIndicatorShown(False)
self.tableWidgetBlacklist.horizontalHeader().setStretchLastSection(True)
self.tableWidgetBlacklist.verticalHeader().setVisible(False)
self.gridLayout_6.addWidget(self.tableWidgetBlacklist, 3, 0, 1, 2)
icon9 = QtGui.QIcon()
icon9.addPixmap(QtGui.QPixmap(":/newPrefix/images/blacklist.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.blackwhitelist, icon9, "")
self.networkstatus = QtWidgets.QWidget()
self.networkstatus.setObjectName("networkstatus")
self.pushButtonStatusIcon = QtWidgets.QPushButton(parent=self.networkstatus)
self.pushButtonStatusIcon.setGeometry(QtCore.QRect(680, 440, 21, 23))
self.pushButtonStatusIcon.setText("")
icon10 = QtGui.QIcon()
icon10.addPixmap(QtGui.QPixmap(":/newPrefix/images/redicon.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.pushButtonStatusIcon.setIcon(icon10)
self.pushButtonStatusIcon.setFlat(True)
self.pushButtonStatusIcon.setObjectName("pushButtonStatusIcon")
self.tableWidgetConnectionCount = QtWidgets.QTableWidget(parent=self.networkstatus)
self.tableWidgetConnectionCount.setGeometry(QtCore.QRect(20, 70, 241, 241))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(212, 208, 200))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(212, 208, 200))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(212, 208, 200))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
self.tableWidgetConnectionCount.setPalette(palette)
self.tableWidgetConnectionCount.setFrameShape(QtWidgets.QFrame.Shape.Box)
self.tableWidgetConnectionCount.setFrameShadow(QtWidgets.QFrame.Shadow.Plain)
self.tableWidgetConnectionCount.setProperty("showDropIndicator", False)
self.tableWidgetConnectionCount.setAlternatingRowColors(True)
self.tableWidgetConnectionCount.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.NoSelection)
self.tableWidgetConnectionCount.setObjectName("tableWidgetConnectionCount")
self.tableWidgetConnectionCount.setColumnCount(2)
self.tableWidgetConnectionCount.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetConnectionCount.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetConnectionCount.setHorizontalHeaderItem(1, item)
self.tableWidgetConnectionCount.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetConnectionCount.horizontalHeader().setHighlightSections(False)
self.tableWidgetConnectionCount.horizontalHeader().setStretchLastSection(True)
self.tableWidgetConnectionCount.verticalHeader().setVisible(False)
self.labelTotalConnections = QtWidgets.QLabel(parent=self.networkstatus)
self.labelTotalConnections.setGeometry(QtCore.QRect(20, 30, 401, 16))
self.labelTotalConnections.setObjectName("labelTotalConnections")
self.labelStartupTime = QtWidgets.QLabel(parent=self.networkstatus)
self.labelStartupTime.setGeometry(QtCore.QRect(320, 110, 331, 20))
self.labelStartupTime.setObjectName("labelStartupTime")
self.labelMessageCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelMessageCount.setGeometry(QtCore.QRect(350, 130, 361, 16))
self.labelMessageCount.setObjectName("labelMessageCount")
self.labelPubkeyCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelPubkeyCount.setGeometry(QtCore.QRect(350, 170, 331, 16))
self.labelPubkeyCount.setObjectName("labelPubkeyCount")
self.labelBroadcastCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelBroadcastCount.setGeometry(QtCore.QRect(350, 150, 351, 16))
self.labelBroadcastCount.setObjectName("labelBroadcastCount")
self.labelLookupsPerSecond = QtWidgets.QLabel(parent=self.networkstatus)
self.labelLookupsPerSecond.setGeometry(QtCore.QRect(320, 250, 291, 16))
self.labelLookupsPerSecond.setObjectName("labelLookupsPerSecond")
self.labelBytesRecvCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelBytesRecvCount.setGeometry(QtCore.QRect(350, 210, 251, 16))
self.labelBytesRecvCount.setObjectName("labelBytesRecvCount")
self.labelBytesSentCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelBytesSentCount.setGeometry(QtCore.QRect(350, 230, 251, 16))
self.labelBytesSentCount.setObjectName("labelBytesSentCount")
icon11 = QtGui.QIcon()
icon11.addPixmap(QtGui.QPixmap(":/newPrefix/images/networkstatus.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.networkstatus, icon11, "")
self.gridLayout_10.addWidget(self.tabWidget, 0, 0, 1, 1) self.gridLayout_10.addWidget(self.tabWidget, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget) self.MainDock.setWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow) # XXX unresolved
#MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(None), self.MainDock)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 885, 27)) self.menubar.setGeometry(QtCore.QRect(0, 0, 885, 27))
self.menubar.setObjectName(_fromUtf8("menubar")) self.menubar.setObjectName("menubar")
self.menuFile = QtGui.QMenu(self.menubar) self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName(_fromUtf8("menuFile")) self.menuFile.setObjectName("menuFile")
self.menuSettings = QtGui.QMenu(self.menubar) self.menuSettings = QtWidgets.QMenu(parent=self.menubar)
self.menuSettings.setObjectName(_fromUtf8("menuSettings")) self.menuSettings.setObjectName("menuSettings")
self.menuHelp = QtGui.QMenu(self.menubar) self.menuHelp = QtWidgets.QMenu(parent=self.menubar)
self.menuHelp.setObjectName(_fromUtf8("menuHelp")) self.menuHelp.setObjectName("menuHelp")
MainWindow.setMenuBar(self.menubar) MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setMaximumSize(QtCore.QSize(16777215, 22)) self.statusbar.setMaximumSize(QtCore.QSize(16777215, 22))
self.statusbar.setObjectName(_fromUtf8("statusbar")) self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar) MainWindow.setStatusBar(self.statusbar)
self.actionImport_keys = QtGui.QAction(MainWindow) self.actionImport_keys = QtGui.QAction(parent=MainWindow)
self.actionImport_keys.setObjectName(_fromUtf8("actionImport_keys")) self.actionImport_keys.setObjectName("actionImport_keys")
self.actionManageKeys = QtGui.QAction(MainWindow) self.actionManageKeys = QtGui.QAction(parent=MainWindow)
self.actionManageKeys.setCheckable(False) self.actionManageKeys.setCheckable(False)
self.actionManageKeys.setEnabled(True) 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.setIcon(icon)
self.actionManageKeys.setObjectName(_fromUtf8("actionManageKeys")) self.actionManageKeys.setObjectName("actionManageKeys")
self.actionNetworkSwitch = QtGui.QAction(MainWindow) self.actionExit = QtGui.QAction(parent=MainWindow)
self.actionNetworkSwitch.setObjectName(_fromUtf8("actionNetworkSwitch")) icon = QtGui.QIcon.fromTheme("application-exit")
self.actionExit = QtGui.QAction(MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("application-exit"))
self.actionExit.setIcon(icon) self.actionExit.setIcon(icon)
self.actionExit.setObjectName(_fromUtf8("actionExit")) self.actionExit.setObjectName("actionExit")
self.actionHelp = QtGui.QAction(MainWindow) self.actionHelp = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("help-contents")) icon = QtGui.QIcon.fromTheme("help-contents")
self.actionHelp.setIcon(icon) self.actionHelp.setIcon(icon)
self.actionHelp.setObjectName(_fromUtf8("actionHelp")) self.actionHelp.setObjectName("actionHelp")
self.actionSupport = QtGui.QAction(MainWindow) self.actionSupport = QtGui.QAction(MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("help-support")) icon = QtGui.QIcon.fromTheme("help-support")
self.actionSupport.setIcon(icon) self.actionSupport.setIcon(icon)
self.actionSupport.setObjectName(_fromUtf8("actionSupport")) self.actionSupport.setObjectName("actionSupport")
self.actionAbout = QtGui.QAction(MainWindow) self.actionAbout = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("help-about")) icon = QtGui.QIcon.fromTheme("help-about")
self.actionAbout.setIcon(icon) self.actionAbout.setIcon(icon)
self.actionAbout.setObjectName(_fromUtf8("actionAbout")) self.actionAbout.setObjectName("actionAbout")
self.actionSettings = QtGui.QAction(MainWindow) self.actionSettings = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("document-properties")) icon = QtGui.QIcon.fromTheme("document-properties")
self.actionSettings.setIcon(icon) self.actionSettings.setIcon(icon)
self.actionSettings.setObjectName(_fromUtf8("actionSettings")) self.actionSettings.setObjectName("actionSettings")
self.actionRegenerateDeterministicAddresses = QtGui.QAction(MainWindow) self.actionRegenerateDeterministicAddresses = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("view-refresh")) icon = QtGui.QIcon.fromTheme("view-refresh")
self.actionRegenerateDeterministicAddresses.setIcon(icon) self.actionRegenerateDeterministicAddresses.setIcon(icon)
self.actionRegenerateDeterministicAddresses.setObjectName(_fromUtf8("actionRegenerateDeterministicAddresses")) self.actionRegenerateDeterministicAddresses.setObjectName("actionRegenerateDeterministicAddresses")
self.actionDeleteAllTrashedMessages = QtGui.QAction(MainWindow) self.actionDeleteAllTrashedMessages = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("user-trash")) icon = QtGui.QIcon.fromTheme("user-trash")
self.actionDeleteAllTrashedMessages.setIcon(icon) self.actionDeleteAllTrashedMessages.setIcon(icon)
self.actionDeleteAllTrashedMessages.setObjectName(_fromUtf8("actionDeleteAllTrashedMessages")) self.actionDeleteAllTrashedMessages.setObjectName("actionDeleteAllTrashedMessages")
self.actionJoinChan = QtGui.QAction(MainWindow) self.actionJoinChan = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme(_fromUtf8("contact-new")) icon = QtGui.QIcon.fromTheme("contact-new")
self.actionJoinChan.setIcon(icon) self.actionJoinChan.setIcon(icon)
self.actionJoinChan.setObjectName(_fromUtf8("actionJoinChan")) self.actionJoinChan.setObjectName("actionJoinChan")
self.menuFile.addAction(self.actionManageKeys) self.menuFile.addAction(self.actionManageKeys)
self.menuFile.addAction(self.actionDeleteAllTrashedMessages) self.menuFile.addAction(self.actionDeleteAllTrashedMessages)
self.menuFile.addAction(self.actionRegenerateDeterministicAddresses) self.menuFile.addAction(self.actionRegenerateDeterministicAddresses)
@ -655,30 +611,34 @@ class Ui_MainWindow(object):
self.menubar.addAction(self.menuHelp.menuAction()) self.menubar.addAction(self.menuHelp.menuAction())
self.retranslateUi(MainWindow) self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex( self.tabWidget.setCurrentIndex(0)
self.tabWidget.indexOf(self.inbox) self.tabWidgetSend.setCurrentIndex(0)
)
self.tabWidgetSend.setCurrentIndex(
self.tabWidgetSend.indexOf(self.sendDirect)
)
QtCore.QMetaObject.connectSlotsByName(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.tableWidgetInbox, self.textEditInboxMessage) MainWindow.setTabOrder(self.tableWidgetInbox, self.textEditInboxMessage)
MainWindow.setTabOrder(self.textEditInboxMessage, self.comboBoxSendFrom) MainWindow.setTabOrder(self.textEditInboxMessage, self.comboBoxSendFrom)
MainWindow.setTabOrder(self.comboBoxSendFrom, self.lineEditTo) MainWindow.setTabOrder(self.comboBoxSendFrom, self.lineEditTo)
MainWindow.setTabOrder(self.lineEditTo, self.lineEditSubject) MainWindow.setTabOrder(self.lineEditTo, self.lineEditSubject)
MainWindow.setTabOrder(self.lineEditSubject, self.textEditMessage) MainWindow.setTabOrder(self.lineEditSubject, self.textEditMessage)
MainWindow.setTabOrder(self.textEditMessage, self.pushButtonAddSubscription) MainWindow.setTabOrder(self.textEditMessage, self.pushButtonSend)
MainWindow.setTabOrder(self.pushButtonSend, self.pushButtonAddSubscription)
MainWindow.setTabOrder(self.pushButtonAddSubscription, self.radioButtonBlacklist)
MainWindow.setTabOrder(self.radioButtonBlacklist, self.radioButtonWhitelist)
MainWindow.setTabOrder(self.radioButtonWhitelist, self.pushButtonAddBlacklist)
MainWindow.setTabOrder(self.pushButtonAddBlacklist, self.tableWidgetBlacklist)
MainWindow.setTabOrder(self.tableWidgetBlacklist, self.tableWidgetConnectionCount)
MainWindow.setTabOrder(self.tableWidgetConnectionCount, self.pushButtonStatusIcon)
# Popup menu actions container for the Sent page # Popup menu actions container for the Sent page
# pylint: disable=attribute-defined-outside-init # pylint: disable=attribute-defined-outside-init
self.sentContextMenuToolbar = QtGui.QToolBar() self.sentContextMenuToolbar = QtWidgets.QToolBar()
# Popup menu actions container for chans tree # Popup menu actions container for chans tree
self.addressContextMenuToolbar = QtGui.QToolBar() self.addressContextMenuToolbar = QtWidgets.QToolBar()
# Popup menu actions container for subscriptions tree # Popup menu actions container for subscriptions tree
self.subscriptionsContextMenuToolbar = QtGui.QToolBar() self.subscriptionsContextMenuToolbar = QtWidgets.QToolBar()
def updateNetworkSwitchMenuLabel(self, dontconnect=None): def updateNetworkSwitchMenuLabel(self, dontconnect=None):
if dontconnect is None: if dontconnect is None:
_translate = QtCore.QCoreApplication.translate
dontconnect = config.safeGetBoolean( dontconnect = config.safeGetBoolean(
'bitmessagesettings', 'dontconnect') 'bitmessagesettings', 'dontconnect')
self.actionNetworkSwitch.setText( self.actionNetworkSwitch.setText(
@ -688,130 +648,126 @@ class Ui_MainWindow(object):
) )
def retranslateUi(self, MainWindow): def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "Bitmessage", None)) _translate = QtCore.QCoreApplication.translate
self.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities", None)) self.MainDock.setWindowTitle(_translate("MainWindow", "Bitmessage"))
self.pushButtonNewAddress.setText(_translate("MainWindow", "New Identity", None)) self.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities"))
self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None)) self.pushButtonNewAddress.setText(_translate("MainWindow", "New Indentitiy"))
self.inboxSearchOption.setItemText(0, _translate("MainWindow", "All", None)) self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search"))
self.inboxSearchOption.setItemText(1, _translate("MainWindow", "To", None)) self.inboxSearchOption.setItemText(0, _translate("MainWindow", "All"))
self.inboxSearchOption.setItemText(2, _translate("MainWindow", "From", None)) self.inboxSearchOption.setItemText(1, _translate("MainWindow", "To"))
self.inboxSearchOption.setItemText(3, _translate("MainWindow", "Subject", None)) self.inboxSearchOption.setItemText(2, _translate("MainWindow", "From"))
self.inboxSearchOption.setItemText(4, _translate("MainWindow", "Message", None)) self.inboxSearchOption.setItemText(3, _translate("MainWindow", "Subject"))
self.inboxSearchOption.setItemText(4, _translate("MainWindow", "Message"))
self.tableWidgetInbox.setSortingEnabled(True) self.tableWidgetInbox.setSortingEnabled(True)
item = self.tableWidgetInbox.horizontalHeaderItem(0) item = self.tableWidgetInbox.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "To", None)) item.setText(_translate("MainWindow", "To"))
item = self.tableWidgetInbox.horizontalHeaderItem(1) item = self.tableWidgetInbox.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "From", None)) item.setText(_translate("MainWindow", "From"))
item = self.tableWidgetInbox.horizontalHeaderItem(2) item = self.tableWidgetInbox.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Subject", None)) item.setText(_translate("MainWindow", "Subject"))
item = self.tableWidgetInbox.horizontalHeaderItem(3) item = self.tableWidgetInbox.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages"))
self.tableWidgetAddressBook.setSortingEnabled(True) self.tableWidgetAddressBook.setSortingEnabled(True)
item = self.tableWidgetAddressBook.horizontalHeaderItem(0) item = self.tableWidgetAddressBook.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "Address book", None)) item.setText(_translate("MainWindow", "Address book"))
item = self.tableWidgetAddressBook.horizontalHeaderItem(1) item = self.tableWidgetAddressBook.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "Address", None)) item.setText(_translate("MainWindow", "Address"))
self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact", None)) self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact"))
self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID", None)) self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID"))
self.label_3.setText(_translate("MainWindow", "Subject:", None)) self.label_3.setText(_translate("MainWindow", "Subject:"))
self.label_2.setText(_translate("MainWindow", "From:", None)) self.label_2.setText(_translate("MainWindow", "From:"))
self.label.setText(_translate("MainWindow", "To:", None)) self.label.setText(_translate("MainWindow", "To:"))
self.tabWidgetSend.setTabText( self.textEditMessage.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
self.tabWidgetSend.indexOf(self.sendDirect), _translate("MainWindow", "Send ordinary Message", None) "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
) "p, li { white-space: pre-wrap; }\n"
self.label_8.setText(_translate("MainWindow", "From:", None)) "</style></head><body style=\" font-family:\'Droid Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
self.label_7.setText(_translate("MainWindow", "Subject:", None)) "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
self.tabWidgetSend.setTabText( self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.tab), _translate("MainWindow", "Send ordinary Message"))
self.tabWidgetSend.indexOf(self.sendBroadcast), self.label_8.setText(_translate("MainWindow", "From:"))
_translate("MainWindow", "Send Message to your Subscribers", None) self.label_7.setText(_translate("MainWindow", "Subject:"))
) self.textEditMessageBroadcast.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
self.pushButtonTTL.setText(_translate("MainWindow", "TTL:", None)) "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
hours = 48 "p, li { white-space: pre-wrap; }\n"
try: "</style></head><body style=\" font-family:\'Droid Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
hours = int(config.getint('bitmessagesettings', 'ttl') / 60 / 60) "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
except: self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.tab_2), _translate("MainWindow", "Send Message to your Subscribers"))
pass self.pushButtonTTL.setText(_translate("MainWindow", "TTL:"))
self.labelHumanFriendlyTTLDescription.setText( self.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "X days"))
_translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, hours) self.pushButtonClear.setText(_translate("MainWindow", "Clear"))
) self.pushButtonSend.setText(_translate("MainWindow", "Send"))
self.pushButtonClear.setText(_translate("MainWindow", "Clear", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send"))
self.pushButtonSend.setText(_translate("MainWindow", "Send", None)) self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)) self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription"))
self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions", None)) self.inboxSearchLineEditSubscriptions.setPlaceholderText(_translate("MainWindow", "Search"))
self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription", None)) self.inboxSearchOptionSubscriptions.setItemText(0, _translate("MainWindow", "All"))
self.inboxSearchLineEditSubscriptions.setPlaceholderText(_translate("MainWindow", "Search", None)) self.inboxSearchOptionSubscriptions.setItemText(1, _translate("MainWindow", "To"))
self.inboxSearchOptionSubscriptions.setItemText(0, _translate("MainWindow", "All", None)) self.inboxSearchOptionSubscriptions.setItemText(2, _translate("MainWindow", "From"))
self.inboxSearchOptionSubscriptions.setItemText(1, _translate("MainWindow", "From", None)) self.inboxSearchOptionSubscriptions.setItemText(3, _translate("MainWindow", "Subject"))
self.inboxSearchOptionSubscriptions.setItemText(2, _translate("MainWindow", "Subject", None)) self.inboxSearchOptionSubscriptions.setItemText(4, _translate("MainWindow", "Message"))
self.inboxSearchOptionSubscriptions.setItemText(3, _translate("MainWindow", "Message", None))
self.tableWidgetInboxSubscriptions.setSortingEnabled(True) self.tableWidgetInboxSubscriptions.setSortingEnabled(True)
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(0) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "To", None)) item.setText(_translate("MainWindow", "To"))
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(1) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "From", None)) item.setText(_translate("MainWindow", "From"))
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(2) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Subject", None)) item.setText(_translate("MainWindow", "Subject"))
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received"))
self.tabWidget.setTabText( self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions"))
self.tabWidget.indexOf(self.subscriptions), self.treeWidgetChans.headerItem().setText(0, _translate("MainWindow", "Chans"))
_translate("MainWindow", "Subscriptions", None) self.pushButtonAddChan.setText(_translate("MainWindow", "Add Chan"))
) self.inboxSearchLineEditChans.setPlaceholderText(_translate("MainWindow", "Search"))
self.treeWidgetChans.headerItem().setText(0, _translate("MainWindow", "Chans", None)) self.inboxSearchOptionChans.setItemText(0, _translate("MainWindow", "All"))
self.pushButtonAddChan.setText(_translate("MainWindow", "Add Chan", None)) self.inboxSearchOptionChans.setItemText(1, _translate("MainWindow", "To"))
self.inboxSearchLineEditChans.setPlaceholderText(_translate("MainWindow", "Search", None)) self.inboxSearchOptionChans.setItemText(2, _translate("MainWindow", "From"))
self.inboxSearchOptionChans.setItemText(0, _translate("MainWindow", "All", None)) self.inboxSearchOptionChans.setItemText(3, _translate("MainWindow", "Subject"))
self.inboxSearchOptionChans.setItemText(1, _translate("MainWindow", "To", None)) self.inboxSearchOptionChans.setItemText(4, _translate("MainWindow", "Message"))
self.inboxSearchOptionChans.setItemText(2, _translate("MainWindow", "From", None))
self.inboxSearchOptionChans.setItemText(3, _translate("MainWindow", "Subject", None))
self.inboxSearchOptionChans.setItemText(4, _translate("MainWindow", "Message", None))
self.tableWidgetInboxChans.setSortingEnabled(True) self.tableWidgetInboxChans.setSortingEnabled(True)
item = self.tableWidgetInboxChans.horizontalHeaderItem(0) item = self.tableWidgetInboxChans.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "To", None)) item.setText(_translate("MainWindow", "To"))
item = self.tableWidgetInboxChans.horizontalHeaderItem(1) item = self.tableWidgetInboxChans.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "From", None)) item.setText(_translate("MainWindow", "From"))
item = self.tableWidgetInboxChans.horizontalHeaderItem(2) item = self.tableWidgetInboxChans.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Subject", None)) item.setText(_translate("MainWindow", "Subject"))
item = self.tableWidgetInboxChans.horizontalHeaderItem(3) item = self.tableWidgetInboxChans.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.chans), _translate("MainWindow", "Chans", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Chans"))
self.blackwhitelist.retranslateUi() self.radioButtonBlacklist.setText(_translate("MainWindow", "Use a Blacklist (Allow all incoming messages except those on the Blacklist)"))
self.tabWidget.setTabText( self.radioButtonWhitelist.setText(_translate("MainWindow", "Use a Whitelist (Block all incoming messages except those on the Whitelist)"))
self.tabWidget.indexOf(self.blackwhitelist), self.pushButtonAddBlacklist.setText(_translate("MainWindow", "Add new entry"))
_translate("blacklist", "Blacklist", None) self.tableWidgetBlacklist.setSortingEnabled(True)
) item = self.tableWidgetBlacklist.horizontalHeaderItem(0)
self.networkstatus.retranslateUi() item.setText(_translate("MainWindow", "Name or Label"))
self.tabWidget.setTabText( item = self.tableWidgetBlacklist.horizontalHeaderItem(1)
self.tabWidget.indexOf(self.networkstatus), item.setText(_translate("MainWindow", "Address"))
_translate("networkstatus", "Network Status", None) self.tabWidget.setTabText(self.tabWidget.indexOf(self.blackwhitelist), _translate("MainWindow", "Blacklist"))
) item = self.tableWidgetConnectionCount.horizontalHeaderItem(0)
self.menuFile.setTitle(_translate("MainWindow", "File", None)) item.setText(_translate("MainWindow", "Stream #"))
self.menuSettings.setTitle(_translate("MainWindow", "Settings", None)) item = self.tableWidgetConnectionCount.horizontalHeaderItem(1)
self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) item.setText(_translate("MainWindow", "Connections"))
self.actionImport_keys.setText(_translate("MainWindow", "Import keys", None)) self.labelTotalConnections.setText(_translate("MainWindow", "Total connections:"))
self.actionManageKeys.setText(_translate("MainWindow", "Manage keys", None)) self.labelStartupTime.setText(_translate("MainWindow", "Since startup:"))
self.actionExit.setText(_translate("MainWindow", "Quit", None)) self.labelMessageCount.setText(_translate("MainWindow", "Processed 0 person-to-person messages."))
self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q", None)) self.labelPubkeyCount.setText(_translate("MainWindow", "Processed 0 public keys."))
self.actionHelp.setText(_translate("MainWindow", "Help", None)) self.labelBroadcastCount.setText(_translate("MainWindow", "Processed 0 broadcasts."))
self.actionHelp.setShortcut(_translate("MainWindow", "F1", None)) self.labelLookupsPerSecond.setText(_translate("MainWindow", "Inventory lookups per second: 0"))
self.actionSupport.setText(_translate("MainWindow", "Contact support", None)) self.labelBytesRecvCount.setText(_translate("MainWindow", "Down: 0 KB/s"))
self.actionAbout.setText(_translate("MainWindow", "About", None)) self.labelBytesSentCount.setText(_translate("MainWindow", "Up: 0 KB/s"))
self.actionSettings.setText(_translate("MainWindow", "Settings", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.networkstatus), _translate("MainWindow", "Network Status"))
self.actionRegenerateDeterministicAddresses.setText( self.menuFile.setTitle(_translate("MainWindow", "File"))
_translate("MainWindow", "Regenerate deterministic addresses", None) self.menuSettings.setTitle(_translate("MainWindow", "Settings"))
) self.menuHelp.setTitle(_translate("MainWindow", "Help"))
self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages", None)) self.actionImport_keys.setText(_translate("MainWindow", "Import keys"))
self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None)) self.actionManageKeys.setText(_translate("MainWindow", "Manage keys"))
self.actionExit.setText(_translate("MainWindow", "Quit"))
self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q"))
self.actionHelp.setText(_translate("MainWindow", "Help"))
self.actionHelp.setShortcut(_translate("MainWindow", "F1"))
self.actionSupport.setText(_translate("MainWindow", "Contact support"))
self.actionAbout.setText(_translate("MainWindow", "About"))
self.actionSettings.setText(_translate("MainWindow", "Settings"))
self.actionRegenerateDeterministicAddresses.setText(_translate("MainWindow", "Regenerate deterministic addresses"))
self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages"))
self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan"))
self.updateNetworkSwitchMenuLabel() self.updateNetworkSwitchMenuLabel()
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
MainWindow = settingsmixin.SMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

View File

@ -0,0 +1,732 @@
# Form implementation generated from reading ui file 'bitmessageui.ui'
#
# Created by: PyQt6 UI code generator 6.4.2
#
# 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.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
self.MainDock = QtWidgets.QDockWidget(parent=MainWindow)
self.MainDock.setGeometry(QtCore.QRect(0, 0, 885, 580))
icon = QtGui.QIcon()
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())
self.tabWidget.setSizePolicy(sizePolicy)
self.tabWidget.setMinimumSize(QtCore.QSize(0, 0))
self.tabWidget.setBaseSize(QtCore.QSize(0, 0))
font = QtGui.QFont()
font.setPointSize(9)
self.tabWidget.setFont(font)
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(":/newPrefix/images/identities.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
self.treeWidgetYourIdentities.headerItem().setIcon(0, icon1)
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(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetInbox.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInbox.setWordWrap(False)
self.tableWidgetInbox.setObjectName("tableWidgetInbox")
self.tableWidgetInbox.setColumnCount(4)
self.tableWidgetInbox.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInbox.setHorizontalHeaderItem(3, item)
self.tableWidgetInbox.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInbox.horizontalHeader().setDefaultSectionSize(200)
self.tableWidgetInbox.horizontalHeader().setHighlightSections(False)
self.tableWidgetInbox.horizontalHeader().setMinimumSectionSize(27)
self.tableWidgetInbox.horizontalHeader().setSortIndicatorShown(False)
self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInbox.verticalHeader().setVisible(False)
self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26)
self.verticalLayout_7.addWidget(self.tableWidgetInbox)
self.textEditInboxMessage = QtWidgets.QTextEdit(parent=self.inbox)
self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessage.setReadOnly(True)
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(":/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(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetAddressBook.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetAddressBook.setObjectName("tableWidgetAddressBook")
self.tableWidgetAddressBook.setColumnCount(2)
self.tableWidgetAddressBook.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
icon3 = QtGui.QIcon()
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 = 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.verticalLayout_2.addWidget(self.tableWidgetAddressBook)
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.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.gridLayout_8 = QtWidgets.QGridLayout(self.tab)
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.tab)
self.label_3.setObjectName("label_3")
self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1)
self.label_2 = QtWidgets.QLabel(parent=self.tab)
self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1)
self.lineEditSubject = QtWidgets.QLineEdit(parent=self.tab)
self.lineEditSubject.setText("")
self.lineEditSubject.setObjectName("lineEditSubject")
self.gridLayout_2.addWidget(self.lineEditSubject, 2, 1, 1, 1)
self.label = QtWidgets.QLabel(parent=self.tab)
self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)
self.comboBoxSendFrom = QtWidgets.QComboBox(parent=self.tab)
self.comboBoxSendFrom.setMinimumSize(QtCore.QSize(300, 0))
self.comboBoxSendFrom.setObjectName("comboBoxSendFrom")
self.gridLayout_2.addWidget(self.comboBoxSendFrom, 0, 1, 1, 1)
self.lineEditTo = QtWidgets.QLineEdit(parent=self.tab)
self.lineEditTo.setObjectName("lineEditTo")
self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1)
self.verticalLayout_5.addLayout(self.gridLayout_2)
self.textEditMessage = QtWidgets.QTextEdit(parent=self.tab)
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.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.gridLayout_9 = QtWidgets.QGridLayout(self.tab_2)
self.gridLayout_9.setObjectName("gridLayout_9")
self.verticalLayout_6 = QtWidgets.QVBoxLayout()
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.gridLayout_5 = QtWidgets.QGridLayout()
self.gridLayout_5.setObjectName("gridLayout_5")
self.label_8 = QtWidgets.QLabel(parent=self.tab_2)
self.label_8.setObjectName("label_8")
self.gridLayout_5.addWidget(self.label_8, 0, 0, 1, 1)
self.lineEditSubjectBroadcast = QtWidgets.QLineEdit(parent=self.tab_2)
self.lineEditSubjectBroadcast.setText("")
self.lineEditSubjectBroadcast.setObjectName("lineEditSubjectBroadcast")
self.gridLayout_5.addWidget(self.lineEditSubjectBroadcast, 1, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(parent=self.tab_2)
self.label_7.setObjectName("label_7")
self.gridLayout_5.addWidget(self.label_7, 1, 0, 1, 1)
self.comboBoxSendFromBroadcast = QtWidgets.QComboBox(parent=self.tab_2)
self.comboBoxSendFromBroadcast.setMinimumSize(QtCore.QSize(300, 0))
self.comboBoxSendFromBroadcast.setObjectName("comboBoxSendFromBroadcast")
self.gridLayout_5.addWidget(self.comboBoxSendFromBroadcast, 0, 1, 1, 1)
self.verticalLayout_6.addLayout(self.gridLayout_5)
self.textEditMessageBroadcast = QtWidgets.QTextEdit(parent=self.tab_2)
self.textEditMessageBroadcast.setObjectName("textEditMessageBroadcast")
self.verticalLayout_6.addWidget(self.textEditMessageBroadcast)
self.gridLayout_9.addLayout(self.verticalLayout_6, 0, 0, 1, 1)
self.tabWidgetSend.addTab(self.tab_2, "")
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.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.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.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("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("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.setMaximumSize(QtCore.QSize(45, 16777215))
self.labelHumanFriendlyTTLDescription.setObjectName("labelHumanFriendlyTTLDescription")
self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription)
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(":/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(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
self.treeWidgetSubscriptions.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.treeWidgetSubscriptions.setObjectName("treeWidgetSubscriptions")
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(":/newPrefix/images/subscriptions.png"), QtGui.QIcon.Mode.Selected, QtGui.QIcon.State.Off)
self.treeWidgetSubscriptions.headerItem().setIcon(0, icon5)
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(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInboxSubscriptions.setWordWrap(False)
self.tableWidgetInboxSubscriptions.setObjectName("tableWidgetInboxSubscriptions")
self.tableWidgetInboxSubscriptions.setColumnCount(4)
self.tableWidgetInboxSubscriptions.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(3, item)
self.tableWidgetInboxSubscriptions.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInboxSubscriptions.horizontalHeader().setDefaultSectionSize(200)
self.tableWidgetInboxSubscriptions.horizontalHeader().setHighlightSections(False)
self.tableWidgetInboxSubscriptions.horizontalHeader().setMinimumSectionSize(27)
self.tableWidgetInboxSubscriptions.horizontalHeader().setSortIndicatorShown(False)
self.tableWidgetInboxSubscriptions.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInboxSubscriptions.verticalHeader().setVisible(False)
self.tableWidgetInboxSubscriptions.verticalHeader().setDefaultSectionSize(26)
self.verticalLayout_4.addWidget(self.tableWidgetInboxSubscriptions)
self.textEditInboxMessageSubscriptions = QtWidgets.QTextEdit(parent=self.subscriptions)
self.textEditInboxMessageSubscriptions.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessageSubscriptions.setReadOnly(True)
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(":/newPrefix/images/subscriptions.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.subscriptions, icon6, "")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_3)
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.tab_3)
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(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
self.treeWidgetChans.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.treeWidgetChans.setObjectName("treeWidgetChans")
icon7 = QtGui.QIcon()
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.verticalLayout_17.addWidget(self.treeWidgetChans)
self.pushButtonAddChan = QtWidgets.QPushButton(parent=self.tab_3)
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.tab_3)
self.inboxSearchLineEditChans.setObjectName("inboxSearchLineEditChans")
self.horizontalLayout_6.addWidget(self.inboxSearchLineEditChans)
self.inboxSearchOptionChans = QtWidgets.QComboBox(parent=self.tab_3)
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.tab_3)
self.tableWidgetInboxChans.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
self.tableWidgetInboxChans.setAlternatingRowColors(True)
self.tableWidgetInboxChans.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
self.tableWidgetInboxChans.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetInboxChans.setWordWrap(False)
self.tableWidgetInboxChans.setObjectName("tableWidgetInboxChans")
self.tableWidgetInboxChans.setColumnCount(4)
self.tableWidgetInboxChans.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetInboxChans.setHorizontalHeaderItem(3, item)
self.tableWidgetInboxChans.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInboxChans.horizontalHeader().setDefaultSectionSize(200)
self.tableWidgetInboxChans.horizontalHeader().setHighlightSections(False)
self.tableWidgetInboxChans.horizontalHeader().setMinimumSectionSize(27)
self.tableWidgetInboxChans.horizontalHeader().setSortIndicatorShown(False)
self.tableWidgetInboxChans.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInboxChans.verticalHeader().setVisible(False)
self.tableWidgetInboxChans.verticalHeader().setDefaultSectionSize(26)
self.verticalLayout_8.addWidget(self.tableWidgetInboxChans)
self.textEditInboxMessageChans = QtWidgets.QTextEdit(parent=self.tab_3)
self.textEditInboxMessageChans.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessageChans.setReadOnly(True)
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(":/newPrefix/images/can-icon-16px.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.tab_3, icon8, "")
self.blackwhitelist = QtWidgets.QWidget()
self.blackwhitelist.setObjectName("blackwhitelist")
self.gridLayout_6 = QtWidgets.QGridLayout(self.blackwhitelist)
self.gridLayout_6.setObjectName("gridLayout_6")
self.radioButtonBlacklist = QtWidgets.QRadioButton(parent=self.blackwhitelist)
self.radioButtonBlacklist.setChecked(True)
self.radioButtonBlacklist.setObjectName("radioButtonBlacklist")
self.gridLayout_6.addWidget(self.radioButtonBlacklist, 0, 0, 1, 2)
self.radioButtonWhitelist = QtWidgets.QRadioButton(parent=self.blackwhitelist)
self.radioButtonWhitelist.setObjectName("radioButtonWhitelist")
self.gridLayout_6.addWidget(self.radioButtonWhitelist, 1, 0, 1, 2)
self.pushButtonAddBlacklist = QtWidgets.QPushButton(parent=self.blackwhitelist)
self.pushButtonAddBlacklist.setObjectName("pushButtonAddBlacklist")
self.gridLayout_6.addWidget(self.pushButtonAddBlacklist, 2, 0, 1, 1)
spacerItem = QtWidgets.QSpacerItem(689, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_6.addItem(spacerItem, 2, 1, 1, 1)
self.tableWidgetBlacklist = QtWidgets.QTableWidget(parent=self.blackwhitelist)
self.tableWidgetBlacklist.setAlternatingRowColors(True)
self.tableWidgetBlacklist.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
self.tableWidgetBlacklist.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
self.tableWidgetBlacklist.setObjectName("tableWidgetBlacklist")
self.tableWidgetBlacklist.setColumnCount(2)
self.tableWidgetBlacklist.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetBlacklist.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetBlacklist.setHorizontalHeaderItem(1, item)
self.tableWidgetBlacklist.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetBlacklist.horizontalHeader().setDefaultSectionSize(400)
self.tableWidgetBlacklist.horizontalHeader().setHighlightSections(False)
self.tableWidgetBlacklist.horizontalHeader().setSortIndicatorShown(False)
self.tableWidgetBlacklist.horizontalHeader().setStretchLastSection(True)
self.tableWidgetBlacklist.verticalHeader().setVisible(False)
self.gridLayout_6.addWidget(self.tableWidgetBlacklist, 3, 0, 1, 2)
icon9 = QtGui.QIcon()
icon9.addPixmap(QtGui.QPixmap(":/newPrefix/images/blacklist.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.blackwhitelist, icon9, "")
self.networkstatus = QtWidgets.QWidget()
self.networkstatus.setObjectName("networkstatus")
self.pushButtonStatusIcon = QtWidgets.QPushButton(parent=self.networkstatus)
self.pushButtonStatusIcon.setGeometry(QtCore.QRect(680, 440, 21, 23))
self.pushButtonStatusIcon.setText("")
icon10 = QtGui.QIcon()
icon10.addPixmap(QtGui.QPixmap(":/newPrefix/images/redicon.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.pushButtonStatusIcon.setIcon(icon10)
self.pushButtonStatusIcon.setFlat(True)
self.pushButtonStatusIcon.setObjectName("pushButtonStatusIcon")
self.tableWidgetConnectionCount = QtWidgets.QTableWidget(parent=self.networkstatus)
self.tableWidgetConnectionCount.setGeometry(QtCore.QRect(20, 70, 241, 241))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(212, 208, 200))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(212, 208, 200))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(212, 208, 200))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
self.tableWidgetConnectionCount.setPalette(palette)
self.tableWidgetConnectionCount.setFrameShape(QtWidgets.QFrame.Shape.Box)
self.tableWidgetConnectionCount.setFrameShadow(QtWidgets.QFrame.Shadow.Plain)
self.tableWidgetConnectionCount.setProperty("showDropIndicator", False)
self.tableWidgetConnectionCount.setAlternatingRowColors(True)
self.tableWidgetConnectionCount.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.NoSelection)
self.tableWidgetConnectionCount.setObjectName("tableWidgetConnectionCount")
self.tableWidgetConnectionCount.setColumnCount(2)
self.tableWidgetConnectionCount.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetConnectionCount.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidgetConnectionCount.setHorizontalHeaderItem(1, item)
self.tableWidgetConnectionCount.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetConnectionCount.horizontalHeader().setHighlightSections(False)
self.tableWidgetConnectionCount.horizontalHeader().setStretchLastSection(True)
self.tableWidgetConnectionCount.verticalHeader().setVisible(False)
self.labelTotalConnections = QtWidgets.QLabel(parent=self.networkstatus)
self.labelTotalConnections.setGeometry(QtCore.QRect(20, 30, 401, 16))
self.labelTotalConnections.setObjectName("labelTotalConnections")
self.labelStartupTime = QtWidgets.QLabel(parent=self.networkstatus)
self.labelStartupTime.setGeometry(QtCore.QRect(320, 110, 331, 20))
self.labelStartupTime.setObjectName("labelStartupTime")
self.labelMessageCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelMessageCount.setGeometry(QtCore.QRect(350, 130, 361, 16))
self.labelMessageCount.setObjectName("labelMessageCount")
self.labelPubkeyCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelPubkeyCount.setGeometry(QtCore.QRect(350, 170, 331, 16))
self.labelPubkeyCount.setObjectName("labelPubkeyCount")
self.labelBroadcastCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelBroadcastCount.setGeometry(QtCore.QRect(350, 150, 351, 16))
self.labelBroadcastCount.setObjectName("labelBroadcastCount")
self.labelLookupsPerSecond = QtWidgets.QLabel(parent=self.networkstatus)
self.labelLookupsPerSecond.setGeometry(QtCore.QRect(320, 250, 291, 16))
self.labelLookupsPerSecond.setObjectName("labelLookupsPerSecond")
self.labelBytesRecvCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelBytesRecvCount.setGeometry(QtCore.QRect(350, 210, 251, 16))
self.labelBytesRecvCount.setObjectName("labelBytesRecvCount")
self.labelBytesSentCount = QtWidgets.QLabel(parent=self.networkstatus)
self.labelBytesSentCount.setGeometry(QtCore.QRect(350, 230, 251, 16))
self.labelBytesSentCount.setObjectName("labelBytesSentCount")
icon11 = QtGui.QIcon()
icon11.addPixmap(QtGui.QPixmap(":/newPrefix/images/networkstatus.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
self.tabWidget.addTab(self.networkstatus, icon11, "")
self.gridLayout_10.addWidget(self.tabWidget, 0, 0, 1, 1)
self.MainDock.setWidget(self.centralwidget)
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(None), self.MainDock)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 885, 27))
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 = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setMaximumSize(QtCore.QSize(16777215, 22))
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
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("dialog-password")
self.actionManageKeys.setIcon(icon)
self.actionManageKeys.setObjectName("actionManageKeys")
self.actionExit = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("application-exit")
self.actionExit.setIcon(icon)
self.actionExit.setObjectName("actionExit")
self.actionHelp = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("help-contents")
self.actionHelp.setIcon(icon)
self.actionHelp.setObjectName("actionHelp")
self.actionAbout = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("help-about")
self.actionAbout.setIcon(icon)
self.actionAbout.setObjectName("actionAbout")
self.actionSettings = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("document-properties")
self.actionSettings.setIcon(icon)
self.actionSettings.setObjectName("actionSettings")
self.actionRegenerateDeterministicAddresses = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("view-refresh")
self.actionRegenerateDeterministicAddresses.setIcon(icon)
self.actionRegenerateDeterministicAddresses.setObjectName("actionRegenerateDeterministicAddresses")
self.actionDeleteAllTrashedMessages = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("user-trash")
self.actionDeleteAllTrashedMessages.setIcon(icon)
self.actionDeleteAllTrashedMessages.setObjectName("actionDeleteAllTrashedMessages")
self.actionJoinChan = QtGui.QAction(parent=MainWindow)
icon = QtGui.QIcon.fromTheme("contact-new")
self.actionJoinChan.setIcon(icon)
self.actionJoinChan.setObjectName("actionJoinChan")
self.menuFile.addAction(self.actionManageKeys)
self.menuFile.addAction(self.actionDeleteAllTrashedMessages)
self.menuFile.addAction(self.actionRegenerateDeterministicAddresses)
self.menuFile.addAction(self.actionExit)
self.menuSettings.addAction(self.actionSettings)
self.menuHelp.addAction(self.actionHelp)
self.menuHelp.addAction(self.actionAbout)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuSettings.menuAction())
self.menubar.addAction(self.menuHelp.menuAction())
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(0)
self.tabWidgetSend.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.tableWidgetInbox, self.textEditInboxMessage)
MainWindow.setTabOrder(self.textEditInboxMessage, self.comboBoxSendFrom)
MainWindow.setTabOrder(self.comboBoxSendFrom, self.lineEditTo)
MainWindow.setTabOrder(self.lineEditTo, self.lineEditSubject)
MainWindow.setTabOrder(self.lineEditSubject, self.textEditMessage)
MainWindow.setTabOrder(self.textEditMessage, self.pushButtonSend)
MainWindow.setTabOrder(self.pushButtonSend, self.pushButtonAddSubscription)
MainWindow.setTabOrder(self.pushButtonAddSubscription, self.radioButtonBlacklist)
MainWindow.setTabOrder(self.radioButtonBlacklist, self.radioButtonWhitelist)
MainWindow.setTabOrder(self.radioButtonWhitelist, self.pushButtonAddBlacklist)
MainWindow.setTabOrder(self.pushButtonAddBlacklist, self.tableWidgetBlacklist)
MainWindow.setTabOrder(self.tableWidgetBlacklist, self.tableWidgetConnectionCount)
MainWindow.setTabOrder(self.tableWidgetConnectionCount, self.pushButtonStatusIcon)
def retranslateUi(self, MainWindow):
_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"))
item = self.tableWidgetInbox.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "From"))
item = self.tableWidgetInbox.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Subject"))
item = self.tableWidgetInbox.horizontalHeaderItem(3)
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"))
item = self.tableWidgetAddressBook.horizontalHeaderItem(1)
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", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Droid Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.tab), _translate("MainWindow", "Send ordinary Message"))
self.label_8.setText(_translate("MainWindow", "From:"))
self.label_7.setText(_translate("MainWindow", "Subject:"))
self.textEditMessageBroadcast.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Droid Sans\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\';\"><br /></p></body></html>"))
self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.tab_2), _translate("MainWindow", "Send Message to your Subscribers"))
self.pushButtonTTL.setText(_translate("MainWindow", "TTL:"))
self.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "X days"))
self.pushButtonSend.setText(_translate("MainWindow", "Send"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send"))
self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions"))
self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription"))
self.inboxSearchLineEditSubscriptions.setPlaceholderText(_translate("MainWindow", "Search"))
self.inboxSearchOptionSubscriptions.setItemText(0, _translate("MainWindow", "All"))
self.inboxSearchOptionSubscriptions.setItemText(1, _translate("MainWindow", "To"))
self.inboxSearchOptionSubscriptions.setItemText(2, _translate("MainWindow", "From"))
self.inboxSearchOptionSubscriptions.setItemText(3, _translate("MainWindow", "Subject"))
self.inboxSearchOptionSubscriptions.setItemText(4, _translate("MainWindow", "Message"))
self.tableWidgetInboxSubscriptions.setSortingEnabled(True)
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "To"))
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "From"))
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Subject"))
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions"))
self.treeWidgetChans.headerItem().setText(0, _translate("MainWindow", "Chans"))
self.pushButtonAddChan.setText(_translate("MainWindow", "Add Chan"))
self.inboxSearchLineEditChans.setPlaceholderText(_translate("MainWindow", "Search"))
self.inboxSearchOptionChans.setItemText(0, _translate("MainWindow", "All"))
self.inboxSearchOptionChans.setItemText(1, _translate("MainWindow", "To"))
self.inboxSearchOptionChans.setItemText(2, _translate("MainWindow", "From"))
self.inboxSearchOptionChans.setItemText(3, _translate("MainWindow", "Subject"))
self.inboxSearchOptionChans.setItemText(4, _translate("MainWindow", "Message"))
self.tableWidgetInboxChans.setSortingEnabled(True)
item = self.tableWidgetInboxChans.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "To"))
item = self.tableWidgetInboxChans.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "From"))
item = self.tableWidgetInboxChans.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Subject"))
item = self.tableWidgetInboxChans.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Chans"))
self.radioButtonBlacklist.setText(_translate("MainWindow", "Use a Blacklist (Allow all incoming messages except those on the Blacklist)"))
self.radioButtonWhitelist.setText(_translate("MainWindow", "Use a Whitelist (Block all incoming messages except those on the Whitelist)"))
self.pushButtonAddBlacklist.setText(_translate("MainWindow", "Add new entry"))
self.tableWidgetBlacklist.setSortingEnabled(True)
item = self.tableWidgetBlacklist.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "Name or Label"))
item = self.tableWidgetBlacklist.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "Address"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.blackwhitelist), _translate("MainWindow", "Blacklist"))
item = self.tableWidgetConnectionCount.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "Stream #"))
item = self.tableWidgetConnectionCount.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "Connections"))
self.labelTotalConnections.setText(_translate("MainWindow", "Total connections:"))
self.labelStartupTime.setText(_translate("MainWindow", "Since startup:"))
self.labelMessageCount.setText(_translate("MainWindow", "Processed 0 person-to-person messages."))
self.labelPubkeyCount.setText(_translate("MainWindow", "Processed 0 public keys."))
self.labelBroadcastCount.setText(_translate("MainWindow", "Processed 0 broadcasts."))
self.labelLookupsPerSecond.setText(_translate("MainWindow", "Inventory lookups per second: 0"))
self.labelBytesRecvCount.setText(_translate("MainWindow", "Down: 0 KB/s"))
self.labelBytesSentCount.setText(_translate("MainWindow", "Up: 0 KB/s"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.networkstatus), _translate("MainWindow", "Network Status"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.menuSettings.setTitle(_translate("MainWindow", "Settings"))
self.menuHelp.setTitle(_translate("MainWindow", "Help"))
self.actionImport_keys.setText(_translate("MainWindow", "Import keys"))
self.actionManageKeys.setText(_translate("MainWindow", "Manage keys"))
self.actionExit.setText(_translate("MainWindow", "Quit"))
self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q"))
self.actionHelp.setText(_translate("MainWindow", "Help"))
self.actionHelp.setShortcut(_translate("MainWindow", "F1"))
self.actionAbout.setText(_translate("MainWindow", "About"))
self.actionSettings.setText(_translate("MainWindow", "Settings"))
self.actionRegenerateDeterministicAddresses.setText(_translate("MainWindow", "Regenerate deterministic addresses"))
self.actionDeleteAllTrashedMessages.setText(_translate("MainWindow", "Delete all trashed messages"))
self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan"))

View File

@ -2,6 +2,7 @@
<ui version="4.0"> <ui version="4.0">
<class>MainWindow</class> <class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow"> <widget class="QMainWindow" name="MainWindow">
<widget class="QDockWidget" name="MainDock">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -17,13 +18,13 @@
<iconset resource="bitmessage_icons.qrc"> <iconset resource="bitmessage_icons.qrc">
<normaloff>:/newPrefix/images/can-icon-24px.png</normaloff>:/newPrefix/images/can-icon-24px.png</iconset> <normaloff>:/newPrefix/images/can-icon-24px.png</normaloff>:/newPrefix/images/can-icon-24px.png</iconset>
</property> </property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_10"> <layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1290,6 +1291,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
</widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">
<property name="geometry"> <property name="geometry">
<rect> <rect>

View File

@ -1,42 +1,37 @@
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
import widgets import bitmessageqt.widgets as widgets
from addresses import addBMIfNotPresent from addresses import addBMIfNotPresent
from bmconfigparser import config from bmconfigparser import config
from dialogs import AddAddressDialog from .dialogs import AddAddressDialog
from helper_sql import sqlExecute, sqlQuery from helper_sql import sqlExecute, sqlQuery
from queues import UISignalQueue from queues import UISignalQueue
from retranslateui import RetranslateMixin from .retranslateui import RetranslateMixin
from tr import _translate from tr import _translate
from uisignaler import UISignaler from .uisignaler import UISignaler
from utils import avatarize from .utils import avatarize
class Blacklist(QtGui.QWidget, RetranslateMixin): class Blacklist(QtWidgets.QWidget, RetranslateMixin):
def __init__(self, parent=None): def __init__(self, parent=None):
super(Blacklist, self).__init__(parent) super(Blacklist, self).__init__(parent)
widgets.load('blacklist.ui', self) widgets.load('blacklist.ui', self)
QtCore.QObject.connect(self.radioButtonBlacklist, QtCore.SIGNAL( self.radioButtonBlacklist.clicked.connect(self.click_radioButtonBlacklist)
"clicked()"), self.click_radioButtonBlacklist) self.radioButtonWhitelist.clicked.connect(self.click_radioButtonWhitelist)
QtCore.QObject.connect(self.radioButtonWhitelist, QtCore.SIGNAL( self.pushButtonAddBlacklist.clicked.connect(self.click_pushButtonAddBlacklist)
"clicked()"), self.click_radioButtonWhitelist)
QtCore.QObject.connect(self.pushButtonAddBlacklist, QtCore.SIGNAL(
"clicked()"), self.click_pushButtonAddBlacklist)
self.init_blacklist_popup_menu() self.init_blacklist_popup_menu()
# Initialize blacklist # Initialize blacklist
QtCore.QObject.connect(self.tableWidgetBlacklist, QtCore.SIGNAL( self.tableWidgetBlacklist.itemChanged.connect(self.tableWidgetBlacklistItemChanged)
"itemChanged(QTableWidgetItem *)"), self.tableWidgetBlacklistItemChanged)
# Set the icon sizes for the identicons # Set the icon sizes for the identicons
identicon_size = 3*7 identicon_size = 3*7
self.tableWidgetBlacklist.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.tableWidgetBlacklist.setIconSize(QtCore.QSize(identicon_size, identicon_size))
self.UISignalThread = UISignaler.get() self.UISignalThread = UISignaler.get()
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.rerenderBlackWhiteList.connect(self.rerenderBlackWhiteList)
"rerenderBlackWhiteList()"), self.rerenderBlackWhiteList)
def click_radioButtonBlacklist(self): def click_radioButtonBlacklist(self):
if config.get('bitmessagesettings', 'blackwhitelist') == 'white': if config.get('bitmessagesettings', 'blackwhitelist') == 'white':
@ -118,7 +113,7 @@ class Blacklist(QtGui.QWidget, RetranslateMixin):
def init_blacklist_popup_menu(self, connectSignal=True): def init_blacklist_popup_menu(self, connectSignal=True):
# Popup menu for the Blacklist page # Popup menu for the Blacklist page
self.blacklistContextMenuToolbar = QtGui.QToolBar() self.blacklistContextMenuToolbar = QtWidgets.QToolBar()
# Actions # Actions
self.actionBlacklistNew = self.blacklistContextMenuToolbar.addAction( self.actionBlacklistNew = self.blacklistContextMenuToolbar.addAction(
_translate( _translate(
@ -141,12 +136,10 @@ class Blacklist(QtGui.QWidget, RetranslateMixin):
"MainWindow", "Set avatar..."), "MainWindow", "Set avatar..."),
self.on_action_BlacklistSetAvatar) self.on_action_BlacklistSetAvatar)
self.tableWidgetBlacklist.setContextMenuPolicy( self.tableWidgetBlacklist.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.tableWidgetBlacklist, QtCore.SIGNAL( self.tableWidgetBlacklist.customContextMenuRequested.connect(self.on_context_menuBlacklist)
'customContextMenuRequested(const QPoint&)'), self.popMenuBlacklist = QtWidgets.QMenu(self)
self.on_context_menuBlacklist)
self.popMenuBlacklist = QtGui.QMenu(self)
# self.popMenuBlacklist.addAction( self.actionBlacklistNew ) # self.popMenuBlacklist.addAction( self.actionBlacklistNew )
self.popMenuBlacklist.addAction(self.actionBlacklistDelete) self.popMenuBlacklist.addAction(self.actionBlacklistDelete)
self.popMenuBlacklist.addSeparator() self.popMenuBlacklist.addSeparator()
@ -172,12 +165,12 @@ class Blacklist(QtGui.QWidget, RetranslateMixin):
for row in queryreturn: for row in queryreturn:
label, address, enabled = row label, address, enabled = row
self.tableWidgetBlacklist.insertRow(0) self.tableWidgetBlacklist.insertRow(0)
newItem = QtGui.QTableWidgetItem(unicode(label, 'utf-8')) newItem = QtWidgets.QTableWidgetItem(unicode(label, 'utf-8'))
if not enabled: if not enabled:
newItem.setTextColor(QtGui.QColor(128, 128, 128)) newItem.setTextColor(QtGui.QColor(128, 128, 128))
newItem.setIcon(avatarize(address)) newItem.setIcon(avatarize(address))
self.tableWidgetBlacklist.setItem(0, 0, newItem) self.tableWidgetBlacklist.setItem(0, 0, newItem)
newItem = QtGui.QTableWidgetItem(address) newItem = QtWidgets.QTableWidgetItem(address)
newItem.setFlags( newItem.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
if not enabled: if not enabled:

View File

@ -2,17 +2,17 @@
Custom dialog classes Custom dialog classes
""" """
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
from PyQt4 import QtGui from PyQt6 import QtGui, QtWidgets
import paths import paths
import widgets import bitmessageqt.widgets as widgets
from address_dialogs import ( from .address_dialogs import (
AddAddressDialog, EmailGatewayDialog, NewAddressDialog, AddAddressDialog, EmailGatewayDialog, NewAddressDialog,
NewSubscriptionDialog, RegenerateAddressesDialog, NewSubscriptionDialog, RegenerateAddressesDialog,
SpecialAddressBehaviorDialog SpecialAddressBehaviorDialog
) )
from newchandialog import NewChanDialog from .newchandialog import NewChanDialog
from settings import SettingsDialog from .settings import SettingsDialog
from tr import _translate from tr import _translate
from version import softwareVersion from version import softwareVersion
@ -25,7 +25,7 @@ __all__ = [
] ]
class AboutDialog(QtGui.QDialog): class AboutDialog(QtWidgets.QDialog):
"""The `About` dialog""" """The `About` dialog"""
def __init__(self, parent=None): def __init__(self, parent=None):
super(AboutDialog, self).__init__(parent) super(AboutDialog, self).__init__(parent)
@ -50,10 +50,10 @@ class AboutDialog(QtGui.QDialog):
except AttributeError: except AttributeError:
pass pass
self.setFixedSize(QtGui.QWidget.sizeHint(self)) self.setFixedSize(QtWidgets.QWidget.sizeHint(self))
class IconGlossaryDialog(QtGui.QDialog): class IconGlossaryDialog(QtWidgets.QDialog):
"""The `Icon Glossary` dialog, explaining the status icon colors""" """The `Icon Glossary` dialog, explaining the status icon colors"""
def __init__(self, parent=None, config=None): def __init__(self, parent=None, config=None):
super(IconGlossaryDialog, self).__init__(parent) super(IconGlossaryDialog, self).__init__(parent)
@ -66,20 +66,20 @@ class IconGlossaryDialog(QtGui.QDialog):
"iconGlossaryDialog", "iconGlossaryDialog",
"You are using TCP port %1. (This can be changed in the settings)." "You are using TCP port %1. (This can be changed in the settings)."
).arg(config.getint('bitmessagesettings', 'port'))) ).arg(config.getint('bitmessagesettings', 'port')))
self.setFixedSize(QtGui.QWidget.sizeHint(self)) self.setFixedSize(QtWidgets.QWidget.sizeHint(self))
class HelpDialog(QtGui.QDialog): class HelpDialog(QtWidgets.QDialog):
"""The `Help` dialog""" """The `Help` dialog"""
def __init__(self, parent=None): def __init__(self, parent=None):
super(HelpDialog, self).__init__(parent) super(HelpDialog, self).__init__(parent)
widgets.load('help.ui', self) widgets.load('help.ui', self)
self.setFixedSize(QtGui.QWidget.sizeHint(self)) self.setFixedSize(QtWidgets.QWidget.sizeHint(self))
class ConnectDialog(QtGui.QDialog): class ConnectDialog(QtWidgets.QDialog):
"""The `Connect` dialog""" """The `Connect` dialog"""
def __init__(self, parent=None): def __init__(self, parent=None):
super(ConnectDialog, self).__init__(parent) super(ConnectDialog, self).__init__(parent)
widgets.load('connect.ui', self) widgets.load('connect.ui', self)
self.setFixedSize(QtGui.QWidget.sizeHint(self)) self.setFixedSize(QtWidgets.QWidget.sizeHint(self))

View File

@ -4,15 +4,15 @@ Folder tree and messagelist widgets definitions.
# pylint: disable=too-many-arguments,bad-super-call # pylint: disable=too-many-arguments,bad-super-call
# pylint: disable=attribute-defined-outside-init # pylint: disable=attribute-defined-outside-init
from cgi import escape from html import escape
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
from bmconfigparser import config from bmconfigparser import config
from helper_sql import sqlExecute, sqlQuery from helper_sql import sqlExecute, sqlQuery
from settingsmixin import SettingsMixin from .settingsmixin import SettingsMixin
from tr import _translate from tr import _translate
from utils import avatarize from .utils import avatarize
# for pylupdate # for pylupdate
_translate("MainWindow", "inbox") _translate("MainWindow", "inbox")
@ -20,7 +20,7 @@ _translate("MainWindow", "new")
_translate("MainWindow", "sent") _translate("MainWindow", "sent")
_translate("MainWindow", "trash") _translate("MainWindow", "trash")
TimestampRole = QtCore.Qt.UserRole + 1 TimestampRole = QtCore.Qt.ItemDataRole.UserRole + 1
class AccountMixin(object): class AccountMixin(object):
@ -40,13 +40,13 @@ class AccountMixin(object):
return QtGui.QColor(216, 119, 0) return QtGui.QColor(216, 119, 0)
elif self.type in [self.MAILINGLIST, self.SUBSCRIPTION]: elif self.type in [self.MAILINGLIST, self.SUBSCRIPTION]:
return QtGui.QColor(137, 4, 177) return QtGui.QColor(137, 4, 177)
return QtGui.QApplication.palette().text().color() return QtWidgets.QApplication.palette().text().color()
def folderColor(self): def folderColor(self):
"""QT UI color for a folder""" """QT UI color for a folder"""
if not self.parent().isEnabled: if not self.parent().isEnabled:
return QtGui.QColor(128, 128, 128) return QtGui.QColor(128, 128, 128)
return QtGui.QApplication.palette().text().color() return QtWidgets.QApplication.palette().text().color()
def accountBrush(self): def accountBrush(self):
"""Account brush (for QT UI)""" """Account brush (for QT UI)"""
@ -83,7 +83,7 @@ class AccountMixin(object):
except AttributeError: except AttributeError:
pass pass
self.unreadCount = int(cnt) self.unreadCount = int(cnt)
if isinstance(self, QtGui.QTreeWidgetItem): if isinstance(self, QtWidgets.QTreeWidgetItem):
self.emitDataChanged() self.emitDataChanged()
def setEnabled(self, enabled): def setEnabled(self, enabled):
@ -97,15 +97,15 @@ class AccountMixin(object):
for i in range(self.childCount()): for i in range(self.childCount()):
if isinstance(self.child(i), Ui_FolderWidget): if isinstance(self.child(i), Ui_FolderWidget):
self.child(i).setEnabled(enabled) self.child(i).setEnabled(enabled)
if isinstance(self, QtGui.QTreeWidgetItem): if isinstance(self, QtWidgets.QTreeWidgetItem):
self.emitDataChanged() self.emitDataChanged()
def setType(self): def setType(self):
"""Set account type (QT UI)""" """Set account type (QT UI)"""
self.setFlags(self.flags() | QtCore.Qt.ItemIsEditable) self.setFlags(self.flags() | QtCore.Qt.ItemFlag.ItemIsEditable)
if self.address is None: if self.address is None:
self.type = self.ALL self.type = self.ALL
self.setFlags(self.flags() & ~QtCore.Qt.ItemIsEditable) self.setFlags(self.flags() & ~QtCore.Qt.ItemFlag.ItemIsEditable)
elif config.safeGetBoolean(self.address, 'chan'): elif config.safeGetBoolean(self.address, 'chan'):
self.type = self.CHAN self.type = self.CHAN
elif config.safeGetBoolean(self.address, 'mailinglist'): elif config.safeGetBoolean(self.address, 'mailinglist'):
@ -144,11 +144,11 @@ class AccountMixin(object):
return retval or unicode(self.address, 'utf-8') return retval or unicode(self.address, 'utf-8')
class BMTreeWidgetItem(QtGui.QTreeWidgetItem, AccountMixin): class BMTreeWidgetItem(QtWidgets.QTreeWidgetItem, AccountMixin):
"""A common abstract class for Tree widget item""" """A common abstract class for Tree widget item"""
def __init__(self, parent, pos, address, unreadCount): def __init__(self, parent, pos, address, unreadCount):
super(QtGui.QTreeWidgetItem, self).__init__() super(QtWidgets.QTreeWidgetItem, self).__init__()
self.setAddress(address) self.setAddress(address)
self.setUnreadCount(unreadCount) self.setUnreadCount(unreadCount)
self._setup(parent, pos) self._setup(parent, pos)
@ -159,14 +159,14 @@ class BMTreeWidgetItem(QtGui.QTreeWidgetItem, AccountMixin):
def data(self, column, role): def data(self, column, role):
"""Override internal QT method for returning object data""" """Override internal QT method for returning object data"""
if column == 0: if column == 0:
if role == QtCore.Qt.DisplayRole: if role == QtCore.Qt.ItemDataRole.DisplayRole:
return self._getLabel() + self._getAddressBracket( return self._getLabel() + self._getAddressBracket(
self.unreadCount > 0) self.unreadCount > 0)
elif role == QtCore.Qt.EditRole: elif role == QtCore.Qt.ItemDataRole.EditRole:
return self._getLabel() return self._getLabel()
elif role == QtCore.Qt.ToolTipRole: elif role == QtCore.Qt.ItemDataRole.ToolTipRole:
return self._getLabel() + self._getAddressBracket(False) return self._getLabel() + self._getAddressBracket(False)
elif role == QtCore.Qt.FontRole: elif role == QtCore.Qt.ItemDataRole.FontRole:
font = QtGui.QFont() font = QtGui.QFont()
font.setBold(self.unreadCount > 0) font.setBold(self.unreadCount > 0)
return font return font
@ -195,7 +195,7 @@ class Ui_FolderWidget(BMTreeWidgetItem):
def data(self, column, role): def data(self, column, role):
"""Override internal QT method for returning object data""" """Override internal QT method for returning object data"""
if column == 0 and role == QtCore.Qt.ForegroundRole: if column == 0 and role == QtCore.Qt.ItemDataRole.ForegroundRole:
return self.folderBrush() return self.folderBrush()
return super(Ui_FolderWidget, self).data(column, role) return super(Ui_FolderWidget, self).data(column, role)
@ -216,7 +216,7 @@ class Ui_FolderWidget(BMTreeWidgetItem):
return self.folderName < other.folderName return self.folderName < other.folderName
return x >= y if reverse else x < y return x >= y if reverse else x < y
return super(QtGui.QTreeWidgetItem, self).__lt__(other) return super(QtWidgets.QTreeWidgetItem, self).__lt__(other)
class Ui_AddressWidget(BMTreeWidgetItem, SettingsMixin): class Ui_AddressWidget(BMTreeWidgetItem, SettingsMixin):
@ -252,16 +252,16 @@ class Ui_AddressWidget(BMTreeWidgetItem, SettingsMixin):
def data(self, column, role): def data(self, column, role):
"""Override internal QT method for returning object data""" """Override internal QT method for returning object data"""
if column == 0: if column == 0:
if role == QtCore.Qt.DecorationRole: if role == QtCore.Qt.ItemDataRole.DecorationRole:
return avatarize( return avatarize(
self.address or self._getLabel().encode('utf8')) self.address or self._getLabel().encode('utf8'))
elif role == QtCore.Qt.ForegroundRole: elif role == QtCore.Qt.ItemDataRole.ForegroundRole:
return self.accountBrush() return self.accountBrush()
return super(Ui_AddressWidget, self).data(column, role) return super(Ui_AddressWidget, self).data(column, role)
def setData(self, column, role, value): def setData(self, column, role, value):
"""Save account label (if you edit in the the UI, this will be triggered and will save it to keys.dat)""" """Save account label (if you edit in the the UI, this will be triggered and will save it to keys.dat)"""
if role == QtCore.Qt.EditRole \ if role == QtCore.Qt.ItemDataRole.EditRole \
and self.type != AccountMixin.SUBSCRIPTION: and self.type != AccountMixin.SUBSCRIPTION:
config.set( config.set(
str(self.address), 'label', str(self.address), 'label',
@ -275,7 +275,7 @@ class Ui_AddressWidget(BMTreeWidgetItem, SettingsMixin):
def setAddress(self, address): def setAddress(self, address):
"""Set address to object (for QT UI)""" """Set address to object (for QT UI)"""
super(Ui_AddressWidget, self).setAddress(address) super(Ui_AddressWidget, self).setAddress(address)
self.setData(0, QtCore.Qt.UserRole, self.address) self.setData(0, QtCore.Qt.ItemDataRole.UserRole, self.address)
def _getSortRank(self): def _getSortRank(self):
return self.type if self.isEnabled else (self.type + 100) return self.type if self.isEnabled else (self.type + 100)
@ -295,7 +295,7 @@ class Ui_AddressWidget(BMTreeWidgetItem, SettingsMixin):
if self._getSortRank() < other._getSortRank() else reverse if self._getSortRank() < other._getSortRank() else reverse
) )
return super(QtGui.QTreeWidgetItem, self).__lt__(other) return super(QtWidgets.QTreeWidgetItem, self).__lt__(other)
class Ui_SubscriptionWidget(Ui_AddressWidget): class Ui_SubscriptionWidget(Ui_AddressWidget):
@ -321,7 +321,7 @@ class Ui_SubscriptionWidget(Ui_AddressWidget):
def setData(self, column, role, value): def setData(self, column, role, value):
"""Save subscription label to database""" """Save subscription label to database"""
if role == QtCore.Qt.EditRole: if role == QtCore.Qt.ItemDataRole.EditRole:
if isinstance(value, QtCore.QVariant): if isinstance(value, QtCore.QVariant):
label = str( label = str(
value.toString().toUtf8()).decode('utf-8', 'ignore') value.toString().toUtf8()).decode('utf-8', 'ignore')
@ -333,17 +333,17 @@ class Ui_SubscriptionWidget(Ui_AddressWidget):
return super(Ui_SubscriptionWidget, self).setData(column, role, value) return super(Ui_SubscriptionWidget, self).setData(column, role, value)
class BMTableWidgetItem(QtGui.QTableWidgetItem, SettingsMixin): class BMTableWidgetItem(QtWidgets.QTableWidgetItem, SettingsMixin):
"""A common abstract class for Table widget item""" """A common abstract class for Table widget item"""
def __init__(self, label=None, unread=False): def __init__(self, label=None, unread=False):
super(QtGui.QTableWidgetItem, self).__init__() super(QtWidgets.QTableWidgetItem, self).__init__()
self.setLabel(label) self.setLabel(label)
self.setUnread(unread) self.setUnread(unread)
self._setup() self._setup()
def _setup(self): def _setup(self):
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) self.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled)
def setLabel(self, label): def setLabel(self, label):
"""Set object label""" """Set object label"""
@ -356,10 +356,10 @@ class BMTableWidgetItem(QtGui.QTableWidgetItem, SettingsMixin):
def data(self, role): def data(self, role):
"""Return object data (QT UI)""" """Return object data (QT UI)"""
if role in ( if role in (
QtCore.Qt.DisplayRole, QtCore.Qt.EditRole, QtCore.Qt.ToolTipRole QtCore.Qt.ItemDataRole.DisplayRole, QtCore.Qt.ItemDataRole.EditRole, QtCore.Qt.ItemDataRole.ToolTipRole
): ):
return self.label return self.label
elif role == QtCore.Qt.FontRole: elif role == QtCore.Qt.ItemDataRole.FontRole:
font = QtGui.QFont() font = QtGui.QFont()
font.setBold(self.unread) font.setBold(self.unread)
return font return font
@ -379,13 +379,13 @@ class BMAddressWidget(BMTableWidgetItem, AccountMixin):
def data(self, role): def data(self, role):
"""Return object data (QT UI)""" """Return object data (QT UI)"""
if role == QtCore.Qt.ToolTipRole: if role == QtCore.Qt.ItemDataRole.ToolTipRole:
return self.label + " (" + self.address + ")" return self.label + " (" + self.address + ")"
elif role == QtCore.Qt.DecorationRole: elif role == QtCore.Qt.ItemDataRole.DecorationRole:
if config.safeGetBoolean( if config.safeGetBoolean(
'bitmessagesettings', 'useidenticons'): 'bitmessagesettings', 'useidenticons'):
return avatarize(self.address or self.label) return avatarize(self.address or self.label)
elif role == QtCore.Qt.ForegroundRole: elif role == QtCore.Qt.ItemDataRole.ForegroundRole:
return self.accountBrush() return self.accountBrush()
return super(BMAddressWidget, self).data(role) return super(BMAddressWidget, self).data(role)
@ -424,13 +424,13 @@ class MessageList_AddressWidget(BMAddressWidget):
def data(self, role): def data(self, role):
"""Return object data (QT UI)""" """Return object data (QT UI)"""
if role == QtCore.Qt.UserRole: if role == QtCore.Qt.ItemDataRole.UserRole:
return self.address return self.address
return super(MessageList_AddressWidget, self).data(role) return super(MessageList_AddressWidget, self).data(role)
def setData(self, role, value): def setData(self, role, value):
"""Set object data""" """Set object data"""
if role == QtCore.Qt.EditRole: if role == QtCore.Qt.ItemDataRole.EditRole:
self.setLabel() self.setLabel()
return super(MessageList_AddressWidget, self).setData(role, value) return super(MessageList_AddressWidget, self).setData(role, value)
@ -438,7 +438,7 @@ class MessageList_AddressWidget(BMAddressWidget):
def __lt__(self, other): def __lt__(self, other):
if isinstance(other, MessageList_AddressWidget): if isinstance(other, MessageList_AddressWidget):
return self.label.lower() < other.label.lower() return self.label.lower() < other.label.lower()
return super(QtGui.QTableWidgetItem, self).__lt__(other) return super(QtWidgets.QTableWidgetItem, self).__lt__(other)
class MessageList_SubjectWidget(BMTableWidgetItem): class MessageList_SubjectWidget(BMTableWidgetItem):
@ -453,9 +453,9 @@ class MessageList_SubjectWidget(BMTableWidgetItem):
def data(self, role): def data(self, role):
"""Return object data (QT UI)""" """Return object data (QT UI)"""
if role == QtCore.Qt.UserRole: if role == QtCore.Qt.ItemDataRole.UserRole:
return self.subject return self.subject
if role == QtCore.Qt.ToolTipRole: if role == QtCore.Qt.ItemDataRole.ToolTipRole:
return escape(unicode(self.subject, 'utf-8')) return escape(unicode(self.subject, 'utf-8'))
return super(MessageList_SubjectWidget, self).data(role) return super(MessageList_SubjectWidget, self).data(role)
@ -463,7 +463,7 @@ class MessageList_SubjectWidget(BMTableWidgetItem):
def __lt__(self, other): def __lt__(self, other):
if isinstance(other, MessageList_SubjectWidget): if isinstance(other, MessageList_SubjectWidget):
return self.label.lower() < other.label.lower() return self.label.lower() < other.label.lower()
return super(QtGui.QTableWidgetItem, self).__lt__(other) return super(QtWidgets.QTableWidgetItem, self).__lt__(other)
# In order for the time columns on the Inbox and Sent tabs to be sorted # In order for the time columns on the Inbox and Sent tabs to be sorted
@ -473,26 +473,26 @@ class MessageList_TimeWidget(BMTableWidgetItem):
""" """
A subclass of QTableWidgetItem for received (lastactiontime) field. A subclass of QTableWidgetItem for received (lastactiontime) field.
'<' operator is overloaded to sort by TimestampRole == 33 '<' operator is overloaded to sort by TimestampRole == 33
msgid is available by QtCore.Qt.UserRole msgid is available by QtCore.Qt.ItemDataRole.UserRole
""" """
def __init__(self, label=None, unread=False, timestamp=None, msgid=''): def __init__(self, label=None, unread=False, timestamp=None, msgid=''):
super(MessageList_TimeWidget, self).__init__(label, unread) super(MessageList_TimeWidget, self).__init__(label, unread)
self.setData(QtCore.Qt.UserRole, QtCore.QByteArray(msgid)) self.setData(QtCore.Qt.ItemDataRole.UserRole, QtCore.QByteArray(msgid))
self.setData(TimestampRole, int(timestamp)) self.setData(TimestampRole, int(timestamp))
def __lt__(self, other): def __lt__(self, other):
return self.data(TimestampRole) < other.data(TimestampRole) return self.data(TimestampRole) < other.data(TimestampRole)
def data(self, role=QtCore.Qt.UserRole): def data(self, role=QtCore.Qt.ItemDataRole.UserRole):
""" """
Returns expected python types for QtCore.Qt.UserRole and TimestampRole Returns expected python types for QtCore.Qt.ItemDataRole.UserRole and TimestampRole
custom roles and super for any Qt role custom roles and super for any Qt role
""" """
data = super(MessageList_TimeWidget, self).data(role) data = super(MessageList_TimeWidget, self).data(role)
if role == TimestampRole: if role == TimestampRole:
return int(data.toPyObject()) return int(data.toPyObject())
if role == QtCore.Qt.UserRole: if role == QtCore.Qt.ItemDataRole.UserRole:
return str(data.toPyObject()) return str(data.toPyObject())
return data return data
@ -506,13 +506,13 @@ class Ui_AddressBookWidgetItem(BMAddressWidget):
def data(self, role): def data(self, role):
"""Return object data""" """Return object data"""
if role == QtCore.Qt.UserRole: if role == QtCore.Qt.ItemDataRole.UserRole:
return self.type return self.type
return super(Ui_AddressBookWidgetItem, self).data(role) return super(Ui_AddressBookWidgetItem, self).data(role)
def setData(self, role, value): def setData(self, role, value):
"""Set data""" """Set data"""
if role == QtCore.Qt.EditRole: if role == QtCore.Qt.ItemDataRole.EditRole:
self.label = str( self.label = str(
value.toString().toUtf8() value.toString().toUtf8()
if isinstance(value, QtCore.QVariant) else value if isinstance(value, QtCore.QVariant) else value
@ -540,7 +540,7 @@ class Ui_AddressBookWidgetItem(BMAddressWidget):
if self.type == other.type: if self.type == other.type:
return self.label.lower() < other.label.lower() return self.label.lower() < other.label.lower()
return not reverse if self.type < other.type else reverse return not reverse if self.type < other.type else reverse
return super(QtGui.QTableWidgetItem, self).__lt__(other) return super(QtWidgets.QTableWidgetItem, self).__lt__(other)
class Ui_AddressBookWidgetItemLabel(Ui_AddressBookWidgetItem): class Ui_AddressBookWidgetItemLabel(Ui_AddressBookWidgetItem):
@ -563,14 +563,14 @@ class Ui_AddressBookWidgetItemAddress(Ui_AddressBookWidgetItem):
def data(self, role): def data(self, role):
"""Return object data""" """Return object data"""
if role == QtCore.Qt.ToolTipRole: if role == QtCore.Qt.ItemDataRole.ToolTipRole:
return self.address return self.address
if role == QtCore.Qt.DecorationRole: if role == QtCore.Qt.ItemDataRole.DecorationRole:
return None return None
return super(Ui_AddressBookWidgetItemAddress, self).data(role) return super(Ui_AddressBookWidgetItemAddress, self).data(role)
class AddressBookCompleter(QtGui.QCompleter): class AddressBookCompleter(QtWidgets.QCompleter):
"""Addressbook completer""" """Addressbook completer"""
def __init__(self): def __init__(self):
@ -590,7 +590,7 @@ class AddressBookCompleter(QtGui.QCompleter):
def pathFromIndex(self, index): def pathFromIndex(self, index):
"""Perform autocompletion (reimplemented QCompleter method)""" """Perform autocompletion (reimplemented QCompleter method)"""
autoString = unicode( autoString = unicode(
index.data(QtCore.Qt.EditRole).toString().toUtf8(), 'utf-8') index.data(QtCore.Qt.ItemDataRole.EditRole).toString().toUtf8(), 'utf-8')
text = unicode(self.widget().text().toUtf8(), 'utf-8') text = unicode(self.widget().text().toUtf8(), 'utf-8')
# If cursor position was saved, restore it, else save it # If cursor position was saved, restore it, else save it

View File

@ -3,10 +3,10 @@ Message editor with a wheel zoom functionality
""" """
# pylint: disable=bad-continuation # pylint: disable=bad-continuation
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
class MessageCompose(QtGui.QTextEdit): class MessageCompose(QtWidgets.QTextEdit):
"""Editor class with wheel zoom functionality""" """Editor class with wheel zoom functionality"""
def __init__(self, parent=0): def __init__(self, parent=0):
super(MessageCompose, self).__init__(parent) super(MessageCompose, self).__init__(parent)

View File

@ -5,13 +5,13 @@ zoom and URL click warning popup
""" """
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
from safehtmlparser import SafeHTMLParser from .safehtmlparser import SafeHTMLParser
from tr import _translate from tr import _translate
class MessageView(QtGui.QTextBrowser): class MessageView(QtWidgets.QTextBrowser):
"""Message content viewer class, can switch between plaintext and HTML""" """Message content viewer class, can switch between plaintext and HTML"""
MODE_PLAIN = 0 MODE_PLAIN = 0
MODE_HTML = 1 MODE_HTML = 1
@ -60,7 +60,7 @@ class MessageView(QtGui.QTextBrowser):
def setWrappingWidth(self, width=None): def setWrappingWidth(self, width=None):
"""Set word-wrapping width""" """Set word-wrapping width"""
self.setLineWrapMode(QtGui.QTextEdit.FixedPixelWidth) self.setLineWrapMode(QtWidgets.QTextEdit.LineWrapMode.FixedPixelWidth)
if width is None: if width is None:
width = self.width() width = self.width()
self.setLineWrapColumnOrWidth(width) self.setLineWrapColumnOrWidth(width)

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
class MigrationWizardIntroPage(QtGui.QWizardPage): class MigrationWizardIntroPage(QtWidgets.QWizardPage):
def __init__(self): def __init__(self):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("Migrating configuration") self.setTitle("Migrating configuration")
@ -18,7 +18,7 @@ class MigrationWizardIntroPage(QtGui.QWizardPage):
return 1 return 1
class MigrationWizardAddressesPage(QtGui.QWizardPage): class MigrationWizardAddressesPage(QtWidgets.QWizardPage):
def __init__(self, addresses): def __init__(self, addresses):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("Addresses") self.setTitle("Addresses")
@ -34,7 +34,7 @@ class MigrationWizardAddressesPage(QtGui.QWizardPage):
return 10 return 10
class MigrationWizardGPUPage(QtGui.QWizardPage): class MigrationWizardGPUPage(QtWidgets.QWizardPage):
def __init__(self): def __init__(self):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("GPU") self.setTitle("GPU")
@ -50,7 +50,7 @@ class MigrationWizardGPUPage(QtGui.QWizardPage):
return 10 return 10
class MigrationWizardConclusionPage(QtGui.QWizardPage): class MigrationWizardConclusionPage(QtWidgets.QWizardPage):
def __init__(self): def __init__(self):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("All done!") self.setTitle("All done!")
@ -63,7 +63,7 @@ class MigrationWizardConclusionPage(QtGui.QWizardPage):
self.setLayout(layout) self.setLayout(layout)
class Ui_MigrationWizard(QtGui.QWizard): class Ui_MigrationWizard(QtWidgets.QWizard):
def __init__(self, addresses): def __init__(self, addresses):
super(QtGui.QWizard, self).__init__() super(QtGui.QWizard, self).__init__()

View File

@ -4,47 +4,43 @@ Network status tab widget definition.
import time import time
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
import l10n import l10n
import network.stats import network.stats
import state import state
import widgets import bitmessageqt.widgets as widgets
from network import connectionpool, knownnodes from network import connectionpool, knownnodes
from retranslateui import RetranslateMixin from .retranslateui import RetranslateMixin
from tr import _translate from tr import _translate
from uisignaler import UISignaler from .uisignaler import UISignaler
class NetworkStatus(QtGui.QWidget, RetranslateMixin): class NetworkStatus(QtWidgets.QWidget, RetranslateMixin):
"""Network status tab""" """Network status tab"""
def __init__(self, parent=None): def __init__(self, parent=None):
super(NetworkStatus, self).__init__(parent) super(NetworkStatus, self).__init__(parent)
widgets.load('networkstatus.ui', self) widgets.load('networkstatus.ui', self)
header = self.tableWidgetConnectionCount.horizontalHeader() header = self.tableWidgetConnectionCount.horizontalHeader()
header.setResizeMode(QtGui.QHeaderView.ResizeToContents) header.setSectionResizeMode(QtWidgets.QHeaderView.ResizeMode.ResizeToContents)
# Somehow this value was 5 when I tested # Somehow this value was 5 when I tested
if header.sortIndicatorSection() > 4: if header.sortIndicatorSection() > 4:
header.setSortIndicator(0, QtCore.Qt.AscendingOrder) header.setSortIndicator(0, QtCore.Qt.SortOrder.AscendingOrder)
self.startup = time.localtime() self.startup = time.localtime()
self.UISignalThread = UISignaler.get() self.UISignalThread = UISignaler.get()
# pylint: disable=no-member # pylint: disable=no-member
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.updateNumberOfMessagesProcessed.connect(self.updateNumberOfMessagesProcessed)
"updateNumberOfMessagesProcessed()"), self.updateNumberOfMessagesProcessed) self.UISignalThread.updateNumberOfPubkeysProcessed.connect(self.updateNumberOfPubkeysProcessed)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( self.UISignalThread.updateNumberOfBroadcastsProcessed.connect(self.updateNumberOfBroadcastsProcessed)
"updateNumberOfPubkeysProcessed()"), self.updateNumberOfPubkeysProcessed) self.UISignalThread.updateNetworkStatusTab.connect(self.updateNetworkStatusTab)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
"updateNumberOfBroadcastsProcessed()"), self.updateNumberOfBroadcastsProcessed)
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(
"updateNetworkStatusTab(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)"), self.updateNetworkStatusTab)
self.timer = QtCore.QTimer() self.timer = QtCore.QTimer()
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.runEveryTwoSeconds) self.timer.timeout.connect(self.runEveryTwoSeconds)
# pylint: enable=no-member # pylint: enable=no-member
def startUpdate(self): def startUpdate(self):
@ -65,7 +61,6 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin):
"networkstatus", "networkstatus",
"byte(s)", "byte(s)",
None, None,
QtCore.QCoreApplication.CodecForTr,
num), num),
"kB", "kB",
"MB", "MB",
@ -89,7 +84,6 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin):
"networkstatus", "networkstatus",
"Object(s) to be synced: %n", "Object(s) to be synced: %n",
None, None,
QtCore.QCoreApplication.CodecForTr,
network.stats.pendingDownload() network.stats.pendingDownload()
+ network.stats.pendingUpload())) + network.stats.pendingUpload()))
@ -101,7 +95,6 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin):
"networkstatus", "networkstatus",
"Processed %n person-to-person message(s).", "Processed %n person-to-person message(s).",
None, None,
QtCore.QCoreApplication.CodecForTr,
state.numberOfMessagesProcessed)) state.numberOfMessagesProcessed))
def updateNumberOfBroadcastsProcessed(self): def updateNumberOfBroadcastsProcessed(self):
@ -112,7 +105,6 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin):
"networkstatus", "networkstatus",
"Processed %n broadcast message(s).", "Processed %n broadcast message(s).",
None, None,
QtCore.QCoreApplication.CodecForTr,
state.numberOfBroadcastsProcessed)) state.numberOfBroadcastsProcessed))
def updateNumberOfPubkeysProcessed(self): def updateNumberOfPubkeysProcessed(self):
@ -123,7 +115,6 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin):
"networkstatus", "networkstatus",
"Processed %n public key(s).", "Processed %n public key(s).",
None, None,
QtCore.QCoreApplication.CodecForTr,
state.numberOfPubkeysProcessed)) state.numberOfPubkeysProcessed))
def updateNumberOfBytes(self): def updateNumberOfBytes(self):

View File

@ -4,18 +4,18 @@ src/bitmessageqt/newchandialog.py
""" """
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
import widgets import bitmessageqt.widgets
from addresses import addBMIfNotPresent from addresses import addBMIfNotPresent
from addressvalidator import AddressValidator, PassPhraseValidator from .addressvalidator import AddressValidator, PassPhraseValidator
from queues import ( from queues import (
addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue) addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue)
from tr import _translate from tr import _translate
from utils import str_chan from .utils import str_chan
class NewChanDialog(QtGui.QDialog): class NewChanDialog(QtWidgets.QDialog):
"""The `New Chan` dialog""" """The `New Chan` dialog"""
def __init__(self, parent=None): def __init__(self, parent=None):
super(NewChanDialog, self).__init__(parent) super(NewChanDialog, self).__init__(parent)

View File

@ -1,7 +1,7 @@
from os import path from os import path
from PyQt4 import QtGui from PyQt6 import QtGui
from debug import logger from debug import logger
import widgets import bitmessageqt.widgets
class RetranslateMixin(object): class RetranslateMixin(object):
def retranslateUi(self): def retranslateUi(self):

View File

@ -2,10 +2,9 @@
import inspect import inspect
import re import re
from HTMLParser import HTMLParser from html.parser import HTMLParser
from urllib import quote_plus from urllib.parse import quote_plus, urlparse
from urlparse import urlparse
class SafeHTMLParser(HTMLParser): class SafeHTMLParser(HTMLParser):

View File

@ -1,13 +1,13 @@
""" """
This module setting file is for settings This module setting file is for settings
""" """
import ConfigParser from configparser import ConfigParser
import os import os
import sys import sys
import tempfile import tempfile
import six import six
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
import debug import debug
import defaults import defaults
@ -16,7 +16,7 @@ import openclpow
import paths import paths
import queues import queues
import state import state
import widgets import bitmessageqt.widgets
from bmconfigparser import config as config_obj from bmconfigparser import config as config_obj
from helper_sql import sqlExecute, sqlStoredProcedure from helper_sql import sqlExecute, sqlStoredProcedure
from helper_startup import start_proxyconfig from helper_startup import start_proxyconfig
@ -39,7 +39,7 @@ def getSOCKSProxyType(config):
return result return result
class SettingsDialog(QtGui.QDialog): class SettingsDialog(QtWidgets.QDialog):
"""The "Settings" dialog""" """The "Settings" dialog"""
def __init__(self, parent=None, firstrun=False): def __init__(self, parent=None, firstrun=False):
super(SettingsDialog, self).__init__(parent) super(SettingsDialog, self).__init__(parent)

View File

@ -5,7 +5,7 @@ src/settingsmixin.py
""" """
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
class SettingsMixin(object): class SettingsMixin(object):
@ -56,7 +56,7 @@ class SettingsMixin(object):
pass pass
class SMainWindow(QtGui.QMainWindow, SettingsMixin): class SMainWindow(QtWidgets.QMainWindow, SettingsMixin):
"""Main window with Settings functionality.""" """Main window with Settings functionality."""
def loadSettings(self): def loadSettings(self):
"""Load main window settings.""" """Load main window settings."""
@ -69,7 +69,7 @@ class SMainWindow(QtGui.QMainWindow, SettingsMixin):
self.writeGeometry(self) self.writeGeometry(self)
class STableWidget(QtGui.QTableWidget, SettingsMixin): class STableWidget(QtWidgets.QTableWidget, SettingsMixin):
"""Table widget with Settings functionality""" """Table widget with Settings functionality"""
# pylint: disable=too-many-ancestors # pylint: disable=too-many-ancestors
def loadSettings(self): def loadSettings(self):
@ -81,7 +81,7 @@ class STableWidget(QtGui.QTableWidget, SettingsMixin):
self.writeState(self.horizontalHeader()) self.writeState(self.horizontalHeader())
class SSplitter(QtGui.QSplitter, SettingsMixin): class SSplitter(QtWidgets.QSplitter, SettingsMixin):
"""Splitter with Settings functionality.""" """Splitter with Settings functionality."""
def loadSettings(self): def loadSettings(self):
"""Load splitter settings""" """Load splitter settings"""
@ -92,7 +92,7 @@ class SSplitter(QtGui.QSplitter, SettingsMixin):
self.writeState(self) self.writeState(self)
class STreeWidget(QtGui.QTreeWidget, SettingsMixin): class STreeWidget(QtWidgets.QTreeWidget, SettingsMixin):
"""Tree widget with settings functionality.""" """Tree widget with settings functionality."""
# pylint: disable=too-many-ancestors # pylint: disable=too-many-ancestors
def loadSettings(self): def loadSettings(self):

View File

@ -2,10 +2,10 @@
"""Status bar Module""" """Status bar Module"""
from time import time from time import time
from PyQt4 import QtGui from PyQt6 import QtGui, QtWidgets
class BMStatusBar(QtGui.QStatusBar): class BMStatusBar(QtWidgets.QStatusBar):
"""Status bar with queue and priorities""" """Status bar with queue and priorities"""
duration = 10000 duration = 10000
deleteAfter = 60 deleteAfter = 60

View File

@ -6,9 +6,9 @@ import ssl
import sys import sys
import time import time
from PyQt4 import QtCore from PyQt6 import QtCore
import account import bitmessageqt.account
import defaults import defaults
import network.stats import network.stats
import paths import paths
@ -16,12 +16,12 @@ import proofofwork
import queues import queues
import state import state
from bmconfigparser import config from bmconfigparser import config
from foldertree import AccountMixin from .foldertree import AccountMixin
from helper_sql import sqlExecute, sqlQuery from helper_sql import sqlExecute, sqlQuery
from l10n import getTranslationLanguage from l10n import getTranslationLanguage
from openclpow import openclEnabled from openclpow import openclEnabled
from pyelliptic.openssl import OpenSSL from pyelliptic.openssl import OpenSSL
from settings import getSOCKSProxyType from .settings import getSOCKSProxyType
from version import softwareVersion from version import softwareVersion
from tr import _translate from tr import _translate

View File

@ -1,5 +1,5 @@
from PyQt4.QtCore import QThread, SIGNAL from PyQt6.QtCore import QThread, pyqtSignal
import sys import sys
import queues import queues
@ -11,6 +11,27 @@ class UISignaler(QThread):
def __init__(self, parent=None): def __init__(self, parent=None):
QThread.__init__(self, parent) QThread.__init__(self, parent)
rerenderBlackWhiteList = pyqtSignal()
updateNumberOfMessagesProcessed = pyqtSignal()
updateNumberOfPubkeysProcessed = pyqtSignal()
updateNumberOfBroadcastsProcessed = pyqtSignal()
updateNetworkStatusTab = pyqtSignal(object, object, object)
writeNewAddressToTable = pyqtSignal(object, object, object)
updateStatusBar = pyqtSignal(object)
updateSentItemStatusByToAddress = pyqtSignal(object, object)
updateSentItemStatusByAckdata = pyqtSignal(object, object)
displayNewInboxMessage = pyqtSignal(object, object, object, object, object)
displayNewSentMessage = pyqtSignal(object, object, object, object, object, object)
setStatusIcon = pyqtSignal(object)
changedInboxUnread = pyqtSignal(object)
rerenderMessagelistFromLabels = pyqtSignal()
rerenderMessagelistToLabels = pyqtSignal()
rerenderAddressBook = pyqtSignal()
rerenderSubscriptions = pyqtSignal()
removeInboxRowByMsgid = pyqtSignal(object)
newVersionAvailable = pyqtSignal(object)
displayAlert = pyqtSignal(object, object, object)
@classmethod @classmethod
def get(cls): def get(cls):
if not cls._instance: if not cls._instance:
@ -28,7 +49,7 @@ class UISignaler(QThread):
address, address,
str(streamNumber)) str(streamNumber))
elif command == 'updateStatusBar': elif command == 'updateStatusBar':
self.emit(SIGNAL("updateStatusBar(PyQt_PyObject)"), data) self.updateStatusBar.emit(data)
elif command == 'updateSentItemStatusByToAddress': elif command == 'updateSentItemStatusByToAddress':
toAddress, message = data toAddress, message = data
self.emit(SIGNAL( self.emit(SIGNAL(

View File

@ -1,7 +1,7 @@
import hashlib import hashlib
import os import os
from PyQt4 import QtGui from PyQt6 import QtGui
import state import state
from addresses import addBMIfNotPresent from addresses import addBMIfNotPresent
@ -85,11 +85,11 @@ def avatarize(address):
if address == str_broadcast_subscribers: if address == str_broadcast_subscribers:
# don't hash [Broadcast subscribers] # don't hash [Broadcast subscribers]
icon_hash = address icon_hash = address
# https://www.riverbankcomputing.com/static/Docs/PyQt4/qimagereader.html#supportedImageFormats # https://doc.qt.io/qt-6/qimagereader.html#supportedImageFormats
# QImageReader.supportedImageFormats () # QImageReader.supportedImageFormats ()
extensions = [ extensions = [
'PNG', 'GIF', 'JPG', 'JPEG', 'SVG', 'BMP', 'MNG', 'PBM', 'PGM', 'PPM', 'PNG', 'GIF', 'JPG', 'JPEG', 'SVG', 'BMP', 'PBM', 'PGM', 'PPM',
'TIFF', 'XBM', 'XPM', 'TGA'] 'XBM', 'XPM' ]
# try to find a specific avatar # try to find a specific avatar
for ext in extensions: for ext in extensions:
lower_hash = state.appdata + 'avatars/' + icon_hash + '.' + ext.lower() lower_hash = state.appdata + 'avatars/' + icon_hash + '.' + ext.lower()

View File

@ -1,4 +1,4 @@
from PyQt4 import uic from PyQt6 import uic
import os.path import os.path
import paths import paths
import sys import sys

View File

@ -380,11 +380,11 @@ def check_curses():
def check_pyqt(): def check_pyqt():
"""Do pyqt dependency check. """Do pyqt dependency check.
Here we are checking for PyQt4 with its version, as for it require Here we are checking for PyQt6 with its version, as for it require
PyQt 4.8 or later. PyQt 6.4 or later.
""" """
QtCore = try_import( QtCore = try_import(
'PyQt4.QtCore', 'PyBitmessage requires PyQt 4.8 or later and Qt 4.7 or later.') 'PyQt6.QtCore', 'PyBitmessage requires PyQt 6.4 or later and Qt 6.4 or later.')
if not QtCore: if not QtCore:
return False return False
@ -433,15 +433,10 @@ def check_dependencies(verbose=False, optional=False):
# Python 3+ is not supported, but it is still useful to provide # Python 3+ is not supported, but it is still useful to provide
# information about our other requirements. # information about our other requirements.
logger.info('Python version: %s', sys.version) logger.info('Python version: %s', sys.version)
if sys.hexversion < 0x20704F0: if sys.hexversion < 0x3000000:
logger.error( logger.error(
'PyBitmessage requires Python 2.7.4 or greater' 'PyBitmessage requires Python 3 or greater')
' (but not Python 3+)') #has_all_dependencies = False
has_all_dependencies = False
if sys.hexversion >= 0x3000000:
logger.error(
'PyBitmessage does not support Python 3+. Python 2.7.4'
' or greater is required. Python 2.7.18 is recommended.')
sys.exit() sys.exit()
# FIXME: This needs to be uncommented when more of the code is python3 compatible # FIXME: This needs to be uncommented when more of the code is python3 compatible

View File

@ -4,7 +4,7 @@ Namecoin queries
# pylint: disable=too-many-branches,protected-access # pylint: disable=too-many-branches,protected-access
import base64 import base64
import httplib import http.client
import json import json
import os import os
import socket import socket
@ -71,7 +71,7 @@ class namecoinConnection(object):
assert self.nmctype == "namecoind" or self.nmctype == "nmcontrol" assert self.nmctype == "namecoind" or self.nmctype == "nmcontrol"
if self.nmctype == "namecoind": if self.nmctype == "namecoind":
self.con = httplib.HTTPConnection(self.host, self.port, timeout=3) self.con = http.client.HTTPConnection(self.host, self.port, timeout=3)
def query(self, identity): def query(self, identity):
""" """

View File

@ -12,7 +12,7 @@ def start(config, state):
"""Start network threads""" """Start network threads"""
import state import state
from .announcethread import AnnounceThread from .announcethread import AnnounceThread
import connectionpool # pylint: disable=relative-import import network.connectionpool # pylint: disable=relative-import
from .addrthread import AddrThread from .addrthread import AddrThread
from .dandelion import Dandelion from .dandelion import Dandelion
from .downloadthread import DownloadThread from .downloadthread import DownloadThread

View File

@ -5,12 +5,12 @@ from six.moves import queue
# magic imports! # magic imports!
import state import state
import connectionpool import network.connectionpool
from helper_random import randomshuffle from helper_random import randomshuffle
from protocol import assembleAddrMessage from protocol import assembleAddrMessage
from queues import addrQueue # FIXME: init with queue from queues import addrQueue # FIXME: init with queue
from threads import StoppableThread from .threads import StoppableThread
class AddrThread(StoppableThread): class AddrThread(StoppableThread):

View File

@ -7,7 +7,7 @@ import time
import network.asyncore_pollchoose as asyncore import network.asyncore_pollchoose as asyncore
import state import state
from threads import BusyError, nonBlocking from .threads import BusyError, nonBlocking
class ProcessingError(Exception): class ProcessingError(Exception):

View File

@ -5,12 +5,12 @@ import time
# magic imports! # magic imports!
import state import state
import connectionpool import network.connectionpool as connectionpool
from bmconfigparser import config from bmconfigparser import config
from protocol import assembleAddrMessage from protocol import assembleAddrMessage
from node import Peer from .node import Peer
from threads import StoppableThread from .threads import StoppableThread
class AnnounceThread(StoppableThread): class AnnounceThread(StoppableThread):

View File

@ -12,10 +12,10 @@ import time
# magic imports! # magic imports!
import addresses import addresses
import knownnodes import network.knownnodes
import protocol import protocol
import state import state
import connectionpool import network.connectionpool
from bmconfigparser import config from bmconfigparser import config
from queues import invQueue, objectProcessorQueue, portCheckerQueue from queues import invQueue, objectProcessorQueue, portCheckerQueue
from randomtrackingdict import RandomTrackingDict from randomtrackingdict import RandomTrackingDict
@ -27,8 +27,8 @@ from network.bmobject import (
) )
from network.proxy import ProxyError from network.proxy import ProxyError
from node import Node, Peer from .node import Node, Peer
from objectracker import ObjectTracker, missingObjects from .objectracker import ObjectTracker, missingObjects
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -5,7 +5,7 @@ Select which node to connect to
import logging import logging
import random import random
import knownnodes import network.knownnodes
import protocol import protocol
import state import state
from bmconfigparser import config from bmconfigparser import config

View File

@ -8,19 +8,19 @@ import socket
import sys import sys
import time import time
import asyncore_pollchoose as asyncore import network.asyncore_pollchoose as asyncore
import helper_random import helper_random
import knownnodes import network.knownnodes
import protocol import protocol
import state import state
from bmconfigparser import config from bmconfigparser import config
from connectionchooser import chooseConnection from .connectionchooser import chooseConnection
from node import Peer from .node import Peer
from proxy import Proxy from .proxy import Proxy
from tcp import ( from .tcp import (
bootstrap, Socks4aBMConnection, Socks5BMConnection, bootstrap, Socks4aBMConnection, Socks5BMConnection,
TCPConnection, TCPServer) TCPConnection, TCPServer)
from udp import UDPSocket from .udp import UDPSocket
logger = logging.getLogger('default') logger = logging.getLogger('default')
@ -78,7 +78,7 @@ class BMConnectionPool(object):
Shortcut for combined list of connections from Shortcut for combined list of connections from
`inboundConnections` and `outboundConnections` dicts `inboundConnections` and `outboundConnections` dicts
""" """
return self.inboundConnections.values() + self.outboundConnections.values() return list(self.inboundConnections.values()) + list(self.outboundConnections.values())
def establishedConnections(self): def establishedConnections(self):
"""Shortcut for list of connections having fullyEstablished == True""" """Shortcut for list of connections having fullyEstablished == True"""

View File

@ -7,7 +7,7 @@ from random import choice, expovariate, sample
from threading import RLock from threading import RLock
from time import time from time import time
import connectionpool import network.connectionpool
import state import state
from queues import invQueue from queues import invQueue
@ -99,12 +99,12 @@ class Dandelion: # pylint: disable=old-style-class
with self.lock: with self.lock:
if len(self.stem) < MAX_STEMS: if len(self.stem) < MAX_STEMS:
self.stem.append(connection) self.stem.append(connection)
for k in (k for k, v in self.nodeMap.iteritems() if v is None): for k in (k for k, v in self.nodeMap.items() if v is None):
self.nodeMap[k] = connection self.nodeMap[k] = connection
for k, v in { for k, v in {
k: v for k, v in self.hashMap.iteritems() k: v for k, v in self.hashMap.items()
if v.child is None if v.child is None
}.iteritems(): }.items():
self.hashMap[k] = Stem( self.hashMap[k] = Stem(
connection, v.stream, self.poissonTimeout()) connection, v.stream, self.poissonTimeout())
invQueue.put((v.stream, k, v.child)) invQueue.put((v.stream, k, v.child))
@ -120,14 +120,14 @@ class Dandelion: # pylint: disable=old-style-class
self.stem.remove(connection) self.stem.remove(connection)
# active mappings to pointing to the removed node # active mappings to pointing to the removed node
for k in ( for k in (
k for k, v in self.nodeMap.iteritems() k for k, v in self.nodeMap.items()
if v == connection if v == connection
): ):
self.nodeMap[k] = None self.nodeMap[k] = None
for k, v in { for k, v in {
k: v for k, v in self.hashMap.iteritems() k: v for k, v in self.hashMap.items()
if v.child == connection if v.child == connection
}.iteritems(): }.items():
self.hashMap[k] = Stem( self.hashMap[k] = Stem(
None, v.stream, self.poissonTimeout()) None, v.stream, self.poissonTimeout())
@ -168,7 +168,7 @@ class Dandelion: # pylint: disable=old-style-class
with self.lock: with self.lock:
deadline = time() deadline = time()
toDelete = [ toDelete = [
[v.stream, k, v.child] for k, v in self.hashMap.iteritems() [v.stream, k, v.child] for k, v in self.hashMap.items()
if v.timeout < deadline if v.timeout < deadline
] ]

View File

@ -6,9 +6,9 @@ import state
import addresses import addresses
import helper_random import helper_random
import protocol import protocol
import connectionpool import network.connectionpool
from objectracker import missingObjects from .objectracker import missingObjects
from threads import StoppableThread from .threads import StoppableThread
class DownloadThread(StoppableThread): class DownloadThread(StoppableThread):
@ -28,7 +28,7 @@ class DownloadThread(StoppableThread):
deadline = time.time() - self.requestExpires deadline = time.time() - self.requestExpires
try: try:
toDelete = [ toDelete = [
k for k, v in missingObjects.iteritems() k for k, v in missingObjects.items()
if v < deadline] if v < deadline]
except RuntimeError: except RuntimeError:
pass pass

View File

@ -1,16 +1,16 @@
""" """
Thread to send inv annoucements Thread to send inv annoucements
""" """
import Queue import queue
import random import random
from time import time from time import time
import addresses import addresses
import protocol import protocol
import state import state
import connectionpool import network.connectionpool
from queues import invQueue from queues import invQueue
from threads import StoppableThread from .threads import StoppableThread
def handleExpiredDandelion(expired): def handleExpiredDandelion(expired):
@ -58,7 +58,7 @@ class InvThread(StoppableThread):
# locally generated # locally generated
if len(data) == 2 or data[2] is None: if len(data) == 2 or data[2] is None:
self.handleLocallyGenerated(data[0], data[1]) self.handleLocallyGenerated(data[0], data[1])
except Queue.Empty: except queue.Empty:
break break
if chunk: if chunk:

View File

@ -54,8 +54,8 @@ def json_serialize_knownnodes(output):
Reorganize knownnodes dict and write it as JSON to output Reorganize knownnodes dict and write it as JSON to output
""" """
_serialized = [] _serialized = []
for stream, peers in knownNodes.iteritems(): for stream, peers in knownNodes.items():
for peer, info in peers.iteritems(): for peer, info in peers.items():
info.update(rating=round(info.get('rating', 0), 2)) info.update(rating=round(info.get('rating', 0), 2))
_serialized.append({ _serialized.append({
'stream': stream, 'peer': peer._asdict(), 'info': info 'stream': stream, 'peer': peer._asdict(), 'info': info
@ -87,7 +87,7 @@ def pickle_deserialize_old_knownnodes(source):
global knownNodes global knownNodes
knownNodes = pickle.load(source) # nosec B301 knownNodes = pickle.load(source) # nosec B301
for stream in knownNodes.keys(): for stream in knownNodes.keys():
for node, params in knownNodes[stream].iteritems(): for node, params in knownNodes[stream].items():
if isinstance(params, (float, int)): if isinstance(params, (float, int)):
addKnownNode(stream, node, params) addKnownNode(stream, node, params)
@ -97,7 +97,7 @@ def saveKnownNodes(dirName=None):
if dirName is None: if dirName is None:
dirName = state.appdata dirName = state.appdata
with knownNodesLock: with knownNodesLock:
with open(os.path.join(dirName, 'knownnodes.dat'), 'wb') as output: with open(os.path.join(dirName, 'knownnodes.dat'), 'w') as output:
json_serialize_knownnodes(output) json_serialize_knownnodes(output)

View File

@ -3,9 +3,9 @@ A thread to handle network concerns
""" """
import network.asyncore_pollchoose as asyncore import network.asyncore_pollchoose as asyncore
import state import state
import connectionpool import network.connectionpool
from queues import excQueue from queues import excQueue
from threads import StoppableThread from .threads import StoppableThread
class BMNetworkThread(StoppableThread): class BMNetworkThread(StoppableThread):

View File

@ -5,7 +5,7 @@ import time
from threading import RLock from threading import RLock
import state import state
import connectionpool import network.connectionpool
from randomtrackingdict import RandomTrackingDict from randomtrackingdict import RandomTrackingDict
haveBloom = False haveBloom = False
@ -75,7 +75,7 @@ class ObjectTracker(object):
with self.objectsNewToThemLock: with self.objectsNewToThemLock:
self.objectsNewToThem = { self.objectsNewToThem = {
k: v k: v
for k, v in self.objectsNewToThem.iteritems() for k, v in self.objectsNewToThem.items()
if v >= deadline} if v >= deadline}
self.lastCleaned = time.time() self.lastCleaned = time.time()

View File

@ -6,10 +6,10 @@ import logging
import socket import socket
import time import time
import asyncore_pollchoose as asyncore import network.asyncore_pollchoose as asyncore
from advanceddispatcher import AdvancedDispatcher from .advanceddispatcher import AdvancedDispatcher
from bmconfigparser import config from bmconfigparser import config
from node import Peer from .node import Peer
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -2,14 +2,14 @@
Process data incoming from network Process data incoming from network
""" """
import errno import errno
import Queue import queue
import socket import socket
import state import state
import connectionpool import network.connectionpool
from network.advanceddispatcher import UnknownStateError from network.advanceddispatcher import UnknownStateError
from queues import receiveDataQueue from queues import receiveDataQueue
from threads import StoppableThread from .threads import StoppableThread
class ReceiveQueueThread(StoppableThread): class ReceiveQueueThread(StoppableThread):
@ -22,7 +22,7 @@ class ReceiveQueueThread(StoppableThread):
while not self._stopped and state.shutdown == 0: while not self._stopped and state.shutdown == 0:
try: try:
dest = receiveDataQueue.get(block=True, timeout=1) dest = receiveDataQueue.get(block=True, timeout=1)
except Queue.Empty: except queue.Empty:
continue continue
if self._stopped or state.shutdown: if self._stopped or state.shutdown:

View File

@ -6,7 +6,7 @@ import logging
import socket import socket
import struct import struct
from proxy import GeneralProxyError, Proxy, ProxyError from .proxy import GeneralProxyError, Proxy, ProxyError
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -7,8 +7,8 @@ import logging
import socket import socket
import struct import struct
from node import Peer from .node import Peer
from proxy import GeneralProxyError, Proxy, ProxyError from .proxy import GeneralProxyError, Proxy, ProxyError
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -3,9 +3,9 @@ Network statistics
""" """
import time import time
import asyncore_pollchoose as asyncore import network.asyncore_pollchoose as asyncore
import connectionpool import network.connectionpool
from objectracker import missingObjects from .objectracker import missingObjects
lastReceivedTimestamp = time.time() lastReceivedTimestamp = time.time()

View File

@ -15,21 +15,21 @@ import helper_random
import l10n import l10n
import protocol import protocol
import state import state
import connectionpool import network.connectionpool
from bmconfigparser import config from bmconfigparser import config
from highlevelcrypto import randomBytes from highlevelcrypto import randomBytes
from queues import invQueue, receiveDataQueue, UISignalQueue from queues import invQueue, receiveDataQueue, UISignalQueue
from tr import _translate from tr import _translate
import asyncore_pollchoose as asyncore import network.asyncore_pollchoose as asyncore
import knownnodes import network.knownnodes
from network.advanceddispatcher import AdvancedDispatcher from network.advanceddispatcher import AdvancedDispatcher
from network.bmproto import BMProto from network.bmproto import BMProto
from network.objectracker import ObjectTracker from network.objectracker import ObjectTracker
from network.socks4a import Socks4aConnection from network.socks4a import Socks4aConnection
from network.socks5 import Socks5Connection from network.socks5 import Socks5Connection
from network.tls import TLSDispatcher from network.tls import TLSDispatcher
from node import Peer from .node import Peer
logger = logging.getLogger('default') logger = logging.getLogger('default')
@ -191,7 +191,7 @@ class TCPConnection(BMProto, TLSDispatcher):
# only if more recent than 3 hours # only if more recent than 3 hours
# and having positive or neutral rating # and having positive or neutral rating
filtered = [ filtered = [
(k, v) for k, v in nodes.iteritems() (k, v) for k, v in nodes.items()
if v["lastseen"] > int(time.time()) if v["lastseen"] > int(time.time())
- maximumAgeOfNodesThatIAdvertiseToOthers - maximumAgeOfNodesThatIAdvertiseToOthers
and v["rating"] >= 0 and not k.host.endswith('.onion') and v["rating"] >= 0 and not k.host.endswith('.onion')

View File

@ -34,7 +34,7 @@ else:
# ciphers # ciphers
if ( if (
ssl.OPENSSL_VERSION_NUMBER >= 0x10100000 ssl.OPENSSL_VERSION_NUMBER >= 0x10100000
and not ssl.OPENSSL_VERSION.startswith(b"LibreSSL") and not ssl.OPENSSL_VERSION.startswith("LibreSSL")
): ):
sslProtocolCiphers = "AECDH-AES256-SHA@SECLEVEL=0" sslProtocolCiphers = "AECDH-AES256-SHA@SECLEVEL=0"
else: else:

View File

@ -10,9 +10,9 @@ import protocol
import state import state
from queues import receiveDataQueue from queues import receiveDataQueue
from bmproto import BMProto from .bmproto import BMProto
from node import Peer from .node import Peer
from objectracker import ObjectTracker from .objectracker import ObjectTracker
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -6,9 +6,9 @@ import time
import helper_random import helper_random
import protocol import protocol
import state import state
import connectionpool import network.connectionpool as connectionpool
from randomtrackingdict import RandomTrackingDict from randomtrackingdict import RandomTrackingDict
from threads import StoppableThread from .threads import StoppableThread
class UploadThread(StoppableThread): class UploadThread(StoppableThread):

View File

@ -41,7 +41,7 @@ def translateText(context, text, n=None):
enableGUI = True enableGUI = True
if enableGUI: if enableGUI:
try: try:
from PyQt4 import QtCore, QtGui from PyQt6 import QtCore, QtGui, QtWidgets
except Exception as err: except Exception as err:
print('PyBitmessage requires PyQt unless you want to run it as a daemon' print('PyBitmessage requires PyQt unless you want to run it as a daemon'
' and interact with it using the API.' ' and interact with it using the API.'
@ -51,7 +51,7 @@ def translateText(context, text, n=None):
print('Error message:', err) print('Error message:', err)
os._exit(0) # pylint: disable=protected-access os._exit(0) # pylint: disable=protected-access
if n is None: if n is None:
return QtGui.QApplication.translate(context, text) return QtWidgets.QApplication.translate(context, text)
return QtGui.QApplication.translate(context, text, None, QtCore.QCoreApplication.CodecForTr, n) return QtGui.QApplication.translate(context, text, None, QtCore.QCoreApplication.CodecForTr, n)
else: else:
if '%' in text: if '%' in text:

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
python2 pybitmessage/bitmessagemain.py "$@" python3 pybitmessage/bitmessagemain.py "$@"