Formatting

This commit is contained in:
mailchuck 2015-10-01 10:15:23 +02:00 committed by Peter Surda
parent 9ab9984283
commit a961ad1d84

View File

@ -577,53 +577,54 @@ class MyForm(QtGui.QMainWindow):
configSections = sorted(shared.config.sections(), cmp=address_compare) configSections = sorted(shared.config.sections(), cmp=address_compare)
for addressInKeysFile in configSections: for addressInKeysFile in configSections:
if addressInKeysFile != 'bitmessagesettings': if addressInKeysFile == 'bitmessagesettings':
isEnabled = shared.config.getboolean( continue
addressInKeysFile, 'enabled') isEnabled = shared.config.getboolean(
isChan = shared.safeConfigGetBoolean( addressInKeysFile, 'enabled')
addressInKeysFile, 'chan') isChan = shared.safeConfigGetBoolean(
isMaillinglist = shared.safeConfigGetBoolean( addressInKeysFile, 'chan')
addressInKeysFile, 'mailinglist') isMaillinglist = shared.safeConfigGetBoolean(
addressInKeysFile, 'mailinglist')
if tab == 'messages': if tab == 'messages':
if isChan: if isChan:
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.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)')
+ ' (' + addressInKeysFile + ')') + ' (' + addressInKeysFile + ')')
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:
if isMaillinglist: if isMaillinglist:
brush = QtGui.QBrush(QtGui.QColor(137, 04, 177)) 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(QApplication.palette().text().color())
brush.setStyle(QtCore.Qt.NoBrush) else:
newItem.setForeground(0, brush) brush = QtGui.QBrush(QtGui.QColor(128, 128, 128))
brush.setStyle(QtCore.Qt.NoBrush)
newItem.setForeground(0, brush)
for folder in folders: for folder in folders:
newSubItem = QtGui.QTreeWidgetItem(newItem) newSubItem = QtGui.QTreeWidgetItem(newItem)
cnt = cntUnreadMsg.get(addressInKeysFile + folder, False) cnt = cntUnreadMsg.get(addressInKeysFile + folder, False)
if cnt: if cnt:
unreadText = " (" + str(cnt) + ")" unreadText = " (" + str(cnt) + ")"
font = QtGui.QFont() font = QtGui.QFont()
font.setBold(True) font.setBold(True)
newSubItem.setFont(0, font) newSubItem.setFont(0, font)
else: else:
unreadText = "" unreadText = ""
newSubItem.setText(0, _translate("MainWindow", folder) + 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):
QtGui.QWidget.__init__(self, parent) QtGui.QWidget.__init__(self, parent)