From feea1ccd8de8202cc4c68188e7964f7f7a0d606d Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sat, 31 Oct 2015 20:27:28 +0100 Subject: [PATCH] Colors for From ComboBox Fixes #86 --- src/bitmessageqt/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 71bb16b1..e0ea3e5e 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2308,6 +2308,9 @@ class MyForm(QtGui.QMainWindow): self.ui.comboBoxSendFrom.addItem(avatarize(addressInKeysFile), unicode(shared.config.get( addressInKeysFile, 'label'), 'utf-8'), addressInKeysFile) # self.ui.comboBoxSendFrom.model().sort(1, Qt.AscendingOrder) + for i in range(self.ui.comboBoxSendFrom.count()): + address = str(self.ui.comboBoxSendFrom.itemData(i, Qt.UserRole).toString()) + self.ui.comboBoxSendFrom.setItemData(i, AccountColor(address).accountColor(), Qt.ForegroundRole) self.ui.comboBoxSendFrom.insertItem(0, '', '') if(self.ui.comboBoxSendFrom.count() == 2): self.ui.comboBoxSendFrom.setCurrentIndex(1) @@ -2323,6 +2326,9 @@ class MyForm(QtGui.QMainWindow): if isEnabled and isMaillinglist: self.ui.comboBoxSendFromBroadcast.addItem(avatarize(addressInKeysFile), unicode(shared.config.get( addressInKeysFile, 'label'), 'utf-8'), addressInKeysFile) + for i in range(self.ui.comboBoxSendFromBroadcast.count()): + address = str(self.ui.comboBoxSendFromBroadcast.itemData(i, Qt.UserRole).toString()) + self.ui.comboBoxSendFromBroadcast.setItemData(i, AccountColor(address).accountColor(), Qt.ForegroundRole) self.ui.comboBoxSendFromBroadcast.insertItem(0, '', '') if(self.ui.comboBoxSendFromBroadcast.count() == 2): self.ui.comboBoxSendFromBroadcast.setCurrentIndex(1)