From 18 Jan, 2021 0:00 UTC: All services will be temporary unavailable for maintenance
  • R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision29055 (tree)
Zeit2021-01-12 02:55:00
Autorstefankueng

Log Message

patch from Matthias (https://groups.google.com/g/tortoisesvn-dev/c/LNDlILw3llI/m/0CF1qKpzCQAJ)
I've developed two more "copy to clipboard" commands:
- Bug IDs
- Bug Urls
Both are derived from bugtraq information.

Ändern Zusammenfassung

Diff

--- trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 29054)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 29055)
@@ -154,6 +154,8 @@
154154 ID_COPYCLIPBOARDURLVIEWERREV,
155155 ID_COPYCLIPBOARDURLVIEWERPATHREV,
156156 ID_COPYCLIPBOARDURLTSVNSHOWCOMPARE,
157+ ID_COPYCLIPBOARDBUGID,
158+ ID_COPYCLIPBOARDBUGURL,
157159 ID_COPYCLIPBOARDRELPATH,
158160 ID_COPYCLIPBOARDFILENAMES,
159161 ID_CHECKOUT,
@@ -2230,6 +2232,59 @@
22302232 }
22312233 }
22322234
2235+std::set<CString> CLogDlg::GetSelectedBugIds()
2236+{
2237+ std::set<CString> setAllBugIDs;
2238+ POSITION pos = m_LogList.GetFirstSelectedItemPosition();
2239+ if (pos != NULL)
2240+ {
2241+ while (pos)
2242+ {
2243+ int index = m_LogList.GetNextSelectedItem(pos);
2244+ if (index >= (int)m_logEntries.GetVisibleCount())
2245+ continue;
2246+ PLOGENTRYDATA pLogEntry = m_logEntries.GetVisible(index);
2247+ if (pLogEntry == NULL)
2248+ continue;
2249+
2250+ CString logMessage = CUnicodeUtils::StdGetUnicode(pLogEntry->GetMessageW()).c_str();
2251+
2252+ std::set<CString> setBugIDs = m_ProjectProperties.FindBugIDs(logMessage);
2253+ setAllBugIDs.merge(setBugIDs);
2254+
2255+ }
2256+ }
2257+ return setAllBugIDs;
2258+}
2259+
2260+void CLogDlg::CopySelectionToClipBoardBugId()
2261+{
2262+ std::set<CString> selectedBugIDs = GetSelectedBugIds();
2263+ CString sClipdata;
2264+ std::set<CString>::iterator it;
2265+ for (it = selectedBugIDs.begin(); it != selectedBugIDs.end(); ++it) {
2266+ if (!sClipdata.IsEmpty()) {
2267+ sClipdata += ", ";
2268+ }
2269+ sClipdata += *it;
2270+ }
2271+ CStringUtils::WriteAsciiStringToClipboard(sClipdata, GetSafeHwnd());
2272+}
2273+
2274+void CLogDlg::CopySelectionToClipBoardBugUrl()
2275+{
2276+ std::set<CString> selectedBugIDs = GetSelectedBugIds();
2277+ CString sClipdata;
2278+ std::set<CString>::iterator it;
2279+ for (it = selectedBugIDs.begin(); it != selectedBugIDs.end(); ++it) {
2280+ if (!sClipdata.IsEmpty()) {
2281+ sClipdata += "\r\n";
2282+ }
2283+ sClipdata += m_ProjectProperties.GetBugIDUrl(*it);
2284+ }
2285+ CStringUtils::WriteAsciiStringToClipboard(sClipdata, GetSafeHwnd());
2286+}
2287+
22332288 void CLogDlg::CopySelectionToClipBoard(bool bIncludeChangedList)
22342289 {
22352290 POSITION pos = m_LogList.GetFirstSelectedItemPosition();
@@ -5453,7 +5508,13 @@
54535508 if (!m_ProjectProperties.sWebViewerPathRev.IsEmpty())
54545509 clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDURLVIEWERPATHREV, IDS_LOG_POPUP_CLIPBOARD_URLVIEWERPATHREV, IDI_COPYCLIP);
54555510 clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDURLTSVNSHOWCOMPARE, IDS_LOG_POPUP_CLIPBOARD_TSVNSHOWCOMPARE, IDI_COPYCLIP);
5511+ if (!m_ProjectProperties.sWebViewerRev.IsEmpty())
5512+ clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDURLVIEWERREV, IDS_LOG_POPUP_CLIPBOARD_URLVIEWERREV, IDI_COPYCLIP);
54565513 clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDFULLNOPATHS, IDS_LOG_POPUP_CLIPBOARD_FULLNOPATHS, IDI_COPYCLIP);
5514+ if (GetSelectedBugIds().size() > 0) {
5515+ clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDBUGID, IDS_LOG_POPUP_CLIPBOARD_BUGID, IDI_COPYCLIP);
5516+ clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDBUGURL, IDS_LOG_POPUP_CLIPBOARD_BUGURL, IDI_COPYCLIP);
5517+ }
54575518 clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDREVS, IDS_LOG_POPUP_CLIPBOARD_REVS, IDI_COPYCLIP);
54585519 clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDAUTHORS, IDS_LOG_POPUP_CLIPBOARD_AUTHORS, IDI_COPYCLIP);
54595520 clipSubMenu.AppendMenuIcon(ID_COPYCLIPBOARDMESSAGES, IDS_LOG_POPUP_CLIPBOARD_MSGS, IDI_COPYCLIP);
@@ -5592,6 +5653,12 @@
55925653 case ID_COPYCLIPBOARDURLTSVNSHOWCOMPARE:
55935654 CopySelectionToClipBoardTsvnShowCompare();
55945655 break;
5656+ case ID_COPYCLIPBOARDBUGID:
5657+ CopySelectionToClipBoardBugId();
5658+ break;
5659+ case ID_COPYCLIPBOARDBUGURL:
5660+ CopySelectionToClipBoardBugUrl();
5661+ break;
55955662 case ID_COPYCLIPBOARDFULLNOPATHS:
55965663 CopySelectionToClipBoard(false);
55975664 break;
--- trunk/src/TortoiseProc/LogDialog/LogDlg.h (revision 29054)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.h (revision 29055)
@@ -276,6 +276,9 @@
276276 void CopySelectionToClipBoardViewerRev();
277277 void CopySelectionToClipBoardViewerPathRev();
278278 void CopySelectionToClipBoardTsvnShowCompare();
279+ void CopySelectionToClipBoardBugId();
280+ std::set<CString> GetSelectedBugIds();
281+ void CopySelectionToClipBoardBugUrl();
279282 void CopyCommaSeparatedRevisionsToClipboard();
280283 void CopyChangedSelectionToClipBoard();
281284 void CopyCommaSeparatedAuthorsToClipboard();
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Show on old repository browser