finished implementing more email client like interface

This commit is contained in:
sbkaf 2015-03-23 22:35:56 +01:00 committed by Peter Surda
parent f6f68dc975
commit 800fd2a143
4 changed files with 587 additions and 663 deletions

View File

@ -197,7 +197,7 @@ class Main:
singleAPIThread.daemon = True # close the main program even if there are threads left singleAPIThread.daemon = True # close the main program even if there are threads left
singleAPIThread.start() singleAPIThread.start()
#connectToStream(1) connectToStream(1)
singleListenerThread = singleListener() singleListenerThread = singleListener()
singleListenerThread.setup(selfInitiatedConnections) singleListenerThread.setup(selfInitiatedConnections)

View File

@ -199,7 +199,7 @@ class MyForm(QtGui.QMainWindow):
QtCore.SIGNAL( QtCore.SIGNAL(
"triggered()"), "triggered()"),
self.click_actionRegenerateDeterministicAddresses) self.click_actionRegenerateDeterministicAddresses)
QtCore.QObject.connect(self.ui.pushButtonAddChanel, QtCore.SIGNAL( QtCore.QObject.connect(self.ui.pushButtonAddChan, QtCore.SIGNAL(
"clicked()"), "clicked()"),
self.click_actionJoinChan) # also used for creating chans. self.click_actionJoinChan) # also used for creating chans.
QtCore.QObject.connect(self.ui.pushButtonNewAddress, QtCore.SIGNAL( QtCore.QObject.connect(self.ui.pushButtonNewAddress, QtCore.SIGNAL(
@ -253,12 +253,27 @@ class MyForm(QtGui.QMainWindow):
self.actionMarkUnread = self.ui.inboxContextMenuToolbar.addAction( self.actionMarkUnread = self.ui.inboxContextMenuToolbar.addAction(
_translate( _translate(
"MainWindow", "Mark Unread"), self.on_action_InboxMarkUnread) "MainWindow", "Mark Unread"), self.on_action_InboxMarkUnread)
# contextmenu messagelists
self.ui.tableWidgetInbox.setContextMenuPolicy( self.ui.tableWidgetInbox.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL( self.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
'customContextMenuRequested(const QPoint&)'), 'customContextMenuRequested(const QPoint&)'),
self.on_context_menuInbox) 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 = QtGui.QMenu(self)
self.popMenuInbox.addAction(self.actionForceHtml) self.popMenuInbox.addAction(self.actionForceHtml)
self.popMenuInbox.addAction(self.actionMarkUnread) self.popMenuInbox.addAction(self.actionMarkUnread)
@ -312,7 +327,7 @@ class MyForm(QtGui.QMainWindow):
self.popMenuYourIdentities.addAction(self.actionSpecialAddressBehaviorYourIdentities) self.popMenuYourIdentities.addAction(self.actionSpecialAddressBehaviorYourIdentities)
def init_chan_popup_menu(self, connectSignal=True): 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() self.ui.addressContextMenuToolbar = QtGui.QToolBar()
# Actions # Actions
self.actionNew = self.ui.addressContextMenuToolbar.addAction(_translate( self.actionNew = self.ui.addressContextMenuToolbar.addAction(_translate(
@ -336,10 +351,10 @@ class MyForm(QtGui.QMainWindow):
"MainWindow", "Special address behavior..."), "MainWindow", "Special address behavior..."),
self.on_action_SpecialAddressBehaviorDialog) self.on_action_SpecialAddressBehaviorDialog)
self.ui.treeWidgetChanList.setContextMenuPolicy( self.ui.treeWidgetChans.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.CustomContextMenu)
if connectSignal: if connectSignal:
self.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( self.connect(self.ui.treeWidgetChans, QtCore.SIGNAL(
'customContextMenuRequested(const QPoint&)'), 'customContextMenuRequested(const QPoint&)'),
self.on_context_menuChan) self.on_context_menuChan)
@ -489,19 +504,53 @@ class MyForm(QtGui.QMainWindow):
self.popMenuBlacklist.addAction(self.actionBlacklistDisable) self.popMenuBlacklist.addAction(self.actionBlacklistDisable)
self.popMenuBlacklist.addAction(self.actionBlacklistSetAvatar) 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): def rerenderTabTree(self, tab):
folders = ['inbox', 'sent', 'trash']
if tab == 'messages': if tab == 'messages':
treeWidget = self.ui.treeWidgetYourIdentities treeWidget = self.ui.treeWidgetYourIdentities
folders = ['inbox', 'sent', 'trash']
elif tab == 'subscriptions':
treeWidget = self.ui.treeWidgetSubscriptions
folders = ['inbox', 'trash']
elif tab == 'chan': elif tab == 'chan':
treeWidget = self.ui.treeWidgetChanList treeWidget = self.ui.treeWidgetChans
folders = ['inbox', 'sent', 'trash']
treeWidget.clear() 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() configSections = shared.config.sections()
for addressInKeysFile in configSections: for addressInKeysFile in configSections:
if addressInKeysFile != 'bitmessagesettings': if addressInKeysFile != 'bitmessagesettings':
@ -513,16 +562,14 @@ class MyForm(QtGui.QMainWindow):
addressInKeysFile, 'mailinglist') addressInKeysFile, 'mailinglist')
if tab == 'messages': if tab == 'messages':
if isChan or isMaillinglist: if isChan:
continue
elif tab == 'subscriptions':
if not isMaillinglist:
continue continue
elif tab == 'chan': elif tab == 'chan':
if not isChan: if not isChan:
continue continue
newItem = QtGui.QTreeWidgetItem(treeWidget) newItem = QtGui.QTreeWidgetItem(treeWidget)
newItem.setExpanded(True)
newItem.setIcon(0, avatarize(addressInKeysFile)) newItem.setIcon(0, avatarize(addressInKeysFile))
newItem.setText(0, unicode( newItem.setText(0, unicode(
shared.config.get(addressInKeysFile, 'label'), 'utf-8)') shared.config.get(addressInKeysFile, 'label'), 'utf-8)')
@ -530,7 +577,10 @@ class MyForm(QtGui.QMainWindow):
newItem.setData(0, Qt.UserRole, [str(addressInKeysFile), "inbox"]) newItem.setData(0, Qt.UserRole, [str(addressInKeysFile), "inbox"])
#set text color #set text color
if isEnabled: 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: else:
brush = QtGui.QBrush(QtGui.QColor(128, 128, 128)) brush = QtGui.QBrush(QtGui.QColor(128, 128, 128))
brush.setStyle(QtCore.Qt.NoBrush) brush.setStyle(QtCore.Qt.NoBrush)
@ -538,7 +588,17 @@ class MyForm(QtGui.QMainWindow):
for folder in folders: for folder in folders:
newSubItem = QtGui.QTreeWidgetItem(newItem) 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]) newSubItem.setData(0, Qt.UserRole, [str(addressInKeysFile), folder])
def __init__(self, parent=None): def __init__(self, parent=None):
@ -598,54 +658,18 @@ class MyForm(QtGui.QMainWindow):
self.init_blacklist_popup_menu() self.init_blacklist_popup_menu()
# Initialize the user's list of addresses on the 'Chan' tab. # Initialize the user's list of addresses on the 'Chan' tab.
self.rerenderTabTree('chan') self.rerenderTabTreeChans()
"""
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)
"""
# Initialize the user's list of addresses on the 'Messages' tab. # Initialize the user's list of addresses on the 'Messages' tab.
self.rerenderTabTree('messages') self.rerenderTabTreeMessages()
# Set welcome message # Set welcome message
self.ui.textEditInboxMessage.setText( self.ui.textEditInboxMessage.setText(
""" """
Welcome to easy and secure Bitmessage Welcome to easy and secure Bitmessage
* send messages like e-mails * send messages to other people
* send broadcast messages like twitter or * 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 # Initialize the inbox search
QtCore.QObject.connect(self.ui.inboxSearchLineEdit, QtCore.SIGNAL( QtCore.QObject.connect(self.ui.inboxSearchLineEdit, QtCore.SIGNAL(
"returnPressed()"), self.inboxSearchLineEditPressed) "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 # Initialize the Blacklist or Whitelist
if shared.config.get('bitmessagesettings', 'blackwhitelist') == 'white': if shared.config.get('bitmessagesettings', 'blackwhitelist') == 'white':
@ -665,24 +693,25 @@ class MyForm(QtGui.QMainWindow):
self.ui.radioButtonWhitelist.click() self.ui.radioButtonWhitelist.click()
self.rerenderBlackWhiteList() self.rerenderBlackWhiteList()
# Initialize addresslists # Initialize addressbook
QtCore.QObject.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL( QtCore.QObject.connect(self.ui.tableWidgetAddressBook, QtCore.SIGNAL(
"itemChanged(QTableWidgetItem *)"), self.tableWidgetAddressBookItemChanged) "itemChanged(QTableWidgetItem *)"), self.tableWidgetAddressBookItemChanged)
"""
TODO implement # show messages from message list
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( QtCore.QObject.connect(self.ui.tableWidgetInbox, QtCore.SIGNAL(
"itemSelectionChanged ()"), self.tableWidgetInboxItemClicked) "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( QtCore.QObject.connect(self.ui.treeWidgetYourIdentities, QtCore.SIGNAL(
"itemSelectionChanged ()"), self.treeWidgetYourIdentitiesItemClicked) "itemSelectionChanged ()"), self.treeWidgetItemClicked)
QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL( QtCore.QObject.connect(self.ui.treeWidgetSubscriptions, QtCore.SIGNAL(
"itemSelectionChanged ()"), self.treeWidgetSubscribtionsItemClicked) "itemSelectionChanged ()"), self.treeWidgetItemClicked)
QtCore.QObject.connect(self.ui.treeWidgetChanList, QtCore.SIGNAL( QtCore.QObject.connect(self.ui.treeWidgetChans, QtCore.SIGNAL(
"itemSelectionChanged ()"), self.treeWidgetChanListItemClicked) "itemSelectionChanged ()"), self.treeWidgetItemClicked)
# Put the colored icon on the status bar # Put the colored icon on the status bar
# self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png")) # self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png"))
@ -697,7 +726,7 @@ class MyForm(QtGui.QMainWindow):
# Set the icon sizes for the identicons # Set the icon sizes for the identicons
identicon_size = 3*7 identicon_size = 3*7
self.ui.tableWidgetInbox.setIconSize(QtCore.QSize(identicon_size, identicon_size)) 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.treeWidgetYourIdentities.setIconSize(QtCore.QSize(identicon_size, identicon_size))
self.ui.treeWidgetSubscriptions.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.tableWidgetAddressBook.setIconSize(QtCore.QSize(identicon_size, identicon_size))
@ -883,35 +912,35 @@ class MyForm(QtGui.QMainWindow):
self.appIndicatorShow() self.appIndicatorShow()
self.ui.tabWidget.setCurrentIndex(2) self.ui.tabWidget.setCurrentIndex(2)
# Show the program window and select chanels tab # Show the program window and select channels tab
def appIndicatorChanel(self): def appIndicatorChannel(self):
self.appIndicatorShow() self.appIndicatorShow()
self.ui.tabWidget.setCurrentIndex(3) self.ui.tabWidget.setCurrentIndex(3)
# Load Sent items from database # Load Sent items from database
def loadSent(self, where="", what=""): def loadSent(self, tableWidget, account, where="", what=""):
what = "%" + what + "%" what = "%" + what + "%"
if where == "To": if where == _translate("MainWindow", "To"):
where = "toaddress" where = "toaddress"
elif where == "From": elif where == _translate("MainWindow", "From"):
where = "fromaddress" where = "fromaddress"
elif where == "Subject": elif where == _translate("MainWindow", "Subject"):
where = "subject" where = "subject"
elif where == "Message": elif where == _translate("MainWindow", "Message"):
where = "message" where = "message"
else: else:
where = "toaddress || fromaddress || subject || message" where = "toaddress || fromaddress || subject || message"
sqlStatement = ''' sqlStatement = '''
SELECT toaddress, fromaddress, subject, status, ackdata, lastactiontime 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 ORDER BY lastactiontime
''' % (where,) ''' % (where,)
while self.ui.tableWidgetInbox.rowCount() > 0: while tableWidget.rowCount() > 0:
self.ui.tableWidgetInbox.removeRow(0) tableWidget.removeRow(0)
queryreturn = sqlQuery(sqlStatement, what) queryreturn = sqlQuery(sqlStatement, account, what)
for row in queryreturn: for row in queryreturn:
toAddress, fromAddress, subject, status, ackdata, lastactiontime = row toAddress, fromAddress, subject, status, ackdata, lastactiontime = row
subject = shared.fixPotentiallyInvalidUTF8Data(subject) subject = shared.fixPotentiallyInvalidUTF8Data(subject)
@ -943,14 +972,14 @@ class MyForm(QtGui.QMainWindow):
if toLabel == '': if toLabel == '':
toLabel = toAddress toLabel = toAddress
self.ui.tableWidgetInbox.insertRow(0) tableWidget.insertRow(0)
toAddressItem = QtGui.QTableWidgetItem(unicode(toLabel, 'utf-8')) toAddressItem = QtGui.QTableWidgetItem(unicode(toLabel, 'utf-8'))
toAddressItem.setToolTip(unicode(toLabel, 'utf-8')) toAddressItem.setToolTip(unicode(toLabel, 'utf-8'))
toAddressItem.setIcon(avatarize(toAddress)) toAddressItem.setIcon(avatarize(toAddress))
toAddressItem.setData(Qt.UserRole, str(toAddress)) toAddressItem.setData(Qt.UserRole, str(toAddress))
toAddressItem.setFlags( toAddressItem.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
self.ui.tableWidgetInbox.setItem(0, 0, toAddressItem) tableWidget.setItem(0, 0, toAddressItem)
if fromLabel == '': if fromLabel == '':
fromLabel = fromAddress fromLabel = fromAddress
@ -960,13 +989,13 @@ class MyForm(QtGui.QMainWindow):
fromAddressItem.setData(Qt.UserRole, str(fromAddress)) fromAddressItem.setData(Qt.UserRole, str(fromAddress))
fromAddressItem.setFlags( fromAddressItem.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) 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 = QtGui.QTableWidgetItem(unicode(subject, 'utf-8'))
subjectItem.setToolTip(unicode(subject, 'utf-8')) subjectItem.setToolTip(unicode(subject, 'utf-8'))
subjectItem.setFlags( subjectItem.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
self.ui.tableWidgetInbox.setItem(0, 2, subjectItem) tableWidget.setItem(0, 2, subjectItem)
if status == 'awaitingpubkey': if status == 'awaitingpubkey':
statusText = _translate( statusText = _translate(
@ -1013,34 +1042,33 @@ class MyForm(QtGui.QMainWindow):
newItem.setData(33, int(lastactiontime)) newItem.setData(33, int(lastactiontime))
newItem.setFlags( newItem.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
self.ui.tableWidgetInbox.setItem(0, 3, newItem) tableWidget.setItem(0, 3, newItem)
self.ui.tableWidgetInbox.sortItems(3, Qt.DescendingOrder) tableWidget.sortItems(3, Qt.DescendingOrder)
self.ui.tableWidgetInbox.keyPressEvent = self.tableWidgetInboxKeyPressEvent tableWidget.keyPressEvent = self.tableWidgetInboxKeyPressEvent
# Load inbox from messages database file # Load messages from database file
def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what=""): def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what=""):
if folder == 'sent':
self.loadSent(tableWidget, account, where, what)
return
what = "%" + what + "%" what = "%" + what + "%"
if where == "To": if where == _translate("MainWindow", "To"):
where = "toaddress" where = "toaddress"
elif where == "From": elif where == _translate("MainWindow", "From"):
where = "fromaddress" where = "fromaddress"
elif where == "Subject": elif where == _translate("MainWindow", "Subject"):
where = "subject" where = "subject"
elif where == "Message": elif where == _translate("MainWindow", "Message"):
where = "message" where = "message"
else: else:
where = "toaddress || fromaddress || subject || message" where = "toaddress || fromaddress || subject || message"
if folder == "sent":
accounttype = "fromaddress"
else:
accounttype = "toaddress"
sqlStatement = ''' sqlStatement = '''
SELECT msgid, toaddress, fromaddress, subject, received, read 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 ORDER BY received
''' % (accounttype, where) ''' % (where)
while tableWidget.rowCount() > 0: while tableWidget.rowCount() > 0:
tableWidget.removeRow(0) tableWidget.removeRow(0)
@ -1131,115 +1159,6 @@ class MyForm(QtGui.QMainWindow):
tableWidget.sortItems(3, Qt.DescendingOrder) tableWidget.sortItems(3, Qt.DescendingOrder)
tableWidget.keyPressEvent = self.tableWidgetInboxKeyPressEvent 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 # create application indicator
def appIndicatorInit(self, app): def appIndicatorInit(self, app):
self.initTrayIcon("can-icon-24px-red.png", app) self.initTrayIcon("can-icon-24px-red.png", app)
@ -1279,10 +1198,10 @@ class MyForm(QtGui.QMainWindow):
actionSubscribe.triggered.connect(self.appIndicatorSubscribe) actionSubscribe.triggered.connect(self.appIndicatorSubscribe)
m.addAction(actionSubscribe) m.addAction(actionSubscribe)
# Chanels # Channels
actionSubscribe = QtGui.QAction(_translate( actionSubscribe = QtGui.QAction(_translate(
"MainWindow", "Chanel"), m, checkable=False) "MainWindow", "Channel"), m, checkable=False)
actionSubscribe.triggered.connect(self.appIndicatorChanel) actionSubscribe.triggered.connect(self.appIndicatorChannel)
m.addAction(actionSubscribe) m.addAction(actionSubscribe)
# separator # separator
@ -2072,26 +1991,7 @@ class MyForm(QtGui.QMainWindow):
self.ui.tableWidgetAddressBook.setItem(0, 1, newItem) self.ui.tableWidgetAddressBook.setItem(0, 1, newItem)
def rerenderSubscriptions(self): def rerenderSubscriptions(self):
self.rerenderTabTree('subscriptions') self.rerenderTabTreeSubscriptions()
"""
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)
"""
def rerenderBlackWhiteList(self): def rerenderBlackWhiteList(self):
self.ui.tableWidgetBlacklist.setRowCount(0) self.ui.tableWidgetBlacklist.setRowCount(0)
@ -2126,13 +2026,21 @@ more work your computer must do to send the message. A Time-To-Live of four or f
self.statusBar().showMessage('') self.statusBar().showMessage('')
if self.ui.tabWidgetSend.currentIndex() == 0: if self.ui.tabWidgetSend.currentIndex() == 0:
# message to specific people
sendMessageToPeople = True sendMessageToPeople = True
fromAddress = self.ui.comboBoxSendFrom.itemData(
self.ui.comboBoxSendFrom.currentIndex(),
Qt.UserRole).toString()
toAddresses = str(self.ui.lineEditTo.text()) toAddresses = str(self.ui.lineEditTo.text())
subject = str(self.ui.lineEditSubject.text().toUtf8()) subject = str(self.ui.lineEditSubject.text().toUtf8())
message = str( message = str(
self.ui.textEditMessage.document().toPlainText().toUtf8()) self.ui.textEditMessage.document().toPlainText().toUtf8())
else: else:
# broadcast message
sendMessageToPeople = False sendMessageToPeople = False
fromAddress = self.ui.comboBoxSendFromBroadcast.itemData(
self.ui.comboBoxSendFromBroadcast.currentIndex(),
Qt.UserRole).toString()
subject = str(self.ui.lineEditSubjectBroadcast.text().toUtf8()) subject = str(self.ui.lineEditSubjectBroadcast.text().toUtf8())
message = str( message = str(
self.ui.textEditMessageBroadcast.document().toPlainText().toUtf8()) self.ui.textEditMessageBroadcast.document().toPlainText().toUtf8())
@ -2148,11 +2056,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))) "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 return
if toAddresses:
print toAddresses
print subject
print message
return
if sendMessageToPeople: # To send a message to specific people (rather than broadcast) if sendMessageToPeople: # To send a message to specific people (rather than broadcast)
toAddressesList = [s.strip() toAddressesList = [s.strip()
for s in toAddresses.replace(',', ';').split(';')] for s in toAddresses.replace(',', ';').split(';')]
@ -2512,25 +2415,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. #This should be handled outside of this function, for error displaying and such, but it must also be checked here.
if shared.isAddressInMySubscriptionsList(address): if shared.isAddressInMySubscriptionsList(address):
return 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) #Add to database (perhaps this should be separated from the MyForm class)
sqlExecute('''INSERT INTO subscriptions VALUES (?,?,?)''',str(label),address,True) sqlExecute('''INSERT INTO subscriptions VALUES (?,?,?)''',str(label),address,True)
self.rerenderInboxFromLabels() self.rerenderInboxFromLabels()
shared.reloadBroadcastSendersForWhichImWatching() shared.reloadBroadcastSendersForWhichImWatching()
self.rerenderTabTree('subscriptions') self.rerenderTabTreeSubscriptions()
def click_pushButtonAddSubscription(self): def click_pushButtonAddSubscription(self):
self.NewSubscriptionDialogInstance = NewSubscriptionDialog(self) self.NewSubscriptionDialogInstance = NewSubscriptionDialog(self)
@ -2862,38 +2752,6 @@ more work your computer must do to send the message. A Time-To-Live of four or f
shared.writeKeysFile() shared.writeKeysFile()
self.rerenderInboxToLabels() 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): def click_NewAddressDialog(self):
self.dialog = NewAddressDialog(self) self.dialog = NewAddressDialog(self)
# For Modal dialogs # For Modal dialogs
@ -2961,10 +2819,10 @@ more work your computer must do to send the message. A Time-To-Live of four or f
self.quit() self.quit()
def on_action_InboxMessageForceHtml(self): def on_action_InboxMessageForceHtml(self):
currentInboxRow = self.ui.tableWidgetInbox.currentRow() msgid = self.getCurrentMessageId()
textEdit = self.getCurrentMessageTextedit()
msgid = str(self.ui.tableWidgetInbox.item( if not msgid:
currentInboxRow, 3).data(Qt.UserRole).toPyObject()) return
queryreturn = sqlQuery( queryreturn = sqlQuery(
'''select message from inbox where msgid=?''', msgid) '''select message from inbox where msgid=?''', msgid)
if queryreturn != []: if queryreturn != []:
@ -2985,29 +2843,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 = ' '.join(lines) # To keep the whitespace between lines
content = shared.fixPotentiallyInvalidUTF8Data(content) content = shared.fixPotentiallyInvalidUTF8Data(content)
content = unicode(content, 'utf-8)') content = unicode(content, 'utf-8)')
self.ui.textEditInboxMessage.setHtml(QtCore.QString(content)) textEdit.setHtml(QtCore.QString(content))
def on_action_InboxMarkUnread(self): def on_action_InboxMarkUnread(self):
tableWidget = self.getCurrentMessagelist()
if not tableWidget:
return
font = QFont() font = QFont()
font.setBold(True) font.setBold(True)
inventoryHashesToMarkUnread = [] inventoryHashesToMarkUnread = []
for row in self.ui.tableWidgetInbox.selectedIndexes(): for row in tableWidget.selectedIndexes():
currentRow = row.row() currentRow = row.row()
inventoryHashToMarkUnread = str(self.ui.tableWidgetInbox.item( inventoryHashToMarkUnread = str(tableWidget.item(
currentRow, 3).data(Qt.UserRole).toPyObject()) currentRow, 3).data(Qt.UserRole).toPyObject())
inventoryHashesToMarkUnread.append(inventoryHashToMarkUnread) inventoryHashesToMarkUnread.append(inventoryHashToMarkUnread)
self.ui.tableWidgetInbox.item(currentRow, 0).setFont(font) tableWidget.item(currentRow, 0).setFont(font)
self.ui.tableWidgetInbox.item(currentRow, 1).setFont(font) tableWidget.item(currentRow, 1).setFont(font)
self.ui.tableWidgetInbox.item(currentRow, 2).setFont(font) tableWidget.item(currentRow, 2).setFont(font)
self.ui.tableWidgetInbox.item(currentRow, 3).setFont(font) tableWidget.item(currentRow, 3).setFont(font)
#sqlite requires the exact number of ?s to prevent injection #sqlite requires the exact number of ?s to prevent injection
sqlExecute('''UPDATE inbox SET read=0 WHERE msgid IN (%s)''' % ( sqlExecute('''UPDATE inbox SET read=0 WHERE msgid IN (%s)''' % (
"?," * len(inventoryHashesToMarkUnread))[:-1], *inventoryHashesToMarkUnread) "?," * len(inventoryHashesToMarkUnread))[:-1], *inventoryHashesToMarkUnread)
self.changedInboxUnread() 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. # 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. # 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. # Format predefined text on message reply.
def quoted_text(self, message): def quoted_text(self, message):
@ -3032,12 +2893,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' return '\n'.join([quote_line(l) for l in message.splitlines()]) + '\n\n'
def on_action_InboxReply(self): def on_action_InboxReply(self):
currentInboxRow = self.ui.tableWidgetInbox.currentRow() tableWidget = self.getCurrentMessagelist()
toAddressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item( if not tableWidget:
return
currentInboxRow = tableWidget.currentRow()
toAddressAtCurrentInboxRow = str(tableWidget.item(
currentInboxRow, 0).data(Qt.UserRole).toPyObject()) currentInboxRow, 0).data(Qt.UserRole).toPyObject())
fromAddressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item( fromAddressAtCurrentInboxRow = str(tableWidget.item(
currentInboxRow, 1).data(Qt.UserRole).toPyObject()) currentInboxRow, 1).data(Qt.UserRole).toPyObject())
msgid = str(self.ui.tableWidgetInbox.item( msgid = str(tableWidget.item(
currentInboxRow, 3).data(Qt.UserRole).toPyObject()) currentInboxRow, 3).data(Qt.UserRole).toPyObject())
queryreturn = sqlQuery( queryreturn = sqlQuery(
'''select message from inbox where msgid=?''', msgid) '''select message from inbox where msgid=?''', msgid)
@ -3073,19 +2937,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')) quotedText = self.quoted_text(unicode(messageAtCurrentInboxRow, 'utf-8'))
self.ui.textEditMessage.setText(quotedText) 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.lineEditSubject.setText(
self.ui.tableWidgetInbox.item(currentInboxRow, 2).text()) tableWidget.item(currentInboxRow, 2).text())
else: else:
self.ui.lineEditSubject.setText( 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.tabWidgetSend.setCurrentIndex(0)
self.ui.tabWidget.setCurrentIndex(1) self.ui.tabWidget.setCurrentIndex(1)
def on_action_InboxAddSenderToAddressBook(self): def on_action_InboxAddSenderToAddressBook(self):
currentInboxRow = self.ui.tableWidgetInbox.currentRow() tableWidget = self.getCurrentMessagelist()
# self.ui.tableWidgetInbox.item(currentRow,1).data(Qt.UserRole).toPyObject() if not tableWidget:
addressAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item( return
currentInboxRow = tableWidget.currentRow()
# tableWidget.item(currentRow,1).data(Qt.UserRole).toPyObject()
addressAtCurrentInboxRow = str(tableWidget.item(
currentInboxRow, 1).data(Qt.UserRole).toPyObject()) currentInboxRow, 1).data(Qt.UserRole).toPyObject())
# Let's make sure that it isn't already in the address book # Let's make sure that it isn't already in the address book
queryreturn = sqlQuery('''select * from addressbook where address=?''', queryreturn = sqlQuery('''select * from addressbook where address=?''',
@ -3103,7 +2970,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f
sqlExecute('''INSERT INTO addressbook VALUES (?,?)''', sqlExecute('''INSERT INTO addressbook VALUES (?,?)''',
'--New entry. Change label in Address Book.--', '--New entry. Change label in Address Book.--',
addressAtCurrentInboxRow) addressAtCurrentInboxRow)
self.ui.tabWidget.setCurrentIndex(5) self.ui.tabWidget.setCurrentIndex(1)
self.ui.tableWidgetAddressBook.setCurrentCell(0, 0) self.ui.tableWidgetAddressBook.setCurrentCell(0, 0)
self.statusBar().showMessage(_translate( self.statusBar().showMessage(_translate(
"MainWindow", "Entry added to the Address Book. Edit the label to your liking.")) "MainWindow", "Entry added to the Address Book. Edit the label to your liking."))
@ -3113,29 +2980,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 # Send item on the Inbox tab to trash
def on_action_InboxTrash(self): def on_action_InboxTrash(self):
while self.ui.tableWidgetInbox.selectedIndexes() != []: tableWidget = self.getCurrentMessagelist()
currentRow = self.ui.tableWidgetInbox.selectedIndexes()[0].row() if not tableWidget:
inventoryHashToTrash = str(self.ui.tableWidgetInbox.item( return
while tableWidget.selectedIndexes() != []:
currentRow = tableWidget.selectedIndexes()[0].row()
inventoryHashToTrash = str(tableWidget.item(
currentRow, 3).data(Qt.UserRole).toPyObject()) currentRow, 3).data(Qt.UserRole).toPyObject())
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', inventoryHashToTrash) sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', inventoryHashToTrash)
self.ui.textEditInboxMessage.setText("") self.ui.textEditInboxMessage.setText("")
self.ui.tableWidgetInbox.removeRow(currentRow) tableWidget.removeRow(currentRow)
self.statusBar().showMessage(_translate( 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.")) "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: if currentRow == 0:
self.ui.tableWidgetInbox.selectRow(currentRow) tableWidget.selectRow(currentRow)
else: else:
self.ui.tableWidgetInbox.selectRow(currentRow - 1) tableWidget.selectRow(currentRow - 1)
def on_action_InboxSaveMessageAs(self): def on_action_InboxSaveMessageAs(self):
currentInboxRow = self.ui.tableWidgetInbox.currentRow() tableWidget = self.getCurrentMessagelist()
if not tableWidget:
return
currentInboxRow = tableWidget.currentRow()
try: try:
subjectAtCurrentInboxRow = str(self.ui.tableWidgetInbox.item(currentInboxRow,2).text()) subjectAtCurrentInboxRow = str(tableWidget.item(currentInboxRow,2).text())
except: except:
subjectAtCurrentInboxRow = '' subjectAtCurrentInboxRow = ''
# Retrieve the message data out of the SQL database # 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()) currentInboxRow, 3).data(Qt.UserRole).toPyObject())
queryreturn = sqlQuery( queryreturn = sqlQuery(
'''select message from inbox where msgid=?''', msgid) '''select message from inbox where msgid=?''', msgid)
@ -3270,73 +3143,37 @@ more work your computer must do to send the message. A Time-To-Live of four or f
self.click_pushButtonAddSubscription() self.click_pushButtonAddSubscription()
def on_action_SubscriptionsDelete(self): def on_action_SubscriptionsDelete(self):
print 'clicked Delete' address = self.getCurrentAccount()
""" sqlExecute('''DELETE FROM subscriptions WHERE address=?''',
TODO implement address)
currentRow = self.ui.tableWidgetSubscriptions.currentRow() self.rerenderTabTreeSubscriptions()
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)
self.rerenderInboxFromLabels() self.rerenderInboxFromLabels()
shared.reloadBroadcastSendersForWhichImWatching() shared.reloadBroadcastSendersForWhichImWatching()
"""
def on_action_SubscriptionsClipboard(self): def on_action_SubscriptionsClipboard(self):
""" address = self.getCurrentAccount()
TODO implement
currentRow = self.ui.tableWidgetSubscriptions.currentRow()
addressAtCurrentRow = self.ui.tableWidgetSubscriptions.item(
currentRow, 1).text()
clipboard = QtGui.QApplication.clipboard() clipboard = QtGui.QApplication.clipboard()
clipboard.setText(str(addressAtCurrentRow)) clipboard.setText(str(address))
"""
def on_action_SubscriptionsEnable(self): def on_action_SubscriptionsEnable(self):
""" address = self.getCurrentAccount()
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( sqlExecute(
'''update subscriptions set enabled=1 WHERE label=? AND address=?''', '''update subscriptions set enabled=1 WHERE address=?''',
str(labelAtCurrentRow), str(addressAtCurrentRow)) address)
self.ui.tableWidgetSubscriptions.item( self.setCurrentItemColor(QApplication.palette().text().color())
currentRow, 0).setTextColor(QApplication.palette().text().color())
self.ui.tableWidgetSubscriptions.item(
currentRow, 1).setTextColor(QApplication.palette().text().color())
shared.reloadBroadcastSendersForWhichImWatching() shared.reloadBroadcastSendersForWhichImWatching()
"""
def on_action_SubscriptionsDisable(self): def on_action_SubscriptionsDisable(self):
""" address = self.getCurrentAccount()
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( sqlExecute(
'''update subscriptions set enabled=0 WHERE label=? AND address=?''', '''update subscriptions set enabled=0 WHERE address=?''',
str(labelAtCurrentRow), str(addressAtCurrentRow)) address)
self.ui.tableWidgetSubscriptions.item( self.setCurrentItemColor(QtGui.QColor(128, 128, 128))
currentRow, 0).setTextColor(QtGui.QColor(128, 128, 128))
self.ui.tableWidgetSubscriptions.item(
currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128))
shared.reloadBroadcastSendersForWhichImWatching() shared.reloadBroadcastSendersForWhichImWatching()
"""
def on_context_menuSubscriptions(self, point): def on_context_menuSubscriptions(self, point):
"""
TODO implement
self.popMenuSubscriptions.exec_( self.popMenuSubscriptions.exec_(
self.ui.tableWidgetSubscriptions.mapToGlobal(point)) self.ui.treeWidgetSubscriptions.mapToGlobal(point))
"""
# Group of functions for the Blacklist dialog box # Group of functions for the Blacklist dialog box
def on_action_BlacklistNew(self): def on_action_BlacklistNew(self):
@ -3414,6 +3251,68 @@ more work your computer must do to send the message. A Time-To-Live of four or f
else: else:
return False 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 # Group of functions for the Your Identities dialog box
def getCurrentAccount(self): def getCurrentAccount(self):
treeWidget = self.getCurrentTreeWidget() treeWidget = self.getCurrentTreeWidget()
@ -3444,6 +3343,7 @@ more work your computer must do to send the message. A Time-To-Live of four or f
if treeWidget: if treeWidget:
brush = QtGui.QBrush() brush = QtGui.QBrush()
brush.setStyle(QtCore.Qt.NoBrush) brush.setStyle(QtCore.Qt.NoBrush)
brush.setColor(color)
currentItem = treeWidget.currentItem() currentItem = treeWidget.currentItem()
currentItem.setForeground(0, brush) currentItem.setForeground(0, brush)
@ -3455,25 +3355,6 @@ more work your computer must do to send the message. A Time-To-Live of four or f
self.enableIdentity(addressAtCurrentRow) self.enableIdentity(addressAtCurrentRow)
self.setCurrentItemColor(QApplication.palette().text().color()) 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): def enableIdentity(self, address):
shared.config.set(address, 'enabled', 'true') shared.config.set(address, 'enabled', 'true')
shared.writeKeysFile() shared.writeKeysFile()
@ -3484,49 +3365,20 @@ more work your computer must do to send the message. A Time-To-Live of four or f
self.disableIdentity(address) self.disableIdentity(address)
self.setCurrentItemColor(QtGui.QColor(128, 128, 128)) 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): def disableIdentity(self, address):
shared.config.set(str(addressAtCurrentRow), 'enabled', 'false') shared.config.set(str(address), 'enabled', 'false')
shared.writeKeysFile() shared.writeKeysFile()
shared.reloadMyAddressHashes() shared.reloadMyAddressHashes()
def on_action_Clipboard(self): def on_action_Clipboard(self):
addressAtCurrentRow = self.getCurrentAccount() address = self.getCurrentAccount()
clipboard = QtGui.QApplication.clipboard() clipboard = QtGui.QApplication.clipboard()
clipboard.setText(str(addressAtCurrentRow)) clipboard.setText(str(address))
"""
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 #set avatar functions
def on_action_TreeWidgetSetAvatar(self): def on_action_TreeWidgetSetAvatar(self):
addressAtCurrentRow = self.getCurrentAccount() address = self.getCurrentAccount()
treeWidget = self.getCurrentTreeWidget() self.setAvatar(address)
setToIdenticon = not self.setAvatar(addressAtCurrentRow)
if treeWidget and setToIdenticon:
currentItem = treeWidget.currentItem()
currentItem.setIcon(0, avatarize(addressAtCurrentRow))
def on_action_AddressBookSetAvatar(self): def on_action_AddressBookSetAvatar(self):
self.on_action_SetAvatar(self.ui.tableWidgetAddressBook) self.on_action_SetAvatar(self.ui.tableWidgetAddressBook)
@ -3597,7 +3449,9 @@ more work your computer must do to send the message. A Time-To-Live of four or f
if not copied: if not copied:
print 'couldn\'t copy :(' print 'couldn\'t copy :('
# set the icon # set the icon
self.rerenderSubscriptions() self.rerenderTabTreeMessages()
self.rerenderTabTreeSubscriptions()
self.rerenderTabTreeChans()
self.rerenderComboBoxSendFrom() self.rerenderComboBoxSendFrom()
self.rerenderComboBoxSendFromBroadcast() self.rerenderComboBoxSendFromBroadcast()
self.rerenderInboxFromLabels() self.rerenderInboxFromLabels()
@ -3610,17 +3464,25 @@ more work your computer must do to send the message. A Time-To-Live of four or f
return True return True
# TODO make one popMenu
def on_context_menuYourIdentities(self, point): def on_context_menuYourIdentities(self, point):
self.popMenuYourIdentities.exec_( self.popMenuYourIdentities.exec_(
self.ui.treeWidgetYourIdentities.mapToGlobal(point)) self.ui.treeWidgetYourIdentities.mapToGlobal(point))
# TODO make one popMenu
def on_context_menuChan(self, point): def on_context_menuChan(self, point):
self.popMenu.exec_( self.popMenu.exec_(
self.ui.treeWidgetChanList.mapToGlobal(point)) self.ui.treeWidgetChans.mapToGlobal(point))
def on_context_menuInbox(self, 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): def on_context_menuSent(self, point):
self.popMenuSent = QtGui.QMenu(self) self.popMenuSent = QtGui.QMenu(self)
@ -3630,51 +3492,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 # Check to see if this item is toodifficult and display an additional
# menu option (Force Send) if it is. # menu option (Force Send) if it is.
currentRow = self.ui.tableWidgetInbox.currentRow() currentRow = self.ui.tableWidgetInbox.currentRow()
ackData = str(self.ui.tableWidgetInbox.item( if currentRow >= 0:
currentRow, 3).data(Qt.UserRole).toPyObject()) ackData = str(self.ui.tableWidgetInbox.item(
queryreturn = sqlQuery('''SELECT status FROM sent where ackdata=?''', ackData) currentRow, 3).data(Qt.UserRole).toPyObject())
for row in queryreturn: queryreturn = sqlQuery('''SELECT status FROM sent where ackdata=?''', ackData)
status, = row for row in queryreturn:
if status == 'toodifficult': status, = row
self.popMenuSent.addAction(self.actionForceSend) if status == 'toodifficult':
self.popMenuSent.addAction(self.actionForceSend)
self.popMenuSent.exec_(self.ui.tableWidgetInbox.mapToGlobal(point)) self.popMenuSent.exec_(self.ui.tableWidgetInbox.mapToGlobal(point))
def inboxSearchLineEditPressed(self): def inboxSearchLineEditPressed(self):
searchKeyword = self.ui.inboxSearchLineEdit.text().toUtf8().data() searchLine = self.getCurrentSearchLine()
searchOption = self.ui.inboxSearchOptionCB.currentText().toUtf8().data() searchOption = self.getCurrentSearchOption()
self.ui.inboxSearchLineEdit.setText(QString("")) if searchLine:
self.ui.textEditInboxMessage.setPlainText(QString("")) searchKeyword = searchLine.text().toUtf8().data()
self.loadInbox(searchOption, searchKeyword) 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): def treeWidgetItemClicked(self):
currentItem = self.ui.treeWidgetYourIdentities.currentItem() messagelist = self.getCurrentMessagelist()
if currentItem: if messagelist:
accountFolder = currentItem.data(0, Qt.UserRole).toPyObject() account = self.getCurrentAccount()
account = accountFolder[0] folder = self.getCurrentFolder()
folder = accountFolder[1] self.loadMessagelist(messagelist, account, folder)
self.loadMessagelist(self.ui.tableWidgetInbox, str(account), str(folder))
# TODO trees
def treeWidgetSubscribtionsItemClicked(self):
pass
def treeWidgetChanListItemClicked(self):
pass
def tableWidgetInboxItemClicked(self): def tableWidgetInboxItemClicked(self):
currentRow = self.ui.tableWidgetInbox.currentRow() folder = self.getCurrentFolder()
if currentRow >= 0: messageTextedit = self.getCurrentMessageTextedit()
msgid = str(self.ui.tableWidgetInbox.item( queryreturn = []
currentRow, 3).data(Qt.UserRole).toPyObject()) message = ""
queryreturn = sqlQuery(
'''select message from inbox where msgid=?''', msgid) if folder == 'sent':
if queryreturn != []: ackdata = self.getCurrentMessageId()
for row in queryreturn: if ackdata and messageTextedit:
message, = row queryreturn = sqlQuery(
else: '''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 = "Error occurred: could not load message from disk."
message = unicode(message, 'utf-8)') message = unicode(message, 'utf-8)')
self.ui.textEditInboxMessage.setPlainText(message) messageTextedit.setPlainText(message)
def tableWidgetAddressBookItemChanged(self): def tableWidgetAddressBookItemChanged(self):
currentRow = self.ui.tableWidgetAddressBook.currentRow() currentRow = self.ui.tableWidgetAddressBook.currentRow()
@ -3687,59 +3563,12 @@ more work your computer must do to send the message. A Time-To-Live of four or f
self.rerenderInboxFromLabels() self.rerenderInboxFromLabels()
self.rerenderSentToLabels() 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): def writeNewAddressToTable(self, label, address, streamNumber):
pass self.rerenderTabTreeMessages()
""" self.rerenderTabTreeSubscriptions()
TODO implement self.rerenderTabTreeChans()
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.rerenderComboBoxSendFrom() self.rerenderComboBoxSendFrom()
self.rerenderComboBoxSendFromBroadcast() self.rerenderComboBoxSendFromBroadcast()
"""
def updateStatusBar(self, data): def updateStatusBar(self, data):
if data != "": if data != "":
@ -4029,39 +3858,6 @@ class SpecialAddressBehaviorDialog(QtGui.QDialog):
QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) 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): class AddAddressDialog(QtGui.QDialog):
def __init__(self, parent): def __init__(self, parent):
@ -4165,8 +3961,6 @@ class NewSubscriptionDialog(QtGui.QDialog):
class NewAddressDialog(QtGui.QDialog): class NewAddressDialog(QtGui.QDialog):
def __init__(self, parent): def __init__(self, parent):
"""
TODO implement
QtGui.QWidget.__init__(self, parent) QtGui.QWidget.__init__(self, parent)
self.ui = Ui_NewAddressDialog() self.ui = Ui_NewAddressDialog()
self.ui.setupUi(self) self.ui.setupUi(self)
@ -4174,14 +3968,16 @@ class NewAddressDialog(QtGui.QDialog):
row = 1 row = 1
# Let's fill out the 'existing address' combo box with addresses from # Let's fill out the 'existing address' combo box with addresses from
# the 'Your Identities' tab. # 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.radioButtonExisting.click()
self.ui.comboBoxExisting.addItem( self.ui.comboBoxExisting.addItem(
self.parent.ui.tableWidgetChanList.item(row - 1, 1).text()) addressInKeysFile)
row += 1 row += 1
self.ui.groupBoxDeterministic.setHidden(True) self.ui.groupBoxDeterministic.setHidden(True)
QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self)) QtGui.QWidget.resize(self, QtGui.QWidget.sizeHint(self))
"""
class newChanDialog(QtGui.QDialog): class newChanDialog(QtGui.QDialog):

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'bitmessageui.ui' # 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 # by: PyQt4 UI code generator 4.10.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -69,15 +69,23 @@ class Ui_MainWindow(object):
self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress")) self.pushButtonNewAddress.setObjectName(_fromUtf8("pushButtonNewAddress"))
self.verticalLayout_12.addWidget(self.pushButtonNewAddress) self.verticalLayout_12.addWidget(self.pushButtonNewAddress)
self.horizontalLayout_3.addLayout(self.verticalLayout_12) self.horizontalLayout_3.addLayout(self.verticalLayout_12)
self.verticalLayout_11 = QtGui.QVBoxLayout() self.verticalLayout_7 = QtGui.QVBoxLayout()
self.verticalLayout_11.setObjectName(_fromUtf8("verticalLayout_11")) self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7"))
self.horizontalLayoutSearch = QtGui.QHBoxLayout() self.horizontalLayoutSearch = QtGui.QHBoxLayout()
self.horizontalLayoutSearch.setContentsMargins(-1, 0, -1, -1) self.horizontalLayoutSearch.setContentsMargins(-1, 0, -1, -1)
self.horizontalLayoutSearch.setObjectName(_fromUtf8("horizontalLayoutSearch")) self.horizontalLayoutSearch.setObjectName(_fromUtf8("horizontalLayoutSearch"))
self.inboxSearchLineEdit = QtGui.QLineEdit(self.inbox) self.inboxSearchLineEdit = QtGui.QLineEdit(self.inbox)
self.inboxSearchLineEdit.setObjectName(_fromUtf8("inboxSearchLineEdit")) self.inboxSearchLineEdit.setObjectName(_fromUtf8("inboxSearchLineEdit"))
self.horizontalLayoutSearch.addWidget(self.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 = QtGui.QTableWidget(self.inbox)
self.tableWidgetInbox.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.tableWidgetInbox.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.tableWidgetInbox.setAlternatingRowColors(True) self.tableWidgetInbox.setAlternatingRowColors(True)
@ -103,13 +111,13 @@ class Ui_MainWindow(object):
self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True) self.tableWidgetInbox.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInbox.verticalHeader().setVisible(False) self.tableWidgetInbox.verticalHeader().setVisible(False)
self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26) self.tableWidgetInbox.verticalHeader().setDefaultSectionSize(26)
self.verticalLayout_11.addWidget(self.tableWidgetInbox) self.verticalLayout_7.addWidget(self.tableWidgetInbox)
self.textEditInboxMessage = QtGui.QTextEdit(self.inbox) self.textEditInboxMessage = QtGui.QTextEdit(self.inbox)
self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessage.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessage.setReadOnly(True) self.textEditInboxMessage.setReadOnly(True)
self.textEditInboxMessage.setObjectName(_fromUtf8("textEditInboxMessage")) self.textEditInboxMessage.setObjectName(_fromUtf8("textEditInboxMessage"))
self.verticalLayout_11.addWidget(self.textEditInboxMessage) self.verticalLayout_7.addWidget(self.textEditInboxMessage)
self.horizontalLayout_3.addLayout(self.verticalLayout_11) self.horizontalLayout_3.addLayout(self.verticalLayout_7)
self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
icon2 = QtGui.QIcon() icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/inbox.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon2.addPixmap(QtGui.QPixmap(_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.tabWidget.addTab(self.send, icon4, _fromUtf8(""))
self.subscriptions = QtGui.QWidget() self.subscriptions = QtGui.QWidget()
self.subscriptions.setObjectName(_fromUtf8("subscriptions")) self.subscriptions.setObjectName(_fromUtf8("subscriptions"))
self.gridLayout_4 = QtGui.QGridLayout(self.subscriptions) self.gridLayout_3 = QtGui.QGridLayout(self.subscriptions)
self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_4 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
self.verticalLayout_3 = QtGui.QVBoxLayout() self.verticalLayout_3 = QtGui.QVBoxLayout()
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
self.treeWidgetSubscriptions = QtGui.QTreeWidget(self.subscriptions) self.treeWidgetSubscriptions = QtGui.QTreeWidget(self.subscriptions)
@ -298,12 +306,23 @@ class Ui_MainWindow(object):
self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215)) self.pushButtonAddSubscription.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription")) self.pushButtonAddSubscription.setObjectName(_fromUtf8("pushButtonAddSubscription"))
self.verticalLayout_3.addWidget(self.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 = QtGui.QVBoxLayout()
self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
self.inboxSearchLineSubscriptions = QtGui.QLineEdit(self.subscriptions) self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.inboxSearchLineSubscriptions.setObjectName(_fromUtf8("inboxSearchLineSubscriptions")) self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.verticalLayout_4.addWidget(self.inboxSearchLineSubscriptions) 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 = QtGui.QTableWidget(self.subscriptions)
self.tableWidgetInboxSubscriptions.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.tableWidgetInboxSubscriptions.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True) self.tableWidgetInboxSubscriptions.setAlternatingRowColors(True)
@ -330,83 +349,90 @@ class Ui_MainWindow(object):
self.tableWidgetInboxSubscriptions.verticalHeader().setVisible(False) self.tableWidgetInboxSubscriptions.verticalHeader().setVisible(False)
self.tableWidgetInboxSubscriptions.verticalHeader().setDefaultSectionSize(26) self.tableWidgetInboxSubscriptions.verticalHeader().setDefaultSectionSize(26)
self.verticalLayout_4.addWidget(self.tableWidgetInboxSubscriptions) self.verticalLayout_4.addWidget(self.tableWidgetInboxSubscriptions)
self.textEditInboxSubscriptions = QtGui.QTextEdit(self.subscriptions) self.textEditInboxMessageSubscriptions = QtGui.QTextEdit(self.subscriptions)
self.textEditInboxSubscriptions.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessageSubscriptions.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxSubscriptions.setReadOnly(True) self.textEditInboxMessageSubscriptions.setReadOnly(True)
self.textEditInboxSubscriptions.setObjectName(_fromUtf8("textEditInboxSubscriptions")) self.textEditInboxMessageSubscriptions.setObjectName(_fromUtf8("textEditInboxMessageSubscriptions"))
self.verticalLayout_4.addWidget(self.textEditInboxSubscriptions) self.verticalLayout_4.addWidget(self.textEditInboxMessageSubscriptions)
self.horizontalLayout_2.addLayout(self.verticalLayout_4) self.horizontalLayout_4.addLayout(self.verticalLayout_4)
self.gridLayout_4.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 1)
icon6 = QtGui.QIcon() icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/subscriptions.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8("")) self.tabWidget.addTab(self.subscriptions, icon6, _fromUtf8(""))
self.tab_3 = QtGui.QWidget() self.tab_3 = QtGui.QWidget()
self.tab_3.setObjectName(_fromUtf8("tab_3")) self.tab_3.setObjectName(_fromUtf8("tab_3"))
self.gridLayout_3 = QtGui.QGridLayout(self.tab_3) self.gridLayout_4 = QtGui.QGridLayout(self.tab_3)
self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_7 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
self.verticalLayout_17 = QtGui.QVBoxLayout() self.verticalLayout_17 = QtGui.QVBoxLayout()
self.verticalLayout_17.setObjectName(_fromUtf8("verticalLayout_17")) self.verticalLayout_17.setObjectName(_fromUtf8("verticalLayout_17"))
self.treeWidgetChanList = QtGui.QTreeWidget(self.tab_3) self.treeWidgetChans = QtGui.QTreeWidget(self.tab_3)
self.treeWidgetChanList.setMaximumSize(QtCore.QSize(200, 16777215)) self.treeWidgetChans.setMaximumSize(QtCore.QSize(200, 16777215))
self.treeWidgetChanList.setFrameShadow(QtGui.QFrame.Sunken) self.treeWidgetChans.setFrameShadow(QtGui.QFrame.Sunken)
self.treeWidgetChanList.setLineWidth(1) self.treeWidgetChans.setLineWidth(1)
self.treeWidgetChanList.setAlternatingRowColors(True) self.treeWidgetChans.setAlternatingRowColors(True)
self.treeWidgetChanList.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.treeWidgetChans.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
self.treeWidgetChanList.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.treeWidgetChans.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.treeWidgetChanList.setObjectName(_fromUtf8("treeWidgetChanList")) self.treeWidgetChans.setObjectName(_fromUtf8("treeWidgetChans"))
icon7 = QtGui.QIcon() icon7 = QtGui.QIcon()
icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Selected, QtGui.QIcon.Off)
self.treeWidgetChanList.headerItem().setIcon(0, icon7) self.treeWidgetChans.headerItem().setIcon(0, icon7)
self.verticalLayout_17.addWidget(self.treeWidgetChanList) self.verticalLayout_17.addWidget(self.treeWidgetChans)
self.pushButtonAddChanel = QtGui.QPushButton(self.tab_3) self.pushButtonAddChan = QtGui.QPushButton(self.tab_3)
self.pushButtonAddChanel.setMaximumSize(QtCore.QSize(200, 16777215)) self.pushButtonAddChan.setMaximumSize(QtCore.QSize(200, 16777215))
self.pushButtonAddChanel.setObjectName(_fromUtf8("pushButtonAddChanel")) self.pushButtonAddChan.setObjectName(_fromUtf8("pushButtonAddChan"))
self.verticalLayout_17.addWidget(self.pushButtonAddChanel) self.verticalLayout_17.addWidget(self.pushButtonAddChan)
self.horizontalLayout_4.addLayout(self.verticalLayout_17) self.horizontalLayout_7.addLayout(self.verticalLayout_17)
self.verticalLayout_13 = QtGui.QVBoxLayout() self.verticalLayout_8 = QtGui.QVBoxLayout()
self.verticalLayout_13.setObjectName(_fromUtf8("verticalLayout_13")) self.verticalLayout_8.setObjectName(_fromUtf8("verticalLayout_8"))
self.horizontalLayoutSearch_2 = QtGui.QHBoxLayout() self.horizontalLayout_6 = QtGui.QHBoxLayout()
self.horizontalLayoutSearch_2.setContentsMargins(-1, 0, -1, -1) self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
self.horizontalLayoutSearch_2.setObjectName(_fromUtf8("horizontalLayoutSearch_2")) self.inboxSearchLineEditChans = QtGui.QLineEdit(self.tab_3)
self.inboxSearchLineEdit_2 = QtGui.QLineEdit(self.tab_3) self.inboxSearchLineEditChans.setObjectName(_fromUtf8("inboxSearchLineEditChans"))
self.inboxSearchLineEdit_2.setObjectName(_fromUtf8("inboxSearchLineEdit_2")) self.horizontalLayout_6.addWidget(self.inboxSearchLineEditChans)
self.horizontalLayoutSearch_2.addWidget(self.inboxSearchLineEdit_2) self.inboxSearchOptionChans = QtGui.QComboBox(self.tab_3)
self.verticalLayout_13.addLayout(self.horizontalLayoutSearch_2) self.inboxSearchOptionChans.setObjectName(_fromUtf8("inboxSearchOptionChans"))
self.tableWidgetInbox_2 = QtGui.QTableWidget(self.tab_3) self.inboxSearchOptionChans.addItem(_fromUtf8(""))
self.tableWidgetInbox_2.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.inboxSearchOptionChans.addItem(_fromUtf8(""))
self.tableWidgetInbox_2.setAlternatingRowColors(True) self.inboxSearchOptionChans.addItem(_fromUtf8(""))
self.tableWidgetInbox_2.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.inboxSearchOptionChans.addItem(_fromUtf8(""))
self.tableWidgetInbox_2.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.inboxSearchOptionChans.addItem(_fromUtf8(""))
self.tableWidgetInbox_2.setWordWrap(False) self.horizontalLayout_6.addWidget(self.inboxSearchOptionChans)
self.tableWidgetInbox_2.setObjectName(_fromUtf8("tableWidgetInbox_2")) self.verticalLayout_8.addLayout(self.horizontalLayout_6)
self.tableWidgetInbox_2.setColumnCount(4) self.tableWidgetInboxChans = QtGui.QTableWidget(self.tab_3)
self.tableWidgetInbox_2.setRowCount(0) 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() item = QtGui.QTableWidgetItem()
self.tableWidgetInbox_2.setHorizontalHeaderItem(0, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem()
self.tableWidgetInbox_2.setHorizontalHeaderItem(1, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem()
self.tableWidgetInbox_2.setHorizontalHeaderItem(2, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem()
self.tableWidgetInbox_2.setHorizontalHeaderItem(3, item) self.tableWidgetInboxChans.setHorizontalHeaderItem(3, item)
self.tableWidgetInbox_2.horizontalHeader().setCascadingSectionResizes(True) self.tableWidgetInboxChans.horizontalHeader().setCascadingSectionResizes(True)
self.tableWidgetInbox_2.horizontalHeader().setDefaultSectionSize(200) self.tableWidgetInboxChans.horizontalHeader().setDefaultSectionSize(200)
self.tableWidgetInbox_2.horizontalHeader().setHighlightSections(False) self.tableWidgetInboxChans.horizontalHeader().setHighlightSections(False)
self.tableWidgetInbox_2.horizontalHeader().setMinimumSectionSize(27) self.tableWidgetInboxChans.horizontalHeader().setMinimumSectionSize(27)
self.tableWidgetInbox_2.horizontalHeader().setSortIndicatorShown(False) self.tableWidgetInboxChans.horizontalHeader().setSortIndicatorShown(False)
self.tableWidgetInbox_2.horizontalHeader().setStretchLastSection(True) self.tableWidgetInboxChans.horizontalHeader().setStretchLastSection(True)
self.tableWidgetInbox_2.verticalHeader().setVisible(False) self.tableWidgetInboxChans.verticalHeader().setVisible(False)
self.tableWidgetInbox_2.verticalHeader().setDefaultSectionSize(26) self.tableWidgetInboxChans.verticalHeader().setDefaultSectionSize(26)
self.verticalLayout_13.addWidget(self.tableWidgetInbox_2) self.verticalLayout_8.addWidget(self.tableWidgetInboxChans)
self.textEditInboxMessage_2 = QtGui.QTextEdit(self.tab_3) self.textEditInboxMessageChans = QtGui.QTextEdit(self.tab_3)
self.textEditInboxMessage_2.setBaseSize(QtCore.QSize(0, 500)) self.textEditInboxMessageChans.setBaseSize(QtCore.QSize(0, 500))
self.textEditInboxMessage_2.setReadOnly(True) self.textEditInboxMessageChans.setReadOnly(True)
self.textEditInboxMessage_2.setObjectName(_fromUtf8("textEditInboxMessage_2")) self.textEditInboxMessageChans.setObjectName(_fromUtf8("textEditInboxMessageChans"))
self.verticalLayout_13.addWidget(self.textEditInboxMessage_2) self.verticalLayout_8.addWidget(self.textEditInboxMessageChans)
self.horizontalLayout_4.addLayout(self.verticalLayout_13) self.horizontalLayout_7.addLayout(self.verticalLayout_8)
self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 1) self.gridLayout_4.addLayout(self.horizontalLayout_7, 0, 0, 1, 1)
icon8 = QtGui.QIcon() icon8 = QtGui.QIcon()
icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/can-icon-16px.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) 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.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.treeWidgetYourIdentities.headerItem().setText(0, _translate("MainWindow", "Identities", None))
self.pushButtonNewAddress.setText(_translate("MainWindow", "New Indentitiy", None)) self.pushButtonNewAddress.setText(_translate("MainWindow", "New Indentitiy", None))
self.inboxSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", 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) self.tableWidgetInbox.setSortingEnabled(True)
item = self.tableWidgetInbox.horizontalHeaderItem(0) item = self.tableWidgetInbox.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "To", None)) item.setText(_translate("MainWindow", "To", None))
@ -610,7 +641,7 @@ class Ui_MainWindow(object):
self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Messages", None))
self.tableWidgetAddressBook.setSortingEnabled(True) self.tableWidgetAddressBook.setSortingEnabled(True)
item = self.tableWidgetAddressBook.horizontalHeaderItem(0) item = self.tableWidgetAddressBook.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "Name", None)) item.setText(_translate("MainWindow", "Address book", None))
item = self.tableWidgetAddressBook.horizontalHeaderItem(1) item = self.tableWidgetAddressBook.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "Address", None)) item.setText(_translate("MainWindow", "Address", None))
self.pushButtonAddAddressBook.setText(_translate("MainWindow", "Add Contact", 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.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None))
self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions", None)) self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions", None))
self.pushButtonAddSubscription.setText(_translate("MainWindow", "Add new Subscription", 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) self.tableWidgetInboxSubscriptions.setSortingEnabled(True)
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(0) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "To", None)) item.setText(_translate("MainWindow", "To", None))
@ -649,17 +685,22 @@ class Ui_MainWindow(object):
item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3) item = self.tableWidgetInboxSubscriptions.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.subscriptions), _translate("MainWindow", "Subscriptions", None))
self.treeWidgetChanList.headerItem().setText(0, _translate("MainWindow", "Chans", None)) self.treeWidgetChans.headerItem().setText(0, _translate("MainWindow", "Chans", None))
self.pushButtonAddChanel.setText(_translate("MainWindow", "Add Chanel", None)) self.pushButtonAddChan.setText(_translate("MainWindow", "Add Chan", None))
self.inboxSearchLineEdit_2.setPlaceholderText(_translate("MainWindow", "Search", None)) self.inboxSearchLineEditChans.setPlaceholderText(_translate("MainWindow", "Search", None))
self.tableWidgetInbox_2.setSortingEnabled(True) self.inboxSearchOptionChans.setItemText(0, _translate("MainWindow", "All", None))
item = self.tableWidgetInbox_2.horizontalHeaderItem(0) 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.setText(_translate("MainWindow", "To", None))
item = self.tableWidgetInbox_2.horizontalHeaderItem(1) item = self.tableWidgetInboxChans.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "From", None)) item.setText(_translate("MainWindow", "From", None))
item = self.tableWidgetInbox_2.horizontalHeaderItem(2) item = self.tableWidgetInboxChans.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Subject", None)) item.setText(_translate("MainWindow", "Subject", None))
item = self.tableWidgetInbox_2.horizontalHeaderItem(3) item = self.tableWidgetInboxChans.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Received", None)) item.setText(_translate("MainWindow", "Received", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Chans", 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.radioButtonBlacklist.setText(_translate("MainWindow", "Use a Blacklist (Allow all incoming messages except those on the Blacklist)", None))

View File

@ -105,7 +105,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_11"> <layout class="QVBoxLayout" name="verticalLayout_7">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayoutSearch"> <layout class="QHBoxLayout" name="horizontalLayoutSearch">
<property name="topMargin"> <property name="topMargin">
@ -118,6 +118,35 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="inboxSearchOption">
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>To</string>
</property>
</item>
<item>
<property name="text">
<string>From</string>
</property>
</item>
<item>
<property name="text">
<string>Subject</string>
</property>
</item>
<item>
<property name="text">
<string>Message</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -255,7 +284,7 @@
</attribute> </attribute>
<column> <column>
<property name="text"> <property name="text">
<string>Name</string> <string>Address book</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset> <iconset>
@ -573,7 +602,6 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
<zorder></zorder> <zorder></zorder>
<zorder>pushButtonFetchNamecoinID</zorder>
</widget> </widget>
<widget class="QWidget" name="subscriptions"> <widget class="QWidget" name="subscriptions">
<attribute name="icon"> <attribute name="icon">
@ -583,9 +611,9 @@ p, li { white-space: pre-wrap; }
<attribute name="title"> <attribute name="title">
<string>Subscriptions</string> <string>Subscriptions</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
@ -635,11 +663,44 @@ p, li { white-space: pre-wrap; }
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QLineEdit" name="inboxSearchLineSubscriptions"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="placeholderText"> <item>
<string>Search</string> <widget class="QLineEdit" name="inboxSearchLineEditSubscriptions">
</property> <property name="placeholderText">
</widget> <string>Search</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="inboxSearchOptionSubscriptions">
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>To</string>
</property>
</item>
<item>
<property name="text">
<string>From</string>
</property>
</item>
<item>
<property name="text">
<string>Subject</string>
</property>
</item>
<item>
<property name="text">
<string>Message</string>
</property>
</item>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QTableWidget" name="tableWidgetInboxSubscriptions"> <widget class="QTableWidget" name="tableWidgetInboxSubscriptions">
@ -708,7 +769,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="textEditInboxSubscriptions"> <widget class="QTextEdit" name="textEditInboxMessageSubscriptions">
<property name="baseSize"> <property name="baseSize">
<size> <size>
<width>0</width> <width>0</width>
@ -734,13 +795,13 @@ p, li { white-space: pre-wrap; }
<attribute name="title"> <attribute name="title">
<string>Chans</string> <string>Chans</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_17"> <layout class="QVBoxLayout" name="verticalLayout_17">
<item> <item>
<widget class="QTreeWidget" name="treeWidgetChanList"> <widget class="QTreeWidget" name="treeWidgetChans">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>200</width> <width>200</width>
@ -775,7 +836,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButtonAddChanel"> <widget class="QPushButton" name="pushButtonAddChan">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>200</width> <width>200</width>
@ -783,30 +844,56 @@ p, li { white-space: pre-wrap; }
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Add Chanel</string> <string>Add Chan</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_13"> <layout class="QVBoxLayout" name="verticalLayout_8">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayoutSearch_2"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="topMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLineEdit" name="inboxSearchLineEdit_2"> <widget class="QLineEdit" name="inboxSearchLineEditChans">
<property name="placeholderText"> <property name="placeholderText">
<string>Search</string> <string>Search</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="inboxSearchOptionChans">
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>To</string>
</property>
</item>
<item>
<property name="text">
<string>From</string>
</property>
</item>
<item>
<property name="text">
<string>Subject</string>
</property>
</item>
<item>
<property name="text">
<string>Message</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QTableWidget" name="tableWidgetInbox_2"> <widget class="QTableWidget" name="tableWidgetInboxChans">
<property name="editTriggers"> <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
@ -872,7 +959,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="textEditInboxMessage_2"> <widget class="QTextEdit" name="textEditInboxMessageChans">
<property name="baseSize"> <property name="baseSize">
<size> <size>
<width>0</width> <width>0</width>