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 | |
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')
-rw-r--r-- | plugins/CrashDumper/res/crshdmp.rc | 1 | ||||
-rw-r--r-- | plugins/CrashDumper/src/crshdmp.cpp | 28 | ||||
-rw-r--r-- | plugins/CrashDumper/src/crshdmp_icons.cpp | 11 | ||||
-rw-r--r-- | plugins/CrashDumper/src/resource.h | 3 | ||||
-rw-r--r-- | plugins/CrashDumper/src/utils.h | 1 |
5 files changed, 38 insertions, 6 deletions
diff --git a/plugins/CrashDumper/res/crshdmp.rc b/plugins/CrashDumper/res/crshdmp.rc index 12adc55e38..bc761b6f40 100644 --- a/plugins/CrashDumper/res/crshdmp.rc +++ b/plugins/CrashDumper/res/crshdmp.rc @@ -138,6 +138,7 @@ IDI_VISHOW ICON "Vi show.ico" IDI_VITOCLIP ICON "Vi to clipboard.ico"
IDI_VITOFILE ICON "Vi to file.ico"
IDI_VIUPLOAD ICON "Vi upload.ico"
+IDI_LINKTOCLIP ICON "Vi link to clipboard.ico"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
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;
}
diff --git a/plugins/CrashDumper/src/crshdmp_icons.cpp b/plugins/CrashDumper/src/crshdmp_icons.cpp index dfead53dd0..ff6f23520a 100644 --- a/plugins/CrashDumper/src/crshdmp_icons.cpp +++ b/plugins/CrashDumper/src/crshdmp_icons.cpp @@ -20,11 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. static IconItem iconList[] =
{
- { LPGEN("Version Information"), "versionInfo", IDI_VI },
- { LPGEN("Copy To Clipboard"), "storeToClip", IDI_VITOCLIP },
- { LPGEN("Store to file"), "storeToFile", IDI_VITOFILE },
- { LPGEN("Show"), "showInfo", IDI_VISHOW },
- { LPGEN("Upload"), "uploadInfo", IDI_VIUPLOAD },
+ { LPGEN("Version Information"), "versionInfo", IDI_VI },
+ { LPGEN("Copy To Clipboard"), "storeToClip", IDI_VITOCLIP },
+ { LPGEN("Store to file"), "storeToFile", IDI_VITOFILE },
+ { LPGEN("Show"), "showInfo", IDI_VISHOW },
+ { LPGEN("Upload"), "uploadInfo", IDI_VIUPLOAD },
+ { LPGEN("Copy link to clipboard"), "linkToClip", IDI_LINKTOCLIP},
};
void InitIcons(void)
diff --git a/plugins/CrashDumper/src/resource.h b/plugins/CrashDumper/src/resource.h index ae5e2e260f..8172d99a51 100644 --- a/plugins/CrashDumper/src/resource.h +++ b/plugins/CrashDumper/src/resource.h @@ -9,7 +9,8 @@ #define IDI_VITOCLIP 106
#define IDI_VITOFILE 107
#define IDI_VIUPLOAD 108
-#define IDD_OPTIONS 109
+#define IDI_LINKTOCLIP 109
+#define IDD_OPTIONS 110
#define IDC_VIEWVERSIONINFO 1001
#define IDC_FILEVER 1003
#define IDC_CLIPVER 1004
diff --git a/plugins/CrashDumper/src/utils.h b/plugins/CrashDumper/src/utils.h index 43a6938f78..8eac8158c4 100644 --- a/plugins/CrashDumper/src/utils.h +++ b/plugins/CrashDumper/src/utils.h @@ -72,6 +72,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MS_CRASHDUMPER_VIEWINFO "CrashDmp/ViewInfo"
#define MS_CRASHDUMPER_UPLOAD "CrashDmp/UploadInfo"
#define MS_CRASHDUMPER_URL "CrashDmp/StartUrl"
+#define MS_CRASHDUMPER_URLTOCLIP "CrashDmp/CopyToClip"
#define PluginName "Crash Dumper"
|