From 505c5689c2488c36296b3c37e2625daffca15a7f Mon Sep 17 00:00:00 2001 From: sbkaf Date: Tue, 3 Mar 2015 18:17:56 +0100 Subject: [PATCH 1/5] make interface look more like an e-mail programm, not yet functional --- src/bitmessageqt/__init__.py | 220 +++-- src/bitmessageqt/bitmessageui.py | 640 +++++++------- src/bitmessageqt/bitmessageui.ui | 1419 +++++++++++++++--------------- 3 files changed, 1152 insertions(+), 1127 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 3b424c8e..4596525e 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -199,13 +199,11 @@ class MyForm(QtGui.QMainWindow): QtCore.SIGNAL( "triggered()"), self.click_actionRegenerateDeterministicAddresses) - QtCore.QObject.connect(self.ui.actionJoinChan, QtCore.SIGNAL( - "triggered()"), + QtCore.QObject.connect(self.ui.pushButtonAddChanel, QtCore.SIGNAL( + "clicked()"), self.click_actionJoinChan) # also used for creating chans. QtCore.QObject.connect(self.ui.pushButtonNewAddress, QtCore.SIGNAL( "clicked()"), self.click_NewAddressDialog) - QtCore.QObject.connect(self.ui.comboBoxSendFrom, QtCore.SIGNAL( - "activated(int)"), self.redrawLabelFrom) QtCore.QObject.connect(self.ui.pushButtonAddAddressBook, QtCore.SIGNAL( "clicked()"), self.click_pushButtonAddAddressBook) QtCore.QObject.connect(self.ui.pushButtonAddSubscription, QtCore.SIGNAL( @@ -214,12 +212,8 @@ class MyForm(QtGui.QMainWindow): "clicked()"), self.click_pushButtonAddBlacklist) QtCore.QObject.connect(self.ui.pushButtonSend, QtCore.SIGNAL( "clicked()"), self.click_pushButtonSend) - QtCore.QObject.connect(self.ui.pushButtonLoadFromAddressBook, - QtCore.SIGNAL( - "clicked()"), - self.click_pushButtonLoadFromAddressBook) - QtCore.QObject.connect(self.ui.pushButtonFetchNamecoinID, QtCore.SIGNAL( - "clicked()"), self.click_pushButtonFetchNamecoinID) + #QtCore.QObject.connect(self.ui.pushButtonFetchNamecoinID, QtCore.SIGNAL( + #"clicked()"), self.click_pushButtonFetchNamecoinID) QtCore.QObject.connect(self.ui.radioButtonBlacklist, QtCore.SIGNAL( "clicked()"), self.click_radioButtonBlacklist) QtCore.QObject.connect(self.ui.radioButtonWhitelist, QtCore.SIGNAL( @@ -297,12 +291,14 @@ class MyForm(QtGui.QMainWindow): _translate( "MainWindow", "Special address behavior..."), self.on_action_SpecialAddressBehaviorDialog) + self.ui.tableWidgetYourIdentities.setContextMenuPolicy( QtCore.Qt.CustomContextMenu) if connectSignal: self.connect(self.ui.tableWidgetYourIdentities, QtCore.SIGNAL( 'customContextMenuRequested(const QPoint&)'), self.on_context_menuYourIdentities) + self.popMenu = QtGui.QMenu(self) self.popMenu.addAction(self.actionNew) self.popMenu.addSeparator() @@ -405,12 +401,6 @@ class MyForm(QtGui.QMainWindow): self.actionForceSend = self.ui.sentContextMenuToolbar.addAction( _translate( "MainWindow", "Force send"), self.on_action_ForceSend) - self.ui.tableWidgetSent.setContextMenuPolicy( - QtCore.Qt.CustomContextMenu) - if connectSignal: - self.connect(self.ui.tableWidgetSent, QtCore.SIGNAL( - 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuSent) # self.popMenuSent = QtGui.QMenu( self ) # self.popMenuSent.addAction( self.actionSentClipboard ) # self.popMenuSent.addAction( self.actionTrashSentMessage ) @@ -498,8 +488,6 @@ class MyForm(QtGui.QMainWindow): self.totalNumberOfBytesReceived = 0 self.totalNumberOfBytesSent = 0 - self.ui.labelSendBroadcastWarning.setVisible(False) - self.timer = QtCore.QTimer() self.timer.start(2000) # milliseconds QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.runEveryTwoSeconds) @@ -512,7 +500,7 @@ class MyForm(QtGui.QMainWindow): self.init_sent_popup_menu() self.init_blacklist_popup_menu() - # Initialize the user's list of addresses on the 'Your Identities' tab. + # Initialize the user's list of addresses on the 'Your Identities' table. configSections = shared.config.sections() for addressInKeysFile in configSections: if addressInKeysFile != 'bitmessagesettings': @@ -546,6 +534,26 @@ class MyForm(QtGui.QMainWindow): status, addressVersionNumber, streamNumber, hash = decodeAddress( addressInKeysFile) + # Initialize the user's list of addresses on the 'Received' tab. + configSections = shared.config.sections() + for addressInKeysFile in configSections: + if addressInKeysFile != 'bitmessagesettings': + isEnabled = shared.config.getboolean( + addressInKeysFile, 'enabled') + + if isEnabled and not shared.safeConfigGetBoolean(addressInKeysFile, 'chan') and not shared.safeConfigGetBoolean(addressInKeysFile, 'mailinglist'): + newItem = QtGui.QTreeWidgetItem(self.ui.treeWidgetYourIdentities) + newItem.setIcon(0, avatarize(addressInKeysFile)) + newItem.setText(0, unicode( + shared.config.get(addressInKeysFile, 'label'), 'utf-8)') + + ' (' + addressInKeysFile + ')') + newSubItem = QtGui.QTreeWidgetItem(newItem) + newSubItem.setText(0, _translate("MainWindow", "inbox")) + newSubItem = QtGui.QTreeWidgetItem(newItem) + newSubItem.setText(0, _translate("MainWindow", "sent")) + newSubItem = QtGui.QTreeWidgetItem(newItem) + newSubItem.setText(0, _translate("MainWindow", "trash")) + # Load inbox from messages database file self.loadInbox() @@ -562,10 +570,6 @@ class MyForm(QtGui.QMainWindow): QtCore.QObject.connect(self.ui.inboxSearchLineEdit, QtCore.SIGNAL( "returnPressed()"), self.inboxSearchLineEditPressed) - # Initialize the sent search - QtCore.QObject.connect(self.ui.sentSearchLineEdit, QtCore.SIGNAL( - "returnPressed()"), self.sentSearchLineEditPressed) - # Initialize the Blacklist or Whitelist if shared.config.get('bitmessagesettings', 'blackwhitelist') == 'white': self.ui.tabWidget.setTabText(6, 'Whitelist') @@ -580,8 +584,6 @@ class MyForm(QtGui.QMainWindow): "itemChanged(QTableWidgetItem *)"), self.tableWidgetSubscriptionsItemChanged) QtCore.QObject.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL( "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) - QtCore.QObject.connect(self.ui.tableWidgetSent, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.tableWidgetSentItemClicked) # Put the colored icon on the status bar # self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png")) @@ -596,8 +598,8 @@ class MyForm(QtGui.QMainWindow): # Set the icon sizes for the identicons identicon_size = 3*7 self.ui.tableWidgetInbox.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.ui.tableWidgetSent.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.tableWidgetYourIdentities.setIconSize(QtCore.QSize(identicon_size, identicon_size)) + self.ui.treeWidgetYourIdentities.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.tableWidgetSubscriptions.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.tableWidgetAddressBook.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.tableWidgetBlacklist.setIconSize(QtCore.QSize(identicon_size, identicon_size)) @@ -657,11 +659,11 @@ class MyForm(QtGui.QMainWindow): options["user"] = shared.config.get('bitmessagesettings', 'namecoinrpcuser') options["password"] = shared.config.get('bitmessagesettings', 'namecoinrpcpassword') nc = namecoinConnection(options) - if nc.test()[0] == 'failed': - self.ui.pushButtonFetchNamecoinID.hide() + #if nc.test()[0] == 'failed': + #self.ui.pushButtonFetchNamecoinID.hide() except: print 'There was a problem testing for a Namecoin daemon. Hiding the Fetch Namecoin ID button' - self.ui.pushButtonFetchNamecoinID.hide() + #self.ui.pushButtonFetchNamecoinID.hide() # Show or hide the application window after clicking an item within the @@ -751,12 +753,12 @@ class MyForm(QtGui.QMainWindow): # Show the program window and select subscriptions tab def appIndicatorSubscribe(self): self.appIndicatorShow() - self.ui.tabWidget.setCurrentIndex(4) + self.ui.tabWidget.setCurrentIndex(2) - # Show the program window and select the address book tab - def appIndicatorAddressBook(self): + # Show the program window and select chanels tab + def appIndicatorChanel(self): self.appIndicatorShow() - self.ui.tabWidget.setCurrentIndex(5) + self.ui.tabWidget.setCurrentIndex(3) # Load Sent items from database def loadSent(self, where="", what=""): @@ -778,8 +780,8 @@ class MyForm(QtGui.QMainWindow): ORDER BY lastactiontime ''' % (where,) - while self.ui.tableWidgetSent.rowCount() > 0: - self.ui.tableWidgetSent.removeRow(0) + while self.ui.tableWidgetInbox.rowCount() > 0: + self.ui.tableWidgetInbox.removeRow(0) queryreturn = sqlQuery(sqlStatement, what) for row in queryreturn: @@ -813,14 +815,14 @@ class MyForm(QtGui.QMainWindow): if toLabel == '': toLabel = toAddress - self.ui.tableWidgetSent.insertRow(0) + self.ui.tableWidgetInbox.insertRow(0) toAddressItem = QtGui.QTableWidgetItem(unicode(toLabel, 'utf-8')) toAddressItem.setToolTip(unicode(toLabel, 'utf-8')) toAddressItem.setIcon(avatarize(toAddress)) toAddressItem.setData(Qt.UserRole, str(toAddress)) toAddressItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetSent.setItem(0, 0, toAddressItem) + self.ui.tableWidgetInbox.setItem(0, 0, toAddressItem) if fromLabel == '': fromLabel = fromAddress @@ -830,13 +832,13 @@ class MyForm(QtGui.QMainWindow): fromAddressItem.setData(Qt.UserRole, str(fromAddress)) fromAddressItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetSent.setItem(0, 1, fromAddressItem) + self.ui.tableWidgetInbox.setItem(0, 1, fromAddressItem) subjectItem = QtGui.QTableWidgetItem(unicode(subject, 'utf-8')) subjectItem.setToolTip(unicode(subject, 'utf-8')) subjectItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetSent.setItem(0, 2, subjectItem) + self.ui.tableWidgetInbox.setItem(0, 2, subjectItem) if status == 'awaitingpubkey': statusText = _translate( @@ -883,9 +885,9 @@ class MyForm(QtGui.QMainWindow): newItem.setData(33, int(lastactiontime)) newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetSent.setItem(0, 3, newItem) - self.ui.tableWidgetSent.sortItems(3, Qt.DescendingOrder) - self.ui.tableWidgetSent.keyPressEvent = self.tableWidgetSentKeyPressEvent + self.ui.tableWidgetInbox.setItem(0, 3, newItem) + self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder) + self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent # Load inbox from messages database file def loadInbox(self, where="", what=""): @@ -1035,11 +1037,11 @@ class MyForm(QtGui.QMainWindow): actionSubscribe.triggered.connect(self.appIndicatorSubscribe) m.addAction(actionSubscribe) - # Address book - actionAddressBook = QtGui.QAction(_translate( - "MainWindow", "Address Book"), m, checkable=False) - actionAddressBook.triggered.connect(self.appIndicatorAddressBook) - m.addAction(actionAddressBook) + # Chanels + actionSubscribe = QtGui.QAction(_translate( + "MainWindow", "Chanel"), m, checkable=False) + actionSubscribe.triggered.connect(self.appIndicatorChanel) + m.addAction(actionSubscribe) # separator actionSeparator = QtGui.QAction('', m, checkable=False) @@ -1316,16 +1318,13 @@ class MyForm(QtGui.QMainWindow): else: self.tray.showMessage(title, subtitle, 1, 2000) + # set delete key in inbox def tableWidgetInboxKeyPressEvent(self, event): if event.key() == QtCore.Qt.Key_Delete: self.on_action_InboxTrash() return QtGui.QTableWidget.keyPressEvent(self.ui.tableWidgetInbox, event) - def tableWidgetSentKeyPressEvent(self, event): - if event.key() == QtCore.Qt.Key_Delete: - self.on_action_SentTrash() - return QtGui.QTableWidget.keyPressEvent(self.ui.tableWidgetSent, event) - + # menu button 'manage keys' def click_actionManageKeys(self): if 'darwin' in sys.platform or 'linux' in sys.platform: if shared.appdata == '': @@ -1349,11 +1348,13 @@ class MyForm(QtGui.QMainWindow): if reply == QtGui.QMessageBox.Yes: shared.openKeysFile() + # menu button 'delete all treshed messages' def click_actionDeleteAllTrashedMessages(self): if QtGui.QMessageBox.question(self, _translate("MainWindow", "Delete trash?"), _translate("MainWindow", "Are you sure you want to delete all trashed messages?"), QtGui.QMessageBox.Yes, QtGui.QMessageBox.No) == QtGui.QMessageBox.No: return sqlStoredProcedure('deleteandvacuume') + # menu botton 'regenerate deterministic addresses' def click_actionRegenerateDeterministicAddresses(self): self.regenerateAddressesDialogInstance = regenerateAddressesDialog( self) @@ -1379,6 +1380,7 @@ class MyForm(QtGui.QMainWindow): ), self.regenerateAddressesDialogInstance.ui.lineEditPassphrase.text().toUtf8(), self.regenerateAddressesDialogInstance.ui.checkBoxEighteenByteRipe.isChecked())) self.ui.tabWidget.setCurrentIndex(3) + # opens 'join chan' dialog def click_actionJoinChan(self): self.newChanDialogInstance = newChanDialog(self) if self.newChanDialogInstance.exec_(): @@ -1505,7 +1507,6 @@ class MyForm(QtGui.QMainWindow): shared.numberOfBytesSent = 0 def updateNetworkStatusTab(self): - # print 'updating network status tab' totalNumberOfConnectionsFromAllStreams = 0 # One would think we could use len(sendDataQueues) for this but the number doesn't always match: just because we have a sendDataThread running doesn't mean that the connection has been fully established (with the exchange of version messages). streamNumberTotals = {} for host, streamNumber in shared.connectedHostsList.items(): @@ -1667,42 +1668,42 @@ class MyForm(QtGui.QMainWindow): return int(cnt) def updateSentItemStatusByHash(self, toRipe, textToDisplay): - for i in range(self.ui.tableWidgetSent.rowCount()): - toAddress = str(self.ui.tableWidgetSent.item( + for i in range(self.ui.tableWidgetInbox.rowCount()): + toAddress = str(self.ui.tableWidgetInbox.item( i, 0).data(Qt.UserRole).toPyObject()) status, addressVersionNumber, streamNumber, ripe = decodeAddress( toAddress) if ripe == toRipe: - self.ui.tableWidgetSent.item(i, 3).setToolTip(textToDisplay) + self.ui.tableWidgetInbox.item(i, 3).setToolTip(textToDisplay) try: newlinePosition = textToDisplay.indexOf('\n') except: # If someone misses adding a "_translate" to a string before passing it to this function, this function won't receive a qstring which will cause an exception. newlinePosition = 0 if newlinePosition > 1: - self.ui.tableWidgetSent.item(i, 3).setText( + self.ui.tableWidgetInbox.item(i, 3).setText( textToDisplay[:newlinePosition]) else: - self.ui.tableWidgetSent.item(i, 3).setText(textToDisplay) + self.ui.tableWidgetInbox.item(i, 3).setText(textToDisplay) def updateSentItemStatusByAckdata(self, ackdata, textToDisplay): - for i in range(self.ui.tableWidgetSent.rowCount()): - toAddress = str(self.ui.tableWidgetSent.item( + for i in range(self.ui.tableWidgetInbox.rowCount()): + toAddress = str(self.ui.tableWidgetInbox.item( i, 0).data(Qt.UserRole).toPyObject()) - tableAckdata = self.ui.tableWidgetSent.item( + tableAckdata = self.ui.tableWidgetInbox.item( i, 3).data(Qt.UserRole).toPyObject() status, addressVersionNumber, streamNumber, ripe = decodeAddress( toAddress) if ackdata == tableAckdata: - self.ui.tableWidgetSent.item(i, 3).setToolTip(textToDisplay) + self.ui.tableWidgetInbox.item(i, 3).setToolTip(textToDisplay) try: newlinePosition = textToDisplay.indexOf('\n') except: # If someone misses adding a "_translate" to a string before passing it to this function, this function won't receive a qstring which will cause an exception. newlinePosition = 0 if newlinePosition > 1: - self.ui.tableWidgetSent.item(i, 3).setText( + self.ui.tableWidgetInbox.item(i, 3).setText( textToDisplay[:newlinePosition]) else: - self.ui.tableWidgetSent.item(i, 3).setText(textToDisplay) + self.ui.tableWidgetInbox.item(i, 3).setText(textToDisplay) def removeInboxRowByMsgid(self, msgid): # msgid and inventoryHash are the same thing for i in range(self.ui.tableWidgetInbox.rowCount()): @@ -1783,22 +1784,22 @@ class MyForm(QtGui.QMainWindow): i, 0).setTextColor(QApplication.palette().text().color()) def rerenderSentFromLabels(self): - for i in range(self.ui.tableWidgetSent.rowCount()): - fromAddress = str(self.ui.tableWidgetSent.item( + for i in range(self.ui.tableWidgetInbox.rowCount()): + fromAddress = str(self.ui.tableWidgetInbox.item( i, 1).data(Qt.UserRole).toPyObject()) # Message might be from an address we own like a chan address. Let's look for that label. if shared.config.has_section(fromAddress): fromLabel = shared.config.get(fromAddress, 'label') else: fromLabel = fromAddress - self.ui.tableWidgetSent.item( + self.ui.tableWidgetInbox.item( i, 1).setText(unicode(fromLabel, 'utf-8')) - self.ui.tableWidgetSent.item( + self.ui.tableWidgetInbox.item( i, 1).setIcon(avatarize(fromAddress)) def rerenderSentToLabels(self): - for i in range(self.ui.tableWidgetSent.rowCount()): - addressToLookup = str(self.ui.tableWidgetSent.item( + for i in range(self.ui.tableWidgetInbox.rowCount()): + addressToLookup = str(self.ui.tableWidgetInbox.item( i, 0).data(Qt.UserRole).toPyObject()) toLabel = '' queryreturn = sqlQuery( @@ -1813,7 +1814,7 @@ class MyForm(QtGui.QMainWindow): toLabel = shared.config.get(addressToLookup, 'label') if toLabel == '': toLabel = addressToLookup - self.ui.tableWidgetSent.item( + self.ui.tableWidgetInbox.item( i, 0).setText(unicode(toLabel, 'utf-8')) def rerenderAddressBook(self): @@ -1873,7 +1874,6 @@ class MyForm(QtGui.QMainWindow): def click_pushButtonSend(self): self.statusBar().showMessage('') toAddresses = str(self.ui.lineEditTo.text()) - fromAddress = str(self.ui.labelFrom.text()) subject = str(self.ui.lineEditSubject.text().toUtf8()) message = str( self.ui.textEditMessage.document().toPlainText().toUtf8()) @@ -1972,12 +1972,11 @@ class MyForm(QtGui.QMainWindow): shared.workerQueue.put(('sendmessage', toAddress)) self.ui.comboBoxSendFrom.setCurrentIndex(0) - self.ui.labelFrom.setText('') self.ui.lineEditTo.setText('') self.ui.lineEditSubject.setText('') self.ui.textEditMessage.setText('') self.ui.tabWidget.setCurrentIndex(2) - self.ui.tableWidgetSent.setCurrentCell(0, 0) + self.ui.tableWidgetInbox.setCurrentCell(0, 0) else: self.statusBar().showMessage(_translate( "MainWindow", "Your \'To\' field is empty.")) @@ -2006,12 +2005,11 @@ class MyForm(QtGui.QMainWindow): shared.workerQueue.put(('sendbroadcast', '')) self.ui.comboBoxSendFrom.setCurrentIndex(0) - self.ui.labelFrom.setText('') self.ui.lineEditTo.setText('') self.ui.lineEditSubject.setText('') self.ui.textEditMessage.setText('') self.ui.tabWidget.setCurrentIndex(2) - self.ui.tableWidgetSent.setCurrentCell(0, 0) + self.ui.tableWidgetInbox.setCurrentCell(0, 0) def click_pushButtonLoadFromAddressBook(self): self.ui.tabWidget.setCurrentIndex(5) @@ -2033,11 +2031,6 @@ class MyForm(QtGui.QMainWindow): self.statusBar().showMessage(_translate( "MainWindow", "Fetched address from namecoin identity.")) - def redrawLabelFrom(self, index): - self.ui.labelFrom.setText( - self.ui.comboBoxSendFrom.itemData(index).toPyObject()) - self.setBroadcastEnablementDependingOnWhetherThisIsAChanAddress(self.ui.comboBoxSendFrom.itemData(index).toPyObject()) - def setBroadcastEnablementDependingOnWhetherThisIsAChanAddress(self, address): # If this is a chan then don't let people broadcast because no one # should subscribe to chan addresses. @@ -2049,7 +2042,6 @@ class MyForm(QtGui.QMainWindow): def rerenderComboBoxSendFrom(self): self.ui.comboBoxSendFrom.clear() - self.ui.labelFrom.setText('') configSections = shared.config.sections() for addressInKeysFile in configSections: if addressInKeysFile != 'bitmessagesettings': @@ -2061,7 +2053,6 @@ class MyForm(QtGui.QMainWindow): self.ui.comboBoxSendFrom.insertItem(0, '', '') if(self.ui.comboBoxSendFrom.count() == 2): self.ui.comboBoxSendFrom.setCurrentIndex(1) - self.redrawLabelFrom(self.ui.comboBoxSendFrom.currentIndex()) else: self.ui.comboBoxSendFrom.setCurrentIndex(0) @@ -2079,8 +2070,8 @@ class MyForm(QtGui.QMainWindow): if fromLabel == '': fromLabel = fromAddress - self.ui.tableWidgetSent.setSortingEnabled(False) - self.ui.tableWidgetSent.insertRow(0) + self.ui.tableWidgetInbox.setSortingEnabled(False) + self.ui.tableWidgetInbox.insertRow(0) if toLabel == '': newItem = QtGui.QTableWidgetItem(unicode(toAddress, 'utf-8')) newItem.setToolTip(unicode(toAddress, 'utf-8')) @@ -2089,7 +2080,7 @@ class MyForm(QtGui.QMainWindow): newItem.setToolTip(unicode(toLabel, 'utf-8')) newItem.setData(Qt.UserRole, str(toAddress)) newItem.setIcon(avatarize(toAddress)) - self.ui.tableWidgetSent.setItem(0, 0, newItem) + self.ui.tableWidgetInbox.setItem(0, 0, newItem) if fromLabel == '': newItem = QtGui.QTableWidgetItem(unicode(fromAddress, 'utf-8')) newItem.setToolTip(unicode(fromAddress, 'utf-8')) @@ -2098,11 +2089,11 @@ class MyForm(QtGui.QMainWindow): newItem.setToolTip(unicode(fromLabel, 'utf-8')) newItem.setData(Qt.UserRole, str(fromAddress)) newItem.setIcon(avatarize(fromAddress)) - self.ui.tableWidgetSent.setItem(0, 1, newItem) + self.ui.tableWidgetInbox.setItem(0, 1, newItem) newItem = QtGui.QTableWidgetItem(unicode(subject, 'utf-8)')) newItem.setToolTip(unicode(subject, 'utf-8)')) #newItem.setData(Qt.UserRole, unicode(message, 'utf-8)')) # No longer hold the message in the table; we'll use a SQL query to display it as needed. - self.ui.tableWidgetSent.setItem(0, 2, newItem) + self.ui.tableWidgetInbox.setItem(0, 2, newItem) # newItem = QtGui.QTableWidgetItem('Doing work necessary to send # broadcast...'+ # l10n.formatTimestamp()) @@ -2110,9 +2101,9 @@ class MyForm(QtGui.QMainWindow): newItem.setToolTip(_translate("MainWindow", "Work is queued. %1").arg(l10n.formatTimestamp())) newItem.setData(Qt.UserRole, QByteArray(ackdata)) newItem.setData(33, int(time.time())) - self.ui.tableWidgetSent.setItem(0, 3, newItem) + self.ui.tableWidgetInbox.setItem(0, 3, newItem) self.ui.textEditSentMessage.setPlainText(unicode(message, 'utf-8)')) - self.ui.tableWidgetSent.setSortingEnabled(True) + self.ui.tableWidgetInbox.setSortingEnabled(True) def displayNewInboxMessage(self, inventoryHash, toAddress, fromAddress, subject, message): subject = shared.fixPotentiallyInvalidUTF8Data(subject) @@ -2730,17 +2721,15 @@ class MyForm(QtGui.QMainWindow): for row in queryreturn: messageAtCurrentInboxRow, = row if toAddressAtCurrentInboxRow == self.str_broadcast_subscribers: - self.ui.labelFrom.setText('') + #TODO what does this if?.. + a = a elif not shared.config.has_section(toAddressAtCurrentInboxRow): QtGui.QMessageBox.information(self, _translate("MainWindow", "Address is gone"), _translate( "MainWindow", "Bitmessage cannot find your address %1. Perhaps you removed it?").arg(toAddressAtCurrentInboxRow), QMessageBox.Ok) - self.ui.labelFrom.setText('') elif not shared.config.getboolean(toAddressAtCurrentInboxRow, 'enabled'): QtGui.QMessageBox.information(self, _translate("MainWindow", "Address disabled"), _translate( "MainWindow", "Error: The address from which you are trying to send is disabled. You\'ll have to enable it on the \'Your Identities\' tab before using it."), QMessageBox.Ok) - self.ui.labelFrom.setText('') else: - self.ui.labelFrom.setText(toAddressAtCurrentInboxRow) self.setBroadcastEnablementDependingOnWhetherThisIsAChanAddress(toAddressAtCurrentInboxRow) self.ui.lineEditTo.setText(str(fromAddressAtCurrentInboxRow)) @@ -2844,23 +2833,23 @@ class MyForm(QtGui.QMainWindow): # Send item on the Sent tab to trash def on_action_SentTrash(self): - while self.ui.tableWidgetSent.selectedIndexes() != []: - currentRow = self.ui.tableWidgetSent.selectedIndexes()[0].row() - ackdataToTrash = str(self.ui.tableWidgetSent.item( + while self.ui.tableWidgetInbox.selectedIndexes() != []: + currentRow = self.ui.tableWidgetInbox.selectedIndexes()[0].row() + ackdataToTrash = str(self.ui.tableWidgetInbox.item( currentRow, 3).data(Qt.UserRole).toPyObject()) sqlExecute('''UPDATE sent SET folder='trash' WHERE ackdata=?''', ackdataToTrash) self.ui.textEditSentMessage.setPlainText("") - self.ui.tableWidgetSent.removeRow(currentRow) + self.ui.tableWidgetInbox.removeRow(currentRow) self.statusBar().showMessage(_translate( "MainWindow", "Moved items to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.")) if currentRow == 0: - self.ui.tableWidgetSent.selectRow(currentRow) + self.ui.tableWidgetInbox.selectRow(currentRow) else: - self.ui.tableWidgetSent.selectRow(currentRow - 1) + self.ui.tableWidgetInbox.selectRow(currentRow - 1) def on_action_ForceSend(self): - currentRow = self.ui.tableWidgetSent.currentRow() - addressAtCurrentRow = str(self.ui.tableWidgetSent.item( + currentRow = self.ui.tableWidgetInbox.currentRow() + addressAtCurrentRow = str(self.ui.tableWidgetInbox.item( currentRow, 0).data(Qt.UserRole).toPyObject()) toRipe = decodeAddress(addressAtCurrentRow)[3] sqlExecute( @@ -2874,8 +2863,8 @@ class MyForm(QtGui.QMainWindow): shared.workerQueue.put(('sendmessage', '')) def on_action_SentClipboard(self): - currentRow = self.ui.tableWidgetSent.currentRow() - addressAtCurrentRow = str(self.ui.tableWidgetSent.item( + currentRow = self.ui.tableWidgetInbox.currentRow() + addressAtCurrentRow = str(self.ui.tableWidgetInbox.item( currentRow, 0).data(Qt.UserRole).toPyObject()) clipboard = QtGui.QApplication.clipboard() clipboard.setText(str(addressAtCurrentRow)) @@ -3213,15 +3202,15 @@ class MyForm(QtGui.QMainWindow): # Check to see if this item is toodifficult and display an additional # menu option (Force Send) if it is. - currentRow = self.ui.tableWidgetSent.currentRow() - ackData = str(self.ui.tableWidgetSent.item( + currentRow = self.ui.tableWidgetInbox.currentRow() + ackData = str(self.ui.tableWidgetInbox.item( currentRow, 3).data(Qt.UserRole).toPyObject()) queryreturn = sqlQuery('''SELECT status FROM sent where ackdata=?''', ackData) for row in queryreturn: status, = row if status == 'toodifficult': self.popMenuSent.addAction(self.actionForceSend) - self.popMenuSent.exec_(self.ui.tableWidgetSent.mapToGlobal(point)) + self.popMenuSent.exec_(self.ui.tableWidgetInbox.mapToGlobal(point)) def inboxSearchLineEditPressed(self): searchKeyword = self.ui.inboxSearchLineEdit.text().toUtf8().data() @@ -3230,13 +3219,6 @@ class MyForm(QtGui.QMainWindow): self.ui.textEditInboxMessage.setPlainText(QString("")) self.loadInbox(searchOption, searchKeyword) - def sentSearchLineEditPressed(self): - searchKeyword = self.ui.sentSearchLineEdit.text().toUtf8().data() - searchOption = self.ui.sentSearchOptionCB.currentText().toUtf8().data() - self.ui.sentSearchLineEdit.setText(QString("")) - self.ui.textEditInboxMessage.setPlainText(QString("")) - self.loadSent(searchOption, searchKeyword) - def tableWidgetInboxItemClicked(self): currentRow = self.ui.tableWidgetInbox.currentRow() if currentRow >= 0: @@ -3284,10 +3266,10 @@ class MyForm(QtGui.QMainWindow): sqlExecute('''update inbox set read=1 WHERE msgid=?''', inventoryHash) self.changedInboxUnread() - def tableWidgetSentItemClicked(self): - currentRow = self.ui.tableWidgetSent.currentRow() + def tableWidgetInboxItemClicked(self): + currentRow = self.ui.tableWidgetInbox.currentRow() if currentRow >= 0: - ackdata = str(self.ui.tableWidgetSent.item( + ackdata = str(self.ui.tableWidgetInbox.item( currentRow, 3).data(Qt.UserRole).toPyObject()) queryreturn = sqlQuery( '''select message from sent where ackdata=?''', ackdata) @@ -3615,8 +3597,8 @@ class settingsDialog(QtGui.QDialog): responseStatus = response[0] responseText = response[1] self.ui.labelNamecoinTestResult.setText(responseText) - if responseStatus== 'success': - self.parent.ui.pushButtonFetchNamecoinID.show() + #if responseStatus== 'success': + #self.parent.ui.pushButtonFetchNamecoinID.show() class SpecialAddressBehaviorDialog(QtGui.QDialog): diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index 318c1caf..f3a600f6 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'bitmessageui.ui' +# Form implementation generated from reading ui file 'bmail.ui' # -# Created: Mon Jan 05 16:21:20 2015 -# by: PyQt4 UI code generator 4.10.3 +# Created: Sun Mar 1 23:18:09 2015 +# by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! @@ -33,9 +33,8 @@ class Ui_MainWindow(object): MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) - self.gridLayout = QtGui.QGridLayout(self.centralwidget) - self.gridLayout.setMargin(0) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.gridLayout_10 = QtGui.QGridLayout(self.centralwidget) + self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) self.tabWidget = QtGui.QTabWidget(self.centralwidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) @@ -52,27 +51,34 @@ class Ui_MainWindow(object): self.tabWidget.setObjectName(_fromUtf8("tabWidget")) self.inbox = QtGui.QWidget() self.inbox.setObjectName(_fromUtf8("inbox")) - self.verticalLayout_2 = QtGui.QVBoxLayout(self.inbox) - self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) + self.gridLayout = QtGui.QGridLayout(self.inbox) + self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.horizontalLayout_3 = QtGui.QHBoxLayout() + self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) + self.verticalLayout_12 = QtGui.QVBoxLayout() + self.verticalLayout_12.setObjectName(_fromUtf8("verticalLayout_12")) + self.treeWidgetYourIdentities = QtGui.QTreeWidget(self.inbox) + self.treeWidgetYourIdentities.setMaximumSize(QtCore.QSize(200, 16777215)) + self.treeWidgetYourIdentities.setObjectName(_fromUtf8("treeWidgetYourIdentities")) + icon1 = QtGui.QIcon() + icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/identities.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) + self.treeWidgetYourIdentities.headerItem().setIcon(0, icon1) + self.verticalLayout_12.addWidget(self.treeWidgetYourIdentities) + self.pushButtonNewAddress = QtGui.QPushButton(self.inbox) + self.pushButtonNewAddress.setMaximumSize(QtCore.QSize(200, 16777215)) + self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress")) + self.verticalLayout_12.addWidget(self.pushButtonNewAddress) + self.horizontalLayout_3.addLayout(self.verticalLayout_12) + self.verticalLayout_11 = QtGui.QVBoxLayout() + self.verticalLayout_11.setObjectName(_fromUtf8("verticalLayout_11")) self.horizontalLayoutSearch = QtGui.QHBoxLayout() self.horizontalLayoutSearch.setContentsMargins(-1, 0, -1, -1) self.horizontalLayoutSearch.setObjectName(_fromUtf8("horizontalLayoutSearch")) self.inboxSearchLineEdit = QtGui.QLineEdit(self.inbox) self.inboxSearchLineEdit.setObjectName(_fromUtf8("inboxSearchLineEdit")) self.horizontalLayoutSearch.addWidget(self.inboxSearchLineEdit) - self.inboxSearchOptionCB = QtGui.QComboBox(self.inbox) - self.inboxSearchOptionCB.setObjectName(_fromUtf8("inboxSearchOptionCB")) - self.inboxSearchOptionCB.addItem(_fromUtf8("")) - self.inboxSearchOptionCB.addItem(_fromUtf8("")) - self.inboxSearchOptionCB.addItem(_fromUtf8("")) - self.inboxSearchOptionCB.addItem(_fromUtf8("")) - self.inboxSearchOptionCB.addItem(_fromUtf8("")) - self.horizontalLayoutSearch.addWidget(self.inboxSearchOptionCB) - self.verticalLayout_2.addLayout(self.horizontalLayoutSearch) - self.splitter = QtGui.QSplitter(self.inbox) - self.splitter.setOrientation(QtCore.Qt.Vertical) - self.splitter.setObjectName(_fromUtf8("splitter")) - self.tableWidgetInbox = QtGui.QTableWidget(self.splitter) + self.verticalLayout_11.addLayout(self.horizontalLayoutSearch) + self.tableWidgetInbox = QtGui.QTableWidget(self.inbox) self.tableWidgetInbox.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.tableWidgetInbox.setAlternatingRowColors(True) self.tableWidgetInbox.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) @@ -97,151 +103,212 @@ class Ui_MainWindow(object): self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True) self.tableWidgetInbox.verticalHeader().setVisible(False) self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26) - self.textEditInboxMessage = QtGui.QTextEdit(self.splitter) + self.verticalLayout_11.addWidget(self.tableWidgetInbox) + self.textEditInboxMessage = QtGui.QTextEdit(self.inbox) self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessage.setReadOnly(True) self.textEditInboxMessage.setObjectName(_fromUtf8("textEditInboxMessage")) - self.verticalLayout_2.addWidget(self.splitter) - icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.inbox, icon1, _fromUtf8("")) + self.verticalLayout_11.addWidget(self.textEditInboxMessage) + self.horizontalLayout_3.addLayout(self.verticalLayout_11) + self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1) + icon2 = QtGui.QIcon() + icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.inbox, icon2, _fromUtf8("")) self.send = QtGui.QWidget() self.send.setObjectName(_fromUtf8("send")) - self.gridLayout_2 = QtGui.QGridLayout(self.send) + self.gridLayout_11 = QtGui.QGridLayout(self.send) + self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + self.verticalLayout_2 = QtGui.QVBoxLayout() + self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) + self.tableWidgetAddressBook = QtGui.QTableWidget(self.send) + self.tableWidgetAddressBook.setMaximumSize(QtCore.QSize(200, 16777215)) + self.tableWidgetAddressBook.setAlternatingRowColors(True) + self.tableWidgetAddressBook.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) + self.tableWidgetAddressBook.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tableWidgetAddressBook.setObjectName(_fromUtf8("tableWidgetAddressBook")) + self.tableWidgetAddressBook.setColumnCount(2) + self.tableWidgetAddressBook.setRowCount(0) + item = QtGui.QTableWidgetItem() + icon3 = QtGui.QIcon() + icon3.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) + item.setIcon(icon3) + self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item) + item = QtGui.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 = QtGui.QPushButton(self.send) + self.pushButtonAddAddressBook.setMaximumSize(QtCore.QSize(200, 16777215)) + self.pushButtonAddAddressBook.setObjectName(_fromUtf8("pushButtonAddAddressBook")) + self.verticalLayout_2.addWidget(self.pushButtonAddAddressBook) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.tabWidget_2 = QtGui.QTabWidget(self.send) + self.tabWidget_2.setObjectName(_fromUtf8("tabWidget_2")) + self.tab = QtGui.QWidget() + self.tab.setObjectName(_fromUtf8("tab")) + self.gridLayout_8 = QtGui.QGridLayout(self.tab) + self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.gridLayout_2 = QtGui.QGridLayout() self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.pushButtonLoadFromAddressBook = QtGui.QPushButton(self.send) - font = QtGui.QFont() - font.setPointSize(7) - self.pushButtonLoadFromAddressBook.setFont(font) - self.pushButtonLoadFromAddressBook.setObjectName(_fromUtf8("pushButtonLoadFromAddressBook")) - self.gridLayout_2.addWidget(self.pushButtonLoadFromAddressBook, 3, 2, 1, 1) - self.pushButtonFetchNamecoinID = QtGui.QPushButton(self.send) - font = QtGui.QFont() - font.setPointSize(7) - self.pushButtonFetchNamecoinID.setFont(font) - self.pushButtonFetchNamecoinID.setObjectName(_fromUtf8("pushButtonFetchNamecoinID")) - self.gridLayout_2.addWidget(self.pushButtonFetchNamecoinID, 3, 3, 1, 1) - self.label_4 = QtGui.QLabel(self.send) - self.label_4.setObjectName(_fromUtf8("label_4")) - self.gridLayout_2.addWidget(self.label_4, 5, 0, 1, 1) - self.comboBoxSendFrom = QtGui.QComboBox(self.send) + self.comboBoxSendFrom = QtGui.QComboBox(self.tab) self.comboBoxSendFrom.setMinimumSize(QtCore.QSize(300, 0)) self.comboBoxSendFrom.setObjectName(_fromUtf8("comboBoxSendFrom")) - self.gridLayout_2.addWidget(self.comboBoxSendFrom, 2, 1, 1, 1) - self.label_3 = QtGui.QLabel(self.send) - self.label_3.setObjectName(_fromUtf8("label_3")) - self.gridLayout_2.addWidget(self.label_3, 4, 0, 1, 1) - self.labelFrom = QtGui.QLabel(self.send) - self.labelFrom.setText(_fromUtf8("")) - self.labelFrom.setObjectName(_fromUtf8("labelFrom")) - self.gridLayout_2.addWidget(self.labelFrom, 2, 2, 1, 3) - self.radioButtonSpecific = QtGui.QRadioButton(self.send) - self.radioButtonSpecific.setChecked(True) - self.radioButtonSpecific.setObjectName(_fromUtf8("radioButtonSpecific")) - self.gridLayout_2.addWidget(self.radioButtonSpecific, 0, 1, 1, 1) - self.lineEditTo = QtGui.QLineEdit(self.send) - self.lineEditTo.setObjectName(_fromUtf8("lineEditTo")) - self.gridLayout_2.addWidget(self.lineEditTo, 3, 1, 1, 1) - self.textEditMessage = QtGui.QTextEdit(self.send) - self.textEditMessage.setObjectName(_fromUtf8("textEditMessage")) - self.gridLayout_2.addWidget(self.textEditMessage, 5, 1, 2, 5) - self.label = QtGui.QLabel(self.send) + self.gridLayout_2.addWidget(self.comboBoxSendFrom, 0, 1, 1, 1) + self.label = QtGui.QLabel(self.tab) self.label.setObjectName(_fromUtf8("label")) - self.gridLayout_2.addWidget(self.label, 3, 0, 1, 1) - self.label_2 = QtGui.QLabel(self.send) + self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1) + self.lineEditTo = QtGui.QLineEdit(self.tab) + self.lineEditTo.setObjectName(_fromUtf8("lineEditTo")) + self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1) + self.label_3 = QtGui.QLabel(self.tab) + self.label_3.setObjectName(_fromUtf8("label_3")) + self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1) + self.label_2 = QtGui.QLabel(self.tab) self.label_2.setObjectName(_fromUtf8("label_2")) - self.gridLayout_2.addWidget(self.label_2, 2, 0, 1, 1) - spacerItem = QtGui.QSpacerItem(20, 297, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem, 6, 0, 1, 1) - self.radioButtonBroadcast = QtGui.QRadioButton(self.send) - self.radioButtonBroadcast.setObjectName(_fromUtf8("radioButtonBroadcast")) - self.gridLayout_2.addWidget(self.radioButtonBroadcast, 1, 1, 1, 3) - self.lineEditSubject = QtGui.QLineEdit(self.send) + self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) + self.lineEditSubject = QtGui.QLineEdit(self.tab) self.lineEditSubject.setText(_fromUtf8("")) self.lineEditSubject.setObjectName(_fromUtf8("lineEditSubject")) - self.gridLayout_2.addWidget(self.lineEditSubject, 4, 1, 1, 5) - spacerItem1 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_2.addItem(spacerItem1, 3, 4, 1, 1) - self.pushButtonSend = QtGui.QPushButton(self.send) + self.gridLayout_2.addWidget(self.lineEditSubject, 2, 1, 1, 1) + self.verticalLayout.addLayout(self.gridLayout_2) + self.textEditMessage = QtGui.QTextEdit(self.tab) + self.textEditMessage.setObjectName(_fromUtf8("textEditMessage")) + self.verticalLayout.addWidget(self.textEditMessage) + self.pushButtonSend = QtGui.QPushButton(self.tab) self.pushButtonSend.setObjectName(_fromUtf8("pushButtonSend")) - self.gridLayout_2.addWidget(self.pushButtonSend, 7, 5, 1, 1) - self.labelSendBroadcastWarning = QtGui.QLabel(self.send) - self.labelSendBroadcastWarning.setEnabled(True) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.labelSendBroadcastWarning.sizePolicy().hasHeightForWidth()) - self.labelSendBroadcastWarning.setSizePolicy(sizePolicy) - self.labelSendBroadcastWarning.setIndent(-1) - self.labelSendBroadcastWarning.setObjectName(_fromUtf8("labelSendBroadcastWarning")) - self.gridLayout_2.addWidget(self.labelSendBroadcastWarning, 7, 1, 1, 4) - icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.send, icon2, _fromUtf8("")) - self.sent = QtGui.QWidget() - self.sent.setObjectName(_fromUtf8("sent")) - self.verticalLayout = QtGui.QVBoxLayout(self.sent) - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setContentsMargins(-1, 0, -1, -1) - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.sentSearchLineEdit = QtGui.QLineEdit(self.sent) - self.sentSearchLineEdit.setObjectName(_fromUtf8("sentSearchLineEdit")) - self.horizontalLayout.addWidget(self.sentSearchLineEdit) - self.sentSearchOptionCB = QtGui.QComboBox(self.sent) - self.sentSearchOptionCB.setObjectName(_fromUtf8("sentSearchOptionCB")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.horizontalLayout.addWidget(self.sentSearchOptionCB) - self.verticalLayout.addLayout(self.horizontalLayout) - self.splitter_2 = QtGui.QSplitter(self.sent) - self.splitter_2.setOrientation(QtCore.Qt.Vertical) - self.splitter_2.setObjectName(_fromUtf8("splitter_2")) - self.tableWidgetSent = QtGui.QTableWidget(self.splitter_2) - self.tableWidgetSent.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tableWidgetSent.setDragDropMode(QtGui.QAbstractItemView.DragDrop) - self.tableWidgetSent.setAlternatingRowColors(True) - self.tableWidgetSent.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.tableWidgetSent.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetSent.setWordWrap(False) - self.tableWidgetSent.setObjectName(_fromUtf8("tableWidgetSent")) - self.tableWidgetSent.setColumnCount(4) - self.tableWidgetSent.setRowCount(0) + self.verticalLayout.addWidget(self.pushButtonSend) + self.gridLayout_8.addLayout(self.verticalLayout, 0, 0, 1, 1) + self.tabWidget_2.addTab(self.tab, _fromUtf8("")) + self.tab_2 = QtGui.QWidget() + self.tab_2.setObjectName(_fromUtf8("tab_2")) + self.gridLayout_9 = QtGui.QGridLayout(self.tab_2) + self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) + self.verticalLayout_5 = QtGui.QVBoxLayout() + self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) + self.gridLayout_5 = QtGui.QGridLayout() + self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) + self.label_8 = QtGui.QLabel(self.tab_2) + self.label_8.setObjectName(_fromUtf8("label_8")) + self.gridLayout_5.addWidget(self.label_8, 0, 0, 1, 1) + self.lineEditSubject_2 = QtGui.QLineEdit(self.tab_2) + self.lineEditSubject_2.setText(_fromUtf8("")) + self.lineEditSubject_2.setObjectName(_fromUtf8("lineEditSubject_2")) + self.gridLayout_5.addWidget(self.lineEditSubject_2, 1, 1, 1, 1) + self.label_7 = QtGui.QLabel(self.tab_2) + self.label_7.setObjectName(_fromUtf8("label_7")) + self.gridLayout_5.addWidget(self.label_7, 1, 0, 1, 1) + self.comboBoxSendFrom_2 = QtGui.QComboBox(self.tab_2) + self.comboBoxSendFrom_2.setMinimumSize(QtCore.QSize(300, 0)) + self.comboBoxSendFrom_2.setObjectName(_fromUtf8("comboBoxSendFrom_2")) + self.gridLayout_5.addWidget(self.comboBoxSendFrom_2, 0, 1, 1, 1) + self.verticalLayout_5.addLayout(self.gridLayout_5) + self.textEditMessage_2 = QtGui.QTextEdit(self.tab_2) + self.textEditMessage_2.setObjectName(_fromUtf8("textEditMessage_2")) + self.verticalLayout_5.addWidget(self.textEditMessage_2) + self.pushButtonSend_3 = QtGui.QPushButton(self.tab_2) + self.pushButtonSend_3.setObjectName(_fromUtf8("pushButtonSend_3")) + self.verticalLayout_5.addWidget(self.pushButtonSend_3) + self.gridLayout_9.addLayout(self.verticalLayout_5, 0, 0, 1, 1) + self.tabWidget_2.addTab(self.tab_2, _fromUtf8("")) + self.horizontalLayout.addWidget(self.tabWidget_2) + self.gridLayout_11.addLayout(self.horizontalLayout, 0, 0, 1, 1) + icon4 = QtGui.QIcon() + icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.send, icon4, _fromUtf8("")) + self.subscriptions = QtGui.QWidget() + self.subscriptions.setObjectName(_fromUtf8("subscriptions")) + self.gridLayout_4 = QtGui.QGridLayout(self.subscriptions) + self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) + self.verticalLayout_3 = QtGui.QVBoxLayout() + self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) + self.tableWidgetSubscriptions = QtGui.QTableWidget(self.subscriptions) + self.tableWidgetSubscriptions.setMaximumSize(QtCore.QSize(200, 16777215)) + self.tableWidgetSubscriptions.setAlternatingRowColors(True) + self.tableWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.tableWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tableWidgetSubscriptions.setObjectName(_fromUtf8("tableWidgetSubscriptions")) + self.tableWidgetSubscriptions.setColumnCount(2) + self.tableWidgetSubscriptions.setRowCount(0) item = QtGui.QTableWidgetItem() - self.tableWidgetSent.setHorizontalHeaderItem(0, item) + icon5 = QtGui.QIcon() + icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) + item.setIcon(icon5) + self.tableWidgetSubscriptions.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() - self.tableWidgetSent.setHorizontalHeaderItem(1, item) + self.tableWidgetSubscriptions.setHorizontalHeaderItem(1, item) + self.tableWidgetSubscriptions.horizontalHeader().setCascadingSectionResizes(True) + self.tableWidgetSubscriptions.horizontalHeader().setDefaultSectionSize(200) + self.tableWidgetSubscriptions.horizontalHeader().setHighlightSections(False) + self.tableWidgetSubscriptions.horizontalHeader().setSortIndicatorShown(False) + self.tableWidgetSubscriptions.horizontalHeader().setStretchLastSection(True) + self.tableWidgetSubscriptions.verticalHeader().setVisible(False) + self.verticalLayout_3.addWidget(self.tableWidgetSubscriptions) + self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions) + self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215)) + self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) + self.verticalLayout_3.addWidget(self.pushButtonAddSubscription) + self.horizontalLayout_2.addLayout(self.verticalLayout_3) + self.verticalLayout_4 = QtGui.QVBoxLayout() + self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) + self.inboxSearchLineSubscriptions = QtGui.QLineEdit(self.subscriptions) + self.inboxSearchLineSubscriptions.setObjectName(_fromUtf8("inboxSearchLineSubscriptions")) + self.verticalLayout_4.addWidget(self.inboxSearchLineSubscriptions) + self.tableWidgetInboxSubscriptions = QtGui.QTableWidget(self.subscriptions) + self.tableWidgetInboxSubscriptions.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True) + self.tableWidgetInboxSubscriptions.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) + self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tableWidgetInboxSubscriptions.setWordWrap(False) + self.tableWidgetInboxSubscriptions.setObjectName(_fromUtf8("tableWidgetInboxSubscriptions")) + self.tableWidgetInboxSubscriptions.setColumnCount(4) + self.tableWidgetInboxSubscriptions.setRowCount(0) item = QtGui.QTableWidgetItem() - self.tableWidgetSent.setHorizontalHeaderItem(2, item) + self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() - self.tableWidgetSent.setHorizontalHeaderItem(3, item) - self.tableWidgetSent.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetSent.horizontalHeader().setDefaultSectionSize(130) - self.tableWidgetSent.horizontalHeader().setHighlightSections(False) - self.tableWidgetSent.horizontalHeader().setSortIndicatorShown(False) - self.tableWidgetSent.horizontalHeader().setStretchLastSection(True) - self.tableWidgetSent.verticalHeader().setVisible(False) - self.tableWidgetSent.verticalHeader().setStretchLastSection(False) - self.textEditSentMessage = QtGui.QTextEdit(self.splitter_2) - self.textEditSentMessage.setReadOnly(True) - self.textEditSentMessage.setObjectName(_fromUtf8("textEditSentMessage")) - self.verticalLayout.addWidget(self.splitter_2) - icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/sent.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.sent, icon3, _fromUtf8("")) - self.youridentities = QtGui.QWidget() - self.youridentities.setObjectName(_fromUtf8("youridentities")) - self.gridLayout_3 = QtGui.QGridLayout(self.youridentities) + self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(1, item) + item = QtGui.QTableWidgetItem() + self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(2, item) + item = QtGui.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.textEditInboxSubscriptions = QtGui.QTextEdit(self.subscriptions) + self.textEditInboxSubscriptions.setBaseSize(QtCore.QSize(0, 500)) + self.textEditInboxSubscriptions.setReadOnly(True) + self.textEditInboxSubscriptions.setObjectName(_fromUtf8("textEditInboxSubscriptions")) + self.verticalLayout_4.addWidget(self.textEditInboxSubscriptions) + self.horizontalLayout_2.addLayout(self.verticalLayout_4) + self.gridLayout_4.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) + icon6 = QtGui.QIcon() + icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8("")) + self.tab_3 = QtGui.QWidget() + self.tab_3.setObjectName(_fromUtf8("tab_3")) + self.gridLayout_3 = QtGui.QGridLayout(self.tab_3) self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) - self.pushButtonNewAddress = QtGui.QPushButton(self.youridentities) - self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress")) - self.gridLayout_3.addWidget(self.pushButtonNewAddress, 0, 0, 1, 1) - spacerItem2 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_3.addItem(spacerItem2, 0, 1, 1, 1) - self.tableWidgetYourIdentities = QtGui.QTableWidget(self.youridentities) + self.horizontalLayout_4 = QtGui.QHBoxLayout() + self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) + self.verticalLayout_17 = QtGui.QVBoxLayout() + self.verticalLayout_17.setObjectName(_fromUtf8("verticalLayout_17")) + self.tableWidgetYourIdentities = QtGui.QTableWidget(self.tab_3) + self.tableWidgetYourIdentities.setMaximumSize(QtCore.QSize(200, 16777215)) self.tableWidgetYourIdentities.setFrameShadow(QtGui.QFrame.Sunken) self.tableWidgetYourIdentities.setLineWidth(1) self.tableWidgetYourIdentities.setAlternatingRowColors(True) @@ -254,13 +321,14 @@ class Ui_MainWindow(object): font = QtGui.QFont() font.setKerning(True) item.setFont(font) + item.setIcon(icon1) self.tableWidgetYourIdentities.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tableWidgetYourIdentities.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.tableWidgetYourIdentities.setHorizontalHeaderItem(2, item) self.tableWidgetYourIdentities.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetYourIdentities.horizontalHeader().setDefaultSectionSize(346) + self.tableWidgetYourIdentities.horizontalHeader().setDefaultSectionSize(200) self.tableWidgetYourIdentities.horizontalHeader().setMinimumSectionSize(52) self.tableWidgetYourIdentities.horizontalHeader().setSortIndicatorShown(True) self.tableWidgetYourIdentities.horizontalHeader().setStretchLastSection(True) @@ -268,77 +336,57 @@ class Ui_MainWindow(object): self.tableWidgetYourIdentities.verticalHeader().setDefaultSectionSize(26) self.tableWidgetYourIdentities.verticalHeader().setSortIndicatorShown(False) self.tableWidgetYourIdentities.verticalHeader().setStretchLastSection(False) - self.gridLayout_3.addWidget(self.tableWidgetYourIdentities, 1, 0, 1, 2) - icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/identities.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.youridentities, icon4, _fromUtf8("")) - self.subscriptions = QtGui.QWidget() - self.subscriptions.setObjectName(_fromUtf8("subscriptions")) - self.gridLayout_4 = QtGui.QGridLayout(self.subscriptions) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.label_5 = QtGui.QLabel(self.subscriptions) - self.label_5.setWordWrap(True) - self.label_5.setObjectName(_fromUtf8("label_5")) - self.gridLayout_4.addWidget(self.label_5, 0, 0, 1, 2) - self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions) - self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) - self.gridLayout_4.addWidget(self.pushButtonAddSubscription, 1, 0, 1, 1) - spacerItem3 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_4.addItem(spacerItem3, 1, 1, 1, 1) - self.tableWidgetSubscriptions = QtGui.QTableWidget(self.subscriptions) - self.tableWidgetSubscriptions.setAlternatingRowColors(True) - self.tableWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tableWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetSubscriptions.setObjectName(_fromUtf8("tableWidgetSubscriptions")) - self.tableWidgetSubscriptions.setColumnCount(2) - self.tableWidgetSubscriptions.setRowCount(0) + self.verticalLayout_17.addWidget(self.tableWidgetYourIdentities) + self.pushButtonAddChanel = QtGui.QPushButton(self.tab_3) + self.pushButtonAddChanel.setMaximumSize(QtCore.QSize(200, 16777215)) + self.pushButtonAddChanel.setObjectName(_fromUtf8("pushButtonAddChanel")) + self.verticalLayout_17.addWidget(self.pushButtonAddChanel) + self.horizontalLayout_4.addLayout(self.verticalLayout_17) + self.verticalLayout_13 = QtGui.QVBoxLayout() + self.verticalLayout_13.setObjectName(_fromUtf8("verticalLayout_13")) + self.horizontalLayoutSearch_2 = QtGui.QHBoxLayout() + self.horizontalLayoutSearch_2.setContentsMargins(-1, 0, -1, -1) + self.horizontalLayoutSearch_2.setObjectName(_fromUtf8("horizontalLayoutSearch_2")) + self.inboxSearchLineEdit_2 = QtGui.QLineEdit(self.tab_3) + self.inboxSearchLineEdit_2.setObjectName(_fromUtf8("inboxSearchLineEdit_2")) + self.horizontalLayoutSearch_2.addWidget(self.inboxSearchLineEdit_2) + self.verticalLayout_13.addLayout(self.horizontalLayoutSearch_2) + self.tableWidgetInbox_2 = QtGui.QTableWidget(self.tab_3) + self.tableWidgetInbox_2.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tableWidgetInbox_2.setAlternatingRowColors(True) + self.tableWidgetInbox_2.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) + self.tableWidgetInbox_2.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tableWidgetInbox_2.setWordWrap(False) + self.tableWidgetInbox_2.setObjectName(_fromUtf8("tableWidgetInbox_2")) + self.tableWidgetInbox_2.setColumnCount(4) + self.tableWidgetInbox_2.setRowCount(0) item = QtGui.QTableWidgetItem() - self.tableWidgetSubscriptions.setHorizontalHeaderItem(0, item) + self.tableWidgetInbox_2.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() - self.tableWidgetSubscriptions.setHorizontalHeaderItem(1, item) - self.tableWidgetSubscriptions.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetSubscriptions.horizontalHeader().setDefaultSectionSize(400) - self.tableWidgetSubscriptions.horizontalHeader().setHighlightSections(False) - self.tableWidgetSubscriptions.horizontalHeader().setSortIndicatorShown(False) - self.tableWidgetSubscriptions.horizontalHeader().setStretchLastSection(True) - self.tableWidgetSubscriptions.verticalHeader().setVisible(False) - self.gridLayout_4.addWidget(self.tableWidgetSubscriptions, 2, 0, 1, 2) - icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.subscriptions, icon5, _fromUtf8("")) - self.addressbook = QtGui.QWidget() - self.addressbook.setObjectName(_fromUtf8("addressbook")) - self.gridLayout_5 = QtGui.QGridLayout(self.addressbook) - self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) - self.label_6 = QtGui.QLabel(self.addressbook) - self.label_6.setWordWrap(True) - self.label_6.setObjectName(_fromUtf8("label_6")) - self.gridLayout_5.addWidget(self.label_6, 0, 0, 1, 2) - self.pushButtonAddAddressBook = QtGui.QPushButton(self.addressbook) - self.pushButtonAddAddressBook.setObjectName(_fromUtf8("pushButtonAddAddressBook")) - self.gridLayout_5.addWidget(self.pushButtonAddAddressBook, 1, 0, 1, 1) - spacerItem4 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_5.addItem(spacerItem4, 1, 1, 1, 1) - self.tableWidgetAddressBook = QtGui.QTableWidget(self.addressbook) - self.tableWidgetAddressBook.setAlternatingRowColors(True) - self.tableWidgetAddressBook.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.tableWidgetAddressBook.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetAddressBook.setObjectName(_fromUtf8("tableWidgetAddressBook")) - self.tableWidgetAddressBook.setColumnCount(2) - self.tableWidgetAddressBook.setRowCount(0) + self.tableWidgetInbox_2.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() - self.tableWidgetAddressBook.setHorizontalHeaderItem(0, item) + self.tableWidgetInbox_2.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() - self.tableWidgetAddressBook.setHorizontalHeaderItem(1, item) - self.tableWidgetAddressBook.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetAddressBook.horizontalHeader().setDefaultSectionSize(400) - self.tableWidgetAddressBook.horizontalHeader().setHighlightSections(False) - self.tableWidgetAddressBook.horizontalHeader().setStretchLastSection(True) - self.tableWidgetAddressBook.verticalHeader().setVisible(False) - self.gridLayout_5.addWidget(self.tableWidgetAddressBook, 2, 0, 1, 2) - icon6 = QtGui.QIcon() - icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/addressbook.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.addressbook, icon6, _fromUtf8("")) + self.tableWidgetInbox_2.setHorizontalHeaderItem(3, item) + self.tableWidgetInbox_2.horizontalHeader().setCascadingSectionResizes(True) + self.tableWidgetInbox_2.horizontalHeader().setDefaultSectionSize(200) + self.tableWidgetInbox_2.horizontalHeader().setHighlightSections(False) + self.tableWidgetInbox_2.horizontalHeader().setMinimumSectionSize(27) + self.tableWidgetInbox_2.horizontalHeader().setSortIndicatorShown(False) + self.tableWidgetInbox_2.horizontalHeader().setStretchLastSection(True) + self.tableWidgetInbox_2.verticalHeader().setVisible(False) + self.tableWidgetInbox_2.verticalHeader().setDefaultSectionSize(26) + self.verticalLayout_13.addWidget(self.tableWidgetInbox_2) + self.textEditInboxMessage_2 = QtGui.QTextEdit(self.tab_3) + self.textEditInboxMessage_2.setBaseSize(QtCore.QSize(0, 500)) + self.textEditInboxMessage_2.setReadOnly(True) + self.textEditInboxMessage_2.setObjectName(_fromUtf8("textEditInboxMessage_2")) + self.verticalLayout_13.addWidget(self.textEditInboxMessage_2) + self.horizontalLayout_4.addLayout(self.verticalLayout_13) + self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 1) + icon7 = QtGui.QIcon() + icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.tab_3, icon7, _fromUtf8("")) self.blackwhitelist = QtGui.QWidget() self.blackwhitelist.setObjectName(_fromUtf8("blackwhitelist")) self.gridLayout_6 = QtGui.QGridLayout(self.blackwhitelist) @@ -353,8 +401,8 @@ class Ui_MainWindow(object): self.pushButtonAddBlacklist = QtGui.QPushButton(self.blackwhitelist) self.pushButtonAddBlacklist.setObjectName(_fromUtf8("pushButtonAddBlacklist")) self.gridLayout_6.addWidget(self.pushButtonAddBlacklist, 2, 0, 1, 1) - spacerItem5 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_6.addItem(spacerItem5, 2, 1, 1, 1) + spacerItem = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_6.addItem(spacerItem, 2, 1, 1, 1) self.tableWidgetBlacklist = QtGui.QTableWidget(self.blackwhitelist) self.tableWidgetBlacklist.setAlternatingRowColors(True) self.tableWidgetBlacklist.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) @@ -373,17 +421,17 @@ class Ui_MainWindow(object): self.tableWidgetBlacklist.horizontalHeader().setStretchLastSection(True) self.tableWidgetBlacklist.verticalHeader().setVisible(False) self.gridLayout_6.addWidget(self.tableWidgetBlacklist, 3, 0, 1, 2) - icon7 = QtGui.QIcon() - icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/blacklist.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.blackwhitelist, icon7, _fromUtf8("")) + icon8 = QtGui.QIcon() + icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/blacklist.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.blackwhitelist, icon8, _fromUtf8("")) self.networkstatus = QtGui.QWidget() self.networkstatus.setObjectName(_fromUtf8("networkstatus")) self.pushButtonStatusIcon = QtGui.QPushButton(self.networkstatus) self.pushButtonStatusIcon.setGeometry(QtCore.QRect(680, 440, 21, 23)) self.pushButtonStatusIcon.setText(_fromUtf8("")) - icon8 = QtGui.QIcon() - icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/redicon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.pushButtonStatusIcon.setIcon(icon8) + icon9 = QtGui.QIcon() + icon9.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/redicon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.pushButtonStatusIcon.setIcon(icon9) self.pushButtonStatusIcon.setFlat(True) self.pushButtonStatusIcon.setObjectName(_fromUtf8("pushButtonStatusIcon")) self.tableWidgetConnectionCount = QtGui.QTableWidget(self.networkstatus) @@ -439,13 +487,13 @@ class Ui_MainWindow(object): self.labelBytesSentCount = QtGui.QLabel(self.networkstatus) self.labelBytesSentCount.setGeometry(QtCore.QRect(350, 230, 251, 16)) self.labelBytesSentCount.setObjectName(_fromUtf8("labelBytesSentCount")) - icon9 = QtGui.QIcon() - icon9.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/networkstatus.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.networkstatus, icon9, _fromUtf8("")) - self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) + icon10 = QtGui.QIcon() + icon10.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/networkstatus.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.networkstatus, icon10, _fromUtf8("")) + self.gridLayout_10.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 885, 21)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 885, 27)) self.menubar.setObjectName(_fromUtf8("menubar")) self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName(_fromUtf8("menuFile")) @@ -497,7 +545,6 @@ class Ui_MainWindow(object): self.menuFile.addAction(self.actionManageKeys) self.menuFile.addAction(self.actionDeleteAllTrashedMessages) self.menuFile.addAction(self.actionRegenerateDeterministicAddresses) - self.menuFile.addAction(self.actionJoinChan) self.menuFile.addAction(self.actionExit) self.menuSettings.addAction(self.actionSettings) self.menuHelp.addAction(self.actionHelp) @@ -508,29 +555,16 @@ class Ui_MainWindow(object): self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) - QtCore.QObject.connect(self.radioButtonSpecific, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.lineEditTo.setEnabled) - QtCore.QObject.connect(self.radioButtonSpecific, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.labelSendBroadcastWarning.hide) - QtCore.QObject.connect(self.radioButtonBroadcast, QtCore.SIGNAL(_fromUtf8("clicked()")), self.labelSendBroadcastWarning.show) + self.tabWidget_2.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) - MainWindow.setTabOrder(self.tabWidget, self.tableWidgetInbox) MainWindow.setTabOrder(self.tableWidgetInbox, self.textEditInboxMessage) - MainWindow.setTabOrder(self.textEditInboxMessage, self.radioButtonSpecific) - MainWindow.setTabOrder(self.radioButtonSpecific, self.radioButtonBroadcast) - MainWindow.setTabOrder(self.radioButtonBroadcast, self.comboBoxSendFrom) + MainWindow.setTabOrder(self.textEditInboxMessage, self.comboBoxSendFrom) MainWindow.setTabOrder(self.comboBoxSendFrom, self.lineEditTo) - MainWindow.setTabOrder(self.lineEditTo, self.pushButtonLoadFromAddressBook) - MainWindow.setTabOrder(self.pushButtonLoadFromAddressBook, self.lineEditSubject) + MainWindow.setTabOrder(self.lineEditTo, self.lineEditSubject) MainWindow.setTabOrder(self.lineEditSubject, self.textEditMessage) MainWindow.setTabOrder(self.textEditMessage, self.pushButtonSend) - MainWindow.setTabOrder(self.pushButtonSend, self.tableWidgetSent) - MainWindow.setTabOrder(self.tableWidgetSent, self.textEditSentMessage) - MainWindow.setTabOrder(self.textEditSentMessage, self.pushButtonNewAddress) - MainWindow.setTabOrder(self.pushButtonNewAddress, self.tableWidgetYourIdentities) - MainWindow.setTabOrder(self.tableWidgetYourIdentities, self.pushButtonAddSubscription) - MainWindow.setTabOrder(self.pushButtonAddSubscription, self.tableWidgetSubscriptions) - MainWindow.setTabOrder(self.tableWidgetSubscriptions, self.pushButtonAddAddressBook) - MainWindow.setTabOrder(self.pushButtonAddAddressBook, self.tableWidgetAddressBook) - MainWindow.setTabOrder(self.tableWidgetAddressBook, self.radioButtonBlacklist) + 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) @@ -538,13 +572,10 @@ class Ui_MainWindow(object): MainWindow.setTabOrder(self.tableWidgetConnectionCount, self.pushButtonStatusIcon) def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(_translate("MainWindow", "Bitmessage", None)) + MainWindow.setWindowTitle(_translate("MainWindow", "B-Mail", None)) + self.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities", None)) + self.pushButtonNewAddress.setText(_translate("MainWindow", "New Indentitiy", None)) self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None)) - self.inboxSearchOptionCB.setItemText(0, _translate("MainWindow", "All", None)) - self.inboxSearchOptionCB.setItemText(1, _translate("MainWindow", "To", None)) - self.inboxSearchOptionCB.setItemText(2, _translate("MainWindow", "From", None)) - self.inboxSearchOptionCB.setItemText(3, _translate("MainWindow", "Subject", None)) - self.inboxSearchOptionCB.setItemText(4, _translate("MainWindow", "Message", None)) self.tableWidgetInbox.setSortingEnabled(True) item = self.tableWidgetInbox.horizontalHeaderItem(0) item.setText(_translate("MainWindow", "To", None)) @@ -554,64 +585,69 @@ class Ui_MainWindow(object): item.setText(_translate("MainWindow", "Subject", None)) item = self.tableWidgetInbox.horizontalHeaderItem(3) item.setText(_translate("MainWindow", "Received", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Inbox", None)) - self.pushButtonLoadFromAddressBook.setText(_translate("MainWindow", "Load from Address book", None)) - self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID", None)) - self.label_4.setText(_translate("MainWindow", "Message:", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Received", None)) + self.tableWidgetAddressBook.setSortingEnabled(True) + item = self.tableWidgetAddressBook.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", "Name", None)) + item = self.tableWidgetAddressBook.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "Address", None)) + self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact", None)) + self.label.setText(_translate("MainWindow", "To:", None)) self.label_3.setText(_translate("MainWindow", "Subject:", None)) - self.radioButtonSpecific.setText(_translate("MainWindow", "Send to one or more specific people", None)) + self.label_2.setText(_translate("MainWindow", "From:", None)) self.textEditMessage.setHtml(_translate("MainWindow", "\n" "\n" -"


", None)) - self.label.setText(_translate("MainWindow", "To:", None)) - self.label_2.setText(_translate("MainWindow", "From:", None)) - self.radioButtonBroadcast.setText(_translate("MainWindow", "Broadcast to everyone who is subscribed to your address", None)) +"\n" +"


", None)) self.pushButtonSend.setText(_translate("MainWindow", "Send", None)) - self.labelSendBroadcastWarning.setText(_translate("MainWindow", "Be aware that broadcasts are only encrypted with your address. Anyone who knows your address can read them.", None)) + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab), _translate("MainWindow", "Send ordinary Message", None)) + self.label_8.setText(_translate("MainWindow", "From:", None)) + self.label_7.setText(_translate("MainWindow", "Subject:", None)) + self.textEditMessage_2.setHtml(_translate("MainWindow", "\n" +"\n" +"


", None)) + self.pushButtonSend_3.setText(_translate("MainWindow", "Send", None)) + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_2), _translate("MainWindow", "Send Message to your Subscribers", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)) - self.sentSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None)) - self.sentSearchOptionCB.setItemText(0, _translate("MainWindow", "All", None)) - self.sentSearchOptionCB.setItemText(1, _translate("MainWindow", "To", None)) - self.sentSearchOptionCB.setItemText(2, _translate("MainWindow", "From", None)) - self.sentSearchOptionCB.setItemText(3, _translate("MainWindow", "Subject", None)) - self.sentSearchOptionCB.setItemText(4, _translate("MainWindow", "Message", None)) - self.tableWidgetSent.setSortingEnabled(True) - item = self.tableWidgetSent.horizontalHeaderItem(0) + self.tableWidgetSubscriptions.setSortingEnabled(True) + item = self.tableWidgetSubscriptions.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", "Name", None)) + item = self.tableWidgetSubscriptions.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "Address", None)) + self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription", None)) + self.inboxSearchLineSubscriptions.setPlaceholderText(_translate("MainWindow", "Search", None)) + self.tableWidgetInboxSubscriptions.setSortingEnabled(True) + item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(0) item.setText(_translate("MainWindow", "To", None)) - item = self.tableWidgetSent.horizontalHeaderItem(1) + item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(1) item.setText(_translate("MainWindow", "From", None)) - item = self.tableWidgetSent.horizontalHeaderItem(2) + item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(2) item.setText(_translate("MainWindow", "Subject", None)) - item = self.tableWidgetSent.horizontalHeaderItem(3) - item.setText(_translate("MainWindow", "Status", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.sent), _translate("MainWindow", "Sent", None)) - self.pushButtonNewAddress.setText(_translate("MainWindow", "New", None)) + item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3) + item.setText(_translate("MainWindow", "Received", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions", None)) self.tableWidgetYourIdentities.setSortingEnabled(True) item = self.tableWidgetYourIdentities.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Label (not shown to anyone)", None)) + item.setText(_translate("MainWindow", "Name", None)) item = self.tableWidgetYourIdentities.horizontalHeaderItem(1) item.setText(_translate("MainWindow", "Address", None)) item = self.tableWidgetYourIdentities.horizontalHeaderItem(2) item.setText(_translate("MainWindow", "Stream", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.youridentities), _translate("MainWindow", "Your Identities", None)) - self.label_5.setText(_translate("MainWindow", "Here you can subscribe to \'broadcast messages\' that are sent by other users. Messages will appear in your Inbox. Addresses here override those on the Blacklist tab.", None)) - self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription", None)) - self.tableWidgetSubscriptions.setSortingEnabled(True) - item = self.tableWidgetSubscriptions.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Label", None)) - item = self.tableWidgetSubscriptions.horizontalHeaderItem(1) - item.setText(_translate("MainWindow", "Address", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions", None)) - self.label_6.setText(_translate("MainWindow", "The Address book is useful for adding names or labels to other people\'s Bitmessage addresses so that you can recognize them more easily in your inbox. You can add entries here using the \'Add\' button, or from your inbox by right-clicking on a message.", None)) - self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add new entry", None)) - self.tableWidgetAddressBook.setSortingEnabled(True) - item = self.tableWidgetAddressBook.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Name or Label", None)) - item = self.tableWidgetAddressBook.horizontalHeaderItem(1) - item.setText(_translate("MainWindow", "Address", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.addressbook), _translate("MainWindow", "Address Book", None)) + self.pushButtonAddChanel.setText(_translate("MainWindow", "Add Chanel", None)) + self.inboxSearchLineEdit_2.setPlaceholderText(_translate("MainWindow", "Search", None)) + self.tableWidgetInbox_2.setSortingEnabled(True) + item = self.tableWidgetInbox_2.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", "To", None)) + item = self.tableWidgetInbox_2.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "From", None)) + item = self.tableWidgetInbox_2.horizontalHeaderItem(2) + item.setText(_translate("MainWindow", "Subject", None)) + item = self.tableWidgetInbox_2.horizontalHeaderItem(3) + item.setText(_translate("MainWindow", "Received", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Chanels", None)) self.radioButtonBlacklist.setText(_translate("MainWindow", "Use a Blacklist (Allow all incoming messages except those on the Blacklist)", None)) self.radioButtonWhitelist.setText(_translate("MainWindow", "Use a Whitelist (Block all incoming messages except those on the Whitelist)", None)) self.pushButtonAddBlacklist.setText(_translate("MainWindow", "Add new entry", None)) @@ -650,3 +686,13 @@ class Ui_MainWindow(object): self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None)) import bitmessage_icons_rc + +if __name__ == "__main__": + import sys + app = QtGui.QApplication(sys.argv) + MainWindow = QtGui.QMainWindow() + ui = Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec_()) + diff --git a/src/bitmessageqt/bitmessageui.ui b/src/bitmessageqt/bitmessageui.ui index 58e115d7..9340f531 100644 --- a/src/bitmessageqt/bitmessageui.ui +++ b/src/bitmessageqt/bitmessageui.ui @@ -21,10 +21,7 @@ QTabWidget::Rounded - - - 0 - + @@ -65,134 +62,147 @@ :/newPrefix/images/inbox.png:/newPrefix/images/inbox.png - Inbox + Received - - - - - 0 - + + + - - - Search - - + + + + + + 200 + 16777215 + + + + + Identities + + + + :/newPrefix/images/identities.png + + + + + + + + + + 200 + 16777215 + + + + New Indentitiy + + + + - + - - All - + + + 0 + + + + + Search + + + + - - To - + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + true + + + 200 + + + false + + + 27 + + + false + + + true + + + false + + + 26 + + + + To + + + + + From + + + + + Subject + + + + + Received + + + - - From - + + + + 0 + 500 + + + + true + + - - - Subject - - - - - Message - - - + - - - - Qt::Vertical - - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectRows - - - true - - - false - - - true - - - 200 - - - false - - - 27 - - - false - - - true - - - false - - - 26 - - - - To - - - - - From - - - - - Subject - - - - - Received - - - - - - - 0 - 500 - - - - true - - - - @@ -203,396 +213,225 @@ Send - - - - - - 7 - - - - Load from Address book - - - - - - - - 7 - - - - Fetch Namecoin ID - - - - - - - Message: - - - - - - - - 300 - 0 - - - - - - - - Subject: - - - - - - - - - - - - - - Send to one or more specific people - - - true - - - - - - - - - - <!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:'MS Shell Dlg 2'; 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;"><br /></p></body></html> - - - - - - - To: - - - - - - - From: - - - - - - - Qt::Vertical - - - - 20 - 297 - - - - - - - - Broadcast to everyone who is subscribed to your address - - - - - - - - - - - - - - Qt::Horizontal - - - - 20 - 20 - - - - - - - - Send - - - - - - - true - - - - 0 - 0 - - - - Be aware that broadcasts are only encrypted with your address. Anyone who knows your address can read them. - - - -1 - - - - - - - - - :/newPrefix/images/sent.png:/newPrefix/images/sent.png - - - Sent - - - + + - - 0 - - - - Search - - + + + + + + 200 + 16777215 + + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + true + + + true + + + 200 + + + false + + + true + + + false + + + + Name + + + + :/newPrefix/images/addressbook.png + + + + + + Address + + + + + + + + + 200 + 16777215 + + + + Add Contact + + + + - - - - All - - - - - To - - - - - From - - - - - Subject - - - - - Message - - + + + 0 + + + + Send ordinary Message + + + + + + + + + + + 300 + 0 + + + + + + + + To: + + + + + + + + + + Subject: + + + + + + + From: + + + + + + + + + + + + + + + + <!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:'Droid 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 + + + + + + + + + + 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:'Droid 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 + + + + + + + - - - - Qt::Vertical - - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::DragDrop - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectRows - - - true - - - false - - - true - - - 130 - - - false - - - false - - - true - - - false - - - false - - - - To - - - - - From - - - - - Subject - - - - - Status - - - - - - true - - - - - - - - - - :/newPrefix/images/identities.png:/newPrefix/images/identities.png - - - Your Identities - - - - - - New - - - - - - - Qt::Horizontal - - - - 689 - 20 - - - - - - - - QFrame::Sunken - - - 1 - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - true - - - 346 - - - 52 - - - true - - - true - - - false - - - 26 - - - false - - - false - - - - Label (not shown to anyone) - - - - true - - - - - - Address - - - - - Stream - - - - @@ -604,161 +443,380 @@ p, li { white-space: pre-wrap; } Subscriptions - - - - Here you can subscribe to 'broadcast messages' that are sent by other users. Messages will appear in your Inbox. Addresses here override those on the Blacklist tab. - - - true - - - - - - - Add new Subscription - - - - - - - Qt::Horizontal - - - - 689 - 20 - - - - - - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - true - - - 400 - - - false - - - false - - - true - - - false - - - - Label - - - - - Address - - - + + + + + + + + + 200 + 16777215 + + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + true + + + 200 + + + false + + + false + + + true + + + false + + + + Name + + + + :/newPrefix/images/subscriptions.png + + + + + + Address + + + + + + + + + 200 + 16777215 + + + + Add new Subscription + + + + + + + + + + + Search + + + + + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + true + + + 200 + + + false + + + 27 + + + false + + + true + + + false + + + 26 + + + + To + + + + + From + + + + + Subject + + + + + Received + + + + + + + + + 0 + 500 + + + + true + + + + + + - + - :/newPrefix/images/addressbook.png:/newPrefix/images/addressbook.png + :/newPrefix/images/can-icon-16px.png:/newPrefix/images/can-icon-16px.png - Address Book + Chanels - - - - - The Address book is useful for adding names or labels to other people's Bitmessage addresses so that you can recognize them more easily in your inbox. You can add entries here using the 'Add' button, or from your inbox by right-clicking on a message. - - - true - - - - - - - Add new entry - - - - - - - Qt::Horizontal - - - - 689 - 20 - - - - - - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectRows - - - true - - - true - - - 400 - - - false - - - true - - - false - - - - Name or Label - - - - - Address - - - + + + + + + + + + + 200 + 16777215 + + + + QFrame::Sunken + + + 1 + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + true + + + 200 + + + 52 + + + true + + + true + + + false + + + 26 + + + false + + + false + + + + Name + + + + true + + + + + :/newPrefix/images/identities.png + + + + + + Address + + + + + Stream + + + + + + + + + 200 + 16777215 + + + + Add Chanel + + + + + + + + + + + 0 + + + + + Search + + + + + + + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + true + + + 200 + + + false + + + 27 + + + false + + + true + + + false + + + 26 + + + + To + + + + + From + + + + + Subject + + + + + Received + + + + + + + + + 0 + 500 + + + + true + + + + + + @@ -1081,7 +1139,7 @@ p, li { white-space: pre-wrap; } 0 0 885 - 21 + 27 @@ -1091,7 +1149,6 @@ p, li { white-space: pre-wrap; } - @@ -1218,25 +1275,14 @@ p, li { white-space: pre-wrap; } - tabWidget tableWidgetInbox textEditInboxMessage - radioButtonSpecific - radioButtonBroadcast comboBoxSendFrom lineEditTo - pushButtonLoadFromAddressBook lineEditSubject textEditMessage pushButtonSend - tableWidgetSent - textEditSentMessage - pushButtonNewAddress - tableWidgetYourIdentities pushButtonAddSubscription - tableWidgetSubscriptions - pushButtonAddAddressBook - tableWidgetAddressBook radioButtonBlacklist radioButtonWhitelist pushButtonAddBlacklist @@ -1247,54 +1293,5 @@ p, li { white-space: pre-wrap; } - - - radioButtonSpecific - toggled(bool) - lineEditTo - setEnabled(bool) - - - 121 - 60 - - - 175 - 147 - - - - - radioButtonSpecific - clicked(bool) - labelSendBroadcastWarning - hide() - - - 95 - 59 - - - 129 - 528 - - - - - radioButtonBroadcast - clicked() - labelSendBroadcastWarning - show() - - - 108 - 84 - - - 177 - 519 - - - - + From b86cf4b5cf81ec107ccbe84f4b48187bd5288df8 Mon Sep 17 00:00:00 2001 From: sbkaf Date: Thu, 19 Mar 2015 18:25:50 +0100 Subject: [PATCH 2/5] interface --- src/bitmessagemain.py | 2 +- src/bitmessageqt/__init__.py | 122 +++++++++++++++++++++++++++++-- src/bitmessageqt/bitmessageui.py | 6 +- 3 files changed, 121 insertions(+), 9 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 732c16c5..4454b031 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -202,7 +202,7 @@ class Main: singleAPIThread.daemon = True # close the main program even if there are threads left singleAPIThread.start() - connectToStream(1) + #connectToStream(1) singleListenerThread = singleListener() singleListenerThread.setup(selfInitiatedConnections) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 4596525e..d90234a7 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -555,10 +555,8 @@ class MyForm(QtGui.QMainWindow): newSubItem.setText(0, _translate("MainWindow", "trash")) # Load inbox from messages database file - self.loadInbox() - - # Load Sent items from database - self.loadSent() + #self.loadInbox() + self.loadMessagelist("BM-2cTxBr9RxjorkjvkgTkD1AgjhUJBwDnVKY"); # Initialize the address book self.rerenderAddressBook() @@ -889,6 +887,120 @@ class MyForm(QtGui.QMainWindow): self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder) self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent + # Load inbox from messages database file + def loadMessagelist(self, account, folder="inbox", where="", what=""): + what = "%" + what + "%" + if where == "To": + where = "toaddress" + elif where == "From": + where = "fromaddress" + elif where == "Subject": + where = "subject" + elif where == "Message": + where = "message" + else: + where = "toaddress || fromaddress || subject || message" + + if folder == "sent": + accountaddress = "fromaddress" + else: + accountaddress = "toaddress" + + sqlStatement = ''' + SELECT msgid, toaddress, fromaddress, subject, received, read + FROM inbox WHERE %s=? AND folder=? AND %s LIKE ? + ORDER BY received + ''' % (accounttype, where) + + while self.ui.tableWidgetInbox.rowCount() > 0: + self.ui.tableWidgetInbox.removeRow(0) + + font = QFont() + font.setBold(True) + queryreturn = sqlQuery(sqlStatement, account, folder, what) + for row in queryreturn: + msgid, toAddress, fromAddress, subject, received, read = row + subject = shared.fixPotentiallyInvalidUTF8Data(subject) + try: + if toAddress == self.str_broadcast_subscribers: + toLabel = self.str_broadcast_subscribers + else: + toLabel = shared.config.get(toAddress, 'label') + except: + toLabel = '' + if toLabel == '': + toLabel = toAddress + + fromLabel = '' + if shared.config.has_section(fromAddress): + fromLabel = shared.config.get(fromAddress, 'label') + + if fromLabel == '': # If the fromAddress isn't one of our addresses and isn't a chan + queryreturn = sqlQuery( + '''select label from addressbook where address=?''', fromAddress) + if queryreturn != []: + for row in queryreturn: + fromLabel, = row + + if fromLabel == '': # If this address wasn't in our address book... + queryreturn = sqlQuery( + '''select label from subscriptions where address=?''', fromAddress) + if queryreturn != []: + for row in queryreturn: + fromLabel, = row + if fromLabel == '': + fromLabel = fromAddress + + # message row + self.ui.tableWidgetInbox.insertRow(0) + # to + to_item = QtGui.QTableWidgetItem(unicode(toLabel, 'utf-8')) + to_item.setToolTip(unicode(toLabel, 'utf-8')) + to_item.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + if not read: + to_item.setFont(font) + to_item.setData(Qt.UserRole, str(toAddress)) + if shared.safeConfigGetBoolean(toAddress, 'mailinglist'): + to_item.setTextColor(QtGui.QColor(137, 04, 177)) # magenta + if shared.safeConfigGetBoolean(str(toAddress), 'chan'): + to_item.setTextColor(QtGui.QColor(216, 119, 0)) # orange + to_item.setIcon(avatarize(toAddress)) + self.ui.tableWidgetInbox.setItem(0, 0, to_item) + # from + from_item = QtGui.QTableWidgetItem(unicode(fromLabel, 'utf-8')) + from_item.setToolTip(unicode(fromLabel, 'utf-8')) + from_item.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + if not read: + from_item.setFont(font) + from_item.setData(Qt.UserRole, str(fromAddress)) + if shared.safeConfigGetBoolean(str(fromAddress), 'chan'): + from_item.setTextColor(QtGui.QColor(216, 119, 0)) # orange + from_item.setIcon(avatarize(fromAddress)) + self.ui.tableWidgetInbox.setItem(0, 1, from_item) + # subject + subject_item = QtGui.QTableWidgetItem(unicode(subject, 'utf-8')) + subject_item.setToolTip(unicode(subject, 'utf-8')) + subject_item.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + if not read: + subject_item.setFont(font) + self.ui.tableWidgetInbox.setItem(0, 2, subject_item) + # time received + time_item = myTableWidgetItem(l10n.formatTimestamp(received)) + time_item.setToolTip(l10n.formatTimestamp(received)) + time_item.setData(Qt.UserRole, QByteArray(msgid)) + time_item.setData(33, int(received)) + time_item.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + if not read: + time_item.setFont(font) + self.ui.tableWidgetInbox.setItem(0, 3, time_item) + + self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder) + self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent + # Load inbox from messages database file def loadInbox(self, where="", what=""): what = "%" + what + "%" @@ -3279,7 +3391,7 @@ class MyForm(QtGui.QMainWindow): else: message = "Error occurred: could not load message from disk." message = unicode(message, 'utf-8)') - self.ui.textEditSentMessage.setPlainText(message) + self.ui.textEditInboxMessage.setPlainText(message) def tableWidgetYourIdentitiesItemChanged(self): currentRow = self.ui.tableWidgetYourIdentities.currentRow() diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index f3a600f6..b4762f43 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'bmail.ui' +# Form implementation generated from reading ui file 'bitmessageui.ui' # -# Created: Sun Mar 1 23:18:09 2015 +# Created: Wed Mar 4 00:11:02 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! @@ -572,7 +572,7 @@ class Ui_MainWindow(object): MainWindow.setTabOrder(self.tableWidgetConnectionCount, self.pushButtonStatusIcon) def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(_translate("MainWindow", "B-Mail", None)) + MainWindow.setWindowTitle(_translate("MainWindow", "Bitmessage", None)) self.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities", None)) self.pushButtonNewAddress.setText(_translate("MainWindow", "New Indentitiy", None)) self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None)) From 2d5905a211442171c817f0ee38792d570a1ff370 Mon Sep 17 00:00:00 2001 From: sbkaf Date: Thu, 19 Mar 2015 18:44:10 +0100 Subject: [PATCH 3/5] merge --- src/bitmessageqt/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 3402676a..2dc0d942 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -693,7 +693,6 @@ class MyForm(QtGui.QMainWindow): else: numberOfDays = int(round(TTL / (24*60*60))) self.ui.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "%1 days").arg(numberOfDays)) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e # Show or hide the application window after clicking an item within the # tray icon or, on Windows, the try icon itself. From ee0fce8f8f26ccd081aad9d366c2d670a4191067 Mon Sep 17 00:00:00 2001 From: sbkaf Date: Sat, 21 Mar 2015 11:37:08 +0100 Subject: [PATCH 4/5] start changing QTreeWiget --- src/bitmessageqt/__init__.py | 726 +++++++++++++++++++++---------- src/bitmessageqt/bitmessageui.py | 536 +++++++---------------- src/bitmessageqt/bitmessageui.ui | 600 ++++++++++++------------- 3 files changed, 929 insertions(+), 933 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 2dc0d942..acee89e4 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -214,8 +214,8 @@ class MyForm(QtGui.QMainWindow): "clicked()"), self.click_pushButtonTTL) 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.pushButtonFetchNamecoinID, QtCore.SIGNAL( + "clicked()"), self.click_pushButtonFetchNamecoinID) QtCore.QObject.connect(self.ui.radioButtonBlacklist, QtCore.SIGNAL( "clicked()"), self.click_radioButtonBlacklist) QtCore.QObject.connect(self.ui.radioButtonWhitelist, QtCore.SIGNAL( @@ -271,35 +271,77 @@ class MyForm(QtGui.QMainWindow): def init_identities_popup_menu(self, connectSignal=True): # Popup menu for the Your Identities tab + self.ui.addressContextMenuToolbarYourIdentities = QtGui.QToolBar() + # Actions + self.actionNewYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction(_translate( + "MainWindow", "New"), self.on_action_YourIdentitiesNew) + self.actionEnableYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction( + _translate( + "MainWindow", "Enable"), self.on_action_Enable) + self.actionDisableYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction( + _translate( + "MainWindow", "Disable"), self.on_action_Disable) + self.actionSetAvatarYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction( + _translate( + "MainWindow", "Set avatar..."), + self.on_action_TreeWidgetSetAvatar) + self.actionClipboardYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction( + _translate( + "MainWindow", "Copy address to clipboard"), + self.on_action_Clipboard) + self.actionSpecialAddressBehaviorYourIdentities = self.ui.addressContextMenuToolbarYourIdentities.addAction( + _translate( + "MainWindow", "Special address behavior..."), + self.on_action_SpecialAddressBehaviorDialog) + + self.ui.treeWidgetYourIdentities.setContextMenuPolicy( + QtCore.Qt.CustomContextMenu) + if connectSignal: + self.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL( + 'customContextMenuRequested(const QPoint&)'), + self.on_context_menuYourIdentities) + + self.popMenuYourIdentities = QtGui.QMenu(self) + self.popMenuYourIdentities.addAction(self.actionNewYourIdentities) + self.popMenuYourIdentities.addSeparator() + self.popMenuYourIdentities.addAction(self.actionClipboardYourIdentities) + self.popMenuYourIdentities.addSeparator() + self.popMenuYourIdentities.addAction(self.actionEnableYourIdentities) + self.popMenuYourIdentities.addAction(self.actionDisableYourIdentities) + self.popMenuYourIdentities.addAction(self.actionSetAvatarYourIdentities) + self.popMenuYourIdentities.addAction(self.actionSpecialAddressBehaviorYourIdentities) + + def init_chan_popup_menu(self, connectSignal=True): + # Popup menu for the Chanels tab self.ui.addressContextMenuToolbar = QtGui.QToolBar() # Actions self.actionNew = self.ui.addressContextMenuToolbar.addAction(_translate( "MainWindow", "New"), self.on_action_YourIdentitiesNew) self.actionEnable = self.ui.addressContextMenuToolbar.addAction( _translate( - "MainWindow", "Enable"), self.on_action_YourIdentitiesEnable) + "MainWindow", "Enable"), self.on_action_Enable) self.actionDisable = self.ui.addressContextMenuToolbar.addAction( _translate( - "MainWindow", "Disable"), self.on_action_YourIdentitiesDisable) + "MainWindow", "Disable"), self.on_action_Disable) self.actionSetAvatar = self.ui.addressContextMenuToolbar.addAction( _translate( "MainWindow", "Set avatar..."), - self.on_action_YourIdentitiesSetAvatar) + self.on_action_TreeWidgetSetAvatar) self.actionClipboard = self.ui.addressContextMenuToolbar.addAction( _translate( "MainWindow", "Copy address to clipboard"), - self.on_action_YourIdentitiesClipboard) + self.on_action_Clipboard) self.actionSpecialAddressBehavior = self.ui.addressContextMenuToolbar.addAction( _translate( "MainWindow", "Special address behavior..."), self.on_action_SpecialAddressBehaviorDialog) - self.ui.tableWidgetYourIdentities.setContextMenuPolicy( + self.ui.treeWidgetChanList.setContextMenuPolicy( QtCore.Qt.CustomContextMenu) if connectSignal: - self.connect(self.ui.tableWidgetYourIdentities, QtCore.SIGNAL( + self.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( 'customContextMenuRequested(const QPoint&)'), - self.on_context_menuYourIdentities) + self.on_context_menuChan) self.popMenu = QtGui.QMenu(self) self.popMenu.addAction(self.actionNew) @@ -372,11 +414,11 @@ class MyForm(QtGui.QMainWindow): self.on_action_SubscriptionsDisable) self.actionsubscriptionsSetAvatar = self.ui.subscriptionsContextMenuToolbar.addAction( _translate("MainWindow", "Set avatar..."), - self.on_action_SubscriptionsSetAvatar) - self.ui.tableWidgetSubscriptions.setContextMenuPolicy( + self.on_action_TreeWidgetSetAvatar) + self.ui.treeWidgetSubscriptions.setContextMenuPolicy( QtCore.Qt.CustomContextMenu) if connectSignal: - self.connect(self.ui.tableWidgetSubscriptions, QtCore.SIGNAL( + self.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( 'customContextMenuRequested(const QPoint&)'), self.on_context_menuSubscriptions) self.popMenuSubscriptions = QtGui.QMenu(self) @@ -447,6 +489,58 @@ class MyForm(QtGui.QMainWindow): self.popMenuBlacklist.addAction(self.actionBlacklistDisable) self.popMenuBlacklist.addAction(self.actionBlacklistSetAvatar) + def rerenderTabTree(self, tab): + if tab == 'messages': + treeWidget = self.ui.treeWidgetYourIdentities + folders = ['inbox', 'sent', 'trash'] + elif tab == 'subscriptions': + treeWidget = self.ui.treeWidgetSubscriptions + folders = ['inbox', 'trash'] + elif tab == 'chan': + treeWidget = self.ui.treeWidgetChanList + folders = ['inbox', 'sent', 'trash'] + + treeWidget.clear() + + configSections = shared.config.sections() + for addressInKeysFile in configSections: + if addressInKeysFile != 'bitmessagesettings': + isEnabled = shared.config.getboolean( + addressInKeysFile, 'enabled') + isChan = shared.safeConfigGetBoolean( + addressInKeysFile, 'chan') + isMaillinglist = shared.safeConfigGetBoolean( + addressInKeysFile, 'mailinglist') + + if tab == 'messages': + if isChan or isMaillinglist: + continue + elif tab == 'subscriptions': + if not isMaillinglist: + continue + elif tab == 'chan': + if not isChan: + continue + + newItem = QtGui.QTreeWidgetItem(treeWidget) + newItem.setIcon(0, avatarize(addressInKeysFile)) + newItem.setText(0, unicode( + shared.config.get(addressInKeysFile, 'label'), 'utf-8)') + + ' (' + addressInKeysFile + ')') + newItem.setData(0, Qt.UserRole, [str(addressInKeysFile), "inbox"]) + #set text color + if isEnabled: + brush = QtGui.QBrush(QApplication.palette().text().color()) + else: + brush = QtGui.QBrush(QtGui.QColor(128, 128, 128)) + brush.setStyle(QtCore.Qt.NoBrush) + newItem.setForeground(0, brush) + + for folder in folders: + newSubItem = QtGui.QTreeWidgetItem(newItem) + newSubItem.setText(0, _translate("MainWindow", folder)) + newSubItem.setData(0, Qt.UserRole, [str(addressInKeysFile), folder]) + def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() @@ -499,66 +593,61 @@ class MyForm(QtGui.QMainWindow): 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() self.init_blacklist_popup_menu() - # Initialize the user's list of addresses on the 'Your Identities' table. + # Initialize the user's list of addresses on the 'Chan' tab. + self.rerenderTabTree('chan') + """ + TODO remove configSections = shared.config.sections() for addressInKeysFile in configSections: if addressInKeysFile != 'bitmessagesettings': isEnabled = shared.config.getboolean( addressInKeysFile, 'enabled') - newItem = QtGui.QTableWidgetItem(unicode( - shared.config.get(addressInKeysFile, 'label'), 'utf-8)')) - if not isEnabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetYourIdentities.insertRow(0) - newItem.setIcon(avatarize(addressInKeysFile)) - self.ui.tableWidgetYourIdentities.setItem(0, 0, newItem) - newItem = QtGui.QTableWidgetItem(addressInKeysFile) - newItem.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) if shared.safeConfigGetBoolean(addressInKeysFile, 'chan'): - newItem.setTextColor(QtGui.QColor(216, 119, 0)) # orange - if not isEnabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - if shared.safeConfigGetBoolean(addressInKeysFile, 'mailinglist'): - newItem.setTextColor(QtGui.QColor(137, 04, 177)) # magenta - self.ui.tableWidgetYourIdentities.setItem(0, 1, newItem) - newItem = QtGui.QTableWidgetItem(str( - decodeAddress(addressInKeysFile)[2])) - newItem.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if not isEnabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetYourIdentities.setItem(0, 2, newItem) - if isEnabled: - status, addressVersionNumber, streamNumber, hash = decodeAddress( - addressInKeysFile) + newItem = QtGui.QTableWidgetItem(unicode( + shared.config.get(addressInKeysFile, 'label'), 'utf-8)')) + if not isEnabled: + newItem.setTextColor(QtGui.QColor(128, 128, 128)) + self.ui.tableWidgetChanList.insertRow(0) + newItem.setIcon(avatarize(addressInKeysFile)) + self.ui.tableWidgetChanList.setItem(0, 0, newItem) + newItem = QtGui.QTableWidgetItem(addressInKeysFile) + newItem.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + if shared.safeConfigGetBoolean(addressInKeysFile, 'chan'): + newItem.setTextColor(QtGui.QColor(216, 119, 0)) # orange + if not isEnabled: + newItem.setTextColor(QtGui.QColor(128, 128, 128)) + if shared.safeConfigGetBoolean(addressInKeysFile, 'mailinglist'): + newItem.setTextColor(QtGui.QColor(137, 04, 177)) # magenta + self.ui.tableWidgetChanList.setItem(0, 1, newItem) + newItem = QtGui.QTableWidgetItem(str( + decodeAddress(addressInKeysFile)[2])) + newItem.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + if not isEnabled: + newItem.setTextColor(QtGui.QColor(128, 128, 128)) + self.ui.tableWidgetChanList.setItem(0, 2, newItem) + if isEnabled: + status, addressVersionNumber, streamNumber, hash = decodeAddress( + addressInKeysFile) + """ - # Initialize the user's list of addresses on the 'Received' tab. - configSections = shared.config.sections() - for addressInKeysFile in configSections: - if addressInKeysFile != 'bitmessagesettings': - isEnabled = shared.config.getboolean( - addressInKeysFile, 'enabled') + # Initialize the user's list of addresses on the 'Messages' tab. + self.rerenderTabTree('messages') - if isEnabled and not shared.safeConfigGetBoolean(addressInKeysFile, 'chan') and not shared.safeConfigGetBoolean(addressInKeysFile, 'mailinglist'): - newItem = QtGui.QTreeWidgetItem(self.ui.treeWidgetYourIdentities) - newItem.setIcon(0, avatarize(addressInKeysFile)) - newItem.setText(0, unicode( - shared.config.get(addressInKeysFile, 'label'), 'utf-8)') - + ' (' + addressInKeysFile + ')') - newSubItem = QtGui.QTreeWidgetItem(newItem) - newSubItem.setText(0, _translate("MainWindow", "inbox")) - newSubItem = QtGui.QTreeWidgetItem(newItem) - newSubItem.setText(0, _translate("MainWindow", "sent")) - newSubItem = QtGui.QTreeWidgetItem(newItem) - newSubItem.setText(0, _translate("MainWindow", "trash")) - - # Load inbox from messages database file - #self.loadInbox() - self.loadMessagelist("BM-2cTxBr9RxjorkjvkgTkD1AgjhUJBwDnVKY"); + # Set welcome message + self.ui.textEditInboxMessage.setText( + """ + Welcome to easy and secure Bitmessage + * send messages like e-mails + * send broadcast messages like twitter or + * discuss in chan(el)s with other people + """ + ) # Initialize the address book self.rerenderAddressBook() @@ -576,14 +665,24 @@ class MyForm(QtGui.QMainWindow): self.ui.radioButtonWhitelist.click() self.rerenderBlackWhiteList() - QtCore.QObject.connect(self.ui.tableWidgetYourIdentities, QtCore.SIGNAL( - "itemChanged(QTableWidgetItem *)"), self.tableWidgetYourIdentitiesItemChanged) + # Initialize addresslists QtCore.QObject.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL( "itemChanged(QTableWidgetItem *)"), self.tableWidgetAddressBookItemChanged) - QtCore.QObject.connect(self.ui.tableWidgetSubscriptions, QtCore.SIGNAL( - "itemChanged(QTableWidgetItem *)"), self.tableWidgetSubscriptionsItemChanged) + """ + TODO implement + QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( + "itemChanged(QTableWidgetItem *)"), self.treeWidgetSubscriptionsItemChanged) + QtCore.QObject.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( + "itemChanged(QTableWidgetItem *)"), self.treeWidgetChanListItemChanged) + """ QtCore.QObject.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL( "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) + QtCore.QObject.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL( + "itemSelectionChanged ()"), self.treeWidgetYourIdentitiesItemClicked) + QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( + "itemSelectionChanged ()"), self.treeWidgetSubscribtionsItemClicked) + QtCore.QObject.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( + "itemSelectionChanged ()"), self.treeWidgetChanListItemClicked) # Put the colored icon on the status bar # self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png")) @@ -598,9 +697,9 @@ class MyForm(QtGui.QMainWindow): # Set the icon sizes for the identicons identicon_size = 3*7 self.ui.tableWidgetInbox.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.ui.tableWidgetYourIdentities.setIconSize(QtCore.QSize(identicon_size, identicon_size)) + self.ui.treeWidgetChanList.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.treeWidgetYourIdentities.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.ui.tableWidgetSubscriptions.setIconSize(QtCore.QSize(identicon_size, identicon_size)) + self.ui.treeWidgetSubscriptions.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.tableWidgetAddressBook.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.tableWidgetBlacklist.setIconSize(QtCore.QSize(identicon_size, identicon_size)) @@ -649,6 +748,7 @@ class MyForm(QtGui.QMainWindow): # structures were initialized. self.rerenderComboBoxSendFrom() + self.rerenderComboBoxSendFromBroadcast() # Put the TTL slider in the correct spot TTL = shared.config.getint('bitmessagesettings', 'ttl') @@ -671,11 +771,11 @@ class MyForm(QtGui.QMainWindow): options["user"] = shared.config.get('bitmessagesettings', 'namecoinrpcuser') options["password"] = shared.config.get('bitmessagesettings', 'namecoinrpcpassword') nc = namecoinConnection(options) - #if nc.test()[0] == 'failed': - #self.ui.pushButtonFetchNamecoinID.hide() + if nc.test()[0] == 'failed': + self.ui.pushButtonFetchNamecoinID.hide() except: print 'There was a problem testing for a Namecoin daemon. Hiding the Fetch Namecoin ID button' - #self.ui.pushButtonFetchNamecoinID.hide() + self.ui.pushButtonFetchNamecoinID.hide() def updateTTL(self, sliderPosition): TTL = int(sliderPosition ** 3.199 + 3600) @@ -918,7 +1018,7 @@ class MyForm(QtGui.QMainWindow): self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent # Load inbox from messages database file - def loadMessagelist(self, account, folder="inbox", where="", what=""): + def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what=""): what = "%" + what + "%" if where == "To": where = "toaddress" @@ -932,9 +1032,9 @@ class MyForm(QtGui.QMainWindow): where = "toaddress || fromaddress || subject || message" if folder == "sent": - accountaddress = "fromaddress" + accounttype = "fromaddress" else: - accountaddress = "toaddress" + accounttype = "toaddress" sqlStatement = ''' SELECT msgid, toaddress, fromaddress, subject, received, read @@ -942,8 +1042,8 @@ class MyForm(QtGui.QMainWindow): ORDER BY received ''' % (accounttype, where) - while self.ui.tableWidgetInbox.rowCount() > 0: - self.ui.tableWidgetInbox.removeRow(0) + while tableWidget.rowCount() > 0: + tableWidget.removeRow(0) font = QFont() font.setBold(True) @@ -982,7 +1082,7 @@ class MyForm(QtGui.QMainWindow): fromLabel = fromAddress # message row - self.ui.tableWidgetInbox.insertRow(0) + tableWidget.insertRow(0) # to to_item = QtGui.QTableWidgetItem(unicode(toLabel, 'utf-8')) to_item.setToolTip(unicode(toLabel, 'utf-8')) @@ -996,7 +1096,7 @@ class MyForm(QtGui.QMainWindow): if shared.safeConfigGetBoolean(str(toAddress), 'chan'): to_item.setTextColor(QtGui.QColor(216, 119, 0)) # orange to_item.setIcon(avatarize(toAddress)) - self.ui.tableWidgetInbox.setItem(0, 0, to_item) + tableWidget.setItem(0, 0, to_item) # from from_item = QtGui.QTableWidgetItem(unicode(fromLabel, 'utf-8')) from_item.setToolTip(unicode(fromLabel, 'utf-8')) @@ -1008,7 +1108,7 @@ class MyForm(QtGui.QMainWindow): if shared.safeConfigGetBoolean(str(fromAddress), 'chan'): from_item.setTextColor(QtGui.QColor(216, 119, 0)) # orange from_item.setIcon(avatarize(fromAddress)) - self.ui.tableWidgetInbox.setItem(0, 1, from_item) + tableWidget.setItem(0, 1, from_item) # subject subject_item = QtGui.QTableWidgetItem(unicode(subject, 'utf-8')) subject_item.setToolTip(unicode(subject, 'utf-8')) @@ -1016,7 +1116,7 @@ class MyForm(QtGui.QMainWindow): QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) if not read: subject_item.setFont(font) - self.ui.tableWidgetInbox.setItem(0, 2, subject_item) + tableWidget.setItem(0, 2, subject_item) # time received time_item = myTableWidgetItem(l10n.formatTimestamp(received)) time_item.setToolTip(l10n.formatTimestamp(received)) @@ -1026,10 +1126,10 @@ class MyForm(QtGui.QMainWindow): QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) if not read: time_item.setFont(font) - self.ui.tableWidgetInbox.setItem(0, 3, time_item) + tableWidget.setItem(0, 3, time_item) - self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder) - self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent + tableWidget.sortItems(3, Qt.DescendingOrder) + tableWidget.keyPressEvent = self.tableWidgetInboxKeyPressEvent # Load inbox from messages database file def loadInbox(self, where="", what=""): @@ -1586,7 +1686,7 @@ class MyForm(QtGui.QMainWindow): if event.type() == QtCore.QEvent.LanguageChange: self.ui.retranslateUi(self) self.init_inbox_popup_menu(False) - self.init_identities_popup_menu(False) + self.init_chan_popup_menu(False) self.init_addressbook_popup_menu(False) self.init_subscriptions_popup_menu(False) self.init_sent_popup_menu(False) @@ -1970,6 +2070,9 @@ class MyForm(QtGui.QMainWindow): self.ui.tableWidgetAddressBook.setItem(0, 1, newItem) def rerenderSubscriptions(self): + self.rerenderTabTree('subscriptions') + """ + TODO remove self.ui.tableWidgetSubscriptions.setRowCount(0) queryreturn = sqlQuery('SELECT label, address, enabled FROM subscriptions') for row in queryreturn: @@ -1986,6 +2089,7 @@ class MyForm(QtGui.QMainWindow): if not enabled: newItem.setTextColor(QtGui.QColor(128, 128, 128)) self.ui.tableWidgetSubscriptions.setItem(0, 1, newItem) + """ def rerenderBlackWhiteList(self): self.ui.tableWidgetBlacklist.setRowCount(0) @@ -2018,10 +2122,18 @@ more work your computer must do to send the message. A Time-To-Live of four or f def click_pushButtonSend(self): self.statusBar().showMessage('') - toAddresses = str(self.ui.lineEditTo.text()) - subject = str(self.ui.lineEditSubject.text().toUtf8()) - message = str( - self.ui.textEditMessage.document().toPlainText().toUtf8()) + + if self.ui.tabWidgetSend.currentIndex() == 0: + sendMessageToPeople = True + toAddresses = str(self.ui.lineEditTo.text()) + subject = str(self.ui.lineEditSubject.text().toUtf8()) + message = str( + self.ui.textEditMessage.document().toPlainText().toUtf8()) + else: + sendMessageToPeople = False + subject = str(self.ui.lineEditSubjectBroadcast.text().toUtf8()) + message = str( + self.ui.textEditMessageBroadcast.document().toPlainText().toUtf8()) """ The whole network message must fit in 2^18 bytes. Let's assume 500 bytes of overhead. If someone wants to get that too an exact @@ -2033,7 +2145,13 @@ more work your computer must do to send the message. A Time-To-Live of four or f QMessageBox.about(self, _translate("MainWindow", "Message too long"), _translate( "MainWindow", "The message that you are trying to send is too long by %1 bytes. (The maximum is 261644 bytes). Please cut it down before sending.").arg(len(message) - (2 ** 18 - 500))) return - if self.ui.radioButtonSpecific.isChecked(): # To send a message to specific people (rather than broadcast) + + if toAddresses: + print toAddresses + print subject + print message + return + if sendMessageToPeople: # To send a message to specific people (rather than broadcast) toAddressesList = [s.strip() for s in toAddresses.replace(',', ';').split(';')] toAddressesList = list(set( @@ -2166,11 +2284,10 @@ more work your computer must do to send the message. A Time-To-Live of four or f shared.workerQueue.put(('sendbroadcast', '')) - self.ui.comboBoxSendFrom.setCurrentIndex(0) - self.ui.lineEditTo.setText('') - self.ui.lineEditSubject.setText('') - self.ui.textEditMessage.setText('') - self.ui.tabWidget.setCurrentIndex(2) + self.ui.comboBoxSendFromBroadcast.setCurrentIndex(0) + self.ui.lineEditSubjectBroadcast.setText('') + self.ui.textEditMessageBroadcast.setText('') + self.ui.tabWidget.setCurrentIndex(1) self.ui.tableWidgetInbox.setCurrentCell(0, 0) def click_pushButtonLoadFromAddressBook(self): @@ -2197,10 +2314,9 @@ more work your computer must do to send the message. A Time-To-Live of four or f # If this is a chan then don't let people broadcast because no one # should subscribe to chan addresses. if shared.safeConfigGetBoolean(str(address), 'chan'): - self.ui.radioButtonSpecific.click() - self.ui.radioButtonBroadcast.setEnabled(False) + self.ui.tabWidgetSend.setCurrentIndex(0) else: - self.ui.radioButtonBroadcast.setEnabled(True) + self.ui.tabWidgetSend.setCurrentIndex(1) def rerenderComboBoxSendFrom(self): self.ui.comboBoxSendFrom.clear() @@ -2209,7 +2325,8 @@ more work your computer must do to send the message. A Time-To-Live of four or f if addressInKeysFile != 'bitmessagesettings': isEnabled = shared.config.getboolean( addressInKeysFile, 'enabled') # I realize that this is poor programming practice but I don't care. It's easier for others to read. - if isEnabled: + isMaillinglist = shared.safeConfigGetBoolean(addressInKeysFile, 'mailinglist') + if isEnabled and not isMaillinglist: self.ui.comboBoxSendFrom.insertItem(0, avatarize(addressInKeysFile), unicode(shared.config.get( addressInKeysFile, 'label'), 'utf-8'), addressInKeysFile) self.ui.comboBoxSendFrom.insertItem(0, '', '') @@ -2218,6 +2335,23 @@ more work your computer must do to send the message. A Time-To-Live of four or f else: self.ui.comboBoxSendFrom.setCurrentIndex(0) + def rerenderComboBoxSendFromBroadcast(self): + self.ui.comboBoxSendFromBroadcast.clear() + configSections = shared.config.sections() + for addressInKeysFile in configSections: + if addressInKeysFile != 'bitmessagesettings': + isEnabled = shared.config.getboolean( + addressInKeysFile, 'enabled') # I realize that this is poor programming practice but I don't care. It's easier for others to read. + isMaillinglist = shared.safeConfigGetBoolean(addressInKeysFile, 'mailinglist') + if isEnabled and isMaillinglist: + self.ui.comboBoxSendFromBroadcast.insertItem(0, avatarize(addressInKeysFile), unicode(shared.config.get( + addressInKeysFile, 'label'), 'utf-8'), addressInKeysFile) + self.ui.comboBoxSendFromBroadcast.insertItem(0, '', '') + if(self.ui.comboBoxSendFromBroadcast.count() == 2): + self.ui.comboBoxSendFromBroadcast.setCurrentIndex(1) + else: + self.ui.comboBoxSendFromBroadcast.setCurrentIndex(0) + # This function is called by the processmsg function when that function # receives a message to an address that is acting as a # pseudo-mailing-list. The message will be broadcast out. This function @@ -2376,7 +2510,9 @@ more work your computer must do to send the message. A Time-To-Live of four or f #This should be handled outside of this function, for error displaying and such, but it must also be checked here. if shared.isAddressInMySubscriptionsList(address): return + """ #Add to UI list + TODO remove self.ui.tableWidgetSubscriptions.setSortingEnabled(False) self.ui.tableWidgetSubscriptions.insertRow(0) newItem = QtGui.QTableWidgetItem(unicode(label, 'utf-8')) @@ -2386,10 +2522,13 @@ more work your computer must do to send the message. A Time-To-Live of four or f newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled ) self.ui.tableWidgetSubscriptions.setItem(0,1,newItem) self.ui.tableWidgetSubscriptions.setSortingEnabled(True) + """ #Add to database (perhaps this should be separated from the MyForm class) sqlExecute('''INSERT INTO subscriptions VALUES (?,?,?)''',str(label),address,True) self.rerenderInboxFromLabels() shared.reloadBroadcastSendersForWhichImWatching() + + self.rerenderTabTree('subscriptions') def click_pushButtonAddSubscription(self): self.NewSubscriptionDialogInstance = NewSubscriptionDialog(self) @@ -2400,7 +2539,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f address = addBMIfNotPresent(str(self.NewSubscriptionDialogInstance.ui.lineEditSubscriptionAddress.text())) # We must check to see if the address is already in the subscriptions list. The user cannot add it again or else it will cause problems when updating and deleting the entry. if shared.isAddressInMySubscriptionsList(address): - self.statusBar().showMessage(_translate("MainWindow", "Error: You cannot add the same address to your subsciptions twice. Perhaps rename the existing one if you want.")) + self.statusBar().showMessage(_translate("MainWindow", "Error: You cannot add the same address to your subscriptions twice. Perhaps rename the existing one if you want.")) return label = self.NewSubscriptionDialogInstance.ui.newsubscriptionlabel.text().toUtf8() self.addSubscription(address, label) @@ -2700,9 +2839,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.dialog = SpecialAddressBehaviorDialog(self) # For Modal dialogs if self.dialog.exec_(): - currentRow = self.ui.tableWidgetYourIdentities.currentRow() - addressAtCurrentRow = str( - self.ui.tableWidgetYourIdentities.item(currentRow, 1).text()) + addressAtCurrentRow = self.getCurrentAccount() if shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): return if self.dialog.ui.radioButtonBehaveNormalAddress.isChecked(): @@ -2710,20 +2847,50 @@ more work your computer must do to send the message. A Time-To-Live of four or f addressAtCurrentRow), 'mailinglist', 'false') # Set the color to either black or grey if shared.config.getboolean(addressAtCurrentRow, 'enabled'): - self.ui.tableWidgetYourIdentities.item( + self.setCurrentItemColor(QApplication.palette() + .text().color()) + else: + self.setCurrentItemColor(QtGui.QColor(128, 128, 128)) + else: + shared.config.set(str( + addressAtCurrentRow), 'mailinglist', 'true') + shared.config.set(str(addressAtCurrentRow), 'mailinglistname', str( + self.dialog.ui.lineEditMailingListName.text().toUtf8())) + self.setCurrentItemColor(QtGui.QColor(137, 04, 177)) #magenta + shared.writeKeysFile() + self.rerenderInboxToLabels() + + """ + TODO remove + def on_action_ChanSpecialAddressBehaviorDialog(self): + self.dialog = SpecialAddressBehaviorDialog(self) + # For Modal dialogs + if self.dialog.exec_(): + currentRow = self.ui.tableWidgetChanList.currentRow() + addressAtCurrentRow = str( + self.ui.tableWidgetChanList.item(currentRow, 1).text()) + if shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): + return + if self.dialog.ui.radioButtonBehaveNormalAddress.isChecked(): + shared.config.set(str( + addressAtCurrentRow), 'mailinglist', 'false') + # Set the color to either black or grey + if shared.config.getboolean(addressAtCurrentRow, 'enabled'): + self.ui.tableWidgetChanList.item( currentRow, 1).setTextColor(QApplication.palette() .text().color()) else: - self.ui.tableWidgetYourIdentities.item( + self.ui.tableWidgetChanList.item( currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128)) else: shared.config.set(str( addressAtCurrentRow), 'mailinglist', 'true') shared.config.set(str(addressAtCurrentRow), 'mailinglistname', str( self.dialog.ui.lineEditMailingListName.text().toUtf8())) - self.ui.tableWidgetYourIdentities.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177)) # magenta + self.ui.tableWidgetChanList.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177)) # magenta shared.writeKeysFile() self.rerenderInboxToLabels() + """ def click_NewAddressDialog(self): self.dialog = NewAddressDialog(self) @@ -2910,7 +3077,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f else: self.ui.lineEditSubject.setText( 'Re: ' + self.ui.tableWidgetInbox.item(currentInboxRow, 2).text()) - self.ui.radioButtonSpecific.setChecked(True) + self.ui.tabWidgetSend.setCurrentIndex(0) self.ui.tabWidget.setCurrentIndex(1) def on_action_InboxAddSenderToAddressBook(self): @@ -3086,7 +3253,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f addressAtCurrentRow = str(self.ui.tableWidgetAddressBook.item(currentRow,1).text()) # Then subscribe to it... provided it's not already in the address book if shared.isAddressInMySubscriptionsList(addressAtCurrentRow): - self.statusBar().showMessage(QtGui.QApplication.translate("MainWindow", "Error: You cannot add the same address to your subsciptions twice. Perhaps rename the existing one if you want.")) + self.statusBar().showMessage(QtGui.QApplication.translate("MainWindow", "Error: You cannot add the same address to your subscriptions twice. Perhaps rename the existing one if you want.")) continue labelAtCurrentRow = self.ui.tableWidgetAddressBook.item(currentRow,0).text().toUtf8() self.addSubscription(addressAtCurrentRow, labelAtCurrentRow) @@ -3102,6 +3269,8 @@ more work your computer must do to send the message. A Time-To-Live of four or f def on_action_SubscriptionsDelete(self): print 'clicked Delete' + """ + TODO implement currentRow = self.ui.tableWidgetSubscriptions.currentRow() labelAtCurrentRow = self.ui.tableWidgetSubscriptions.item( currentRow, 0).text().toUtf8() @@ -3112,15 +3281,21 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.ui.tableWidgetSubscriptions.removeRow(currentRow) self.rerenderInboxFromLabels() shared.reloadBroadcastSendersForWhichImWatching() + """ def on_action_SubscriptionsClipboard(self): + """ + TODO implement currentRow = self.ui.tableWidgetSubscriptions.currentRow() addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item( currentRow, 1).text() clipboard = QtGui.QApplication.clipboard() clipboard.setText(str(addressAtCurrentRow)) + """ def on_action_SubscriptionsEnable(self): + """ + TODO implement currentRow = self.ui.tableWidgetSubscriptions.currentRow() labelAtCurrentRow = self.ui.tableWidgetSubscriptions.item( currentRow, 0).text().toUtf8() @@ -3134,8 +3309,11 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.ui.tableWidgetSubscriptions.item( currentRow, 1).setTextColor(QApplication.palette().text().color()) shared.reloadBroadcastSendersForWhichImWatching() + """ def on_action_SubscriptionsDisable(self): + """ + TODO implement currentRow = self.ui.tableWidgetSubscriptions.currentRow() labelAtCurrentRow = self.ui.tableWidgetSubscriptions.item( currentRow, 0).text().toUtf8() @@ -3149,10 +3327,14 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.ui.tableWidgetSubscriptions.item( currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128)) shared.reloadBroadcastSendersForWhichImWatching() + """ def on_context_menuSubscriptions(self, point): + """ + TODO implement self.popMenuSubscriptions.exec_( self.ui.tableWidgetSubscriptions.mapToGlobal(point)) + """ # Group of functions for the Blacklist dialog box def on_action_BlacklistNew(self): @@ -3217,70 +3399,151 @@ more work your computer must do to send the message. A Time-To-Live of four or f sqlExecute( '''UPDATE whitelist SET enabled=0 WHERE address=?''', str(addressAtCurrentRow)) + def getCurrentTreeWidget(self): + currentIndex = self.ui.tabWidget.currentIndex(); + treeWidgetList = [ + self.ui.treeWidgetYourIdentities, + False, + self.ui.treeWidgetSubscriptions, + self.ui.treeWidgetChans + ] + if currentIndex >= 0 and currentIndex < len(treeWidgetList): + return treeWidgetList[currentIndex] + else: + return False + # Group of functions for the Your Identities dialog box + def getCurrentAccount(self): + treeWidget = self.getCurrentTreeWidget() + if treeWidget: + currentItem = treeWidget.currentItem() + if currentItem: + accountFolder = currentItem.data(0, Qt.UserRole).toPyObject() + account = accountFolder[0] + return str(account) + else: + # TODO need debug msg? + return False + + def getCurrentFolder(self): + treeWidget = self.getCurrentTreeWidget() + if treeWidget: + currentItem = treeWidget.currentItem() + if currentItem: + accountFolder = currentItem.data(0, Qt.UserRole).toPyObject() + folder = accountFolder[1] + return str(folder) + else: + # TODO need debug msg? + return False + + def setCurrentItemColor(self, color): + treeWidget = self.getCurrentTreeWidget() + if treeWidget: + brush = QtGui.QBrush() + brush.setStyle(QtCore.Qt.NoBrush) + currentItem = treeWidget.currentItem() + currentItem.setForeground(0, brush) + def on_action_YourIdentitiesNew(self): self.click_NewAddressDialog() - def on_action_YourIdentitiesEnable(self): - currentRow = self.ui.tableWidgetYourIdentities.currentRow() + def on_action_Enable(self): + addressAtCurrentRow = self.getCurrentAccount() + self.enableIdentity(addressAtCurrentRow) + self.setCurrentItemColor(QApplication.palette().text().color()) + + """ + TODO remove + def on_action_ChanEnable(self): + currentRow = self.ui.tableWidgetChanList.currentRow() addressAtCurrentRow = str( - self.ui.tableWidgetYourIdentities.item(currentRow, 1).text()) - shared.config.set(addressAtCurrentRow, 'enabled', 'true') - shared.writeKeysFile() - self.ui.tableWidgetYourIdentities.item( + self.ui.tableWidgetChanList.item(currentRow, 1).text()) + self.ui.tableWidgetChanList.item( currentRow, 0).setTextColor(QApplication.palette().text().color()) - self.ui.tableWidgetYourIdentities.item( + self.ui.tableWidgetChanList.item( currentRow, 1).setTextColor(QApplication.palette().text().color()) - self.ui.tableWidgetYourIdentities.item( + self.ui.tableWidgetChanList.item( currentRow, 2).setTextColor(QApplication.palette().text().color()) if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'): - self.ui.tableWidgetYourIdentities.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177)) # magenta + self.ui.tableWidgetChanList.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177)) # magenta if shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): - self.ui.tableWidgetYourIdentities.item(currentRow, 1).setTextColor(QtGui.QColor(216, 119, 0)) # orange - shared.reloadMyAddressHashes() + self.ui.tableWidgetChanList.item(currentRow, 1).setTextColor(QtGui.QColor(216, 119, 0)) # orange + self.enableIdentity(addressAtCurrentRow) + """ - def on_action_YourIdentitiesDisable(self): - currentRow = self.ui.tableWidgetYourIdentities.currentRow() - addressAtCurrentRow = str( - self.ui.tableWidgetYourIdentities.item(currentRow, 1).text()) - shared.config.set(str(addressAtCurrentRow), 'enabled', 'false') - self.ui.tableWidgetYourIdentities.item( - currentRow, 0).setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetYourIdentities.item( - currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetYourIdentities.item( - currentRow, 2).setTextColor(QtGui.QColor(128, 128, 128)) - if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'): - self.ui.tableWidgetYourIdentities.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177)) # magenta + def enableIdentity(self, address): + shared.config.set(address, 'enabled', 'true') shared.writeKeysFile() shared.reloadMyAddressHashes() - def on_action_YourIdentitiesClipboard(self): - currentRow = self.ui.tableWidgetYourIdentities.currentRow() - addressAtCurrentRow = self.ui.tableWidgetYourIdentities.item( - currentRow, 1).text() + def on_action_Disable(self): + address = self.getCurrentAccount() + self.disableIdentity(address) + self.setCurrentItemColor(QtGui.QColor(128, 128, 128)) + + """ + TODO remove + def on_action_ChanDisable(self): + currentRow = self.ui.tableWidgetChanList.currentRow() + addressAtCurrentRow = str( + self.ui.tableWidgetChanList.item(currentRow, 1).text()) + self.ui.tableWidgetChanList.item( + currentRow, 0).setTextColor(QtGui.QColor(128, 128, 128)) + self.ui.tableWidgetChanList.item( + currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128)) + self.ui.tableWidgetChanList.item( + currentRow, 2).setTextColor(QtGui.QColor(128, 128, 128)) + self.disableIdentity(address) + """ + + def disableIdentity(self, address): + shared.config.set(str(addressAtCurrentRow), 'enabled', 'false') + shared.writeKeysFile() + shared.reloadMyAddressHashes() + + def on_action_Clipboard(self): + addressAtCurrentRow = self.getCurrentAccount() clipboard = QtGui.QApplication.clipboard() clipboard.setText(str(addressAtCurrentRow)) - def on_action_YourIdentitiesSetAvatar(self): - self.on_action_SetAvatar(self.ui.tableWidgetYourIdentities) - + """ + TODO remove + def on_action_ChanClipboard(self): + currentRow = self.ui.tableWidgetChanList.currentRow() + addressAtCurrentRow = self.ui.tableWidgetChanList.item( + currentRow, 1).text() + clipboard = QtGui.QApplication.clipboard() + clipboard.setText(str(addressAtCurrentRow)) + """ + + #set avatar functions + def on_action_TreeWidgetSetAvatar(self): + addressAtCurrentRow = self.getCurrentAccount() + treeWidget = self.getCurrentTreeWidget() + setToIdenticon = not self.setAvatar(addressAtCurrentRow) + if treeWidget and setToIdenticon: + currentItem = treeWidget.currentItem() + currentItem.setIcon(0, avatarize(addressAtCurrentRow)) + def on_action_AddressBookSetAvatar(self): self.on_action_SetAvatar(self.ui.tableWidgetAddressBook) - def on_action_SubscriptionsSetAvatar(self): - self.on_action_SetAvatar(self.ui.tableWidgetSubscriptions) - def on_action_BlacklistSetAvatar(self): self.on_action_SetAvatar(self.ui.tableWidgetBlacklist) - + def on_action_SetAvatar(self, thisTableWidget): - # thisTableWidget = self.ui.tableWidgetYourIdentities - if not os.path.exists(shared.appdata + 'avatars/'): - os.makedirs(shared.appdata + 'avatars/') currentRow = thisTableWidget.currentRow() addressAtCurrentRow = thisTableWidget.item( currentRow, 1).text() + setToIdenticon = not self.setAvatar(addressAtCurrentRow) + if setToIdenticon: + thisTableWidget.item( + currentRow, 0).setIcon(avatarize(addressAtCurrentRow)) + + def setAvatar(self, addressAtCurrentRow): + if not os.path.exists(shared.appdata + 'avatars/'): + os.makedirs(shared.appdata + 'avatars/') hash = hashlib.md5(addBMIfNotPresent(addressAtCurrentRow)).hexdigest() extensions = ['PNG', 'GIF', 'JPG', 'JPEG', 'SVG', 'BMP', 'MNG', 'PBM', 'PGM', 'PPM', 'TIFF', 'XBM', 'XPM', 'TGA'] # http://pyqt.sourceforge.net/Docs/PyQt4/qimagereader.html#supportedImageFormats @@ -3331,21 +3594,28 @@ more work your computer must do to send the message. A Time-To-Live of four or f copied = QtCore.QFile.copy(sourcefile, destination) if not copied: print 'couldn\'t copy :(' - return False # set the icon - thisTableWidget.item( - currentRow, 0).setIcon(avatarize(addressAtCurrentRow)) self.rerenderSubscriptions() self.rerenderComboBoxSendFrom() + self.rerenderComboBoxSendFromBroadcast() self.rerenderInboxFromLabels() self.rerenderInboxToLabels() self.rerenderSentFromLabels() self.rerenderSentToLabels() self.rerenderBlackWhiteList() + # generate identicon + return False + + return True + # TODO make one popMenu def on_context_menuYourIdentities(self, point): + self.popMenuYourIdentities.exec_( + self.ui.treeWidgetYourIdentities.mapToGlobal(point)) + + def on_context_menuChan(self, point): self.popMenu.exec_( - self.ui.tableWidgetYourIdentities.mapToGlobal(point)) + self.ui.treeWidgetChanList.mapToGlobal(point)) def on_context_menuInbox(self, point): self.popMenuInbox.exec_(self.ui.tableWidgetInbox.mapToGlobal(point)) @@ -3374,60 +3644,28 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.ui.textEditInboxMessage.setPlainText(QString("")) self.loadInbox(searchOption, searchKeyword) + def treeWidgetYourIdentitiesItemClicked(self): + currentItem = self.ui.treeWidgetYourIdentities.currentItem() + if currentItem: + accountFolder = currentItem.data(0, Qt.UserRole).toPyObject() + account = accountFolder[0] + folder = accountFolder[1] + self.loadMessagelist(self.ui.tableWidgetInbox, str(account), str(folder)) + + # TODO trees + def treeWidgetSubscribtionsItemClicked(self): + pass + + def treeWidgetChanListItemClicked(self): + pass + def tableWidgetInboxItemClicked(self): currentRow = self.ui.tableWidgetInbox.currentRow() if currentRow >= 0: - font = QFont() - font.setBold(False) - self.ui.textEditInboxMessage.setCurrentFont(font) - - fromAddress = str(self.ui.tableWidgetInbox.item( - currentRow, 1).data(Qt.UserRole).toPyObject()) msgid = str(self.ui.tableWidgetInbox.item( currentRow, 3).data(Qt.UserRole).toPyObject()) queryreturn = sqlQuery( '''select message from inbox where msgid=?''', msgid) - if queryreturn != []: - for row in queryreturn: - messageText, = row - messageText = shared.fixPotentiallyInvalidUTF8Data(messageText) - messageText = unicode(messageText, 'utf-8)') - if len(messageText) > 30000: - messageText = ( - messageText[:30000] + '\n' + - '--- Display of the remainder of the message ' + - 'truncated because it is too long.\n' + - '--- To see the full message, right-click in the ' + - 'Inbox view and select "View HTML code as formatted ' + - 'text",\n' + - '--- or select "Save message as..." to save it to a ' + - 'file, or select "Reply" and ' + - 'view the full message in the quote.') - # If we have received this message from either a broadcast address - # or from someone in our address book, display as HTML - if decodeAddress(fromAddress)[3] in shared.broadcastSendersForWhichImWatching or shared.isAddressInMyAddressBook(fromAddress): - self.ui.textEditInboxMessage.setText(messageText) - else: - self.ui.textEditInboxMessage.setPlainText(messageText) - - self.ui.tableWidgetInbox.item(currentRow, 0).setFont(font) - self.ui.tableWidgetInbox.item(currentRow, 1).setFont(font) - self.ui.tableWidgetInbox.item(currentRow, 2).setFont(font) - self.ui.tableWidgetInbox.item(currentRow, 3).setFont(font) - - inventoryHash = str(self.ui.tableWidgetInbox.item( - currentRow, 3).data(Qt.UserRole).toPyObject()) - self.ubuntuMessagingMenuClear(inventoryHash) - sqlExecute('''update inbox set read=1 WHERE msgid=?''', inventoryHash) - self.changedInboxUnread() - - def tableWidgetInboxItemClicked(self): - currentRow = self.ui.tableWidgetInbox.currentRow() - if currentRow >= 0: - ackdata = str(self.ui.tableWidgetInbox.item( - currentRow, 3).data(Qt.UserRole).toPyObject()) - queryreturn = sqlQuery( - '''select message from sent where ackdata=?''', ackdata) if queryreturn != []: for row in queryreturn: message, = row @@ -3436,20 +3674,6 @@ more work your computer must do to send the message. A Time-To-Live of four or f message = unicode(message, 'utf-8)') self.ui.textEditInboxMessage.setPlainText(message) - def tableWidgetYourIdentitiesItemChanged(self): - currentRow = self.ui.tableWidgetYourIdentities.currentRow() - if currentRow >= 0: - addressAtCurrentRow = self.ui.tableWidgetYourIdentities.item( - currentRow, 1).text() - shared.config.set(str(addressAtCurrentRow), 'label', str( - self.ui.tableWidgetYourIdentities.item(currentRow, 0).text().toUtf8())) - shared.writeKeysFile() - self.rerenderComboBoxSendFrom() - # self.rerenderInboxFromLabels() - self.rerenderInboxToLabels() - self.rerenderSentFromLabels() - # self.rerenderSentToLabels() - def tableWidgetAddressBookItemChanged(self): currentRow = self.ui.tableWidgetAddressBook.currentRow() if currentRow >= 0: @@ -3461,7 +3685,9 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.rerenderInboxFromLabels() self.rerenderSentToLabels() - def tableWidgetSubscriptionsItemChanged(self): + """ + TODO implement + def treeWidgetSubscriptionsItemChanged(self): currentRow = self.ui.tableWidgetSubscriptions.currentRow() if currentRow >= 0: addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item( @@ -3472,25 +3698,46 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.rerenderInboxFromLabels() self.rerenderSentToLabels() + def treeWidgetChanListItemChanged(self): + currentRow = self.ui.tableWidgetChanList.currentRow() + if currentRow >= 0: + addressAtCurrentRow = self.ui.tableWidgetChanList.item( + currentRow, 1).text() + shared.config.set(str(addressAtCurrentRow), 'label', str( + self.ui.tableWidgetChanList.item(currentRow, 0).text().toUtf8())) + shared.writeKeysFile() + self.rerenderComboBoxSendFrom() + self.rerenderComboBoxSendFromBroadcast() + # self.rerenderInboxFromLabels() + self.rerenderInboxToLabels() + self.rerenderSentFromLabels() + # self.rerenderSentToLabels() + """ + def writeNewAddressToTable(self, label, address, streamNumber): - self.ui.tableWidgetYourIdentities.setSortingEnabled(False) - self.ui.tableWidgetYourIdentities.insertRow(0) + pass + """ + TODO implement + self.ui.tableWidgetChanList.setSortingEnabled(False) + self.ui.tableWidgetChanList.insertRow(0) newItem = QtGui.QTableWidgetItem(unicode(label, 'utf-8')) newItem.setIcon(avatarize(address)) - self.ui.tableWidgetYourIdentities.setItem( + self.ui.tableWidgetChanList.setItem( 0, 0, newItem) newItem = QtGui.QTableWidgetItem(address) newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) if shared.safeConfigGetBoolean(address, 'chan'): newItem.setTextColor(QtGui.QColor(216, 119, 0)) # orange - self.ui.tableWidgetYourIdentities.setItem(0, 1, newItem) + self.ui.tableWidgetChanList.setItem(0, 1, newItem) newItem = QtGui.QTableWidgetItem(streamNumber) newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetYourIdentities.setItem(0, 2, newItem) - # self.ui.tableWidgetYourIdentities.setSortingEnabled(True) + self.ui.tableWidgetChanList.setItem(0, 2, newItem) + # self.ui.tableWidgetChanList.setSortingEnabled(True) self.rerenderComboBoxSendFrom() + self.rerenderComboBoxSendFromBroadcast() + """ def updateStatusBar(self, data): if data != "": @@ -3749,8 +3996,8 @@ class settingsDialog(QtGui.QDialog): responseStatus = response[0] responseText = response[1] self.ui.labelNamecoinTestResult.setText(responseText) - #if responseStatus== 'success': - #self.parent.ui.pushButtonFetchNamecoinID.show() + if responseStatus== 'success': + self.parent.ui.pushButtonFetchNamecoinID.show() class SpecialAddressBehaviorDialog(QtGui.QDialog): @@ -3760,9 +4007,7 @@ class SpecialAddressBehaviorDialog(QtGui.QDialog): self.ui = Ui_SpecialAddressBehaviorDialog() self.ui.setupUi(self) self.parent = parent - currentRow = parent.ui.tableWidgetYourIdentities.currentRow() - addressAtCurrentRow = str( - parent.ui.tableWidgetYourIdentities.item(currentRow, 1).text()) + addressAtCurrentRow = parent.getCurrentAccount() if not shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'): self.ui.radioButtonBehaviorMailingList.click() @@ -3782,6 +4027,38 @@ class SpecialAddressBehaviorDialog(QtGui.QDialog): QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) +""" +TODO remove +class SpecialAddressBehaviorDialog(QtGui.QDialog): + + def __init__(self, parent): + QtGui.QWidget.__init__(self, parent) + self.ui = Ui_SpecialAddressBehaviorDialog() + self.ui.setupUi(self) + self.parent = parent + currentRow = parent.ui.tableWidgetChanList.currentRow() + addressAtCurrentRow = str( + parent.ui.tableWidgetChanList.item(currentRow, 1).text()) + if not shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): + if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'): + self.ui.radioButtonBehaviorMailingList.click() + else: + self.ui.radioButtonBehaveNormalAddress.click() + try: + mailingListName = shared.config.get( + addressAtCurrentRow, 'mailinglistname') + except: + mailingListName = '' + self.ui.lineEditMailingListName.setText( + unicode(mailingListName, 'utf-8')) + else: # if addressAtCurrentRow is a chan address + self.ui.radioButtonBehaviorMailingList.setDisabled(True) + self.ui.lineEditMailingListName.setText(_translate( + "MainWindow", "This is a chan address. You cannot use it as a pseudo-mailing list.")) + + QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) +""" + class AddAddressDialog(QtGui.QDialog): @@ -3886,6 +4163,8 @@ class NewSubscriptionDialog(QtGui.QDialog): class NewAddressDialog(QtGui.QDialog): def __init__(self, parent): + """ + TODO implement QtGui.QWidget.__init__(self, parent) self.ui = Ui_NewAddressDialog() self.ui.setupUi(self) @@ -3893,13 +4172,14 @@ class NewAddressDialog(QtGui.QDialog): row = 1 # Let's fill out the 'existing address' combo box with addresses from # the 'Your Identities' tab. - while self.parent.ui.tableWidgetYourIdentities.item(row - 1, 1): + while self.parent.ui.tableWidgetChanList.item(row - 1, 1): self.ui.radioButtonExisting.click() self.ui.comboBoxExisting.addItem( - self.parent.ui.tableWidgetYourIdentities.item(row - 1, 1).text()) + self.parent.ui.tableWidgetChanList.item(row - 1, 1).text()) row += 1 self.ui.groupBoxDeterministic.setHidden(True) QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) + """ class newChanDialog(QtGui.QDialog): diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index 073dd457..17ab57ee 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -2,13 +2,8 @@ # Form implementation generated from reading ui file 'bitmessageui.ui' # -<<<<<<< HEAD -# Created: Wed Mar 4 00:11:02 2015 +# Created: Fri Mar 20 19:19:21 2015 # by: PyQt4 UI code generator 4.10.4 -======= -# Created: Sun Mar 08 22:07:43 2015 -# by: PyQt4 UI code generator 4.10.3 ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e # # WARNING! All changes made in this file will be lost! @@ -121,8 +116,8 @@ class Ui_MainWindow(object): self.tabWidget.addTab(self.inbox, icon2, _fromUtf8("")) self.send = QtGui.QWidget() self.send.setObjectName(_fromUtf8("send")) - self.gridLayout_11 = QtGui.QGridLayout(self.send) - self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) + self.gridLayout_7 = QtGui.QGridLayout(self.send) + self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.verticalLayout_2 = QtGui.QVBoxLayout() @@ -152,28 +147,26 @@ class Ui_MainWindow(object): self.pushButtonAddAddressBook.setMaximumSize(QtCore.QSize(200, 16777215)) self.pushButtonAddAddressBook.setObjectName(_fromUtf8("pushButtonAddAddressBook")) self.verticalLayout_2.addWidget(self.pushButtonAddAddressBook) + self.pushButtonFetchNamecoinID = QtGui.QPushButton(self.send) + self.pushButtonFetchNamecoinID.setMaximumSize(QtCore.QSize(200, 16777215)) + font = QtGui.QFont() + font.setPointSize(9) + self.pushButtonFetchNamecoinID.setFont(font) + self.pushButtonFetchNamecoinID.setObjectName(_fromUtf8("pushButtonFetchNamecoinID")) + self.verticalLayout_2.addWidget(self.pushButtonFetchNamecoinID) self.horizontalLayout.addLayout(self.verticalLayout_2) - self.tabWidget_2 = QtGui.QTabWidget(self.send) - self.tabWidget_2.setObjectName(_fromUtf8("tabWidget_2")) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.tabWidgetSend = QtGui.QTabWidget(self.send) + self.tabWidgetSend.setObjectName(_fromUtf8("tabWidgetSend")) self.tab = QtGui.QWidget() self.tab.setObjectName(_fromUtf8("tab")) self.gridLayout_8 = QtGui.QGridLayout(self.tab) self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) - self.verticalLayout = QtGui.QVBoxLayout() - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.verticalLayout_5 = QtGui.QVBoxLayout() + self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) self.gridLayout_2 = QtGui.QGridLayout() self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) -<<<<<<< HEAD - self.comboBoxSendFrom = QtGui.QComboBox(self.tab) - self.comboBoxSendFrom.setMinimumSize(QtCore.QSize(300, 0)) - self.comboBoxSendFrom.setObjectName(_fromUtf8("comboBoxSendFrom")) - self.gridLayout_2.addWidget(self.comboBoxSendFrom, 0, 1, 1, 1) - self.label = QtGui.QLabel(self.tab) - self.label.setObjectName(_fromUtf8("label")) - self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1) - self.lineEditTo = QtGui.QLineEdit(self.tab) - self.lineEditTo.setObjectName(_fromUtf8("lineEditTo")) - self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1) self.label_3 = QtGui.QLabel(self.tab) self.label_3.setObjectName(_fromUtf8("label_3")) self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1) @@ -184,160 +177,53 @@ class Ui_MainWindow(object): self.lineEditSubject.setText(_fromUtf8("")) self.lineEditSubject.setObjectName(_fromUtf8("lineEditSubject")) self.gridLayout_2.addWidget(self.lineEditSubject, 2, 1, 1, 1) - self.verticalLayout.addLayout(self.gridLayout_2) + self.label = QtGui.QLabel(self.tab) + self.label.setObjectName(_fromUtf8("label")) + self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1) + self.comboBoxSendFrom = QtGui.QComboBox(self.tab) + self.comboBoxSendFrom.setMinimumSize(QtCore.QSize(300, 0)) + self.comboBoxSendFrom.setObjectName(_fromUtf8("comboBoxSendFrom")) + self.gridLayout_2.addWidget(self.comboBoxSendFrom, 0, 1, 1, 1) + self.lineEditTo = QtGui.QLineEdit(self.tab) + self.lineEditTo.setObjectName(_fromUtf8("lineEditTo")) + self.gridLayout_2.addWidget(self.lineEditTo, 1, 1, 1, 1) + self.verticalLayout_5.addLayout(self.gridLayout_2) self.textEditMessage = QtGui.QTextEdit(self.tab) self.textEditMessage.setObjectName(_fromUtf8("textEditMessage")) - self.verticalLayout.addWidget(self.textEditMessage) - self.pushButtonSend = QtGui.QPushButton(self.tab) - self.pushButtonSend.setObjectName(_fromUtf8("pushButtonSend")) - self.verticalLayout.addWidget(self.pushButtonSend) - self.gridLayout_8.addLayout(self.verticalLayout, 0, 0, 1, 1) - self.tabWidget_2.addTab(self.tab, _fromUtf8("")) + self.verticalLayout_5.addWidget(self.textEditMessage) + self.gridLayout_8.addLayout(self.verticalLayout_5, 0, 0, 1, 1) + self.tabWidgetSend.addTab(self.tab, _fromUtf8("")) self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName(_fromUtf8("tab_2")) self.gridLayout_9 = QtGui.QGridLayout(self.tab_2) self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) - self.verticalLayout_5 = QtGui.QVBoxLayout() - self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) + self.verticalLayout_6 = QtGui.QVBoxLayout() + self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6")) self.gridLayout_5 = QtGui.QGridLayout() self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) self.label_8 = QtGui.QLabel(self.tab_2) self.label_8.setObjectName(_fromUtf8("label_8")) self.gridLayout_5.addWidget(self.label_8, 0, 0, 1, 1) - self.lineEditSubject_2 = QtGui.QLineEdit(self.tab_2) - self.lineEditSubject_2.setText(_fromUtf8("")) - self.lineEditSubject_2.setObjectName(_fromUtf8("lineEditSubject_2")) - self.gridLayout_5.addWidget(self.lineEditSubject_2, 1, 1, 1, 1) + self.lineEditSubjectBroadcast = QtGui.QLineEdit(self.tab_2) + self.lineEditSubjectBroadcast.setText(_fromUtf8("")) + self.lineEditSubjectBroadcast.setObjectName(_fromUtf8("lineEditSubjectBroadcast")) + self.gridLayout_5.addWidget(self.lineEditSubjectBroadcast, 1, 1, 1, 1) self.label_7 = QtGui.QLabel(self.tab_2) self.label_7.setObjectName(_fromUtf8("label_7")) self.gridLayout_5.addWidget(self.label_7, 1, 0, 1, 1) - self.comboBoxSendFrom_2 = QtGui.QComboBox(self.tab_2) - self.comboBoxSendFrom_2.setMinimumSize(QtCore.QSize(300, 0)) - self.comboBoxSendFrom_2.setObjectName(_fromUtf8("comboBoxSendFrom_2")) - self.gridLayout_5.addWidget(self.comboBoxSendFrom_2, 0, 1, 1, 1) - self.verticalLayout_5.addLayout(self.gridLayout_5) - self.textEditMessage_2 = QtGui.QTextEdit(self.tab_2) - self.textEditMessage_2.setObjectName(_fromUtf8("textEditMessage_2")) - self.verticalLayout_5.addWidget(self.textEditMessage_2) - self.pushButtonSend_3 = QtGui.QPushButton(self.tab_2) - self.pushButtonSend_3.setObjectName(_fromUtf8("pushButtonSend_3")) - self.verticalLayout_5.addWidget(self.pushButtonSend_3) - self.gridLayout_9.addLayout(self.verticalLayout_5, 0, 0, 1, 1) - self.tabWidget_2.addTab(self.tab_2, _fromUtf8("")) - self.horizontalLayout.addWidget(self.tabWidget_2) - self.gridLayout_11.addLayout(self.horizontalLayout, 0, 0, 1, 1) - icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.send, icon4, _fromUtf8("")) - self.subscriptions = QtGui.QWidget() - self.subscriptions.setObjectName(_fromUtf8("subscriptions")) - self.gridLayout_4 = QtGui.QGridLayout(self.subscriptions) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.horizontalLayout_2 = QtGui.QHBoxLayout() - self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) - self.verticalLayout_3 = QtGui.QVBoxLayout() - self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) - self.tableWidgetSubscriptions = QtGui.QTableWidget(self.subscriptions) - self.tableWidgetSubscriptions.setMaximumSize(QtCore.QSize(200, 16777215)) - self.tableWidgetSubscriptions.setAlternatingRowColors(True) - self.tableWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tableWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetSubscriptions.setObjectName(_fromUtf8("tableWidgetSubscriptions")) - self.tableWidgetSubscriptions.setColumnCount(2) - self.tableWidgetSubscriptions.setRowCount(0) - item = QtGui.QTableWidgetItem() - icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) - item.setIcon(icon5) - self.tableWidgetSubscriptions.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tableWidgetSubscriptions.setHorizontalHeaderItem(1, item) - self.tableWidgetSubscriptions.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetSubscriptions.horizontalHeader().setDefaultSectionSize(200) - self.tableWidgetSubscriptions.horizontalHeader().setHighlightSections(False) - self.tableWidgetSubscriptions.horizontalHeader().setSortIndicatorShown(False) - self.tableWidgetSubscriptions.horizontalHeader().setStretchLastSection(True) - self.tableWidgetSubscriptions.verticalHeader().setVisible(False) - self.verticalLayout_3.addWidget(self.tableWidgetSubscriptions) - self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions) - self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215)) - self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) - self.verticalLayout_3.addWidget(self.pushButtonAddSubscription) - self.horizontalLayout_2.addLayout(self.verticalLayout_3) - self.verticalLayout_4 = QtGui.QVBoxLayout() - self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) - self.inboxSearchLineSubscriptions = QtGui.QLineEdit(self.subscriptions) - self.inboxSearchLineSubscriptions.setObjectName(_fromUtf8("inboxSearchLineSubscriptions")) - self.verticalLayout_4.addWidget(self.inboxSearchLineSubscriptions) - self.tableWidgetInboxSubscriptions = QtGui.QTableWidget(self.subscriptions) - self.tableWidgetInboxSubscriptions.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True) - self.tableWidgetInboxSubscriptions.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetInboxSubscriptions.setWordWrap(False) - self.tableWidgetInboxSubscriptions.setObjectName(_fromUtf8("tableWidgetInboxSubscriptions")) - self.tableWidgetInboxSubscriptions.setColumnCount(4) - self.tableWidgetInboxSubscriptions.setRowCount(0) -======= - self.pushButtonLoadFromAddressBook = QtGui.QPushButton(self.send) - font = QtGui.QFont() - font.setPointSize(7) - self.pushButtonLoadFromAddressBook.setFont(font) - self.pushButtonLoadFromAddressBook.setObjectName(_fromUtf8("pushButtonLoadFromAddressBook")) - self.gridLayout_2.addWidget(self.pushButtonLoadFromAddressBook, 3, 2, 1, 1) - self.label_3 = QtGui.QLabel(self.send) - self.label_3.setObjectName(_fromUtf8("label_3")) - self.gridLayout_2.addWidget(self.label_3, 4, 0, 1, 1) - self.pushButtonSend = QtGui.QPushButton(self.send) - self.pushButtonSend.setObjectName(_fromUtf8("pushButtonSend")) - self.gridLayout_2.addWidget(self.pushButtonSend, 7, 8, 1, 1) - self.horizontalSliderTTL = QtGui.QSlider(self.send) - self.horizontalSliderTTL.setMinimumSize(QtCore.QSize(35, 0)) - self.horizontalSliderTTL.setMaximumSize(QtCore.QSize(70, 16777215)) - self.horizontalSliderTTL.setOrientation(QtCore.Qt.Horizontal) - self.horizontalSliderTTL.setInvertedAppearance(False) - self.horizontalSliderTTL.setInvertedControls(False) - self.horizontalSliderTTL.setObjectName(_fromUtf8("horizontalSliderTTL")) - self.gridLayout_2.addWidget(self.horizontalSliderTTL, 7, 6, 1, 1) - spacerItem = QtGui.QSpacerItem(20, 297, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem, 6, 0, 1, 1) - self.comboBoxSendFrom = QtGui.QComboBox(self.send) - self.comboBoxSendFrom.setMinimumSize(QtCore.QSize(300, 0)) - self.comboBoxSendFrom.setObjectName(_fromUtf8("comboBoxSendFrom")) - self.gridLayout_2.addWidget(self.comboBoxSendFrom, 2, 1, 1, 1) - self.labelHumanFriendlyTTLDescription = QtGui.QLabel(self.send) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.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(_fromUtf8("labelHumanFriendlyTTLDescription")) - self.gridLayout_2.addWidget(self.labelHumanFriendlyTTLDescription, 7, 7, 1, 1) - self.label_4 = QtGui.QLabel(self.send) - self.label_4.setObjectName(_fromUtf8("label_4")) - self.gridLayout_2.addWidget(self.label_4, 5, 0, 1, 1) - self.label = QtGui.QLabel(self.send) - self.label.setObjectName(_fromUtf8("label")) - self.gridLayout_2.addWidget(self.label, 3, 0, 1, 1) - self.radioButtonSpecific = QtGui.QRadioButton(self.send) - self.radioButtonSpecific.setChecked(True) - self.radioButtonSpecific.setObjectName(_fromUtf8("radioButtonSpecific")) - self.gridLayout_2.addWidget(self.radioButtonSpecific, 0, 1, 1, 1) - self.labelSendBroadcastWarning = QtGui.QLabel(self.send) - self.labelSendBroadcastWarning.setEnabled(True) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.labelSendBroadcastWarning.sizePolicy().hasHeightForWidth()) - self.labelSendBroadcastWarning.setSizePolicy(sizePolicy) - self.labelSendBroadcastWarning.setIndent(-1) - self.labelSendBroadcastWarning.setObjectName(_fromUtf8("labelSendBroadcastWarning")) - self.gridLayout_2.addWidget(self.labelSendBroadcastWarning, 7, 1, 1, 4) - self.radioButtonBroadcast = QtGui.QRadioButton(self.send) - self.radioButtonBroadcast.setObjectName(_fromUtf8("radioButtonBroadcast")) - self.gridLayout_2.addWidget(self.radioButtonBroadcast, 1, 1, 1, 2) + self.comboBoxSendFromBroadcast = QtGui.QComboBox(self.tab_2) + self.comboBoxSendFromBroadcast.setMinimumSize(QtCore.QSize(300, 0)) + self.comboBoxSendFromBroadcast.setObjectName(_fromUtf8("comboBoxSendFromBroadcast")) + self.gridLayout_5.addWidget(self.comboBoxSendFromBroadcast, 0, 1, 1, 1) + self.verticalLayout_6.addLayout(self.gridLayout_5) + self.textEditMessageBroadcast = QtGui.QTextEdit(self.tab_2) + self.textEditMessageBroadcast.setObjectName(_fromUtf8("textEditMessageBroadcast")) + self.verticalLayout_6.addWidget(self.textEditMessageBroadcast) + self.gridLayout_9.addLayout(self.verticalLayout_6, 0, 0, 1, 1) + self.tabWidgetSend.addTab(self.tab_2, _fromUtf8("")) + self.verticalLayout.addWidget(self.tabWidgetSend) + self.horizontalLayout_5 = QtGui.QHBoxLayout() + self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) self.pushButtonTTL = QtGui.QPushButton(self.send) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) @@ -361,66 +247,72 @@ class Ui_MainWindow(object): self.pushButtonTTL.setFont(font) self.pushButtonTTL.setFlat(True) self.pushButtonTTL.setObjectName(_fromUtf8("pushButtonTTL")) - self.gridLayout_2.addWidget(self.pushButtonTTL, 7, 5, 1, 1) - self.label_2 = QtGui.QLabel(self.send) - self.label_2.setObjectName(_fromUtf8("label_2")) - self.gridLayout_2.addWidget(self.label_2, 2, 0, 1, 1) - self.lineEditTo = QtGui.QLineEdit(self.send) - self.lineEditTo.setObjectName(_fromUtf8("lineEditTo")) - self.gridLayout_2.addWidget(self.lineEditTo, 3, 1, 1, 1) - self.textEditMessage = QtGui.QTextEdit(self.send) - self.textEditMessage.setObjectName(_fromUtf8("textEditMessage")) - self.gridLayout_2.addWidget(self.textEditMessage, 5, 1, 2, 8) - self.pushButtonFetchNamecoinID = QtGui.QPushButton(self.send) - font = QtGui.QFont() - font.setPointSize(7) - self.pushButtonFetchNamecoinID.setFont(font) - self.pushButtonFetchNamecoinID.setObjectName(_fromUtf8("pushButtonFetchNamecoinID")) - self.gridLayout_2.addWidget(self.pushButtonFetchNamecoinID, 3, 3, 1, 1) - self.labelFrom = QtGui.QLabel(self.send) - self.labelFrom.setText(_fromUtf8("")) - self.labelFrom.setObjectName(_fromUtf8("labelFrom")) - self.gridLayout_2.addWidget(self.labelFrom, 2, 2, 1, 7) - self.lineEditSubject = QtGui.QLineEdit(self.send) - self.lineEditSubject.setText(_fromUtf8("")) - self.lineEditSubject.setObjectName(_fromUtf8("lineEditSubject")) - self.gridLayout_2.addWidget(self.lineEditSubject, 4, 1, 1, 8) - icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.send, icon2, _fromUtf8("")) - self.sent = QtGui.QWidget() - self.sent.setObjectName(_fromUtf8("sent")) - self.verticalLayout = QtGui.QVBoxLayout(self.sent) - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setContentsMargins(-1, 0, -1, -1) - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.sentSearchLineEdit = QtGui.QLineEdit(self.sent) - self.sentSearchLineEdit.setObjectName(_fromUtf8("sentSearchLineEdit")) - self.horizontalLayout.addWidget(self.sentSearchLineEdit) - self.sentSearchOptionCB = QtGui.QComboBox(self.sent) - self.sentSearchOptionCB.setObjectName(_fromUtf8("sentSearchOptionCB")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.sentSearchOptionCB.addItem(_fromUtf8("")) - self.horizontalLayout.addWidget(self.sentSearchOptionCB) - self.verticalLayout.addLayout(self.horizontalLayout) - self.splitter_2 = QtGui.QSplitter(self.sent) - self.splitter_2.setOrientation(QtCore.Qt.Vertical) - self.splitter_2.setObjectName(_fromUtf8("splitter_2")) - self.tableWidgetSent = QtGui.QTableWidget(self.splitter_2) - self.tableWidgetSent.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tableWidgetSent.setDragDropMode(QtGui.QAbstractItemView.DragDrop) - self.tableWidgetSent.setAlternatingRowColors(True) - self.tableWidgetSent.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.tableWidgetSent.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetSent.setWordWrap(False) - self.tableWidgetSent.setObjectName(_fromUtf8("tableWidgetSent")) - self.tableWidgetSent.setColumnCount(4) - self.tableWidgetSent.setRowCount(0) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e + self.horizontalLayout_5.addWidget(self.pushButtonTTL) + self.horizontalSliderTTL = QtGui.QSlider(self.send) + self.horizontalSliderTTL.setMinimumSize(QtCore.QSize(35, 0)) + self.horizontalSliderTTL.setMaximumSize(QtCore.QSize(70, 16777215)) + self.horizontalSliderTTL.setOrientation(QtCore.Qt.Horizontal) + self.horizontalSliderTTL.setInvertedAppearance(False) + self.horizontalSliderTTL.setInvertedControls(False) + self.horizontalSliderTTL.setObjectName(_fromUtf8("horizontalSliderTTL")) + self.horizontalLayout_5.addWidget(self.horizontalSliderTTL) + self.labelHumanFriendlyTTLDescription = QtGui.QLabel(self.send) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.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(_fromUtf8("labelHumanFriendlyTTLDescription")) + self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription) + self.pushButtonSend = QtGui.QPushButton(self.send) + self.pushButtonSend.setMaximumSize(QtCore.QSize(16777215, 16777215)) + self.pushButtonSend.setObjectName(_fromUtf8("pushButtonSend")) + self.horizontalLayout_5.addWidget(self.pushButtonSend) + self.verticalLayout.addLayout(self.horizontalLayout_5) + self.horizontalLayout.addLayout(self.verticalLayout) + self.gridLayout_7.addLayout(self.horizontalLayout, 0, 0, 1, 1) + icon4 = QtGui.QIcon() + icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/send.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.send, icon4, _fromUtf8("")) + self.subscriptions = QtGui.QWidget() + self.subscriptions.setObjectName(_fromUtf8("subscriptions")) + self.gridLayout_4 = QtGui.QGridLayout(self.subscriptions) + self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) + self.verticalLayout_3 = QtGui.QVBoxLayout() + self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) + self.treeWidgetSubscriptions = QtGui.QTreeWidget(self.subscriptions) + self.treeWidgetSubscriptions.setMaximumSize(QtCore.QSize(200, 16777215)) + self.treeWidgetSubscriptions.setAlternatingRowColors(True) + self.treeWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.treeWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.treeWidgetSubscriptions.setObjectName(_fromUtf8("treeWidgetSubscriptions")) + icon5 = QtGui.QIcon() + icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) + self.treeWidgetSubscriptions.headerItem().setIcon(0, icon5) + self.verticalLayout_3.addWidget(self.treeWidgetSubscriptions) + self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions) + self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215)) + self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) + self.verticalLayout_3.addWidget(self.pushButtonAddSubscription) + self.horizontalLayout_2.addLayout(self.verticalLayout_3) + self.verticalLayout_4 = QtGui.QVBoxLayout() + self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) + self.inboxSearchLineSubscriptions = QtGui.QLineEdit(self.subscriptions) + self.inboxSearchLineSubscriptions.setObjectName(_fromUtf8("inboxSearchLineSubscriptions")) + self.verticalLayout_4.addWidget(self.inboxSearchLineSubscriptions) + self.tableWidgetInboxSubscriptions = QtGui.QTableWidget(self.subscriptions) + self.tableWidgetInboxSubscriptions.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True) + self.tableWidgetInboxSubscriptions.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) + self.tableWidgetInboxSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tableWidgetInboxSubscriptions.setWordWrap(False) + self.tableWidgetInboxSubscriptions.setObjectName(_fromUtf8("tableWidgetInboxSubscriptions")) + self.tableWidgetInboxSubscriptions.setColumnCount(4) + self.tableWidgetInboxSubscriptions.setRowCount(0) item = QtGui.QTableWidgetItem() self.tableWidgetInboxSubscriptions.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() @@ -452,50 +344,22 @@ class Ui_MainWindow(object): self.tab_3.setObjectName(_fromUtf8("tab_3")) self.gridLayout_3 = QtGui.QGridLayout(self.tab_3) self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) -<<<<<<< HEAD self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) self.verticalLayout_17 = QtGui.QVBoxLayout() self.verticalLayout_17.setObjectName(_fromUtf8("verticalLayout_17")) - self.tableWidgetYourIdentities = QtGui.QTableWidget(self.tab_3) - self.tableWidgetYourIdentities.setMaximumSize(QtCore.QSize(200, 16777215)) -======= - self.pushButtonNewAddress = QtGui.QPushButton(self.youridentities) - self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress")) - self.gridLayout_3.addWidget(self.pushButtonNewAddress, 0, 0, 1, 1) - spacerItem1 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_3.addItem(spacerItem1, 0, 1, 1, 1) - self.tableWidgetYourIdentities = QtGui.QTableWidget(self.youridentities) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e - self.tableWidgetYourIdentities.setFrameShadow(QtGui.QFrame.Sunken) - self.tableWidgetYourIdentities.setLineWidth(1) - self.tableWidgetYourIdentities.setAlternatingRowColors(True) - self.tableWidgetYourIdentities.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tableWidgetYourIdentities.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetYourIdentities.setObjectName(_fromUtf8("tableWidgetYourIdentities")) - self.tableWidgetYourIdentities.setColumnCount(3) - self.tableWidgetYourIdentities.setRowCount(0) - item = QtGui.QTableWidgetItem() - font = QtGui.QFont() - font.setKerning(True) - item.setFont(font) - item.setIcon(icon1) - self.tableWidgetYourIdentities.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tableWidgetYourIdentities.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tableWidgetYourIdentities.setHorizontalHeaderItem(2, item) - self.tableWidgetYourIdentities.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetYourIdentities.horizontalHeader().setDefaultSectionSize(200) - self.tableWidgetYourIdentities.horizontalHeader().setMinimumSectionSize(52) - self.tableWidgetYourIdentities.horizontalHeader().setSortIndicatorShown(True) - self.tableWidgetYourIdentities.horizontalHeader().setStretchLastSection(True) - self.tableWidgetYourIdentities.verticalHeader().setVisible(False) - self.tableWidgetYourIdentities.verticalHeader().setDefaultSectionSize(26) - self.tableWidgetYourIdentities.verticalHeader().setSortIndicatorShown(False) - self.tableWidgetYourIdentities.verticalHeader().setStretchLastSection(False) -<<<<<<< HEAD - self.verticalLayout_17.addWidget(self.tableWidgetYourIdentities) + self.treeWidgetChanList = QtGui.QTreeWidget(self.tab_3) + self.treeWidgetChanList.setMaximumSize(QtCore.QSize(200, 16777215)) + self.treeWidgetChanList.setFrameShadow(QtGui.QFrame.Sunken) + self.treeWidgetChanList.setLineWidth(1) + self.treeWidgetChanList.setAlternatingRowColors(True) + self.treeWidgetChanList.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.treeWidgetChanList.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.treeWidgetChanList.setObjectName(_fromUtf8("treeWidgetChanList")) + icon7 = QtGui.QIcon() + icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) + self.treeWidgetChanList.headerItem().setIcon(0, icon7) + self.verticalLayout_17.addWidget(self.treeWidgetChanList) self.pushButtonAddChanel = QtGui.QPushButton(self.tab_3) self.pushButtonAddChanel.setMaximumSize(QtCore.QSize(200, 16777215)) self.pushButtonAddChanel.setObjectName(_fromUtf8("pushButtonAddChanel")) @@ -519,70 +383,10 @@ class Ui_MainWindow(object): self.tableWidgetInbox_2.setObjectName(_fromUtf8("tableWidgetInbox_2")) self.tableWidgetInbox_2.setColumnCount(4) self.tableWidgetInbox_2.setRowCount(0) -======= - self.gridLayout_3.addWidget(self.tableWidgetYourIdentities, 1, 0, 1, 2) - icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/identities.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.youridentities, icon4, _fromUtf8("")) - self.subscriptions = QtGui.QWidget() - self.subscriptions.setObjectName(_fromUtf8("subscriptions")) - self.gridLayout_4 = QtGui.QGridLayout(self.subscriptions) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.label_5 = QtGui.QLabel(self.subscriptions) - self.label_5.setWordWrap(True) - self.label_5.setObjectName(_fromUtf8("label_5")) - self.gridLayout_4.addWidget(self.label_5, 0, 0, 1, 2) - self.pushButtonAddSubscription = QtGui.QPushButton(self.subscriptions) - self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) - self.gridLayout_4.addWidget(self.pushButtonAddSubscription, 1, 0, 1, 1) - spacerItem2 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_4.addItem(spacerItem2, 1, 1, 1, 1) - self.tableWidgetSubscriptions = QtGui.QTableWidget(self.subscriptions) - self.tableWidgetSubscriptions.setAlternatingRowColors(True) - self.tableWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tableWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetSubscriptions.setObjectName(_fromUtf8("tableWidgetSubscriptions")) - self.tableWidgetSubscriptions.setColumnCount(2) - self.tableWidgetSubscriptions.setRowCount(0) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e item = QtGui.QTableWidgetItem() self.tableWidgetInbox_2.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() -<<<<<<< HEAD self.tableWidgetInbox_2.setHorizontalHeaderItem(1, item) -======= - self.tableWidgetSubscriptions.setHorizontalHeaderItem(1, item) - self.tableWidgetSubscriptions.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetSubscriptions.horizontalHeader().setDefaultSectionSize(400) - self.tableWidgetSubscriptions.horizontalHeader().setHighlightSections(False) - self.tableWidgetSubscriptions.horizontalHeader().setSortIndicatorShown(False) - self.tableWidgetSubscriptions.horizontalHeader().setStretchLastSection(True) - self.tableWidgetSubscriptions.verticalHeader().setVisible(False) - self.gridLayout_4.addWidget(self.tableWidgetSubscriptions, 2, 0, 1, 2) - icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.subscriptions, icon5, _fromUtf8("")) - self.addressbook = QtGui.QWidget() - self.addressbook.setObjectName(_fromUtf8("addressbook")) - self.gridLayout_5 = QtGui.QGridLayout(self.addressbook) - self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) - self.label_6 = QtGui.QLabel(self.addressbook) - self.label_6.setWordWrap(True) - self.label_6.setObjectName(_fromUtf8("label_6")) - self.gridLayout_5.addWidget(self.label_6, 0, 0, 1, 2) - self.pushButtonAddAddressBook = QtGui.QPushButton(self.addressbook) - self.pushButtonAddAddressBook.setObjectName(_fromUtf8("pushButtonAddAddressBook")) - self.gridLayout_5.addWidget(self.pushButtonAddAddressBook, 1, 0, 1, 1) - spacerItem3 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_5.addItem(spacerItem3, 1, 1, 1, 1) - self.tableWidgetAddressBook = QtGui.QTableWidget(self.addressbook) - self.tableWidgetAddressBook.setAlternatingRowColors(True) - self.tableWidgetAddressBook.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.tableWidgetAddressBook.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetAddressBook.setObjectName(_fromUtf8("tableWidgetAddressBook")) - self.tableWidgetAddressBook.setColumnCount(2) - self.tableWidgetAddressBook.setRowCount(0) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e item = QtGui.QTableWidgetItem() self.tableWidgetInbox_2.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() @@ -603,9 +407,9 @@ class Ui_MainWindow(object): self.verticalLayout_13.addWidget(self.textEditInboxMessage_2) self.horizontalLayout_4.addLayout(self.verticalLayout_13) self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 1) - icon7 = QtGui.QIcon() - icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.tab_3, icon7, _fromUtf8("")) + icon8 = QtGui.QIcon() + icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.tab_3, icon8, _fromUtf8("")) self.blackwhitelist = QtGui.QWidget() self.blackwhitelist.setObjectName(_fromUtf8("blackwhitelist")) self.gridLayout_6 = QtGui.QGridLayout(self.blackwhitelist) @@ -620,13 +424,8 @@ class Ui_MainWindow(object): self.pushButtonAddBlacklist = QtGui.QPushButton(self.blackwhitelist) self.pushButtonAddBlacklist.setObjectName(_fromUtf8("pushButtonAddBlacklist")) self.gridLayout_6.addWidget(self.pushButtonAddBlacklist, 2, 0, 1, 1) -<<<<<<< HEAD spacerItem = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout_6.addItem(spacerItem, 2, 1, 1, 1) -======= - spacerItem4 = QtGui.QSpacerItem(689, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_6.addItem(spacerItem4, 2, 1, 1, 1) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e self.tableWidgetBlacklist = QtGui.QTableWidget(self.blackwhitelist) self.tableWidgetBlacklist.setAlternatingRowColors(True) self.tableWidgetBlacklist.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) @@ -645,17 +444,17 @@ class Ui_MainWindow(object): self.tableWidgetBlacklist.horizontalHeader().setStretchLastSection(True) self.tableWidgetBlacklist.verticalHeader().setVisible(False) self.gridLayout_6.addWidget(self.tableWidgetBlacklist, 3, 0, 1, 2) - icon8 = QtGui.QIcon() - icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/blacklist.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.blackwhitelist, icon8, _fromUtf8("")) + icon9 = QtGui.QIcon() + icon9.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/blacklist.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.blackwhitelist, icon9, _fromUtf8("")) self.networkstatus = QtGui.QWidget() self.networkstatus.setObjectName(_fromUtf8("networkstatus")) self.pushButtonStatusIcon = QtGui.QPushButton(self.networkstatus) self.pushButtonStatusIcon.setGeometry(QtCore.QRect(680, 440, 21, 23)) self.pushButtonStatusIcon.setText(_fromUtf8("")) - icon9 = QtGui.QIcon() - icon9.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/redicon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.pushButtonStatusIcon.setIcon(icon9) + icon10 = QtGui.QIcon() + icon10.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/redicon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.pushButtonStatusIcon.setIcon(icon10) self.pushButtonStatusIcon.setFlat(True) self.pushButtonStatusIcon.setObjectName(_fromUtf8("pushButtonStatusIcon")) self.tableWidgetConnectionCount = QtGui.QTableWidget(self.networkstatus) @@ -711,9 +510,9 @@ class Ui_MainWindow(object): self.labelBytesSentCount = QtGui.QLabel(self.networkstatus) self.labelBytesSentCount.setGeometry(QtCore.QRect(350, 230, 251, 16)) self.labelBytesSentCount.setObjectName(_fromUtf8("labelBytesSentCount")) - icon10 = QtGui.QIcon() - icon10.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/networkstatus.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.tabWidget.addTab(self.networkstatus, icon10, _fromUtf8("")) + icon11 = QtGui.QIcon() + icon11.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/networkstatus.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.tabWidget.addTab(self.networkstatus, icon11, _fromUtf8("")) self.gridLayout_10.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) @@ -779,15 +578,14 @@ class Ui_MainWindow(object): self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) - self.tabWidget_2.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.textEditMessage, self.pushButtonAddSubscription) MainWindow.setTabOrder(self.pushButtonAddSubscription, self.radioButtonBlacklist) MainWindow.setTabOrder(self.radioButtonBlacklist, self.radioButtonWhitelist) MainWindow.setTabOrder(self.radioButtonWhitelist, self.pushButtonAddBlacklist) @@ -809,58 +607,36 @@ class Ui_MainWindow(object): item.setText(_translate("MainWindow", "Subject", None)) item = self.tableWidgetInbox.horizontalHeaderItem(3) item.setText(_translate("MainWindow", "Received", None)) -<<<<<<< HEAD - self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Received", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages", None)) self.tableWidgetAddressBook.setSortingEnabled(True) item = self.tableWidgetAddressBook.horizontalHeaderItem(0) item.setText(_translate("MainWindow", "Name", None)) item = self.tableWidgetAddressBook.horizontalHeaderItem(1) item.setText(_translate("MainWindow", "Address", None)) self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact", None)) - self.label.setText(_translate("MainWindow", "To:", None)) + self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID", None)) self.label_3.setText(_translate("MainWindow", "Subject:", None)) -======= - self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Inbox", None)) - self.pushButtonLoadFromAddressBook.setText(_translate("MainWindow", "Load from Address book", None)) - self.label_3.setText(_translate("MainWindow", "Subject:", None)) - self.pushButtonSend.setText(_translate("MainWindow", "Send", None)) - self.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "X days", None)) - self.label_4.setText(_translate("MainWindow", "Message:", None)) - self.label.setText(_translate("MainWindow", "To:", None)) - self.radioButtonSpecific.setText(_translate("MainWindow", "Send to one or more specific people", None)) - self.labelSendBroadcastWarning.setText(_translate("MainWindow", "Be aware that broadcasts are only encrypted with your address. Anyone who knows your address can read them.", None)) - self.radioButtonBroadcast.setText(_translate("MainWindow", "Broadcast to everyone who is subscribed to your address", None)) - self.pushButtonTTL.setText(_translate("MainWindow", "TTL:", None)) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e self.label_2.setText(_translate("MainWindow", "From:", None)) + self.label.setText(_translate("MainWindow", "To:", None)) self.textEditMessage.setHtml(_translate("MainWindow", "\n" "\n" "


