diff options
Diffstat (limited to 'plugins/CrashDumper/src')
-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 |
4 files changed, 37 insertions, 6 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;
}
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"
|