Juan Lang : cryptui: Add selections to field selection list in details page .
Alexandre Julliard
julliard at winehq.org
Thu Dec 18 08:08:42 CST 2008
Module: wine
Branch: master
Commit: a4d362805b1de3e36d786fc9a55e4c2c669bd12a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a4d362805b1de3e36d786fc9a55e4c2c669bd12a
Author: Juan Lang <juan.lang at gmail.com>
Date: Wed Dec 17 08:52:52 2008 -0800
cryptui: Add selections to field selection list in details page.
---
dlls/cryptui/cryptui_En.rc | 7 +++++
dlls/cryptui/cryptuires.h | 7 +++++
dlls/cryptui/main.c | 59 +++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 72 insertions(+), 1 deletions(-)
diff --git a/dlls/cryptui/cryptui_En.rc b/dlls/cryptui/cryptui_En.rc
index eef2b30..e8ea266 100644
--- a/dlls/cryptui/cryptui_En.rc
+++ b/dlls/cryptui/cryptui_En.rc
@@ -34,6 +34,13 @@ STRINGTABLE DISCARDABLE
IDS_ISSUER_HEADING "Issued by: "
IDS_VALID_FROM "Valid from "
IDS_VALID_TO " to "
+ IDS_FIELD "Field"
+ IDS_VALUE "Value"
+ IDS_FIELDS_ALL "<All>"
+ IDS_FIELDS_V1 "Version 1 Fields Only"
+ IDS_FIELDS_EXTENSIONS "Extensions Only"
+ IDS_FIELDS_CRITICAL_EXTENSIONS "Critical Extensions Only"
+ IDS_FIELDS_PROPERTIES "Properties Only"
IDS_PURPOSE_SERVER_AUTH "Ensures the identify of a remote computer"
IDS_PURPOSE_CLIENT_AUTH "Proves your identity to a remote computer"
IDS_PURPOSE_CODE_SIGNING "Ensures software came from software publisher\nProtects software from alteration after publication"
diff --git a/dlls/cryptui/cryptuires.h b/dlls/cryptui/cryptuires.h
index 0c80783..8ffb930 100644
--- a/dlls/cryptui/cryptuires.h
+++ b/dlls/cryptui/cryptuires.h
@@ -31,6 +31,13 @@
#define IDS_ISSUER_HEADING 1011
#define IDS_VALID_FROM 1012
#define IDS_VALID_TO 1013
+#define IDS_FIELD 1019
+#define IDS_VALUE 1020
+#define IDS_FIELDS_ALL 1021
+#define IDS_FIELDS_V1 1022
+#define IDS_FIELDS_EXTENSIONS 1023
+#define IDS_FIELDS_CRITICAL_EXTENSIONS 1024
+#define IDS_FIELDS_PROPERTIES 1025
#define IDS_PURPOSE_SERVER_AUTH 1100
#define IDS_PURPOSE_CLIENT_AUTH 1101
diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index db5fc6b..8a724be 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -32,6 +32,7 @@
#include "richedit.h"
#include "ole2.h"
#include "richole.h"
+#include "commctrl.h"
#include "cryptuiapi.h"
#include "cryptuires.h"
#include "urlmon.h"
@@ -1007,6 +1008,62 @@ struct detail_data
BOOL *pfPropertiesChanged;
};
+struct selection_list_item
+{
+ int id;
+};
+
+const struct selection_list_item listItems[] = {
+ { IDS_FIELDS_ALL },
+ { IDS_FIELDS_V1 },
+ { IDS_FIELDS_EXTENSIONS },
+ { IDS_FIELDS_CRITICAL_EXTENSIONS },
+ { IDS_FIELDS_PROPERTIES },
+};
+
+static void create_show_list(HWND hwnd, struct detail_data *data)
+{
+ HWND cb = GetDlgItem(hwnd, IDC_DETAIL_SELECT);
+ WCHAR buf[MAX_STRING_LEN];
+ int i;
+
+ for (i = 0; i < sizeof(listItems) / sizeof(listItems[0]); i++)
+ {
+ int index;
+
+ LoadStringW(hInstance, listItems[i].id, buf,
+ sizeof(buf) / sizeof(buf[0]));
+ index = SendMessageW(cb, CB_INSERTSTRING, -1, (LPARAM)buf);
+ SendMessageW(cb, CB_SETITEMDATA, index, (LPARAM)data);
+ }
+ SendMessageW(cb, CB_SETCURSEL, 0, 0);
+}
+
+static void create_listview_columns(HWND hwnd)
+{
+ HWND lv = GetDlgItem(hwnd, IDC_DETAIL_LIST);
+ RECT rc;
+ WCHAR buf[MAX_STRING_LEN];
+ LVCOLUMNW column;
+
+ SendMessageW(lv, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
+ GetWindowRect(lv, &rc);
+ LoadStringW(hInstance, IDS_FIELD, buf, sizeof(buf) / sizeof(buf[0]));
+ column.mask = LVCF_WIDTH | LVCF_TEXT;
+ column.cx = (rc.right - rc.left) / 2 - 2;
+ column.pszText = buf;
+ SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column);
+ LoadStringW(hInstance, IDS_VALUE, buf, sizeof(buf) / sizeof(buf[0]));
+ SendMessageW(lv, LVM_INSERTCOLUMNW, 1, (LPARAM)&column);
+}
+
+static void create_cert_details_list(HWND hwnd, struct detail_data *data)
+{
+ create_show_list(hwnd, data);
+ create_listview_columns(hwnd);
+ FIXME("add cert details\n");
+}
+
static LRESULT CALLBACK detail_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
LPARAM lp)
{
@@ -1020,7 +1077,7 @@ static LRESULT CALLBACK detail_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
case WM_INITDIALOG:
page = (PROPSHEETPAGEW *)lp;
data = (struct detail_data *)page->lParam;
- FIXME("add cert details\n");
+ create_cert_details_list(hwnd, data);
if (!(data->pCertViewInfo->dwFlags & CRYPTUI_ENABLE_EDITPROPERTIES))
EnableWindow(GetDlgItem(hwnd, IDC_EDITPROPERTIES), FALSE);
if (data->pCertViewInfo->dwFlags & CRYPTUI_DISABLE_EXPORT)
More information about the wine-cvs
mailing list