", None)) - self.pushButtonSend.setText(_translate("MainWindow", "Send", None)) - self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab), _translate("MainWindow", "Send ordinary Message", None)) + self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.tab), _translate("MainWindow", "Send ordinary Message", None)) self.label_8.setText(_translate("MainWindow", "From:", None)) self.label_7.setText(_translate("MainWindow", "Subject:", None)) - self.textEditMessage_2.setHtml(_translate("MainWindow", "\n" + self.textEditMessageBroadcast.setHtml(_translate("MainWindow", "\n" "\n" "


", None)) - self.pushButtonSend_3.setText(_translate("MainWindow", "Send", None)) - self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_2), _translate("MainWindow", "Send Message to your Subscribers", None)) -======= -"\n" -"


", None)) - self.pushButtonFetchNamecoinID.setText(_translate("MainWindow", "Fetch Namecoin ID", None)) ->>>>>>> bbb8c645afd8900b15ec35a1f1b632e095f41f6e + self.tabWidgetSend.setTabText(self.tabWidgetSend.indexOf(self.tab_2), _translate("MainWindow", "Send Message to your Subscribers", None)) + self.pushButtonTTL.setText(_translate("MainWindow", "TTL:", None)) + self.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "X days", None)) + self.pushButtonSend.setText(_translate("MainWindow", "Send", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)) - self.tableWidgetSubscriptions.setSortingEnabled(True) - item = self.tableWidgetSubscriptions.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Name", None)) - item = self.tableWidgetSubscriptions.horizontalHeaderItem(1) - item.setText(_translate("MainWindow", "Address", None)) + self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions", None)) self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription", None)) self.inboxSearchLineSubscriptions.setPlaceholderText(_translate("MainWindow", "Search", None)) self.tableWidgetInboxSubscriptions.setSortingEnabled(True) @@ -873,13 +649,7 @@ class Ui_MainWindow(object): item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3) item.setText(_translate("MainWindow", "Received", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions", None)) - self.tableWidgetYourIdentities.setSortingEnabled(True) - item = self.tableWidgetYourIdentities.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Name", None)) - item = self.tableWidgetYourIdentities.horizontalHeaderItem(1) - item.setText(_translate("MainWindow", "Address", None)) - item = self.tableWidgetYourIdentities.horizontalHeaderItem(2) - item.setText(_translate("MainWindow", "Stream", None)) + self.treeWidgetChanList.headerItem().setText(0, _translate("MainWindow", "Chans", None)) self.pushButtonAddChanel.setText(_translate("MainWindow", "Add Chanel", None)) self.inboxSearchLineEdit_2.setPlaceholderText(_translate("MainWindow", "Search", None)) self.tableWidgetInbox_2.setSortingEnabled(True) @@ -891,7 +661,7 @@ class Ui_MainWindow(object): item.setText(_translate("MainWindow", "Subject", None)) item = self.tableWidgetInbox_2.horizontalHeaderItem(3) item.setText(_translate("MainWindow", "Received", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Chanels", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Chans", None)) self.radioButtonBlacklist.setText(_translate("MainWindow", "Use a Blacklist (Allow all incoming messages except those on the Blacklist)", None)) self.radioButtonWhitelist.setText(_translate("MainWindow", "Use a Whitelist (Block all incoming messages except those on the Whitelist)", None)) self.pushButtonAddBlacklist.setText(_translate("MainWindow", "Add new entry", None)) diff --git a/src/bitmessageqt/bitmessageui.ui b/src/bitmessageqt/bitmessageui.ui index 8d006a89..09498ac4 100644 --- a/src/bitmessageqt/bitmessageui.ui +++ b/src/bitmessageqt/bitmessageui.ui @@ -54,7 +54,7 @@ QTabWidget::Rounded - 1 + 0 @@ -62,7 +62,7 @@ :/newPrefix/images/inbox.png:/newPrefix/images/inbox.png - Received + Messages @@ -213,7 +213,7 @@ Send - + @@ -283,280 +283,297 @@
+ + + + + 200 + 16777215 + + + + + 9 + + + + Fetch Namecoin ID + + +
- - - 0 - - - - Send ordinary Message - - - - - - - - - - Subject: - - + + + + + 0 + + + + Send ordinary Message + + + + + + + + + + Subject: + + + + + + + From: + + + + + + + + + + + + + + To: + + + + + + + + 300 + 0 + + + + + + + + - - - - From: - - - - - - - - - - - - - - To: - - - - - - - - 300 - 0 - - - - - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + <!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:'Droid 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 - - - - - - - - 35 - 0 - - - - - 70 - 16777215 - - - - Qt::Horizontal - - - false - - - false - - - - - - - - 0 - 0 - - - - - 45 - 0 - - - - - 45 - 16777215 - - - - X days - - - - - - - - 16777215 - 16777215 - - - - Send - - - - - - Send Message to your Subscribers - - - - - - - - - - From: - - + + + + Send Message to your Subscribers + + + + + + + + + + From: + + + + + + + + + + + + + + Subject: + + + + + + + + 300 + 0 + + + + + - - - - - - - - - - - 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:'Droid 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> - - - - <!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:'Droid 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 - - - + + + + + + + + + + 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 + + + + + + + + 16777215 + 16777215 + + + + Send + + -
- + + + + pushButtonFetchNamecoinID @@ -572,7 +589,7 @@ p, li { white-space: pre-wrap; } - + 200 @@ -588,30 +605,9 @@ p, li { white-space: pre-wrap; } QAbstractItemView::SelectRows - - true - - - true - - - 200 - - - false - - - false - - - true - - - false - - Name + Subscriptions @@ -619,11 +615,6 @@ p, li { white-space: pre-wrap; } - - - Address - - @@ -741,7 +732,7 @@ p, li { white-space: pre-wrap; } :/newPrefix/images/can-icon-16px.png:/newPrefix/images/can-icon-16px.png - Chanels + Chans @@ -749,7 +740,7 @@ p, li { white-space: pre-wrap; } - + 200 @@ -771,61 +762,16 @@ p, li { white-space: pre-wrap; } QAbstractItemView::SelectRows - - true - - - true - - - 200 - - - 52 - - - true - - - true - - - false - - - 26 - - - false - - - false - - Name - - - - true - + Chans - :/newPrefix/images/identities.png + :/newPrefix/images/can-icon-16px.png - - - Address - - - - - Stream - - From 484166882eed42b9b5137fc3535755e920942679 Mon Sep 17 00:00:00 2001 From: sbkaf Date: Mon, 23 Mar 2015 22:35:56 +0100 Subject: [PATCH 5/5] finished implementing more email client like interface --- src/bitmessagemain.py | 2 +- src/bitmessageqt/__init__.py | 894 ++++++++++++------------------- src/bitmessageqt/bitmessageui.py | 219 +++++--- src/bitmessageqt/bitmessageui.ui | 135 ++++- 4 files changed, 587 insertions(+), 663 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 4454b031..732c16c5 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -202,7 +202,7 @@ class Main: singleAPIThread.daemon = True # close the main program even if there are threads left singleAPIThread.start() - #connectToStream(1) + connectToStream(1) singleListenerThread = singleListener() singleListenerThread.setup(selfInitiatedConnections) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index acee89e4..6382d73f 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -199,7 +199,7 @@ class MyForm(QtGui.QMainWindow): QtCore.SIGNAL( "triggered()"), self.click_actionRegenerateDeterministicAddresses) - QtCore.QObject.connect(self.ui.pushButtonAddChanel, QtCore.SIGNAL( + QtCore.QObject.connect(self.ui.pushButtonAddChan, QtCore.SIGNAL( "clicked()"), self.click_actionJoinChan) # also used for creating chans. QtCore.QObject.connect(self.ui.pushButtonNewAddress, QtCore.SIGNAL( @@ -253,12 +253,27 @@ class MyForm(QtGui.QMainWindow): self.actionMarkUnread = self.ui.inboxContextMenuToolbar.addAction( _translate( "MainWindow", "Mark Unread"), self.on_action_InboxMarkUnread) + + # contextmenu messagelists self.ui.tableWidgetInbox.setContextMenuPolicy( QtCore.Qt.CustomContextMenu) if connectSignal: self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL( 'customContextMenuRequested(const QPoint&)'), self.on_context_menuInbox) + self.ui.tableWidgetInboxSubscriptions.setContextMenuPolicy( + QtCore.Qt.CustomContextMenu) + if connectSignal: + self.connect(self.ui.tableWidgetInboxSubscriptions, QtCore.SIGNAL( + 'customContextMenuRequested(const QPoint&)'), + self.on_context_menuInbox) + self.ui.tableWidgetInboxChans.setContextMenuPolicy( + QtCore.Qt.CustomContextMenu) + if connectSignal: + self.connect(self.ui.tableWidgetInboxChans, QtCore.SIGNAL( + 'customContextMenuRequested(const QPoint&)'), + self.on_context_menuInbox) + self.popMenuInbox = QtGui.QMenu(self) self.popMenuInbox.addAction(self.actionForceHtml) self.popMenuInbox.addAction(self.actionMarkUnread) @@ -312,7 +327,7 @@ class MyForm(QtGui.QMainWindow): self.popMenuYourIdentities.addAction(self.actionSpecialAddressBehaviorYourIdentities) def init_chan_popup_menu(self, connectSignal=True): - # Popup menu for the Chanels tab + # Popup menu for the Channels tab self.ui.addressContextMenuToolbar = QtGui.QToolBar() # Actions self.actionNew = self.ui.addressContextMenuToolbar.addAction(_translate( @@ -336,10 +351,10 @@ class MyForm(QtGui.QMainWindow): "MainWindow", "Special address behavior..."), self.on_action_SpecialAddressBehaviorDialog) - self.ui.treeWidgetChanList.setContextMenuPolicy( + self.ui.treeWidgetChans.setContextMenuPolicy( QtCore.Qt.CustomContextMenu) if connectSignal: - self.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( + self.connect(self.ui.treeWidgetChans, QtCore.SIGNAL( 'customContextMenuRequested(const QPoint&)'), self.on_context_menuChan) @@ -489,19 +504,53 @@ class MyForm(QtGui.QMainWindow): self.popMenuBlacklist.addAction(self.actionBlacklistDisable) self.popMenuBlacklist.addAction(self.actionBlacklistSetAvatar) + def rerenderTabTreeSubscriptions(self): + treeWidget = self.ui.treeWidgetSubscriptions + folders = ['inbox', 'trash'] + treeWidget.clear() + queryreturn = sqlQuery('SELECT label, address, enabled FROM subscriptions') + for row in queryreturn: + label, address, enabled = row + newItem = QtGui.QTreeWidgetItem(treeWidget) + newItem.setExpanded(True) + newItem.setIcon(0, avatarize(address)) + newItem.setText(0, label + ' (' + address + ')') + newItem.setData(0, Qt.UserRole, [str(address), "inbox"]) + #set text color + if enabled: + brush = QtGui.QBrush(QApplication.palette().text().color()) + else: + brush = QtGui.QBrush(QtGui.QColor(128, 128, 128)) + brush.setStyle(QtCore.Qt.NoBrush) + newItem.setForeground(0, brush) + + for folder in folders: + newSubItem = QtGui.QTreeWidgetItem(newItem) + newSubItem.setText(0, _translate("MainWindow", folder)) + newSubItem.setData(0, Qt.UserRole, [str(address), folder]) + + def rerenderTabTreeMessages(self): + self.rerenderTabTree('messages') + + def rerenderTabTreeChans(self): + self.rerenderTabTree('chan') + def rerenderTabTree(self, tab): + folders = ['inbox', 'sent', 'trash'] if tab == 'messages': treeWidget = self.ui.treeWidgetYourIdentities - folders = ['inbox', 'sent', 'trash'] - elif tab == 'subscriptions': - treeWidget = self.ui.treeWidgetSubscriptions - folders = ['inbox', 'trash'] elif tab == 'chan': - treeWidget = self.ui.treeWidgetChanList - folders = ['inbox', 'sent', 'trash'] + treeWidget = self.ui.treeWidgetChans treeWidget.clear() + # get number of (unread) messages + cntUnreadMsg = {} + queryreturn = sqlQuery('SELECT toaddress, folder, count(msgid) as cnt FROM inbox WHERE read = 0 GROUP BY toaddress, folder') + for row in queryreturn: + toaddress, folder, cnt = row + cntUnreadMsg[toaddress + folder] = cnt + configSections = shared.config.sections() for addressInKeysFile in configSections: if addressInKeysFile != 'bitmessagesettings': @@ -513,16 +562,14 @@ class MyForm(QtGui.QMainWindow): addressInKeysFile, 'mailinglist') if tab == 'messages': - if isChan or isMaillinglist: - continue - elif tab == 'subscriptions': - if not isMaillinglist: + if isChan: continue elif tab == 'chan': if not isChan: continue newItem = QtGui.QTreeWidgetItem(treeWidget) + newItem.setExpanded(True) newItem.setIcon(0, avatarize(addressInKeysFile)) newItem.setText(0, unicode( shared.config.get(addressInKeysFile, 'label'), 'utf-8)') @@ -530,7 +577,10 @@ class MyForm(QtGui.QMainWindow): newItem.setData(0, Qt.UserRole, [str(addressInKeysFile), "inbox"]) #set text color if isEnabled: - brush = QtGui.QBrush(QApplication.palette().text().color()) + if isMaillinglist: + brush = QtGui.QBrush(QtGui.QColor(137, 04, 177)) + else: + brush = QtGui.QBrush(QApplication.palette().text().color()) else: brush = QtGui.QBrush(QtGui.QColor(128, 128, 128)) brush.setStyle(QtCore.Qt.NoBrush) @@ -538,7 +588,17 @@ class MyForm(QtGui.QMainWindow): for folder in folders: newSubItem = QtGui.QTreeWidgetItem(newItem) - newSubItem.setText(0, _translate("MainWindow", folder)) + + cnt = cntUnreadMsg.get(addressInKeysFile + folder, False) + if cnt: + unreadText = " (" + str(cnt) + ")" + font = QtGui.QFont() + font.setBold(True) + newSubItem.setFont(0, font) + else: + unreadText = "" + + newSubItem.setText(0, _translate("MainWindow", folder) + unreadText) newSubItem.setData(0, Qt.UserRole, [str(addressInKeysFile), folder]) def __init__(self, parent=None): @@ -598,54 +658,18 @@ class MyForm(QtGui.QMainWindow): self.init_blacklist_popup_menu() # Initialize the user's list of addresses on the 'Chan' tab. - self.rerenderTabTree('chan') - """ - TODO remove - configSections = shared.config.sections() - for addressInKeysFile in configSections: - if addressInKeysFile != 'bitmessagesettings': - isEnabled = shared.config.getboolean( - addressInKeysFile, 'enabled') - if shared.safeConfigGetBoolean(addressInKeysFile, 'chan'): - newItem = QtGui.QTableWidgetItem(unicode( - shared.config.get(addressInKeysFile, 'label'), 'utf-8)')) - if not isEnabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetChanList.insertRow(0) - newItem.setIcon(avatarize(addressInKeysFile)) - self.ui.tableWidgetChanList.setItem(0, 0, newItem) - newItem = QtGui.QTableWidgetItem(addressInKeysFile) - newItem.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if shared.safeConfigGetBoolean(addressInKeysFile, 'chan'): - newItem.setTextColor(QtGui.QColor(216, 119, 0)) # orange - if not isEnabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - if shared.safeConfigGetBoolean(addressInKeysFile, 'mailinglist'): - newItem.setTextColor(QtGui.QColor(137, 04, 177)) # magenta - self.ui.tableWidgetChanList.setItem(0, 1, newItem) - newItem = QtGui.QTableWidgetItem(str( - decodeAddress(addressInKeysFile)[2])) - newItem.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if not isEnabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetChanList.setItem(0, 2, newItem) - if isEnabled: - status, addressVersionNumber, streamNumber, hash = decodeAddress( - addressInKeysFile) - """ + self.rerenderTabTreeChans() # Initialize the user's list of addresses on the 'Messages' tab. - self.rerenderTabTree('messages') + self.rerenderTabTreeMessages() # Set welcome message self.ui.textEditInboxMessage.setText( """ Welcome to easy and secure Bitmessage - * send messages like e-mails + * send messages to other people * send broadcast messages like twitter or - * discuss in chan(el)s with other people + * discuss in chan(nel)s with other people """ ) @@ -658,6 +682,10 @@ class MyForm(QtGui.QMainWindow): # Initialize the inbox search QtCore.QObject.connect(self.ui.inboxSearchLineEdit, QtCore.SIGNAL( "returnPressed()"), self.inboxSearchLineEditPressed) + QtCore.QObject.connect(self.ui.inboxSearchLineEditSubscriptions, QtCore.SIGNAL( + "returnPressed()"), self.inboxSearchLineEditPressed) + QtCore.QObject.connect(self.ui.inboxSearchLineEditChans, QtCore.SIGNAL( + "returnPressed()"), self.inboxSearchLineEditPressed) # Initialize the Blacklist or Whitelist if shared.config.get('bitmessagesettings', 'blackwhitelist') == 'white': @@ -665,24 +693,25 @@ class MyForm(QtGui.QMainWindow): self.ui.radioButtonWhitelist.click() self.rerenderBlackWhiteList() - # Initialize addresslists + # Initialize addressbook QtCore.QObject.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL( "itemChanged(QTableWidgetItem *)"), self.tableWidgetAddressBookItemChanged) - """ - TODO implement - QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( - "itemChanged(QTableWidgetItem *)"), self.treeWidgetSubscriptionsItemChanged) - QtCore.QObject.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( - "itemChanged(QTableWidgetItem *)"), self.treeWidgetChanListItemChanged) - """ + + # show messages from message list QtCore.QObject.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL( "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) + QtCore.QObject.connect(self.ui.tableWidgetInboxSubscriptions, QtCore.SIGNAL( + "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) + QtCore.QObject.connect(self.ui.tableWidgetInboxChans, QtCore.SIGNAL( + "itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) + + # tree address lists QtCore.QObject.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.treeWidgetYourIdentitiesItemClicked) + "itemSelectionChanged ()"), self.treeWidgetItemClicked) QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.treeWidgetSubscribtionsItemClicked) - QtCore.QObject.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( - "itemSelectionChanged ()"), self.treeWidgetChanListItemClicked) + "itemSelectionChanged ()"), self.treeWidgetItemClicked) + QtCore.QObject.connect(self.ui.treeWidgetChans, QtCore.SIGNAL( + "itemSelectionChanged ()"), self.treeWidgetItemClicked) # Put the colored icon on the status bar # self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png")) @@ -697,7 +726,7 @@ class MyForm(QtGui.QMainWindow): # Set the icon sizes for the identicons identicon_size = 3*7 self.ui.tableWidgetInbox.setIconSize(QtCore.QSize(identicon_size, identicon_size)) - self.ui.treeWidgetChanList.setIconSize(QtCore.QSize(identicon_size, identicon_size)) + self.ui.treeWidgetChans.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.treeWidgetYourIdentities.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.treeWidgetSubscriptions.setIconSize(QtCore.QSize(identicon_size, identicon_size)) self.ui.tableWidgetAddressBook.setIconSize(QtCore.QSize(identicon_size, identicon_size)) @@ -883,35 +912,35 @@ class MyForm(QtGui.QMainWindow): self.appIndicatorShow() self.ui.tabWidget.setCurrentIndex(2) - # Show the program window and select chanels tab - def appIndicatorChanel(self): + # Show the program window and select channels tab + def appIndicatorChannel(self): self.appIndicatorShow() self.ui.tabWidget.setCurrentIndex(3) # Load Sent items from database - def loadSent(self, where="", what=""): + def loadSent(self, tableWidget, account, where="", what=""): what = "%" + what + "%" - if where == "To": + if where == _translate("MainWindow", "To"): where = "toaddress" - elif where == "From": + elif where == _translate("MainWindow", "From"): where = "fromaddress" - elif where == "Subject": + elif where == _translate("MainWindow", "Subject"): where = "subject" - elif where == "Message": + elif where == _translate("MainWindow", "Message"): where = "message" else: where = "toaddress || fromaddress || subject || message" sqlStatement = ''' SELECT toaddress, fromaddress, subject, status, ackdata, lastactiontime - FROM sent WHERE folder="sent" AND %s LIKE ? + FROM sent WHERE fromaddress=? AND folder="sent" AND %s LIKE ? ORDER BY lastactiontime ''' % (where,) - while self.ui.tableWidgetInbox.rowCount() > 0: - self.ui.tableWidgetInbox.removeRow(0) + while tableWidget.rowCount() > 0: + tableWidget.removeRow(0) - queryreturn = sqlQuery(sqlStatement, what) + queryreturn = sqlQuery(sqlStatement, account, what) for row in queryreturn: toAddress, fromAddress, subject, status, ackdata, lastactiontime = row subject = shared.fixPotentiallyInvalidUTF8Data(subject) @@ -943,14 +972,14 @@ class MyForm(QtGui.QMainWindow): if toLabel == '': toLabel = toAddress - self.ui.tableWidgetInbox.insertRow(0) + tableWidget.insertRow(0) toAddressItem = QtGui.QTableWidgetItem(unicode(toLabel, 'utf-8')) toAddressItem.setToolTip(unicode(toLabel, 'utf-8')) toAddressItem.setIcon(avatarize(toAddress)) toAddressItem.setData(Qt.UserRole, str(toAddress)) toAddressItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetInbox.setItem(0, 0, toAddressItem) + tableWidget.setItem(0, 0, toAddressItem) if fromLabel == '': fromLabel = fromAddress @@ -960,13 +989,13 @@ class MyForm(QtGui.QMainWindow): fromAddressItem.setData(Qt.UserRole, str(fromAddress)) fromAddressItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetInbox.setItem(0, 1, fromAddressItem) + tableWidget.setItem(0, 1, fromAddressItem) subjectItem = QtGui.QTableWidgetItem(unicode(subject, 'utf-8')) subjectItem.setToolTip(unicode(subject, 'utf-8')) subjectItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetInbox.setItem(0, 2, subjectItem) + tableWidget.setItem(0, 2, subjectItem) if status == 'awaitingpubkey': statusText = _translate( @@ -1013,34 +1042,33 @@ class MyForm(QtGui.QMainWindow): newItem.setData(33, int(lastactiontime)) newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetInbox.setItem(0, 3, newItem) - self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder) - self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent + tableWidget.setItem(0, 3, newItem) + tableWidget.sortItems(3, Qt.DescendingOrder) + tableWidget.keyPressEvent = self.tableWidgetInboxKeyPressEvent - # Load inbox from messages database file + # Load messages from database file def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what=""): + if folder == 'sent': + self.loadSent(tableWidget, account, where, what) + return + what = "%" + what + "%" - if where == "To": + if where == _translate("MainWindow", "To"): where = "toaddress" - elif where == "From": + elif where == _translate("MainWindow", "From"): where = "fromaddress" - elif where == "Subject": + elif where == _translate("MainWindow", "Subject"): where = "subject" - elif where == "Message": + elif where == _translate("MainWindow", "Message"): where = "message" else: where = "toaddress || fromaddress || subject || message" - if folder == "sent": - accounttype = "fromaddress" - else: - accounttype = "toaddress" - sqlStatement = ''' SELECT msgid, toaddress, fromaddress, subject, received, read - FROM inbox WHERE %s=? AND folder=? AND %s LIKE ? + FROM inbox WHERE toaddress=? AND folder=? AND %s LIKE ? ORDER BY received - ''' % (accounttype, where) + ''' % (where) while tableWidget.rowCount() > 0: tableWidget.removeRow(0) @@ -1131,115 +1159,6 @@ class MyForm(QtGui.QMainWindow): tableWidget.sortItems(3, Qt.DescendingOrder) tableWidget.keyPressEvent = self.tableWidgetInboxKeyPressEvent - # Load inbox from messages database file - def loadInbox(self, where="", what=""): - what = "%" + what + "%" - if where == "To": - where = "toaddress" - elif where == "From": - where = "fromaddress" - elif where == "Subject": - where = "subject" - elif where == "Message": - where = "message" - else: - where = "toaddress || fromaddress || subject || message" - - sqlStatement = ''' - SELECT msgid, toaddress, fromaddress, subject, received, read - FROM inbox WHERE folder="inbox" AND %s LIKE ? - ORDER BY received - ''' % (where,) - - while self.ui.tableWidgetInbox.rowCount() > 0: - self.ui.tableWidgetInbox.removeRow(0) - - font = QFont() - font.setBold(True) - queryreturn = sqlQuery(sqlStatement, what) - for row in queryreturn: - msgid, toAddress, fromAddress, subject, received, read = row - subject = shared.fixPotentiallyInvalidUTF8Data(subject) - try: - if toAddress == self.str_broadcast_subscribers: - toLabel = self.str_broadcast_subscribers - else: - toLabel = shared.config.get(toAddress, 'label') - except: - toLabel = '' - if toLabel == '': - toLabel = toAddress - - fromLabel = '' - if shared.config.has_section(fromAddress): - fromLabel = shared.config.get(fromAddress, 'label') - - if fromLabel == '': # If the fromAddress isn't one of our addresses and isn't a chan - queryreturn = sqlQuery( - '''select label from addressbook where address=?''', fromAddress) - if queryreturn != []: - for row in queryreturn: - fromLabel, = row - - if fromLabel == '': # If this address wasn't in our address book... - queryreturn = sqlQuery( - '''select label from subscriptions where address=?''', fromAddress) - if queryreturn != []: - for row in queryreturn: - fromLabel, = row - if fromLabel == '': - fromLabel = fromAddress - - # message row - self.ui.tableWidgetInbox.insertRow(0) - # to - to_item = QtGui.QTableWidgetItem(unicode(toLabel, 'utf-8')) - to_item.setToolTip(unicode(toLabel, 'utf-8')) - to_item.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if not read: - to_item.setFont(font) - to_item.setData(Qt.UserRole, str(toAddress)) - if shared.safeConfigGetBoolean(toAddress, 'mailinglist'): - to_item.setTextColor(QtGui.QColor(137, 04, 177)) # magenta - if shared.safeConfigGetBoolean(str(toAddress), 'chan'): - to_item.setTextColor(QtGui.QColor(216, 119, 0)) # orange - to_item.setIcon(avatarize(toAddress)) - self.ui.tableWidgetInbox.setItem(0, 0, to_item) - # from - from_item = QtGui.QTableWidgetItem(unicode(fromLabel, 'utf-8')) - from_item.setToolTip(unicode(fromLabel, 'utf-8')) - from_item.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if not read: - from_item.setFont(font) - from_item.setData(Qt.UserRole, str(fromAddress)) - if shared.safeConfigGetBoolean(str(fromAddress), 'chan'): - from_item.setTextColor(QtGui.QColor(216, 119, 0)) # orange - from_item.setIcon(avatarize(fromAddress)) - self.ui.tableWidgetInbox.setItem(0, 1, from_item) - # subject - subject_item = QtGui.QTableWidgetItem(unicode(subject, 'utf-8')) - subject_item.setToolTip(unicode(subject, 'utf-8')) - subject_item.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if not read: - subject_item.setFont(font) - self.ui.tableWidgetInbox.setItem(0, 2, subject_item) - # time received - time_item = myTableWidgetItem(l10n.formatTimestamp(received)) - time_item.setToolTip(l10n.formatTimestamp(received)) - time_item.setData(Qt.UserRole, QByteArray(msgid)) - time_item.setData(33, int(received)) - time_item.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if not read: - time_item.setFont(font) - self.ui.tableWidgetInbox.setItem(0, 3, time_item) - - self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder) - self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent - # create application indicator def appIndicatorInit(self, app): self.initTrayIcon("can-icon-24px-red.png", app) @@ -1279,10 +1198,10 @@ class MyForm(QtGui.QMainWindow): actionSubscribe.triggered.connect(self.appIndicatorSubscribe) m.addAction(actionSubscribe) - # Chanels + # Channels actionSubscribe = QtGui.QAction(_translate( - "MainWindow", "Chanel"), m, checkable=False) - actionSubscribe.triggered.connect(self.appIndicatorChanel) + "MainWindow", "Channel"), m, checkable=False) + actionSubscribe.triggered.connect(self.appIndicatorChannel) m.addAction(actionSubscribe) # separator @@ -2070,26 +1989,7 @@ class MyForm(QtGui.QMainWindow): self.ui.tableWidgetAddressBook.setItem(0, 1, newItem) def rerenderSubscriptions(self): - self.rerenderTabTree('subscriptions') - """ - TODO remove - self.ui.tableWidgetSubscriptions.setRowCount(0) - queryreturn = sqlQuery('SELECT label, address, enabled FROM subscriptions') - for row in queryreturn: - label, address, enabled = row - self.ui.tableWidgetSubscriptions.insertRow(0) - newItem = QtGui.QTableWidgetItem(unicode(label, 'utf-8')) - if not enabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - newItem.setIcon(avatarize(address)) - self.ui.tableWidgetSubscriptions.setItem(0, 0, newItem) - newItem = QtGui.QTableWidgetItem(address) - newItem.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if not enabled: - newItem.setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetSubscriptions.setItem(0, 1, newItem) - """ + self.rerenderTabTreeSubscriptions() def rerenderBlackWhiteList(self): self.ui.tableWidgetBlacklist.setRowCount(0) @@ -2124,13 +2024,21 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.statusBar().showMessage('') if self.ui.tabWidgetSend.currentIndex() == 0: + # message to specific people sendMessageToPeople = True + fromAddress = self.ui.comboBoxSendFrom.itemData( + self.ui.comboBoxSendFrom.currentIndex(), + Qt.UserRole).toString() toAddresses = str(self.ui.lineEditTo.text()) subject = str(self.ui.lineEditSubject.text().toUtf8()) message = str( self.ui.textEditMessage.document().toPlainText().toUtf8()) else: + # broadcast message sendMessageToPeople = False + fromAddress = self.ui.comboBoxSendFromBroadcast.itemData( + self.ui.comboBoxSendFromBroadcast.currentIndex(), + Qt.UserRole).toString() subject = str(self.ui.lineEditSubjectBroadcast.text().toUtf8()) message = str( self.ui.textEditMessageBroadcast.document().toPlainText().toUtf8()) @@ -2146,11 +2054,6 @@ more work your computer must do to send the message. A Time-To-Live of four or f "MainWindow", "The message that you are trying to send is too long by %1 bytes. (The maximum is 261644 bytes). Please cut it down before sending.").arg(len(message) - (2 ** 18 - 500))) return - if toAddresses: - print toAddresses - print subject - print message - return if sendMessageToPeople: # To send a message to specific people (rather than broadcast) toAddressesList = [s.strip() for s in toAddresses.replace(',', ';').split(';')] @@ -2510,25 +2413,12 @@ more work your computer must do to send the message. A Time-To-Live of four or f #This should be handled outside of this function, for error displaying and such, but it must also be checked here. if shared.isAddressInMySubscriptionsList(address): return - """ - #Add to UI list - TODO remove - self.ui.tableWidgetSubscriptions.setSortingEnabled(False) - self.ui.tableWidgetSubscriptions.insertRow(0) - newItem = QtGui.QTableWidgetItem(unicode(label, 'utf-8')) - newItem.setIcon(avatarize(address)) - self.ui.tableWidgetSubscriptions.setItem(0,0,newItem) - newItem = QtGui.QTableWidgetItem(address) - newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled ) - self.ui.tableWidgetSubscriptions.setItem(0,1,newItem) - self.ui.tableWidgetSubscriptions.setSortingEnabled(True) - """ #Add to database (perhaps this should be separated from the MyForm class) sqlExecute('''INSERT INTO subscriptions VALUES (?,?,?)''',str(label),address,True) self.rerenderInboxFromLabels() shared.reloadBroadcastSendersForWhichImWatching() - self.rerenderTabTree('subscriptions') + self.rerenderTabTreeSubscriptions() def click_pushButtonAddSubscription(self): self.NewSubscriptionDialogInstance = NewSubscriptionDialog(self) @@ -2860,38 +2750,6 @@ more work your computer must do to send the message. A Time-To-Live of four or f shared.writeKeysFile() self.rerenderInboxToLabels() - """ - TODO remove - def on_action_ChanSpecialAddressBehaviorDialog(self): - self.dialog = SpecialAddressBehaviorDialog(self) - # For Modal dialogs - if self.dialog.exec_(): - currentRow = self.ui.tableWidgetChanList.currentRow() - addressAtCurrentRow = str( - self.ui.tableWidgetChanList.item(currentRow, 1).text()) - if shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): - return - if self.dialog.ui.radioButtonBehaveNormalAddress.isChecked(): - shared.config.set(str( - addressAtCurrentRow), 'mailinglist', 'false') - # Set the color to either black or grey - if shared.config.getboolean(addressAtCurrentRow, 'enabled'): - self.ui.tableWidgetChanList.item( - currentRow, 1).setTextColor(QApplication.palette() - .text().color()) - else: - self.ui.tableWidgetChanList.item( - currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128)) - else: - shared.config.set(str( - addressAtCurrentRow), 'mailinglist', 'true') - shared.config.set(str(addressAtCurrentRow), 'mailinglistname', str( - self.dialog.ui.lineEditMailingListName.text().toUtf8())) - self.ui.tableWidgetChanList.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177)) # magenta - shared.writeKeysFile() - self.rerenderInboxToLabels() - """ - def click_NewAddressDialog(self): self.dialog = NewAddressDialog(self) # For Modal dialogs @@ -2959,10 +2817,10 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.quit() def on_action_InboxMessageForceHtml(self): - currentInboxRow = self.ui.tableWidgetInbox.currentRow() - - msgid = str(self.ui.tableWidgetInbox.item( - currentInboxRow, 3).data(Qt.UserRole).toPyObject()) + msgid = self.getCurrentMessageId() + textEdit = self.getCurrentMessageTextedit() + if not msgid: + return queryreturn = sqlQuery( '''select message from inbox where msgid=?''', msgid) if queryreturn != []: @@ -2983,29 +2841,32 @@ more work your computer must do to send the message. A Time-To-Live of four or f content = ' '.join(lines) # To keep the whitespace between lines content = shared.fixPotentiallyInvalidUTF8Data(content) content = unicode(content, 'utf-8)') - self.ui.textEditInboxMessage.setHtml(QtCore.QString(content)) + textEdit.setHtml(QtCore.QString(content)) def on_action_InboxMarkUnread(self): + tableWidget = self.getCurrentMessagelist() + if not tableWidget: + return font = QFont() font.setBold(True) inventoryHashesToMarkUnread = [] - for row in self.ui.tableWidgetInbox.selectedIndexes(): + for row in tableWidget.selectedIndexes(): currentRow = row.row() - inventoryHashToMarkUnread = str(self.ui.tableWidgetInbox.item( + inventoryHashToMarkUnread = str(tableWidget.item( currentRow, 3).data(Qt.UserRole).toPyObject()) inventoryHashesToMarkUnread.append(inventoryHashToMarkUnread) - self.ui.tableWidgetInbox.item(currentRow, 0).setFont(font) - self.ui.tableWidgetInbox.item(currentRow, 1).setFont(font) - self.ui.tableWidgetInbox.item(currentRow, 2).setFont(font) - self.ui.tableWidgetInbox.item(currentRow, 3).setFont(font) + tableWidget.item(currentRow, 0).setFont(font) + tableWidget.item(currentRow, 1).setFont(font) + tableWidget.item(currentRow, 2).setFont(font) + tableWidget.item(currentRow, 3).setFont(font) #sqlite requires the exact number of ?s to prevent injection sqlExecute('''UPDATE inbox SET read=0 WHERE msgid IN (%s)''' % ( "?," * len(inventoryHashesToMarkUnread))[:-1], *inventoryHashesToMarkUnread) self.changedInboxUnread() - # self.ui.tableWidgetInbox.selectRow(currentRow + 1) + # tableWidget.selectRow(currentRow + 1) # This doesn't de-select the last message if you try to mark it unread, but that doesn't interfere. Might not be necessary. # We could also select upwards, but then our problem would be with the topmost message. - # self.ui.tableWidgetInbox.clearSelection() manages to mark the message as read again. + # tableWidget.clearSelection() manages to mark the message as read again. # Format predefined text on message reply. def quoted_text(self, message): @@ -3030,12 +2891,15 @@ more work your computer must do to send the message. A Time-To-Live of four or f return '\n'.join([quote_line(l) for l in message.splitlines()]) + '\n\n' def on_action_InboxReply(self): - currentInboxRow = self.ui.tableWidgetInbox.currentRow() - toAddressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item( + tableWidget = self.getCurrentMessagelist() + if not tableWidget: + return + currentInboxRow = tableWidget.currentRow() + toAddressAtCurrentInboxRow = str(tableWidget.item( currentInboxRow, 0).data(Qt.UserRole).toPyObject()) - fromAddressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item( + fromAddressAtCurrentInboxRow = str(tableWidget.item( currentInboxRow, 1).data(Qt.UserRole).toPyObject()) - msgid = str(self.ui.tableWidgetInbox.item( + msgid = str(tableWidget.item( currentInboxRow, 3).data(Qt.UserRole).toPyObject()) queryreturn = sqlQuery( '''select message from inbox where msgid=?''', msgid) @@ -3071,19 +2935,22 @@ more work your computer must do to send the message. A Time-To-Live of four or f quotedText = self.quoted_text(unicode(messageAtCurrentInboxRow, 'utf-8')) self.ui.textEditMessage.setText(quotedText) - if self.ui.tableWidgetInbox.item(currentInboxRow, 2).text()[0:3] in ['Re:', 'RE:']: + if tableWidget.item(currentInboxRow, 2).text()[0:3] in ['Re:', 'RE:']: self.ui.lineEditSubject.setText( - self.ui.tableWidgetInbox.item(currentInboxRow, 2).text()) + tableWidget.item(currentInboxRow, 2).text()) else: self.ui.lineEditSubject.setText( - 'Re: ' + self.ui.tableWidgetInbox.item(currentInboxRow, 2).text()) + 'Re: ' + tableWidget.item(currentInboxRow, 2).text()) self.ui.tabWidgetSend.setCurrentIndex(0) self.ui.tabWidget.setCurrentIndex(1) def on_action_InboxAddSenderToAddressBook(self): - currentInboxRow = self.ui.tableWidgetInbox.currentRow() - # self.ui.tableWidgetInbox.item(currentRow,1).data(Qt.UserRole).toPyObject() - addressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item( + tableWidget = self.getCurrentMessagelist() + if not tableWidget: + return + currentInboxRow = tableWidget.currentRow() + # tableWidget.item(currentRow,1).data(Qt.UserRole).toPyObject() + addressAtCurrentInboxRow = str(tableWidget.item( currentInboxRow, 1).data(Qt.UserRole).toPyObject()) # Let's make sure that it isn't already in the address book queryreturn = sqlQuery('''select * from addressbook where address=?''', @@ -3101,7 +2968,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f sqlExecute('''INSERT INTO addressbook VALUES (?,?)''', '--New entry. Change label in Address Book.--', addressAtCurrentInboxRow) - self.ui.tabWidget.setCurrentIndex(5) + self.ui.tabWidget.setCurrentIndex(1) self.ui.tableWidgetAddressBook.setCurrentCell(0, 0) self.statusBar().showMessage(_translate( "MainWindow", "Entry added to the Address Book. Edit the label to your liking.")) @@ -3111,29 +2978,35 @@ more work your computer must do to send the message. A Time-To-Live of four or f # Send item on the Inbox tab to trash def on_action_InboxTrash(self): - while self.ui.tableWidgetInbox.selectedIndexes() != []: - currentRow = self.ui.tableWidgetInbox.selectedIndexes()[0].row() - inventoryHashToTrash = str(self.ui.tableWidgetInbox.item( + tableWidget = self.getCurrentMessagelist() + if not tableWidget: + return + while tableWidget.selectedIndexes() != []: + currentRow = tableWidget.selectedIndexes()[0].row() + inventoryHashToTrash = str(tableWidget.item( currentRow, 3).data(Qt.UserRole).toPyObject()) sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', inventoryHashToTrash) self.ui.textEditInboxMessage.setText("") - self.ui.tableWidgetInbox.removeRow(currentRow) + tableWidget.removeRow(currentRow) self.statusBar().showMessage(_translate( "MainWindow", "Moved items to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.")) if currentRow == 0: - self.ui.tableWidgetInbox.selectRow(currentRow) + tableWidget.selectRow(currentRow) else: - self.ui.tableWidgetInbox.selectRow(currentRow - 1) + tableWidget.selectRow(currentRow - 1) def on_action_InboxSaveMessageAs(self): - currentInboxRow = self.ui.tableWidgetInbox.currentRow() + tableWidget = self.getCurrentMessagelist() + if not tableWidget: + return + currentInboxRow = tableWidget.currentRow() try: - subjectAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(currentInboxRow,2).text()) + subjectAtCurrentInboxRow = str(tableWidget.item(currentInboxRow,2).text()) except: subjectAtCurrentInboxRow = '' # Retrieve the message data out of the SQL database - msgid = str(self.ui.tableWidgetInbox.item( + msgid = str(tableWidget.item( currentInboxRow, 3).data(Qt.UserRole).toPyObject()) queryreturn = sqlQuery( '''select message from inbox where msgid=?''', msgid) @@ -3268,73 +3141,37 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.click_pushButtonAddSubscription() def on_action_SubscriptionsDelete(self): - print 'clicked Delete' - """ - TODO implement - currentRow = self.ui.tableWidgetSubscriptions.currentRow() - labelAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 0).text().toUtf8() - addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 1).text() - sqlExecute('''DELETE FROM subscriptions WHERE label=? AND address=?''', - str(labelAtCurrentRow), str(addressAtCurrentRow)) - self.ui.tableWidgetSubscriptions.removeRow(currentRow) + address = self.getCurrentAccount() + sqlExecute('''DELETE FROM subscriptions WHERE address=?''', + address) + self.rerenderTabTreeSubscriptions() self.rerenderInboxFromLabels() shared.reloadBroadcastSendersForWhichImWatching() - """ def on_action_SubscriptionsClipboard(self): - """ - TODO implement - currentRow = self.ui.tableWidgetSubscriptions.currentRow() - addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 1).text() + address = self.getCurrentAccount() clipboard = QtGui.QApplication.clipboard() - clipboard.setText(str(addressAtCurrentRow)) - """ + clipboard.setText(str(address)) def on_action_SubscriptionsEnable(self): - """ - TODO implement - currentRow = self.ui.tableWidgetSubscriptions.currentRow() - labelAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 0).text().toUtf8() - addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 1).text() + address = self.getCurrentAccount() sqlExecute( - '''update subscriptions set enabled=1 WHERE label=? AND address=?''', - str(labelAtCurrentRow), str(addressAtCurrentRow)) - self.ui.tableWidgetSubscriptions.item( - currentRow, 0).setTextColor(QApplication.palette().text().color()) - self.ui.tableWidgetSubscriptions.item( - currentRow, 1).setTextColor(QApplication.palette().text().color()) + '''update subscriptions set enabled=1 WHERE address=?''', + address) + self.setCurrentItemColor(QApplication.palette().text().color()) shared.reloadBroadcastSendersForWhichImWatching() - """ def on_action_SubscriptionsDisable(self): - """ - TODO implement - currentRow = self.ui.tableWidgetSubscriptions.currentRow() - labelAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 0).text().toUtf8() - addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 1).text() + address = self.getCurrentAccount() sqlExecute( - '''update subscriptions set enabled=0 WHERE label=? AND address=?''', - str(labelAtCurrentRow), str(addressAtCurrentRow)) - self.ui.tableWidgetSubscriptions.item( - currentRow, 0).setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetSubscriptions.item( - currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128)) + '''update subscriptions set enabled=0 WHERE address=?''', + address) + self.setCurrentItemColor(QtGui.QColor(128, 128, 128)) shared.reloadBroadcastSendersForWhichImWatching() - """ def on_context_menuSubscriptions(self, point): - """ - TODO implement self.popMenuSubscriptions.exec_( - self.ui.tableWidgetSubscriptions.mapToGlobal(point)) - """ + self.ui.treeWidgetSubscriptions.mapToGlobal(point)) # Group of functions for the Blacklist dialog box def on_action_BlacklistNew(self): @@ -3412,6 +3249,68 @@ more work your computer must do to send the message. A Time-To-Live of four or f else: return False + def getCurrentMessagelist(self): + currentIndex = self.ui.tabWidget.currentIndex(); + messagelistList = [ + self.ui.tableWidgetInbox, + False, + self.ui.tableWidgetInboxSubscriptions, + self.ui.tableWidgetInboxChans, + ] + if currentIndex >= 0 and currentIndex < len(messagelistList): + return messagelistList[currentIndex] + else: + return False + + def getCurrentMessageId(self): + messagelist = self.getCurrentMessagelist() + if messagelist: + currentRow = messagelist.currentRow() + if currentRow >= 0: + msgid = str(messagelist.item( + currentRow, 3).data(Qt.UserRole).toPyObject()) # data is saved at the 4. column of the table... + return msgid + return False + + def getCurrentMessageTextedit(self): + currentIndex = self.ui.tabWidget.currentIndex(); + messagelistList = [ + self.ui.textEditInboxMessage, + False, + self.ui.textEditInboxMessageSubscriptions, + self.ui.textEditInboxMessageChans, + ] + if currentIndex >= 0 and currentIndex < len(messagelistList): + return messagelistList[currentIndex] + else: + return False + + def getCurrentSearchLine(self): + currentIndex = self.ui.tabWidget.currentIndex(); + messagelistList = [ + self.ui.inboxSearchLineEdit, + False, + self.ui.inboxSearchLineEditSubscriptions, + self.ui.inboxSearchLineEditChans, + ] + if currentIndex >= 0 and currentIndex < len(messagelistList): + return messagelistList[currentIndex] + else: + return False + + def getCurrentSearchOption(self): + currentIndex = self.ui.tabWidget.currentIndex(); + messagelistList = [ + self.ui.inboxSearchOption, + False, + self.ui.inboxSearchOptionSubscriptions, + self.ui.inboxSearchOptionChans, + ] + if currentIndex >= 0 and currentIndex < len(messagelistList): + return messagelistList[currentIndex].currentText().toUtf8().data() + else: + return False + # Group of functions for the Your Identities dialog box def getCurrentAccount(self): treeWidget = self.getCurrentTreeWidget() @@ -3442,6 +3341,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f if treeWidget: brush = QtGui.QBrush() brush.setStyle(QtCore.Qt.NoBrush) + brush.setColor(color) currentItem = treeWidget.currentItem() currentItem.setForeground(0, brush) @@ -3453,25 +3353,6 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.enableIdentity(addressAtCurrentRow) self.setCurrentItemColor(QApplication.palette().text().color()) - """ - TODO remove - def on_action_ChanEnable(self): - currentRow = self.ui.tableWidgetChanList.currentRow() - addressAtCurrentRow = str( - self.ui.tableWidgetChanList.item(currentRow, 1).text()) - self.ui.tableWidgetChanList.item( - currentRow, 0).setTextColor(QApplication.palette().text().color()) - self.ui.tableWidgetChanList.item( - currentRow, 1).setTextColor(QApplication.palette().text().color()) - self.ui.tableWidgetChanList.item( - currentRow, 2).setTextColor(QApplication.palette().text().color()) - if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'): - self.ui.tableWidgetChanList.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177)) # magenta - if shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): - self.ui.tableWidgetChanList.item(currentRow, 1).setTextColor(QtGui.QColor(216, 119, 0)) # orange - self.enableIdentity(addressAtCurrentRow) - """ - def enableIdentity(self, address): shared.config.set(address, 'enabled', 'true') shared.writeKeysFile() @@ -3482,49 +3363,20 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.disableIdentity(address) self.setCurrentItemColor(QtGui.QColor(128, 128, 128)) - """ - TODO remove - def on_action_ChanDisable(self): - currentRow = self.ui.tableWidgetChanList.currentRow() - addressAtCurrentRow = str( - self.ui.tableWidgetChanList.item(currentRow, 1).text()) - self.ui.tableWidgetChanList.item( - currentRow, 0).setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetChanList.item( - currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128)) - self.ui.tableWidgetChanList.item( - currentRow, 2).setTextColor(QtGui.QColor(128, 128, 128)) - self.disableIdentity(address) - """ - def disableIdentity(self, address): - shared.config.set(str(addressAtCurrentRow), 'enabled', 'false') + shared.config.set(str(address), 'enabled', 'false') shared.writeKeysFile() shared.reloadMyAddressHashes() def on_action_Clipboard(self): - addressAtCurrentRow = self.getCurrentAccount() + address = self.getCurrentAccount() clipboard = QtGui.QApplication.clipboard() - clipboard.setText(str(addressAtCurrentRow)) - - """ - TODO remove - def on_action_ChanClipboard(self): - currentRow = self.ui.tableWidgetChanList.currentRow() - addressAtCurrentRow = self.ui.tableWidgetChanList.item( - currentRow, 1).text() - clipboard = QtGui.QApplication.clipboard() - clipboard.setText(str(addressAtCurrentRow)) - """ + clipboard.setText(str(address)) #set avatar functions def on_action_TreeWidgetSetAvatar(self): - addressAtCurrentRow = self.getCurrentAccount() - treeWidget = self.getCurrentTreeWidget() - setToIdenticon = not self.setAvatar(addressAtCurrentRow) - if treeWidget and setToIdenticon: - currentItem = treeWidget.currentItem() - currentItem.setIcon(0, avatarize(addressAtCurrentRow)) + address = self.getCurrentAccount() + self.setAvatar(address) def on_action_AddressBookSetAvatar(self): self.on_action_SetAvatar(self.ui.tableWidgetAddressBook) @@ -3595,7 +3447,9 @@ more work your computer must do to send the message. A Time-To-Live of four or f if not copied: print 'couldn\'t copy :(' # set the icon - self.rerenderSubscriptions() + self.rerenderTabTreeMessages() + self.rerenderTabTreeSubscriptions() + self.rerenderTabTreeChans() self.rerenderComboBoxSendFrom() self.rerenderComboBoxSendFromBroadcast() self.rerenderInboxFromLabels() @@ -3608,17 +3462,25 @@ more work your computer must do to send the message. A Time-To-Live of four or f return True - # TODO make one popMenu def on_context_menuYourIdentities(self, point): self.popMenuYourIdentities.exec_( self.ui.treeWidgetYourIdentities.mapToGlobal(point)) + # TODO make one popMenu def on_context_menuChan(self, point): self.popMenu.exec_( - self.ui.treeWidgetChanList.mapToGlobal(point)) + self.ui.treeWidgetChans.mapToGlobal(point)) def on_context_menuInbox(self, point): - self.popMenuInbox.exec_(self.ui.tableWidgetInbox.mapToGlobal(point)) + tableWidget = self.getCurrentMessagelist() + if tableWidget: + currentFolder = self.getCurrentFolder() + if currentFolder == False: + pass + if currentFolder == 'sent': + self.on_context_menuSent(point) + else: + self.popMenuInbox.exec_(tableWidget.mapToGlobal(point)) def on_context_menuSent(self, point): self.popMenuSent = QtGui.QMenu(self) @@ -3628,51 +3490,65 @@ more work your computer must do to send the message. A Time-To-Live of four or f # Check to see if this item is toodifficult and display an additional # menu option (Force Send) if it is. currentRow = self.ui.tableWidgetInbox.currentRow() - ackData = str(self.ui.tableWidgetInbox.item( - currentRow, 3).data(Qt.UserRole).toPyObject()) - queryreturn = sqlQuery('''SELECT status FROM sent where ackdata=?''', ackData) - for row in queryreturn: - status, = row - if status == 'toodifficult': - self.popMenuSent.addAction(self.actionForceSend) + if currentRow >= 0: + ackData = str(self.ui.tableWidgetInbox.item( + currentRow, 3).data(Qt.UserRole).toPyObject()) + queryreturn = sqlQuery('''SELECT status FROM sent where ackdata=?''', ackData) + for row in queryreturn: + status, = row + if status == 'toodifficult': + self.popMenuSent.addAction(self.actionForceSend) + self.popMenuSent.exec_(self.ui.tableWidgetInbox.mapToGlobal(point)) def inboxSearchLineEditPressed(self): - searchKeyword = self.ui.inboxSearchLineEdit.text().toUtf8().data() - searchOption = self.ui.inboxSearchOptionCB.currentText().toUtf8().data() - self.ui.inboxSearchLineEdit.setText(QString("")) - self.ui.textEditInboxMessage.setPlainText(QString("")) - self.loadInbox(searchOption, searchKeyword) + searchLine = self.getCurrentSearchLine() + searchOption = self.getCurrentSearchOption() + if searchLine: + searchKeyword = searchLine.text().toUtf8().data() + searchLine.setText(QString("")) + messageTextedit = self.getCurrentMessageTextedit() + if messageTextedit: + messageTextedit.setPlainText(QString("")) + messagelist = self.getCurrentMessagelist() + if messagelist: + account = self.getCurrentAccount() + folder = self.getCurrentFolder() + self.loadMessagelist(messagelist, account, folder, searchOption, searchKeyword) - def treeWidgetYourIdentitiesItemClicked(self): - currentItem = self.ui.treeWidgetYourIdentities.currentItem() - if currentItem: - accountFolder = currentItem.data(0, Qt.UserRole).toPyObject() - account = accountFolder[0] - folder = accountFolder[1] - self.loadMessagelist(self.ui.tableWidgetInbox, str(account), str(folder)) - - # TODO trees - def treeWidgetSubscribtionsItemClicked(self): - pass - - def treeWidgetChanListItemClicked(self): - pass + def treeWidgetItemClicked(self): + messagelist = self.getCurrentMessagelist() + if messagelist: + account = self.getCurrentAccount() + folder = self.getCurrentFolder() + self.loadMessagelist(messagelist, account, folder) def tableWidgetInboxItemClicked(self): - currentRow = self.ui.tableWidgetInbox.currentRow() - if currentRow >= 0: - msgid = str(self.ui.tableWidgetInbox.item( - currentRow, 3).data(Qt.UserRole).toPyObject()) - queryreturn = sqlQuery( - '''select message from inbox where msgid=?''', msgid) - if queryreturn != []: - for row in queryreturn: - message, = row - else: + folder = self.getCurrentFolder() + messageTextedit = self.getCurrentMessageTextedit() + queryreturn = [] + message = "" + + if folder == 'sent': + ackdata = self.getCurrentMessageId() + if ackdata and messageTextedit: + queryreturn = sqlQuery( + '''select message from sent where ackdata=?''', ackdata) + else: + msgid = self.getCurrentMessageId() + if msgid and messageTextedit: + queryreturn = sqlQuery( + '''select message from inbox where msgid=?''', msgid) + + if queryreturn != []: + for row in queryreturn: + message, = row + else: + data = self.getCurrentMessageId() + if data != False: message = "Error occurred: could not load message from disk." - message = unicode(message, 'utf-8)') - self.ui.textEditInboxMessage.setPlainText(message) + message = unicode(message, 'utf-8)') + messageTextedit.setPlainText(message) def tableWidgetAddressBookItemChanged(self): currentRow = self.ui.tableWidgetAddressBook.currentRow() @@ -3685,59 +3561,12 @@ more work your computer must do to send the message. A Time-To-Live of four or f self.rerenderInboxFromLabels() self.rerenderSentToLabels() - """ - TODO implement - def treeWidgetSubscriptionsItemChanged(self): - currentRow = self.ui.tableWidgetSubscriptions.currentRow() - if currentRow >= 0: - addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item( - currentRow, 1).text() - sqlExecute('''UPDATE subscriptions set label=? WHERE address=?''', - str(self.ui.tableWidgetSubscriptions.item(currentRow, 0).text().toUtf8()), - str(addressAtCurrentRow)) - self.rerenderInboxFromLabels() - self.rerenderSentToLabels() - - def treeWidgetChanListItemChanged(self): - currentRow = self.ui.tableWidgetChanList.currentRow() - if currentRow >= 0: - addressAtCurrentRow = self.ui.tableWidgetChanList.item( - currentRow, 1).text() - shared.config.set(str(addressAtCurrentRow), 'label', str( - self.ui.tableWidgetChanList.item(currentRow, 0).text().toUtf8())) - shared.writeKeysFile() - self.rerenderComboBoxSendFrom() - self.rerenderComboBoxSendFromBroadcast() - # self.rerenderInboxFromLabels() - self.rerenderInboxToLabels() - self.rerenderSentFromLabels() - # self.rerenderSentToLabels() - """ - def writeNewAddressToTable(self, label, address, streamNumber): - pass - """ - TODO implement - self.ui.tableWidgetChanList.setSortingEnabled(False) - self.ui.tableWidgetChanList.insertRow(0) - newItem = QtGui.QTableWidgetItem(unicode(label, 'utf-8')) - newItem.setIcon(avatarize(address)) - self.ui.tableWidgetChanList.setItem( - 0, 0, newItem) - newItem = QtGui.QTableWidgetItem(address) - newItem.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - if shared.safeConfigGetBoolean(address, 'chan'): - newItem.setTextColor(QtGui.QColor(216, 119, 0)) # orange - self.ui.tableWidgetChanList.setItem(0, 1, newItem) - newItem = QtGui.QTableWidgetItem(streamNumber) - newItem.setFlags( - QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - self.ui.tableWidgetChanList.setItem(0, 2, newItem) - # self.ui.tableWidgetChanList.setSortingEnabled(True) + self.rerenderTabTreeMessages() + self.rerenderTabTreeSubscriptions() + self.rerenderTabTreeChans() self.rerenderComboBoxSendFrom() self.rerenderComboBoxSendFromBroadcast() - """ def updateStatusBar(self, data): if data != "": @@ -4027,39 +3856,6 @@ class SpecialAddressBehaviorDialog(QtGui.QDialog): QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) -""" -TODO remove -class SpecialAddressBehaviorDialog(QtGui.QDialog): - - def __init__(self, parent): - QtGui.QWidget.__init__(self, parent) - self.ui = Ui_SpecialAddressBehaviorDialog() - self.ui.setupUi(self) - self.parent = parent - currentRow = parent.ui.tableWidgetChanList.currentRow() - addressAtCurrentRow = str( - parent.ui.tableWidgetChanList.item(currentRow, 1).text()) - if not shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'): - if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'): - self.ui.radioButtonBehaviorMailingList.click() - else: - self.ui.radioButtonBehaveNormalAddress.click() - try: - mailingListName = shared.config.get( - addressAtCurrentRow, 'mailinglistname') - except: - mailingListName = '' - self.ui.lineEditMailingListName.setText( - unicode(mailingListName, 'utf-8')) - else: # if addressAtCurrentRow is a chan address - self.ui.radioButtonBehaviorMailingList.setDisabled(True) - self.ui.lineEditMailingListName.setText(_translate( - "MainWindow", "This is a chan address. You cannot use it as a pseudo-mailing list.")) - - QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) -""" - - class AddAddressDialog(QtGui.QDialog): def __init__(self, parent): @@ -4163,8 +3959,6 @@ class NewSubscriptionDialog(QtGui.QDialog): class NewAddressDialog(QtGui.QDialog): def __init__(self, parent): - """ - TODO implement QtGui.QWidget.__init__(self, parent) self.ui = Ui_NewAddressDialog() self.ui.setupUi(self) @@ -4172,14 +3966,16 @@ class NewAddressDialog(QtGui.QDialog): row = 1 # Let's fill out the 'existing address' combo box with addresses from # the 'Your Identities' tab. - while self.parent.ui.tableWidgetChanList.item(row - 1, 1): + configSections = shared.config.sections() + for addressInKeysFile in configSections: + if addressInKeysFile == 'bitmessagesettings': + continue self.ui.radioButtonExisting.click() self.ui.comboBoxExisting.addItem( - self.parent.ui.tableWidgetChanList.item(row - 1, 1).text()) + addressInKeysFile) row += 1 self.ui.groupBoxDeterministic.setHidden(True) QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) - """ class newChanDialog(QtGui.QDialog): diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index 17ab57ee..d795f17c 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'bitmessageui.ui' # -# Created: Fri Mar 20 19:19:21 2015 +# Created: Mon Mar 23 22:18:07 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! @@ -69,15 +69,23 @@ class Ui_MainWindow(object): self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress")) self.verticalLayout_12.addWidget(self.pushButtonNewAddress) self.horizontalLayout_3.addLayout(self.verticalLayout_12) - self.verticalLayout_11 = QtGui.QVBoxLayout() - self.verticalLayout_11.setObjectName(_fromUtf8("verticalLayout_11")) + self.verticalLayout_7 = QtGui.QVBoxLayout() + self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7")) self.horizontalLayoutSearch = QtGui.QHBoxLayout() self.horizontalLayoutSearch.setContentsMargins(-1, 0, -1, -1) self.horizontalLayoutSearch.setObjectName(_fromUtf8("horizontalLayoutSearch")) self.inboxSearchLineEdit = QtGui.QLineEdit(self.inbox) self.inboxSearchLineEdit.setObjectName(_fromUtf8("inboxSearchLineEdit")) self.horizontalLayoutSearch.addWidget(self.inboxSearchLineEdit) - self.verticalLayout_11.addLayout(self.horizontalLayoutSearch) + self.inboxSearchOption = QtGui.QComboBox(self.inbox) + self.inboxSearchOption.setObjectName(_fromUtf8("inboxSearchOption")) + self.inboxSearchOption.addItem(_fromUtf8("")) + self.inboxSearchOption.addItem(_fromUtf8("")) + self.inboxSearchOption.addItem(_fromUtf8("")) + self.inboxSearchOption.addItem(_fromUtf8("")) + self.inboxSearchOption.addItem(_fromUtf8("")) + self.horizontalLayoutSearch.addWidget(self.inboxSearchOption) + self.verticalLayout_7.addLayout(self.horizontalLayoutSearch) self.tableWidgetInbox = QtGui.QTableWidget(self.inbox) self.tableWidgetInbox.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.tableWidgetInbox.setAlternatingRowColors(True) @@ -103,13 +111,13 @@ class Ui_MainWindow(object): self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True) self.tableWidgetInbox.verticalHeader().setVisible(False) self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26) - self.verticalLayout_11.addWidget(self.tableWidgetInbox) + self.verticalLayout_7.addWidget(self.tableWidgetInbox) self.textEditInboxMessage = QtGui.QTextEdit(self.inbox) self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessage.setReadOnly(True) self.textEditInboxMessage.setObjectName(_fromUtf8("textEditInboxMessage")) - self.verticalLayout_11.addWidget(self.textEditInboxMessage) - self.horizontalLayout_3.addLayout(self.verticalLayout_11) + self.verticalLayout_7.addWidget(self.textEditInboxMessage) + self.horizontalLayout_3.addLayout(self.verticalLayout_7) self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) @@ -278,10 +286,10 @@ class Ui_MainWindow(object): self.tabWidget.addTab(self.send, icon4, _fromUtf8("")) self.subscriptions = QtGui.QWidget() self.subscriptions.setObjectName(_fromUtf8("subscriptions")) - self.gridLayout_4 = QtGui.QGridLayout(self.subscriptions) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.horizontalLayout_2 = QtGui.QHBoxLayout() - self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) + self.gridLayout_3 = QtGui.QGridLayout(self.subscriptions) + self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) + self.horizontalLayout_4 = QtGui.QHBoxLayout() + self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) self.verticalLayout_3 = QtGui.QVBoxLayout() self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.treeWidgetSubscriptions = QtGui.QTreeWidget(self.subscriptions) @@ -298,12 +306,23 @@ class Ui_MainWindow(object): self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215)) self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) self.verticalLayout_3.addWidget(self.pushButtonAddSubscription) - self.horizontalLayout_2.addLayout(self.verticalLayout_3) + self.horizontalLayout_4.addLayout(self.verticalLayout_3) self.verticalLayout_4 = QtGui.QVBoxLayout() self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) - self.inboxSearchLineSubscriptions = QtGui.QLineEdit(self.subscriptions) - self.inboxSearchLineSubscriptions.setObjectName(_fromUtf8("inboxSearchLineSubscriptions")) - self.verticalLayout_4.addWidget(self.inboxSearchLineSubscriptions) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) + self.inboxSearchLineEditSubscriptions = QtGui.QLineEdit(self.subscriptions) + self.inboxSearchLineEditSubscriptions.setObjectName(_fromUtf8("inboxSearchLineEditSubscriptions")) + self.horizontalLayout_2.addWidget(self.inboxSearchLineEditSubscriptions) + self.inboxSearchOptionSubscriptions = QtGui.QComboBox(self.subscriptions) + self.inboxSearchOptionSubscriptions.setObjectName(_fromUtf8("inboxSearchOptionSubscriptions")) + self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) + self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) + self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) + self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) + self.inboxSearchOptionSubscriptions.addItem(_fromUtf8("")) + self.horizontalLayout_2.addWidget(self.inboxSearchOptionSubscriptions) + self.verticalLayout_4.addLayout(self.horizontalLayout_2) self.tableWidgetInboxSubscriptions = QtGui.QTableWidget(self.subscriptions) self.tableWidgetInboxSubscriptions.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True) @@ -330,83 +349,90 @@ class Ui_MainWindow(object): self.tableWidgetInboxSubscriptions.verticalHeader().setVisible(False) self.tableWidgetInboxSubscriptions.verticalHeader().setDefaultSectionSize(26) self.verticalLayout_4.addWidget(self.tableWidgetInboxSubscriptions) - self.textEditInboxSubscriptions = QtGui.QTextEdit(self.subscriptions) - self.textEditInboxSubscriptions.setBaseSize(QtCore.QSize(0, 500)) - self.textEditInboxSubscriptions.setReadOnly(True) - self.textEditInboxSubscriptions.setObjectName(_fromUtf8("textEditInboxSubscriptions")) - self.verticalLayout_4.addWidget(self.textEditInboxSubscriptions) - self.horizontalLayout_2.addLayout(self.verticalLayout_4) - self.gridLayout_4.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) + self.textEditInboxMessageSubscriptions = QtGui.QTextEdit(self.subscriptions) + self.textEditInboxMessageSubscriptions.setBaseSize(QtCore.QSize(0, 500)) + self.textEditInboxMessageSubscriptions.setReadOnly(True) + self.textEditInboxMessageSubscriptions.setObjectName(_fromUtf8("textEditInboxMessageSubscriptions")) + self.verticalLayout_4.addWidget(self.textEditInboxMessageSubscriptions) + self.horizontalLayout_4.addLayout(self.verticalLayout_4) + self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 1) icon6 = QtGui.QIcon() icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8("")) self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName(_fromUtf8("tab_3")) - self.gridLayout_3 = QtGui.QGridLayout(self.tab_3) - self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) - self.horizontalLayout_4 = QtGui.QHBoxLayout() - self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) + self.gridLayout_4 = QtGui.QGridLayout(self.tab_3) + self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) + self.horizontalLayout_7 = QtGui.QHBoxLayout() + self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7")) self.verticalLayout_17 = QtGui.QVBoxLayout() self.verticalLayout_17.setObjectName(_fromUtf8("verticalLayout_17")) - self.treeWidgetChanList = QtGui.QTreeWidget(self.tab_3) - self.treeWidgetChanList.setMaximumSize(QtCore.QSize(200, 16777215)) - self.treeWidgetChanList.setFrameShadow(QtGui.QFrame.Sunken) - self.treeWidgetChanList.setLineWidth(1) - self.treeWidgetChanList.setAlternatingRowColors(True) - self.treeWidgetChanList.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.treeWidgetChanList.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.treeWidgetChanList.setObjectName(_fromUtf8("treeWidgetChanList")) + self.treeWidgetChans = QtGui.QTreeWidget(self.tab_3) + self.treeWidgetChans.setMaximumSize(QtCore.QSize(200, 16777215)) + self.treeWidgetChans.setFrameShadow(QtGui.QFrame.Sunken) + self.treeWidgetChans.setLineWidth(1) + self.treeWidgetChans.setAlternatingRowColors(True) + self.treeWidgetChans.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.treeWidgetChans.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.treeWidgetChans.setObjectName(_fromUtf8("treeWidgetChans")) icon7 = QtGui.QIcon() icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) - self.treeWidgetChanList.headerItem().setIcon(0, icon7) - self.verticalLayout_17.addWidget(self.treeWidgetChanList) - self.pushButtonAddChanel = QtGui.QPushButton(self.tab_3) - self.pushButtonAddChanel.setMaximumSize(QtCore.QSize(200, 16777215)) - self.pushButtonAddChanel.setObjectName(_fromUtf8("pushButtonAddChanel")) - self.verticalLayout_17.addWidget(self.pushButtonAddChanel) - self.horizontalLayout_4.addLayout(self.verticalLayout_17) - self.verticalLayout_13 = QtGui.QVBoxLayout() - self.verticalLayout_13.setObjectName(_fromUtf8("verticalLayout_13")) - self.horizontalLayoutSearch_2 = QtGui.QHBoxLayout() - self.horizontalLayoutSearch_2.setContentsMargins(-1, 0, -1, -1) - self.horizontalLayoutSearch_2.setObjectName(_fromUtf8("horizontalLayoutSearch_2")) - self.inboxSearchLineEdit_2 = QtGui.QLineEdit(self.tab_3) - self.inboxSearchLineEdit_2.setObjectName(_fromUtf8("inboxSearchLineEdit_2")) - self.horizontalLayoutSearch_2.addWidget(self.inboxSearchLineEdit_2) - self.verticalLayout_13.addLayout(self.horizontalLayoutSearch_2) - self.tableWidgetInbox_2 = QtGui.QTableWidget(self.tab_3) - self.tableWidgetInbox_2.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tableWidgetInbox_2.setAlternatingRowColors(True) - self.tableWidgetInbox_2.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.tableWidgetInbox_2.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tableWidgetInbox_2.setWordWrap(False) - self.tableWidgetInbox_2.setObjectName(_fromUtf8("tableWidgetInbox_2")) - self.tableWidgetInbox_2.setColumnCount(4) - self.tableWidgetInbox_2.setRowCount(0) + self.treeWidgetChans.headerItem().setIcon(0, icon7) + self.verticalLayout_17.addWidget(self.treeWidgetChans) + self.pushButtonAddChan = QtGui.QPushButton(self.tab_3) + self.pushButtonAddChan.setMaximumSize(QtCore.QSize(200, 16777215)) + self.pushButtonAddChan.setObjectName(_fromUtf8("pushButtonAddChan")) + self.verticalLayout_17.addWidget(self.pushButtonAddChan) + self.horizontalLayout_7.addLayout(self.verticalLayout_17) + self.verticalLayout_8 = QtGui.QVBoxLayout() + self.verticalLayout_8.setObjectName(_fromUtf8("verticalLayout_8")) + self.horizontalLayout_6 = QtGui.QHBoxLayout() + self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) + self.inboxSearchLineEditChans = QtGui.QLineEdit(self.tab_3) + self.inboxSearchLineEditChans.setObjectName(_fromUtf8("inboxSearchLineEditChans")) + self.horizontalLayout_6.addWidget(self.inboxSearchLineEditChans) + self.inboxSearchOptionChans = QtGui.QComboBox(self.tab_3) + self.inboxSearchOptionChans.setObjectName(_fromUtf8("inboxSearchOptionChans")) + self.inboxSearchOptionChans.addItem(_fromUtf8("")) + self.inboxSearchOptionChans.addItem(_fromUtf8("")) + self.inboxSearchOptionChans.addItem(_fromUtf8("")) + self.inboxSearchOptionChans.addItem(_fromUtf8("")) + self.inboxSearchOptionChans.addItem(_fromUtf8("")) + self.horizontalLayout_6.addWidget(self.inboxSearchOptionChans) + self.verticalLayout_8.addLayout(self.horizontalLayout_6) + self.tableWidgetInboxChans = QtGui.QTableWidget(self.tab_3) + self.tableWidgetInboxChans.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tableWidgetInboxChans.setAlternatingRowColors(True) + self.tableWidgetInboxChans.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) + self.tableWidgetInboxChans.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tableWidgetInboxChans.setWordWrap(False) + self.tableWidgetInboxChans.setObjectName(_fromUtf8("tableWidgetInboxChans")) + self.tableWidgetInboxChans.setColumnCount(4) + self.tableWidgetInboxChans.setRowCount(0) item = QtGui.QTableWidgetItem() - self.tableWidgetInbox_2.setHorizontalHeaderItem(0, item) + self.tableWidgetInboxChans.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() - self.tableWidgetInbox_2.setHorizontalHeaderItem(1, item) + self.tableWidgetInboxChans.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() - self.tableWidgetInbox_2.setHorizontalHeaderItem(2, item) + self.tableWidgetInboxChans.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() - self.tableWidgetInbox_2.setHorizontalHeaderItem(3, item) - self.tableWidgetInbox_2.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetInbox_2.horizontalHeader().setDefaultSectionSize(200) - self.tableWidgetInbox_2.horizontalHeader().setHighlightSections(False) - self.tableWidgetInbox_2.horizontalHeader().setMinimumSectionSize(27) - self.tableWidgetInbox_2.horizontalHeader().setSortIndicatorShown(False) - self.tableWidgetInbox_2.horizontalHeader().setStretchLastSection(True) - self.tableWidgetInbox_2.verticalHeader().setVisible(False) - self.tableWidgetInbox_2.verticalHeader().setDefaultSectionSize(26) - self.verticalLayout_13.addWidget(self.tableWidgetInbox_2) - self.textEditInboxMessage_2 = QtGui.QTextEdit(self.tab_3) - self.textEditInboxMessage_2.setBaseSize(QtCore.QSize(0, 500)) - self.textEditInboxMessage_2.setReadOnly(True) - self.textEditInboxMessage_2.setObjectName(_fromUtf8("textEditInboxMessage_2")) - self.verticalLayout_13.addWidget(self.textEditInboxMessage_2) - self.horizontalLayout_4.addLayout(self.verticalLayout_13) - self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 1) + 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 = QtGui.QTextEdit(self.tab_3) + self.textEditInboxMessageChans.setBaseSize(QtCore.QSize(0, 500)) + self.textEditInboxMessageChans.setReadOnly(True) + self.textEditInboxMessageChans.setObjectName(_fromUtf8("textEditInboxMessageChans")) + self.verticalLayout_8.addWidget(self.textEditInboxMessageChans) + self.horizontalLayout_7.addLayout(self.verticalLayout_8) + self.gridLayout_4.addLayout(self.horizontalLayout_7, 0, 0, 1, 1) icon8 = QtGui.QIcon() icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.tab_3, icon8, _fromUtf8("")) @@ -598,6 +624,11 @@ class Ui_MainWindow(object): self.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities", None)) self.pushButtonNewAddress.setText(_translate("MainWindow", "New Indentitiy", None)) self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None)) + self.inboxSearchOption.setItemText(0, _translate("MainWindow", "All", None)) + self.inboxSearchOption.setItemText(1, _translate("MainWindow", "To", None)) + self.inboxSearchOption.setItemText(2, _translate("MainWindow", "From", None)) + self.inboxSearchOption.setItemText(3, _translate("MainWindow", "Subject", None)) + self.inboxSearchOption.setItemText(4, _translate("MainWindow", "Message", None)) self.tableWidgetInbox.setSortingEnabled(True) item = self.tableWidgetInbox.horizontalHeaderItem(0) item.setText(_translate("MainWindow", "To", None)) @@ -610,7 +641,7 @@ class Ui_MainWindow(object): self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages", None)) self.tableWidgetAddressBook.setSortingEnabled(True) item = self.tableWidgetAddressBook.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Name", None)) + item.setText(_translate("MainWindow", "Address book", None)) item = self.tableWidgetAddressBook.horizontalHeaderItem(1) item.setText(_translate("MainWindow", "Address", None)) self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact", None)) @@ -638,7 +669,12 @@ class Ui_MainWindow(object): self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)) self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions", None)) self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription", None)) - self.inboxSearchLineSubscriptions.setPlaceholderText(_translate("MainWindow", "Search", None)) + self.inboxSearchLineEditSubscriptions.setPlaceholderText(_translate("MainWindow", "Search", None)) + self.inboxSearchOptionSubscriptions.setItemText(0, _translate("MainWindow", "All", None)) + self.inboxSearchOptionSubscriptions.setItemText(1, _translate("MainWindow", "To", None)) + self.inboxSearchOptionSubscriptions.setItemText(2, _translate("MainWindow", "From", None)) + self.inboxSearchOptionSubscriptions.setItemText(3, _translate("MainWindow", "Subject", None)) + self.inboxSearchOptionSubscriptions.setItemText(4, _translate("MainWindow", "Message", None)) self.tableWidgetInboxSubscriptions.setSortingEnabled(True) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(0) item.setText(_translate("MainWindow", "To", None)) @@ -649,17 +685,22 @@ class Ui_MainWindow(object): item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3) item.setText(_translate("MainWindow", "Received", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions", None)) - self.treeWidgetChanList.headerItem().setText(0, _translate("MainWindow", "Chans", None)) - self.pushButtonAddChanel.setText(_translate("MainWindow", "Add Chanel", None)) - self.inboxSearchLineEdit_2.setPlaceholderText(_translate("MainWindow", "Search", None)) - self.tableWidgetInbox_2.setSortingEnabled(True) - item = self.tableWidgetInbox_2.horizontalHeaderItem(0) + self.treeWidgetChans.headerItem().setText(0, _translate("MainWindow", "Chans", None)) + self.pushButtonAddChan.setText(_translate("MainWindow", "Add Chan", None)) + self.inboxSearchLineEditChans.setPlaceholderText(_translate("MainWindow", "Search", None)) + self.inboxSearchOptionChans.setItemText(0, _translate("MainWindow", "All", None)) + self.inboxSearchOptionChans.setItemText(1, _translate("MainWindow", "To", None)) + 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) + item = self.tableWidgetInboxChans.horizontalHeaderItem(0) item.setText(_translate("MainWindow", "To", None)) - item = self.tableWidgetInbox_2.horizontalHeaderItem(1) + item = self.tableWidgetInboxChans.horizontalHeaderItem(1) item.setText(_translate("MainWindow", "From", None)) - item = self.tableWidgetInbox_2.horizontalHeaderItem(2) + item = self.tableWidgetInboxChans.horizontalHeaderItem(2) item.setText(_translate("MainWindow", "Subject", None)) - item = self.tableWidgetInbox_2.horizontalHeaderItem(3) + item = self.tableWidgetInboxChans.horizontalHeaderItem(3) item.setText(_translate("MainWindow", "Received", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Chans", None)) self.radioButtonBlacklist.setText(_translate("MainWindow", "Use a Blacklist (Allow all incoming messages except those on the Blacklist)", None)) diff --git a/src/bitmessageqt/bitmessageui.ui b/src/bitmessageqt/bitmessageui.ui index 09498ac4..cb50a858 100644 --- a/src/bitmessageqt/bitmessageui.ui +++ b/src/bitmessageqt/bitmessageui.ui @@ -105,7 +105,7 @@ - + @@ -118,6 +118,35 @@ + + + + + All + + + + + To + + + + + From + + + + + Subject + + + + + Message + + + + @@ -255,7 +284,7 @@ - Name + Address book @@ -573,7 +602,6 @@ p, li { white-space: pre-wrap; } - pushButtonFetchNamecoinID @@ -583,9 +611,9 @@ p, li { white-space: pre-wrap; } Subscriptions - + - + @@ -635,11 +663,44 @@ p, li { white-space: pre-wrap; } - - - Search - - + + + + + Search + + + + + + + + All + + + + + To + + + + + From + + + + + Subject + + + + + Message + + + + + @@ -708,7 +769,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -734,13 +795,13 @@ p, li { white-space: pre-wrap; } Chans - + - + - + 200 @@ -775,7 +836,7 @@ p, li { white-space: pre-wrap; } - + 200 @@ -783,30 +844,56 @@ p, li { white-space: pre-wrap; } - Add Chanel + Add Chan - + - - - 0 - + - + Search + + + + + All + + + + + To + + + + + From + + + + + Subject + + + + + Message + + + + - + QAbstractItemView::NoEditTriggers @@ -872,7 +959,7 @@ p, li { white-space: pre-wrap; } - + 0