← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3178: Add a "Copy user information" menu item

 

------------------------------------------------------------
revno: 3178
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2013-01-21 20:03:27 +0100
message:
  Add a "Copy user information" menu item
modified:
  changelog.txt
  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 'changelog.txt'
--- changelog.txt	2013-01-21 18:43:48 +0000
+++ changelog.txt	2013-01-21 19:03:27 +0000
@@ -18,6 +18,7 @@
 * Don't clear the message box when trying to send a message to a disconnected hub (poy)
 * Improve OpenSSL error handling
 * Add copy menus to various lists (poy)
+* [L#289713] Add a "Copy user information" menu item (poy)
 
 Note: The hash registry will be upgraded when running this version for the
 first time. Make sure all your drives are connected to avoid re-hashing.

=== modified file 'win32/UserInfoBase.cpp'
--- win32/UserInfoBase.cpp	2013-01-18 21:28:38 +0000
+++ win32/UserInfoBase.cpp	2013-01-21 19:03:27 +0000
@@ -128,6 +128,7 @@
 			value = str(TF_("%1%/%2%") % Text::toT(fs) % value);
 		addLine(str(TF_("%1%: %2%") % T_("Slots") % value));
 	}
+	addValue(T_("CID"), user.user->getCID().toBase32());
 
 	return ret;
 }

=== modified file 'win32/UserInfoBase.h'
--- win32/UserInfoBase.h	2013-01-18 21:28:38 +0000
+++ win32/UserInfoBase.h	2013-01-21 19:03:27 +0000
@@ -129,6 +129,14 @@
 	void handleIgnoreChat(bool ignore) {
 		handleUserFunction([ignore](UserInfoBase* u) { u->ignoreChat(ignore); });
 	}
+	void handleCopyUserInfo() {
+		tstring text;
+		handleUserFunction([&](UserInfoBase* u) {
+			if(!text.empty()) { text += _T("\r\n\r\n"); }
+			text += u->getTooltip();
+		});
+		WinUtil::setClipboard(text);
+	}
 
 	void appendUserItems(TabViewPtr parent, Menu* menu, bool defaultIsGetList = true, bool includeSendPM = true) {
 		auto users = t().selectedUsersImpl();
@@ -156,6 +164,9 @@
 			menu->appendItem(T_("Ignore chat"), [this] { this->t().handleIgnoreChat(true); });
 		if(!traits.isSet(UserTraits::chatNotIgnoredOnly))
 			menu->appendItem(T_("Un-ignore chat"), [this] { this->t().handleIgnoreChat(false); });
+
+		menu->appendSeparator();
+		menu->appendItem(T_("Copy user information"), [this] { this->t().handleCopyUserInfo(); });
 	}
 };