diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-20 16:21:49 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-20 16:21:49 +0000 |
commit | f424a18112032cf61d2871a6b91a5af607c171ae (patch) | |
tree | 88fedc4e28941ceecda7026f0b06eba6271f91d5 /plugins/CryptoPP/src/GPGw/userdialog.c | |
parent | bfe1bd0fc087be44c70904aee0fe4276643d206d (diff) |
CryptoPP:
changed folder structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src/GPGw/userdialog.c')
-rw-r--r-- | plugins/CryptoPP/src/GPGw/userdialog.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/plugins/CryptoPP/src/GPGw/userdialog.c b/plugins/CryptoPP/src/GPGw/userdialog.c new file mode 100644 index 0000000000..bb82917c55 --- /dev/null +++ b/plugins/CryptoPP/src/GPGw/userdialog.c @@ -0,0 +1,81 @@ +#include "commonheaders.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);
+ }
+}
|