diff options
-rw-r--r-- | new_gpg.rc | 2 | ||||
-rw-r--r-- | options.cpp | 30 | ||||
-rw-r--r-- | resource.h | 5 |
3 files changed, 35 insertions, 2 deletions
@@ -68,6 +68,8 @@ IDD_OPT_GPG DIALOGEX 0, 0, 268, 214 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
+ CONTROL "",IDC_USERLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,17,254,112
+ CTEXT "Userlist:",IDC_STATIC,25,7,201,8
END
IDD_OPT_GPG_BIN DIALOGEX 0, 0, 268, 214
diff --git a/options.cpp b/options.cpp index 8eb471c..494a4fd 100644 --- a/options.cpp +++ b/options.cpp @@ -58,6 +58,36 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_INITDIALOG: { TranslateDialogDefault(hwndDlg); + HWND hwndList=GetDlgItem(hwndDlg, IDC_USERLIST); + LVCOLUMN col; + LVITEM item; + NMLISTVIEW *hdr; + col.pszText = _T("Contact"); + col.mask = LVCF_TEXT | LVCF_WIDTH; + col.fmt = LVCFMT_LEFT; + col.cx = 100; + ListView_InsertColumn(hwndList, 0, &col); + col.pszText = _T("PubKey"); + col.mask = LVCF_TEXT | LVCF_WIDTH; + col.fmt = LVCFMT_LEFT; + col.cx = 250; + ListView_InsertColumn(hwndList, 1, &col); + ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_FULLROWSELECT); + int i = 1, iRow = 0; + for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact != NULL; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) + { + TCHAR *name = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); + item.mask = LVIF_TEXT; + item.iItem = i; + item.iSubItem = 0; + item.pszText = name; + iRow = ListView_InsertItem(hwndList, &item); + ListView_SetItemText(hwndList, iRow, 0, name); + ListView_SetItemText(hwndList, iRow, 1, UniGetContactSettingUtf(hContact, szModuleName, "GPGPubKey", _T("not set"))); + i++; + } + ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);// not sure about this + ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE); return TRUE; } @@ -5,10 +5,11 @@ #define IDD_OPT_GPG 104
#define IDD_OPT_GPG_BIN 105
#define IDC_SET_BIN_PATH 1016
-#define IDC_BUTTON2 1017
#define IDC_SET_HOME_DIR 1017
#define IDC_BIN_PATH 1018
#define IDC_HOME_DIR 1019
+#define IDC_USERLIST 1020
+#define IDC_LIST1 1021
// Next default values for new objects
//
@@ -16,7 +17,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1020
+#define _APS_NEXT_CONTROL_VALUE 1022
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|