diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-11-29 12:56:57 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-11-29 12:56:57 +0000 |
commit | ad099652196b28b4fff4f93ae47d94f6aca7c168 (patch) | |
tree | 1eece059e63da1dc9819805ffe30a0337b9c174b /plugins/CrashDumper/src/crshdmp.cpp | |
parent | b39742edb863597c60db4172fe6a3a4ad86de500 (diff) |
CrashDumper: "Copy link to clipboard" item added (patch by person)
- langpacks/english: update;
- langpacks/russian: update;
git-svn-id: http://svn.miranda-ng.org/main/trunk@11146 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CrashDumper/src/crshdmp.cpp')
-rw-r--r-- | plugins/CrashDumper/src/crshdmp.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index b9f149c88c..53a0a5a389 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -156,6 +156,26 @@ INT_PTR OpenUrl(WPARAM wParam, LPARAM) return 0;
}
+INT_PTR CopyLinkToClipboard(WPARAM, LPARAM)
+{
+ TCHAR *tmp;
+ TCHAR buffer[MAX_PATH];
+
+ tmp = db_get_wsa(NULL, PluginName, "Username");
+ mir_sntprintf(buffer, SIZEOF(buffer), _T("http://vi.miranda-ng.org/detail/%s"), tmp);
+ int bufLen = (sizeof(buffer) + 1) * sizeof(TCHAR);
+ HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
+ LPSTR buf = (LPSTR)GlobalLock(hData);
+ memcpy(buf, buffer, bufLen);
+
+ OpenClipboard(NULL);
+ EmptyClipboard();
+
+ SetClipboardData(CF_UNICODETEXT, hData);
+ CloseClipboard();
+ return 0;
+}
+
INT_PTR ServiceModeLaunch(WPARAM, LPARAM)
{
servicemode = true;
@@ -280,6 +300,13 @@ static int ModulesLoaded(WPARAM, LPARAM) mi.pszService = MS_CRASHDUMPER_UPLOAD;
Menu_AddMainMenuItem(&mi);
+ mi.popupPosition = 0;
+ mi.position = 2000089999;
+ mi.ptszName = LPGENT("Copy link to clipboard");
+ mi.icolibItem = GetIconHandle(IDI_LINKTOCLIP);//need icon
+ mi.pszService = MS_CRASHDUMPER_URLTOCLIP;
+ Menu_AddMainMenuItem(&mi);
+
if (catchcrashes && !needrestart) {
mi.position = 2000099990;
mi.ptszName = LPGENT("Open crash report directory");
@@ -367,6 +394,7 @@ extern "C" int __declspec(dllexport) Load(void) CreateServiceFunction(MS_CRASHDUMPER_UPLOAD, UploadVersionInfo);
CreateServiceFunction(MS_CRASHDUMPER_URL, OpenUrl);
CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceModeLaunch);
+ CreateServiceFunction(MS_CRASHDUMPER_URLTOCLIP, CopyLinkToClipboard);
return 0;
}
|