From 820307153b05c8ce93f5022c6772a748cca49909 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 19 Oct 2011 06:40:18 +0300 Subject: cipy to clipboard button, may not work yet --- new_gpg.rc | 5 +- options.cpp | 15 +++++- resource.h | 172 ++++++++++++++++++++++++++++++------------------------------ 3 files changed, 104 insertions(+), 88 deletions(-) mode change 100644 => 100755 new_gpg.rc mode change 100644 => 100755 options.cpp mode change 100644 => 100755 resource.h diff --git a/new_gpg.rc b/new_gpg.rc old mode 100644 new mode 100755 index bd99e79..50aa6c2 --- a/new_gpg.rc +++ b/new_gpg.rc @@ -316,15 +316,16 @@ BEGIN CTEXT "Userlist:",IDC_STATIC,25,7,201,8 PUSHBUTTON "Export PubKey",IDC_SAVE_KEY_BUTTON,8,135,75,14 PUSHBUTTON "Delete key",IDC_DELETE_KEY_BUTTON,90,135,70,14 - PUSHBUTTON "Select own key",IDC_SELECT_KEY,170,193,109,14 + PUSHBUTTON "Select own key",IDC_SELECT_KEY,203,193,76,14 CONTROL "Turn on debug log",IDC_DEBUG_LOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,181,159,89,10 EDITTEXT IDC_LOG_FILE_EDIT,11,157,98,14,ES_AUTOHSCROLL PUSHBUTTON "Browse",IDC_LOG_FILE_SET,119,156,50,14 CONTROL "Use jabber api on Miranda IM >= 0.9 (recomended)",IDC_JABBER_API, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,175,251,10 - LTEXT "Current key",IDC_CURRENT_KEY,48,196,116,8 + LTEXT "Current key",IDC_CURRENT_KEY,12,196,116,8 CONTROL "Encrypt file transfers",IDC_FILE_TRANSFERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,185,137,10 CONTROL "Automatic key exchange",IDC_AUTO_EXCHANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,137,111,10 + PUSHBUTTON "Copy own key",IDC_COPY_KEY,137,193,62,14 END IDD_OPT_GPG_BIN DIALOGEX 0, 0, 282, 214 diff --git a/options.cpp b/options.cpp old mode 100644 new mode 100755 index fe1c2c3..4b68d63 --- a/options.cpp +++ b/options.cpp @@ -353,6 +353,19 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA f.close(); } break; + case IDC_COPY_KEY: + { + if(OpenClipboard(hwndDlg)) + { + char *szKey = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); + EmptyClipboard(); + SetClipboardData(CF_OEMTEXT, szKey); + CloseClipboard(); + mir_free(szKey); + } + else + MessageBoxA(0, "Error", "Failed to open clipboard", MB_OK); + } case IDC_LOG_FILE_SET: { tmp = GetFilePath(_T("Set log file"), _T("*"), _T("LOG files"), 1); @@ -366,7 +379,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; } - + case WM_NOTIFY: { EnableWindow(GetDlgItem(hwndDlg, IDC_AUTO_EXCHANGE), (bIsMiranda09 && IsDlgButtonChecked(hwndDlg, IDC_JABBER_API))); diff --git a/resource.h b/resource.h old mode 100644 new mode 100755 index 9043ac1..b7900a0 --- a/resource.h +++ b/resource.h @@ -1,85 +1,87 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by new_gpg.rc -// -#define IDD_LOAD_PUBLIC_KEY 102 -#define IDD_FIRST_RUN 103 -#define IDD_OPT_GPG 104 -#define IDD_OPT_GPG_BIN 105 -#define IDD_BIN_PATH 106 -#define IDD_OPT_GPG_MESSAGES 107 -#define IDD_NEW_KEY 108 -#define IDD_KEY_GEN 109 -#define IDD_LOAD_EXISTING_KEY 110 -#define IDD_KEY_PASSWD 111 -#define IDI_SECURED 112 -#define IDD_IMPORT_KEY 112 -#define IDI_UNSECURED 113 -#define IDC_SET_BIN_PATH 1016 -#define IDC_SET_HOME_DIR 1017 -#define IDC_BIN_PATH 1018 -#define IDC_HOME_DIR 1019 -#define IDC_USERLIST 1020 -#define IDC_LOAD_KEY_BUTTON 1022 -#define ID_OK 1023 -#define ID_LOD_FROM_FILE 1024 -#define ID_LOAD_FROM_FILE 1024 -#define IDC_EDIT1 1025 -#define IDC_PUBLIC_KEY_EDIT 1025 -#define IDC_KEY_PASSWORD 1025 -#define IDC_IN_OPEN_TAG 1025 -#define IDC_KEY_PASSWD 1025 -#define IDC_PASSWORD 1025 -#define IDC_LOG_FILE_EDIT 1025 -#define IDC_BUTTON1 1026 -#define IDC_SAVE_KEY_BUTTON 1026 -#define IDC_GENERATE_KEY 1026 -#define IDC_IGNORE_KEY 1026 -#define IDC_SELECT_EXISTING 1026 -#define IDC_KEY_EMAIL 1026 -#define IDC_DELETE_KEY_BUTTON 1027 -#define IDC_IN_CLOSE_TAG 1027 -#define IDC_KEY_REAL_NAME 1027 -#define IDC_KEY_LIST 1028 -#define IDC_KEY_COMMENT 1028 -#define IDC_OUT_OPEN_TAG 1029 -#define IDC_APPEND_TAGS 1030 -#define IDC_OUT_CLOSE_TAG 1031 -#define IDC_SELECT_KEY 1033 -#define IDC_MESSAGE 1034 -#define ID_IMPORT 1035 -#define IDC_IMPORT_AND_USE 1036 -#define IDC_KEY_TYPE 1039 -#define IDC_KEY_LENGTH 1040 -#define IDC_KEY_EXPIRE_DATE 1043 -#define IDC_EXISTING_KEY_LIST 1045 -#define IDC_BUTTON2 1046 -#define IDC_OTHER 1046 -#define IDC_LOG_FILE_SET 1046 -#define IDC_IMPORT 1046 -#define IDC_SAVE_PASSWORD 1047 -#define IDC_DEBUG_LOG 1048 -#define IDC_JABBER_API 1049 -#define IDC_ENABLE_ENCRYPTION 1050 -#define IDC_KEY_FROM 1051 -#define IDC_DELETE_KEY 1052 -#define IDC_KEYID 1053 -#define IDC_CURRENT_KEY 1054 -#define IDC_DEFAULT_PASSWORD 1055 -#define IDC_KEYSERVER 1058 -#define IDC_FILE_TRANSFERS 1061 -#define IDC_REMOVE_FILTERS 1062 -#define IDC_GENERATE_RANDOM 1063 -#define IDC_AUTO_EXCHANGE 1064 -#define IDC_AUT_EXCHANGE 1065 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 114 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1066 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by new_gpg.rc +// +#define IDD_LOAD_PUBLIC_KEY 102 +#define IDD_FIRST_RUN 103 +#define IDD_OPT_GPG 104 +#define IDD_OPT_GPG_BIN 105 +#define IDD_BIN_PATH 106 +#define IDD_OPT_GPG_MESSAGES 107 +#define IDD_NEW_KEY 108 +#define IDD_KEY_GEN 109 +#define IDD_LOAD_EXISTING_KEY 110 +#define IDD_KEY_PASSWD 111 +#define IDI_SECURED 112 +#define IDD_IMPORT_KEY 112 +#define IDI_UNSECURED 113 +#define IDC_SET_BIN_PATH 1016 +#define IDC_SET_HOME_DIR 1017 +#define IDC_BIN_PATH 1018 +#define IDC_HOME_DIR 1019 +#define IDC_USERLIST 1020 +#define IDC_LOAD_KEY_BUTTON 1022 +#define ID_OK 1023 +#define ID_LOD_FROM_FILE 1024 +#define ID_LOAD_FROM_FILE 1024 +#define IDC_EDIT1 1025 +#define IDC_PUBLIC_KEY_EDIT 1025 +#define IDC_KEY_PASSWORD 1025 +#define IDC_IN_OPEN_TAG 1025 +#define IDC_KEY_PASSWD 1025 +#define IDC_PASSWORD 1025 +#define IDC_LOG_FILE_EDIT 1025 +#define IDC_BUTTON1 1026 +#define IDC_SAVE_KEY_BUTTON 1026 +#define IDC_GENERATE_KEY 1026 +#define IDC_IGNORE_KEY 1026 +#define IDC_SELECT_EXISTING 1026 +#define IDC_KEY_EMAIL 1026 +#define IDC_DELETE_KEY_BUTTON 1027 +#define IDC_IN_CLOSE_TAG 1027 +#define IDC_KEY_REAL_NAME 1027 +#define IDC_KEY_LIST 1028 +#define IDC_KEY_COMMENT 1028 +#define IDC_OUT_OPEN_TAG 1029 +#define IDC_APPEND_TAGS 1030 +#define IDC_OUT_CLOSE_TAG 1031 +#define IDC_SELECT_KEY 1033 +#define IDC_MESSAGE 1034 +#define ID_IMPORT 1035 +#define IDC_IMPORT_AND_USE 1036 +#define IDC_KEY_TYPE 1039 +#define IDC_KEY_LENGTH 1040 +#define IDC_KEY_EXPIRE_DATE 1043 +#define IDC_EXISTING_KEY_LIST 1045 +#define IDC_BUTTON2 1046 +#define IDC_OTHER 1046 +#define IDC_LOG_FILE_SET 1046 +#define IDC_IMPORT 1046 +#define IDC_SAVE_PASSWORD 1047 +#define IDC_DEBUG_LOG 1048 +#define IDC_JABBER_API 1049 +#define IDC_ENABLE_ENCRYPTION 1050 +#define IDC_KEY_FROM 1051 +#define IDC_DELETE_KEY 1052 +#define IDC_KEYID 1053 +#define IDC_CURRENT_KEY 1054 +#define IDC_DEFAULT_PASSWORD 1055 +#define IDC_KEYSERVER 1058 +#define IDC_FILE_TRANSFERS 1061 +#define IDC_REMOVE_FILTERS 1062 +#define IDC_GENERATE_RANDOM 1063 +#define IDC_AUTO_EXCHANGE 1064 +#define IDC_AUT_EXCHANGE 1065 +#define IDC_BUTTON3 1066 +#define IDC_COPY_KEY 1066 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 114 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1067 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif -- cgit v1.2.3