diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-11 17:48:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-11 17:48:18 +0000 |
commit | 2fbe1d2262383b272ef887d712f308f787cf33f1 (patch) | |
tree | 772a78df1caf0be843d8778344e02ac750ba7a03 /plugins/CryptoPP/src/GPGw/userdialog.cpp | |
parent | 48fc03aa394f4506c6053323386c040fede13a29 (diff) |
64-bit compatible version of CryptoPP
git-svn-id: http://svn.miranda-ng.org/main/trunk@4917 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src/GPGw/userdialog.cpp')
-rw-r--r-- | plugins/CryptoPP/src/GPGw/userdialog.cpp | 80 |
1 files changed, 80 insertions, 0 deletions
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);
+ }
+}
|