← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3210: no CID in tooltips

 

------------------------------------------------------------
revno: 3210
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2013-03-03 21:15:35 +0100
message:
  no CID in tooltips
modified:
  win32/UserInfoBase.cpp
  win32/UserInfoBase.h


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/UserInfoBase.cpp'
--- win32/UserInfoBase.cpp	2013-01-21 19:03:27 +0000
+++ win32/UserInfoBase.cpp	2013-03-03 20:15:35 +0000
@@ -80,7 +80,7 @@
 	UserMatchManager::getInstance()->ignoreChat(user, ignore);
 }
 
-tstring UserInfoBase::getTooltip() const {
+tstring UserInfoBase::getInfo(int flags) const {
 	static const size_t maxChars = 100; // max chars per tooltip line
 
 	tstring ret(WinUtil::getNicks(user));
@@ -128,11 +128,17 @@
 			value = str(TF_("%1%/%2%") % Text::toT(fs) % value);
 		addLine(str(TF_("%1%: %2%") % T_("Slots") % value));
 	}
-	addValue(T_("CID"), user.user->getCID().toBase32());
+	if((flags & INFO_WITH_CID) == INFO_WITH_CID) {
+		addValue(T_("CID"), user.user->getCID().toBase32());
+	}
 
 	return ret;
 }
 
+tstring UserInfoBase::getTooltip() const {
+	return getInfo();
+}
+
 UserTraits::UserTraits() :
 Flags(adcOnly | favOnly | nonFavOnly | chatIgnoredOnly | chatNotIgnoredOnly)
 {

=== modified file 'win32/UserInfoBase.h'
--- win32/UserInfoBase.h	2013-01-21 19:03:27 +0000
+++ win32/UserInfoBase.h	2013-03-03 20:15:35 +0000
@@ -48,6 +48,11 @@
 	virtual void connectFav(TabViewPtr);
 	virtual void ignoreChat(bool ignore);
 
+	enum {
+		INFO_WITH_CID = 1 << 0,
+		INFO_ALL = INFO_WITH_CID
+	};
+	tstring getInfo(int flags = 0) const;
 	tstring getTooltip() const;
 
 	const HintedUser& getUser() const { return user; }
@@ -133,7 +138,7 @@
 		tstring text;
 		handleUserFunction([&](UserInfoBase* u) {
 			if(!text.empty()) { text += _T("\r\n\r\n"); }
-			text += u->getTooltip();
+			text += u->getInfo(UserInfoBase::INFO_ALL);
 		});
 		WinUtil::setClipboard(text);
 	}