From 2fbe1d2262383b272ef887d712f308f787cf33f1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 Jun 2013 17:48:18 +0000 Subject: 64-bit compatible version of CryptoPP git-svn-id: http://svn.miranda-ng.org/main/trunk@4917 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CryptoPP/src/GPGw/userdialog.cpp | 80 ++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 plugins/CryptoPP/src/GPGw/userdialog.cpp (limited to 'plugins/CryptoPP/src/GPGw/userdialog.cpp') diff --git a/plugins/CryptoPP/src/GPGw/userdialog.cpp b/plugins/CryptoPP/src/GPGw/userdialog.cpp new file mode 100644 index 0000000000..65edcfe278 --- /dev/null +++ b/plugins/CryptoPP/src/GPGw/userdialog.cpp @@ -0,0 +1,80 @@ +#include "../commonheaders.h" +#include "gpgw.h" + +void RefreshListView(HWND hLV); + +BOOL CALLBACK UserIdDialogProcedure(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) +{ + static char *keyid; + HWND hLV = GetDlgItem(hdlg,IDC_KEYLIST); + + switch(msg) + { + case WM_INITDIALOG: + { + int i; + LVCOLUMN lvc; + static char *szColHdr[] = { "Key ID", "User ID" }; + static int iColWidth[] = { 110, 255 }; + keyid = (char *)lparam; + + ZeroMemory(&lvc,sizeof(LVCOLUMN)); + lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; + lvc.fmt = LVCFMT_LEFT; + for (i = 0; i < 2; i++) { + lvc.iSubItem = i; + lvc.pszText = szColHdr[i]; + lvc.cx = iColWidth[i]; + ListView_InsertColumn(hLV, i, &lvc); + } + + RefreshListView(hLV); + + ListView_SetExtendedListViewStyle(hLV, ListView_GetExtendedListViewStyle(hLV) | LVS_EX_FULLROWSELECT); + ListView_SetItemState(hLV, 0, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED); + EnableWindow(hLV, TRUE); + } + break; + case WM_COMMAND: + switch(LOWORD(wparam)) + { + case IDOK: + ListView_GetItemText(hLV, ListView_GetNextItem(hLV, -1, LVNI_SELECTED), 0, keyid, keyidsize); + case IDCANCEL: + EndDialog(hdlg, wparam); + return TRUE; + break; + case IDC_REFRESH: + updateKeyUserIDs(publickeyuserid); + updateKeyUserIDs(secretkeyuserid); + RefreshListView(hLV); + break; + } + break; + } + + return FALSE; +} + + +void RefreshListView(HWND hLV) { + + LVITEM lvi; + int i; + + ListView_DeleteAllItems(hLV); + ZeroMemory(&lvi,sizeof(LVITEM)); + lvi.mask = LVIF_TEXT; + for (i = 0; i < getKeyUserIDCount(publickeyuserid); i++) { + + char keyid[keyidsize]; + char *userid; + char *keyuserid = getKeyUserID(publickeyuserid, i); + + userid = getNextPart(keyid, keyuserid, txtidseparator); + + lvi.iItem++; + lvi.pszText = keyid; + ListView_SetItemText(hLV, ListView_InsertItem(hLV, &lvi), 1, userid); + } +} -- cgit v1.2.3