summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-04 22:09:21 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-04 22:42:02 (GMT)
commit7bca08eb2829982865f1649483f9aa01b3413b1c (patch)
tree630b333f0dd9b05478816eae27c6695b1a6bbe35 /Swift/QtUI/Roster
parentb3208697addc0492f4ae1f76c75a8810c20e701a (diff)
downloadswift-7bca08eb2829982865f1649483f9aa01b3413b1c.zip
swift-7bca08eb2829982865f1649483f9aa01b3413b1c.tar.bz2
Starting towards tooltips for the colour-blind.
Putting status show names along with the text in tooltips. Covers the MeView and roster entries. Still ToDo: status setter Resolves: #429
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r--Swift/QtUI/Roster/RosterModel.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/RosterModel.cpp b/Swift/QtUI/Roster/RosterModel.cpp
index e5a938e..a801d3f 100644
--- a/Swift/QtUI/Roster/RosterModel.cpp
+++ b/Swift/QtUI/Roster/RosterModel.cpp
@@ -115,7 +115,18 @@ QColor RosterModel::getBackgroundColor(RosterItem* item) const {
}
QString RosterModel::getToolTip(RosterItem* item) const {
- return dynamic_cast<ContactRosterItem*>(item) && !getStatusText(item).isEmpty() ? P2QSTRING(item->getDisplayName()) + "\n" + getStatusText(item) : P2QSTRING(item->getDisplayName());
+ QString tip(P2QSTRING(item->getDisplayName()));
+ ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item);
+ if (contact) {
+ if (contact->getDisplayJID().isValid()) {
+ tip += "\n" + P2QSTRING(contact->getDisplayJID().toBare().toString());
+ }
+ tip += "\n " + P2QSTRING(StatusShow::typeToFriendlyName(contact->getStatusShow()));
+ if (!getStatusText(item).isEmpty()) {
+ tip += ": " + getStatusText(item);
+ }
+ }
+ return tip;
}
QIcon RosterModel::getAvatar(RosterItem* item) const {