diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 48180269..e3fe265e 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -3,7 +3,6 @@ PyQt based UI for bitmessage, the main module """ import hashlib -import locale import os import random import string @@ -46,11 +45,9 @@ from account import ( import dialogs from network.stats import pendingDownload, pendingUpload from uisignaler import UISignaler -import paths from proofofwork import getPowType import queues import shutdown -from statusbar import BMStatusBar import sound # This is needed for tray icon import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import @@ -93,192 +90,8 @@ class MainWindow(Window): REPLY_TYPE_CHAN = 1 REPLY_TYPE_UPD = 2 - def change_translation(self, newlocale=None): - """Change translation language for the application""" - if newlocale is None: - newlocale = l10n.getTranslationLanguage() - try: - if not self.qmytranslator.isEmpty(): - QtGui.QApplication.removeTranslator(self.qmytranslator) - except: - pass - try: - if not self.qsystranslator.isEmpty(): - QtGui.QApplication.removeTranslator(self.qsystranslator) - except: - pass - - self.qmytranslator = QtCore.QTranslator() - translationpath = os.path.join( - paths.codePath(), 'translations', 'bitmessage_' + newlocale) - self.qmytranslator.load(translationpath) - QtGui.QApplication.installTranslator(self.qmytranslator) - - self.qsystranslator = QtCore.QTranslator() - if paths.frozen: - translationpath = os.path.join( - paths.codePath(), 'translations', 'qt_' + newlocale) - else: - translationpath = os.path.join( - str(QtCore.QLibraryInfo.location( - QtCore.QLibraryInfo.TranslationsPath)), 'qt_' + newlocale) - self.qsystranslator.load(translationpath) - QtGui.QApplication.installTranslator(self.qsystranslator) - - lang = locale.normalize(l10n.getTranslationLanguage()) - langs = [ - lang.split(".")[0] + "." + l10n.encoding, - lang.split(".")[0] + "." + 'UTF-8', - lang - ] - if 'win32' in sys.platform or 'win64' in sys.platform: - langs = [l10n.getWindowsLocale(lang)] - for lang in langs: - try: - l10n.setlocale(locale.LC_ALL, lang) - if 'win32' not in sys.platform and 'win64' not in sys.platform: - l10n.encoding = locale.nl_langinfo(locale.CODESET) - else: - l10n.encoding = locale.getlocale()[1] - logger.info("Successfully set locale to %s", lang) - break - except: - logger.error("Failed to set locale to %s", lang, exc_info=True) - - def init_file_menu(self): - QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL( - "triggered()"), self.quit) - QtCore.QObject.connect(self.actionNetworkSwitch, QtCore.SIGNAL( - "triggered()"), self.network_switch) - QtCore.QObject.connect(self.actionManageKeys, QtCore.SIGNAL( - "triggered()"), self.click_actionManageKeys) - QtCore.QObject.connect(self.actionDeleteAllTrashedMessages, - QtCore.SIGNAL( - "triggered()"), - self.click_actionDeleteAllTrashedMessages) - QtCore.QObject.connect(self.actionRegenerateDeterministicAddresses, - QtCore.SIGNAL( - "triggered()"), - self.click_actionRegenerateDeterministicAddresses) - QtCore.QObject.connect(self.pushButtonAddChan, QtCore.SIGNAL( - "clicked()"), - self.click_actionJoinChan) # also used for creating chans. - QtCore.QObject.connect(self.pushButtonNewAddress, QtCore.SIGNAL( - "clicked()"), self.click_NewAddressDialog) - QtCore.QObject.connect(self.pushButtonAddAddressBook, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonAddAddressBook) - QtCore.QObject.connect(self.pushButtonAddSubscription, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonAddSubscription) - QtCore.QObject.connect(self.pushButtonTTL, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonTTL) - QtCore.QObject.connect(self.pushButtonClear, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonClear) - QtCore.QObject.connect(self.pushButtonSend, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonSend) - QtCore.QObject.connect(self.pushButtonFetchNamecoinID, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonFetchNamecoinID) - QtCore.QObject.connect(self.actionSettings, QtCore.SIGNAL( - "triggered()"), self.click_actionSettings) - QtCore.QObject.connect(self.actionAbout, QtCore.SIGNAL( - "triggered()"), self.click_actionAbout) - QtCore.QObject.connect(self.actionSupport, QtCore.SIGNAL( - "triggered()"), self.click_actionSupport) - QtCore.QObject.connect(self.actionHelp, QtCore.SIGNAL( - "triggered()"), self.click_actionHelp) - - def init_inbox_popup_menu(self, connectSignal=True): - # Popup menu for the Inbox tab - self.inboxContextMenuToolbar = QtGui.QToolBar() - # Actions - self.actionReply = self.inboxContextMenuToolbar.addAction(_translate( - "MainWindow", "Reply to sender"), self.on_action_InboxReply) - self.actionReplyChan = self.inboxContextMenuToolbar.addAction(_translate( - "MainWindow", "Reply to channel"), self.on_action_InboxReplyChan) - self.actionAddSenderToAddressBook = self.inboxContextMenuToolbar.addAction( - _translate( - "MainWindow", "Add sender to your Address Book"), - self.on_action_InboxAddSenderToAddressBook) - self.actionAddSenderToBlackList = self.inboxContextMenuToolbar.addAction( - _translate( - "MainWindow", "Add sender to your Blacklist"), - self.on_action_InboxAddSenderToBlackList) - self.actionTrashInboxMessage = self.inboxContextMenuToolbar.addAction( - _translate("MainWindow", "Move to Trash"), - self.on_action_InboxTrash) - self.actionUndeleteTrashedMessage = self.inboxContextMenuToolbar.addAction( - _translate("MainWindow", "Undelete"), - self.on_action_TrashUndelete) - self.actionForceHtml = self.inboxContextMenuToolbar.addAction( - _translate( - "MainWindow", "View HTML code as formatted text"), - self.on_action_InboxMessageForceHtml) - self.actionSaveMessageAs = self.inboxContextMenuToolbar.addAction( - _translate( - "MainWindow", "Save message as..."), - self.on_action_InboxSaveMessageAs) - self.actionMarkUnread = self.inboxContextMenuToolbar.addAction( - _translate( - "MainWindow", "Mark Unread"), self.on_action_InboxMarkUnread) - - # contextmenu messagelists - self.tableWidgetInbox.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.tableWidgetInbox, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuInbox) - self.tableWidgetInboxSubscriptions.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.tableWidgetInboxSubscriptions, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuInbox) - self.tableWidgetInboxChans.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.tableWidgetInboxChans, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuInbox) - - def init_identities_popup_menu(self, connectSignal=True): + def init_identities_popup_menu(self): # Popup menu for the Your Identities tab - self.addressContextMenuToolbarYourIdentities = QtGui.QToolBar() - # Actions - self.actionNewYourIdentities = self.addressContextMenuToolbarYourIdentities.addAction(_translate( - "MainWindow", "New"), self.on_action_YourIdentitiesNew) - self.actionEnableYourIdentities = self.addressContextMenuToolbarYourIdentities.addAction( - _translate( - "MainWindow", "Enable"), self.on_action_Enable) - self.actionDisableYourIdentities = self.addressContextMenuToolbarYourIdentities.addAction( - _translate( - "MainWindow", "Disable"), self.on_action_Disable) - self.actionSetAvatarYourIdentities = self.addressContextMenuToolbarYourIdentities.addAction( - _translate( - "MainWindow", "Set avatar..."), - self.on_action_TreeWidgetSetAvatar) - self.actionClipboardYourIdentities = self.addressContextMenuToolbarYourIdentities.addAction( - _translate( - "MainWindow", "Copy address to clipboard"), - self.on_action_Clipboard) - self.actionSpecialAddressBehaviorYourIdentities = self.addressContextMenuToolbarYourIdentities.addAction( - _translate( - "MainWindow", "Special address behavior..."), - self.on_action_SpecialAddressBehaviorDialog) - self.actionEmailGateway = self.addressContextMenuToolbarYourIdentities.addAction( - _translate( - "MainWindow", "Email gateway"), - self.on_action_EmailGatewayDialog) - self.actionMarkAllRead = self.addressContextMenuToolbarYourIdentities.addAction( - _translate( - "MainWindow", "Mark all messages as read"), - self.on_action_MarkAllRead) - - self.treeWidgetYourIdentities.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.treeWidgetYourIdentities, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuYourIdentities) # load all gui.menu plugins with prefix 'address' self.menu_plugins = {'address': []} @@ -294,127 +107,6 @@ class MainWindow(Window): title, handler )) - def init_chan_popup_menu(self, connectSignal=True): - # Actions - self.actionNew = self.addressContextMenuToolbar.addAction(_translate( - "MainWindow", "New"), self.on_action_YourIdentitiesNew) - self.actionDelete = self.addressContextMenuToolbar.addAction( - _translate("MainWindow", "Delete"), - self.on_action_YourIdentitiesDelete) - self.actionEnable = self.addressContextMenuToolbar.addAction( - _translate( - "MainWindow", "Enable"), self.on_action_Enable) - self.actionDisable = self.addressContextMenuToolbar.addAction( - _translate( - "MainWindow", "Disable"), self.on_action_Disable) - self.actionSetAvatar = self.addressContextMenuToolbar.addAction( - _translate( - "MainWindow", "Set avatar..."), - self.on_action_TreeWidgetSetAvatar) - self.actionClipboard = self.addressContextMenuToolbar.addAction( - _translate( - "MainWindow", "Copy address to clipboard"), - self.on_action_Clipboard) - self.actionSend = self.addressContextMenuToolbar.addAction( - _translate("MainWindow", "Send message to this chan"), - self.on_action_Send) - self.actionSpecialAddressBehavior = self.addressContextMenuToolbar.addAction( - _translate( - "MainWindow", "Special address behavior..."), - self.on_action_SpecialAddressBehaviorDialog) - - self.treeWidgetChans.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.treeWidgetChans, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuChan) - - def init_addressbook_popup_menu(self, connectSignal=True): - # Popup menu for the Address Book page - self.addressBookContextMenuToolbar = QtGui.QToolBar() - # Actions - self.actionAddressBookSend = self.addressBookContextMenuToolbar.addAction( - _translate( - "MainWindow", "Send message to this address"), - self.on_action_AddressBookSend) - self.actionAddressBookClipboard = self.addressBookContextMenuToolbar.addAction( - _translate( - "MainWindow", "Copy address to clipboard"), - self.on_action_AddressBookClipboard) - self.actionAddressBookSubscribe = self.addressBookContextMenuToolbar.addAction( - _translate( - "MainWindow", "Subscribe to this address"), - self.on_action_AddressBookSubscribe) - self.actionAddressBookSetAvatar = self.addressBookContextMenuToolbar.addAction( - _translate( - "MainWindow", "Set avatar..."), - self.on_action_AddressBookSetAvatar) - self.actionAddressBookSetSound = \ - self.addressBookContextMenuToolbar.addAction( - _translate("MainWindow", "Set notification sound..."), - self.on_action_AddressBookSetSound) - self.actionAddressBookNew = self.addressBookContextMenuToolbar.addAction( - _translate( - "MainWindow", "Add New Address"), self.on_action_AddressBookNew) - self.actionAddressBookDelete = self.addressBookContextMenuToolbar.addAction( - _translate( - "MainWindow", "Delete"), self.on_action_AddressBookDelete) - self.tableWidgetAddressBook.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.tableWidgetAddressBook, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuAddressBook) - - def init_subscriptions_popup_menu(self, connectSignal=True): - # Actions - self.actionsubscriptionsNew = self.subscriptionsContextMenuToolbar.addAction( - _translate("MainWindow", "New"), self.on_action_SubscriptionsNew) - self.actionsubscriptionsDelete = self.subscriptionsContextMenuToolbar.addAction( - _translate("MainWindow", "Delete"), - self.on_action_SubscriptionsDelete) - self.actionsubscriptionsClipboard = self.subscriptionsContextMenuToolbar.addAction( - _translate("MainWindow", "Copy address to clipboard"), - self.on_action_SubscriptionsClipboard) - self.actionsubscriptionsEnable = self.subscriptionsContextMenuToolbar.addAction( - _translate("MainWindow", "Enable"), - self.on_action_SubscriptionsEnable) - self.actionsubscriptionsDisable = self.subscriptionsContextMenuToolbar.addAction( - _translate("MainWindow", "Disable"), - self.on_action_SubscriptionsDisable) - self.actionsubscriptionsSetAvatar = self.subscriptionsContextMenuToolbar.addAction( - _translate("MainWindow", "Set avatar..."), - self.on_action_TreeWidgetSetAvatar) - self.actionsubscriptionsSend = self.addressContextMenuToolbar.addAction( - _translate("MainWindow", "Send message to this address"), - self.on_action_Send) - self.treeWidgetSubscriptions.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.treeWidgetSubscriptions, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuSubscriptions) - - def init_sent_popup_menu(self, connectSignal=True): - # Actions - self.actionTrashSentMessage = self.sentContextMenuToolbar.addAction( - _translate( - "MainWindow", "Move to Trash"), self.on_action_SentTrash) - self.actionSentClipboard = self.sentContextMenuToolbar.addAction( - _translate( - "MainWindow", "Copy destination address to clipboard"), - self.on_action_SentClipboard) - self.actionForceSend = self.sentContextMenuToolbar.addAction( - _translate( - "MainWindow", "Force send"), self.on_action_ForceSend) - self.actionSentReply = self.sentContextMenuToolbar.addAction( - _translate("MainWindow", "Send update"), - self.on_action_SentReply) - # self.popMenuSent = QtGui.QMenu( self ) - # self.popMenuSent.addAction( self.actionSentClipboard ) - # self.popMenuSent.addAction( self.actionTrashSentMessage ) - def rerenderTabTreeSubscriptions(self): treeWidget = self.treeWidgetSubscriptions folders = Ui_FolderWidget.folderWeight.keys() @@ -649,13 +341,7 @@ class MainWindow(Window): # so that quit won't loop self.wait = self.quitAccepted = False - self.init_file_menu() - self.init_inbox_popup_menu() self.init_identities_popup_menu() - self.init_addressbook_popup_menu() - self.init_subscriptions_popup_menu() - self.init_chan_popup_menu() - self.init_sent_popup_menu() # Initialize the user's list of addresses on the 'Chan' tab. self.rerenderTabTreeChans() @@ -677,77 +363,11 @@ class MainWindow(Window): # Initialize the Subscriptions self.rerenderSubscriptions() - # Initialize the inbox search - QtCore.QObject.connect(self.inboxSearchLineEdit, QtCore.SIGNAL( - "returnPressed()"), self.inboxSearchLineEditReturnPressed) - QtCore.QObject.connect(self.inboxSearchLineEditSubscriptions, QtCore.SIGNAL( - "returnPressed()"), self.inboxSearchLineEditReturnPressed) - QtCore.QObject.connect(self.inboxSearchLineEditChans, QtCore.SIGNAL( - "returnPressed()"), self.inboxSearchLineEditReturnPressed) - QtCore.QObject.connect(self.inboxSearchLineEdit, QtCore.SIGNAL( - "textChanged(QString)"), self.inboxSearchLineEditUpdated) - QtCore.QObject.connect(self.inboxSearchLineEditSubscriptions, QtCore.SIGNAL( - "textChanged(QString)"), self.inboxSearchLineEditUpdated) - QtCore.QObject.connect(self.inboxSearchLineEditChans, QtCore.SIGNAL( - "textChanged(QString)"), self.inboxSearchLineEditUpdated) - - # Initialize addressbook - QtCore.QObject.connect(self.tableWidgetAddressBook, QtCore.SIGNAL( - "itemChanged(QTableWidgetItem *)"), self.tableWidgetAddressBookItemChanged) - # This is necessary for the completer to work if multiple recipients - QtCore.QObject.connect(self.lineEditTo, QtCore.SIGNAL( - "cursorPositionChanged(int, int)"), self.lineEditTo.completer().onCursorPositionChanged) - - # show messages from message list - QtCore.QObject.connect(self.tableWidgetInbox, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) - QtCore.QObject.connect(self.tableWidgetInboxSubscriptions, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) - QtCore.QObject.connect(self.tableWidgetInboxChans, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) - - # tree address lists - QtCore.QObject.connect(self.treeWidgetYourIdentities, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.treeWidgetItemClicked) - QtCore.QObject.connect(self.treeWidgetYourIdentities, QtCore.SIGNAL( - "itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged) - QtCore.QObject.connect(self.treeWidgetSubscriptions, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.treeWidgetItemClicked) - QtCore.QObject.connect(self.treeWidgetSubscriptions, QtCore.SIGNAL( - "itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged) - QtCore.QObject.connect(self.treeWidgetChans, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.treeWidgetItemClicked) - QtCore.QObject.connect(self.treeWidgetChans, QtCore.SIGNAL( - "itemChanged (QTreeWidgetItem *, int)"), self.treeWidgetItemChanged) - QtCore.QObject.connect( - self.tabWidget, QtCore.SIGNAL("currentChanged(int)"), - self.tabWidgetCurrentChanged - ) - # Put the colored icon on the status bar - # self.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png")) - self.setStatusBar(BMStatusBar()) - self.statusbar = self.statusBar() - - self.pushButtonStatusIcon = QtGui.QPushButton(self) - self.pushButtonStatusIcon.setText('') - self.pushButtonStatusIcon.setIcon( - QtGui.QIcon(':/newPrefix/images/redicon.png')) - self.pushButtonStatusIcon.setFlat(True) self.statusbar.insertPermanentWidget(0, self.pushButtonStatusIcon) - QtCore.QObject.connect(self.pushButtonStatusIcon, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonStatusIcon) self.unreadCount = 0 - # Set the icon sizes for the identicons - identicon_size = 3*7 - self.tableWidgetInbox.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.treeWidgetChans.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.treeWidgetYourIdentities.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.treeWidgetSubscriptions.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.tableWidgetAddressBook.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.UISignalThread = UISignaler.get() QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( "writeNewAddressToTable(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)"), self.writeNewAddressToTable) @@ -813,9 +433,6 @@ class MainWindow(Window): TTL = 28*24*60*60 self.horizontalSliderTTL.setSliderPosition((TTL - 3600) ** (1/3.199)) self.updateHumanFriendlyTTLDescription(TTL) - - QtCore.QObject.connect(self.horizontalSliderTTL, QtCore.SIGNAL( - "valueChanged(int)"), self.updateTTL) self.initSettings() self.resetNamecoinConnection() diff --git a/src/bitmessageqt/bitmessageui.ui b/src/bitmessageqt/bitmessageui.ui index e74be78f..fb453a55 100644 --- a/src/bitmessageqt/bitmessageui.ui +++ b/src/bitmessageqt/bitmessageui.ui @@ -21,8 +21,8 @@ QTabWidget::Rounded - - + + @@ -71,81 +71,93 @@ Qt::Horizontal - - - - - - Identities - - - - :/newPrefix/images/identities.png - - - - - - - - - - 200 - 16777215 - - - - New Indentitiy - - - - + + + + + + 200 + 0 + + + + Qt::CustomContextMenu + + + + Identities + + + + :/newPrefix/images/identities.png + + + + + + + + + + 200 + 16777215 + + + + New Indentitiy + + + + Qt::Vertical - - - - - Search - - - - - + - - All - + + + Search + + - - To - + + + + All + + + + + To + + + + + From + + + + + Subject + + + + + Message + + + - - - From - - - - - Subject - - - - - Message - - - - - + + + Qt::CustomContextMenu + QAbstractItemView::NoEditTriggers @@ -236,13 +248,16 @@ - - Qt::Horizontal - - - - + + Qt::Horizontal + + + + + + Qt::CustomContextMenu + true @@ -286,8 +301,8 @@ - - + + @@ -299,8 +314,8 @@ Add Contact - - + + @@ -317,282 +332,281 @@ Fetch Namecoin ID - - + + + + + + Qt::Vertical + + + + 0 + + + + Send ordinary Message + + + + + + + + + + Subject: + + + + + + + From: + + + + + + + + + + + + + + To: + + + + + + + + 300 + 0 + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> +<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> + + + + + + + + + + Send Message to your Subscribers + + + + + + + + + + From: + + + + + + + + + + + + + + Subject: + + + + + + + + 300 + 0 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> +<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> + + + + + + + - - - Qt::Vertical - - - - 0 - - - - Send ordinary Message - - - - - - - - - - Subject: - - - - - - - From: - - - - - - - - - - - - - - To: - - - - - - - - 300 - 0 - - - - - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> -<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> - - - - - - + + + + + + + 0 + 0 + + + + + 32 + 16777215 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 0 + 0 + 255 + + + + + + + + + 120 + 120 + 120 + + + + + + + + + true + + + + TTL: + + + true + - - - Send Message to your Subscribers - - - - - - - - - - From: - - - - - - - - - - - - - - Subject: - - - - - - - - 300 - 0 - - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> -<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> - - - - - - + + + + + + 35 + 0 + + + + + 70 + 16777215 + + + + Qt::Horizontal + + + false + + + false + - - - - - - - - - 0 - 0 - - - - - 32 - 16777215 - - - - - - - - - 0 - 0 - 255 - - - - - - - - - 0 - 0 - 255 - - - - - - - - - 120 - 120 - 120 - - - - - - - - - true - - - - TTL: - - - true - - - - - - - - 35 - 0 - - - - - 70 - 16777215 - - - - Qt::Horizontal - - - false - - - false - - - - - - - - 0 - 0 - - - - - 45 - 0 - - - - - 45 - 16777215 - - - - X days - - - - - - - Clear - - - - - - - - 16777215 - 16777215 - - - - Send - - - + + + + + + 0 + 0 + + + + + 45 + 0 + + + + + 45 + 16777215 + + + + X days + + + + + + + Clear + + + + + + + + 16777215 + 16777215 + + + + Send + + + - + @@ -611,10 +625,13 @@ p, li { white-space: pre-wrap; } Qt::Horizontal - - - + + + + + Qt::CustomContextMenu + true @@ -635,8 +652,8 @@ p, li { white-space: pre-wrap; } - - + + @@ -648,129 +665,132 @@ p, li { white-space: pre-wrap; } Add new Subscription - - + + + + + + Qt::Vertical + + + + + + + Search + + + + + + + + All + + + + + To + + + + + From + + + + + Subject + + + + + Message + + + + + - - - Qt::Vertical + + + Qt::CustomContextMenu + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + true + + + 200 + + + false + + + 27 + + + false + + + true + + + false + + + 26 + + + + To - - - - - - Search - - - - - - - - All - - - - - To - - - - - From - - - - - Subject - - - - - Message - - - - - - - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectRows - - - true - - - false - - - true - - - 200 - - - false - - - 27 - - - false - - - true - - - false - - - 26 - - - - To - - - - - From - - - - - Subject - - - - - Received - - - - - - - 0 - 500 - - - - true - - + + + + From + + + + + Subject + + + + + Received + + + + + + 0 + 500 + + + + true + + + @@ -785,14 +805,17 @@ p, li { white-space: pre-wrap; } - - - Qt::Horizontal - - - - + + + Qt::Horizontal + + + + + + Qt::CustomContextMenu + QFrame::Sunken @@ -819,8 +842,8 @@ p, li { white-space: pre-wrap; } - - + + @@ -832,129 +855,132 @@ p, li { white-space: pre-wrap; } Add Chan - - - - - - Qt::Vertical - - - - - - - Search + + + + + + Qt::Vertical + + + + + + + Search + + + + + + + + All - - - - - - - All - - - - - To - - - - - From - - - - - Subject - - - - - Message - - - - - - - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectRows - - - true - - - false - - - true - - - 200 - - - false - - - 27 - - - false - - - true - - - false - - - 26 - - - - To - - - - - From - - - - - Subject - - - - - Received - - - - - - - 0 - 500 - - - - true - - + + + + To + + + + + From + + + + + Subject + + + + + Message + + + + + + + + Qt::CustomContextMenu + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + true + + + 200 + + + false + + + 27 + + + false + + + true + + + false + + + 26 + + + + To + + + + + From + + + + + Subject + + + + + Received + + + + + + + 0 + 500 + + + + true + + + @@ -979,6 +1005,47 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + + 50 + 50 + + + + ArrowCursor + + + Qt::NoFocus + + + Qt::LeftToRight + + + + + + + :/newPrefix/images/redicon.png:/newPrefix/images/redicon.png + + + + 21 + 23 + + + + true + + + @@ -1018,14 +1085,320 @@ p, li { white-space: pre-wrap; } - + 16777215 - 22 + 25 + + + TopToolBarArea + + + false + + + + Reply to sender + + + + + Reply to channel + + + + + Add sender to your Address Book + + + + + Add sender to your Blacklist + + + + + Move to Trash + + + + + Undelete + + + + + View HTML code as formatted text + + + + + Save message as... + + + + + Mark Unread + + + + + + + + + + + + + + + TopToolBarArea + + + false + + + + New + + + + + Enable + + + + + Disable + + + + + Set avatar... + + + + + Copy address to clipboard + + + + + Special address behavior... + + + + + Email gateway + + + + + Mark all messages as read + + + + + + + + + + + + + + TopToolBarArea + + + false + + + + New + + + + + Delete + + + + + Enable + + + + + Disable + + + + + Set avatar... + + + + + Copy address to clipboard + + + + + Send message to this chan + + + + + Special address behavior... + + + + + + + + + + + + + + TopToolBarArea + + + false + + + + Send message to this address + + + + + Copy address to clipboard + + + + + Subscribe to this address + + + + + Set avatar... + + + + + Set notification sound... + + + + + Add New Address + + + + + Delete + + + + + + + + + + + + + TopToolBarArea + + + false + + + + New + + + + + Delete + + + + + Copy address to clipboard + + + + + Enable + + + + + Disable + + + + + Set avatar... + + + + + Send message to this address + + + + + + + + + + + + + TopToolBarArea + + + false + + + + Move to Trash + + + + + Copy destination address to clipboard + + + + + Force send + + + + + Send update + + + + + + + Import keys @@ -1127,6 +1500,11 @@ p, li { white-space: pre-wrap; } + + BMStatusBar + QStatusBar +
bitmessageqt.statusbar
+
Blacklist QWidget @@ -1163,11 +1541,6 @@ p, li { white-space: pre-wrap; } QTextEdit
bitmessageqt.messagecompose
- - MessagelistControl - SSplitter -
bitmessageqt.messagelist
-
tableWidgetInbox @@ -1182,5 +1555,1342 @@ p, li { white-space: pre-wrap; } - + + + actionExit + triggered() + MainWindow + quit() + + + -1 + -1 + + + 20 + 20 + + + + + actionNetworkSwitch + triggered() + MainWindow + network_switch + + + -1 + -1 + + + 20 + 20 + + + + + actionRegenerateDeterministicAddresses + triggered() + MainWindow + click_actionRegenerateDeterministicAddresses + + + -1 + -1 + + + 20 + 20 + + + + + actionDeleteAllTrashedMessages + triggered() + MainWindow + click_actionDeleteAllTrashedMessages + + + -1 + -1 + + + 20 + 20 + + + + + actionManageKeys + triggered() + MainWindow + click_actionManageKeys + + + -1 + -1 + + + 20 + 20 + + + + + actionSettings + triggered() + MainWindow + click_actionSettings + + + -1 + -1 + + + 20 + 20 + + + + + actionAbout + triggered() + MainWindow + click_actionAbout + + + -1 + -1 + + + 20 + 20 + + + + + actionSupport + triggered() + MainWindow + click_actionSupport + + + -1 + -1 + + + 20 + 20 + + + + + actionHelp + triggered() + MainWindow + click_actionHelp + + + -1 + -1 + + + 20 + 20 + + + + + pushButtonNewAddress + clicked() + MainWindow + click_NewAddressDialog + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonAddAddressBook + clicked() + MainWindow + click_pushButtonAddAddressBook + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonFetchNamecoinID + clicked() + MainWindow + click_pushButtonFetchNamecoinID + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonAddSubscription + clicked() + MainWindow + click_pushButtonAddSubscription + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonAddChan + clicked() + MainWindow + click_actionJoinChan + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonTTL + clicked() + MainWindow + click_pushButtonTTL + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonClear + clicked() + MainWindow + click_pushButtonClear + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonSend + clicked() + MainWindow + click_pushButtonSend + + + 20 + 20 + + + 20 + 20 + + + + + pushButtonStatusIcon + clicked() + MainWindow + click_pushButtonStatusIcon + + + 20 + 20 + + + 20 + 20 + + + + + tableWidgetInbox + customContextMenuRequested(QPoint) + MainWindow + on_context_menuInbox() + + + 656 + 366 + + + 442 + 289 + + + + + tableWidgetInboxSubscriptions + customContextMenuRequested(QPoint) + MainWindow + on_context_menuInbox() + + + 20 + 20 + + + 20 + 20 + + + + + tableWidgetInboxChans + customContextMenuRequested(QPoint) + MainWindow + on_context_menuInbox() + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetYourIdentities + customContextMenuRequested(QPoint) + MainWindow + on_context_menuYourIdentities() + + + 20 + 20 + + + 20 + 20 + + + + + tableWidgetAddressBook + customContextMenuRequested(QPoint) + MainWindow + on_context_menuAddressBook() + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetSubscriptions + customContextMenuRequested(QPoint) + MainWindow + on_context_menuSubscriptions() + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetChans + customContextMenuRequested(QPoint) + MainWindow + on_context_menuChan() + + + 20 + 20 + + + 20 + 20 + + + + + actionReply + triggered() + MainWindow + on_action_InboxReply + + + -1 + -1 + + + 20 + 20 + + + + + actionReplyChan + triggered() + MainWindow + on_action_InboxReplyChan + + + -1 + -1 + + + 20 + 20 + + + + + actionAddSenderToAddressBook + triggered() + MainWindow + on_action_InboxAddSenderToAddressBook + + + -1 + -1 + + + 20 + 20 + + + + + actionAddSenderToBlackList + triggered() + MainWindow + on_action_InboxAddSenderToBlackList + + + -1 + -1 + + + 20 + 20 + + + + + actionTrashInboxMessage + triggered() + MainWindow + on_action_InboxTrash + + + -1 + -1 + + + 20 + 20 + + + + + actionUndeleteTrashedMessage + triggered() + MainWindow + on_action_TrashUndelete + + + -1 + -1 + + + 20 + 20 + + + + + actionForceHtml + triggered() + MainWindow + on_action_InboxMessageForceHtml + + + -1 + -1 + + + 20 + 20 + + + + + actionSaveMessageAs + triggered() + MainWindow + on_action_InboxSaveMessageAs + + + -1 + -1 + + + 20 + 20 + + + + + actionMarkUnread + triggered() + MainWindow + on_action_InboxMarkUnread + + + -1 + -1 + + + 20 + 20 + + + + + actionNew + triggered() + MainWindow + on_action_YourIdentitiesNew + + + -1 + -1 + + + 20 + 20 + + + + + actionDelete + triggered() + MainWindow + on_action_YourIdentitiesDelete + + + -1 + -1 + + + 20 + 20 + + + + + actionEnable + triggered() + MainWindow + on_action_Enable + + + -1 + -1 + + + 20 + 20 + + + + + actionDisable + triggered() + MainWindow + on_action_Disable + + + -1 + -1 + + + 20 + 20 + + + + + actionSetAvatar + triggered() + MainWindow + on_action_TreeWidgetSetAvatar + + + -1 + -1 + + + 20 + 20 + + + + + actionClipboard + triggered() + MainWindow + on_action_Clipboard + + + -1 + -1 + + + 20 + 20 + + + + + actionSend + triggered() + MainWindow + on_action_Send + + + actionSpecialAddressBehavior + triggered() + MainWindow + on_action_SpecialAddressBehaviorDialog + + + -1 + -1 + + + 20 + 20 + + + + + actionNewYourIdentities + triggered() + MainWindow + on_action_YourIdentitiesNew + + + -1 + -1 + + + 20 + 20 + + + + + actionEnableYourIdentities + triggered() + MainWindow + on_action_Enable + + + -1 + -1 + + + 20 + 20 + + + + + actionDisableYourIdentities + triggered() + MainWindow + on_action_Disable + + + -1 + -1 + + + 20 + 20 + + + + + actionSetAvatarYourIdentities + triggered() + MainWindow + on_action_TreeWidgetSetAvatar + + + -1 + -1 + + + 20 + 20 + + + + + actionClipboardYourIdentities + triggered() + MainWindow + on_action_Clipboard + + + -1 + -1 + + + 20 + 20 + + + + + actionSpecialAddressBehaviorYourIdentities + triggered() + MainWindow + on_action_SpecialAddressBehaviorDialog + + + -1 + -1 + + + 20 + 20 + + + + + actionEmailGateway + triggered() + MainWindow + on_action_EmailGatewayDialog + + + -1 + -1 + + + 20 + 20 + + + + + actionMarkAllRead + triggered() + MainWindow + on_action_MarkAllRead + + + -1 + -1 + + + 20 + 20 + + + + + actionAddressBookSend + triggered() + MainWindow + on_action_AddressBookSend + + + -1 + -1 + + + 20 + 20 + + + + + actionAddressBookClipboard + triggered() + MainWindow + on_action_AddressBookClipboard + + + -1 + -1 + + + 20 + 20 + + + + + actionAddressBookSubscribe + triggered() + MainWindow + on_action_AddressBookSubscribe + + + -1 + -1 + + + 20 + 20 + + + + + actionAddressBookSetAvatar + triggered() + MainWindow + on_action_AddressBookSetAvatar + + + -1 + -1 + + + 20 + 20 + + + + + actionAddressBookSetSound + triggered() + MainWindow + on_action_AddressBookSetSound + + + -1 + -1 + + + 20 + 20 + + + + + actionAddressBookNew + triggered() + MainWindow + on_action_AddressBookNew + + + -1 + -1 + + + 20 + 20 + + + + + actionAddressBookDelete + triggered() + MainWindow + on_action_AddressBookDelete + + + -1 + -1 + + + 20 + 20 + + + + + actionsubscriptionsNew + triggered() + MainWindow + on_action_SubscriptionsNew + + + -1 + -1 + + + 20 + 20 + + + + + actionsubscriptionsDelete + triggered() + MainWindow + on_action_SubscriptionsDelete + + + -1 + -1 + + + 20 + 20 + + + + + actionsubscriptionsClipboard + triggered() + MainWindow + on_action_SubscriptionsClipboard + + + -1 + -1 + + + 20 + 20 + + + + + actionsubscriptionsEnable + triggered() + MainWindow + on_action_SubscriptionsEnable + + + -1 + -1 + + + 20 + 20 + + + + + actionsubscriptionsDisable + triggered() + MainWindow + on_action_SubscriptionsDisable + + + -1 + -1 + + + 20 + 20 + + + + + actionsubscriptionsSetAvatar + triggered() + MainWindow + on_action_TreeWidgetSetAvatar + + + -1 + -1 + + + 20 + 20 + + + + + actionsubscriptionsSend + triggered() + MainWindow + on_action_Send + + + actionTrashSentMessage + triggered() + MainWindow + on_action_SentTrash + + + -1 + -1 + + + 20 + 20 + + + + + actionSentClipboard + triggered() + MainWindow + on_action_SentClipboard + + + -1 + -1 + + + 20 + 20 + + + + + actionForceSend + triggered() + MainWindow + on_action_ForceSend + + + -1 + -1 + + + 20 + 20 + + + + + actionSentReply + triggered() + MainWindow + on_action_SentReply + + + inboxSearchLineEdit + returnPressed() + MainWindow + inboxSearchLineEditReturnPressed + + + 20 + 20 + + + 20 + 20 + + + + + inboxSearchLineEditSubscriptions + returnPressed() + MainWindow + inboxSearchLineEditReturnPressed + + + 20 + 20 + + + 20 + 20 + + + + + inboxSearchLineEditChans + returnPressed() + MainWindow + inboxSearchLineEditReturnPressed + + + 20 + 20 + + + 20 + 20 + + + + + inboxSearchLineEdit + textChanged(QString) + MainWindow + inboxSearchLineEditUpdated + + + 20 + 20 + + + 20 + 20 + + + + + inboxSearchLineEditSubscriptions + textChanged(QString) + MainWindow + inboxSearchLineEditUpdated + + + 20 + 20 + + + 20 + 20 + + + + + inboxSearchLineEditChans + textChanged(QString) + MainWindow + inboxSearchLineEditUpdated + + + 20 + 20 + + + 20 + 20 + + + + + tableWidgetAddressBook + itemChanged(QTableWidgetItem*) + MainWindow + tableWidgetAddressBookItemChanged + + + 67 + 107 + + + 442 + 289 + + + + + tableWidgetInbox + itemSelectionChanged() + MainWindow + tableWidgetInboxItemClicked + + + 20 + 20 + + + 20 + 20 + + + + + tableWidgetInboxSubscriptions + itemSelectionChanged() + MainWindow + tableWidgetInboxItemClicked + + + 20 + 20 + + + 20 + 20 + + + + + tableWidgetInboxChans + itemSelectionChanged() + MainWindow + tableWidgetInboxItemClicked + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetYourIdentities + itemSelectionChanged() + MainWindow + treeWidgetItemClicked + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetSubscriptions + itemSelectionChanged() + MainWindow + treeWidgetItemClicked + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetChans + itemSelectionChanged() + MainWindow + treeWidgetItemClicked + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetYourIdentities + itemChanged(QTreeWidgetItem*,int) + MainWindow + treeWidgetItemChanged + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetSubscriptions + itemChanged(QTreeWidgetItem*,int) + MainWindow + treeWidgetItemChanged + + + 20 + 20 + + + 20 + 20 + + + + + treeWidgetChans + itemChanged(QTreeWidgetItem*,int) + MainWindow + treeWidgetItemChanged + + + 20 + 20 + + + 20 + 20 + + + + + tabWidget + currentChanged(int) + MainWindow + tabWidgetCurrentChanged + + + 20 + 20 + + + 20 + 20 + + + + + horizontalSliderTTL + valueChanged(int) + MainWindow + updateTTL + + diff --git a/src/bitmessageqt/main.py b/src/bitmessageqt/main.py index 6768b466..e0703a08 100644 --- a/src/bitmessageqt/main.py +++ b/src/bitmessageqt/main.py @@ -15,13 +15,29 @@ class Window(settingsmixin.SMainWindow, RetranslateMixin): super(Window, self).__init__(parent) widgets.load('bitmessageui.ui', self) - self.addressBookCompleter = AddressBookCompleter() - self.addressBookCompleter.setCompletionMode( + self.blackwhitelist.rerenderBlackWhiteList() + + addressBookCompleter = AddressBookCompleter() + addressBookCompleter.setCompletionMode( QtGui.QCompleter.PopupCompletion) - self.addressBookCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive) - self.addressBookCompleterModel = QtGui.QStringListModel() - self.addressBookCompleter.setModel(self.addressBookCompleterModel) - self.lineEditTo.setCompleter(self.addressBookCompleter) + addressBookCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive) + addressBookCompleterModel = QtGui.QStringListModel() + addressBookCompleter.setModel(addressBookCompleterModel) + self.lineEditTo.setCompleter(addressBookCompleter) + + self.lineEditTo.cursorPositionChanged.connect( + addressBookCompleter.onCursorPositionChanged) + + # Hide all menu action containers + for toolbar in ( + self.inboxContextMenuToolbar, + self.addressContextMenuToolbarYourIdentities, + self.addressContextMenuToolbar, + self.addressBookContextMenuToolbar, + self.subscriptionsContextMenuToolbar, + self.sentContextMenuToolbar + ): + toolbar.setVisible(False) # splitters for splitter in (