26 |
#include <windows.h> |
#include <windows.h> |
27 |
#include <time.h> |
#include <time.h> |
28 |
|
|
29 |
|
#include "resource.h" |
30 |
#include "wptTypes.h" |
#include "wptTypes.h" |
31 |
#include "wptGPG.h" |
#include "wptGPG.h" |
32 |
#include "wptCommonCtl.h" |
#include "wptCommonCtl.h" |
35 |
#include "wptContext.h" |
#include "wptContext.h" |
36 |
#include "wptErrors.h" |
#include "wptErrors.h" |
37 |
#include "wptW32API.h" |
#include "wptW32API.h" |
38 |
|
#include "wptVersion.h" |
39 |
|
|
40 |
/* Symbolic column IDs */ |
/* Symbolic column IDs */ |
41 |
enum { |
enum { |
158 |
verlist_build (verlist_ctrl_t *vlv, HWND ctrl, int fm_mode) |
verlist_build (verlist_ctrl_t *vlv, HWND ctrl, int fm_mode) |
159 |
{ |
{ |
160 |
struct listview_column_s verlist[] = { |
struct listview_column_s verlist[] = { |
161 |
{0, 100, (char *)_("Name")}, |
{0, 120, (char *)_("Name")}, |
162 |
{1, 140, (char *)_("Status") }, |
{1, 140, (char *)_("Status") }, |
163 |
{2, 120, (char *)_("Signed") }, |
{2, 120, (char *)_("Signed") }, |
164 |
{3, 58, (char *)_("Trust") }, |
{3, 58, (char *)_("Trust") }, |
166 |
{5, 160, (char *)_("User ID") }, |
{5, 160, (char *)_("User ID") }, |
167 |
{6, 0, NULL} |
{6, 0, NULL} |
168 |
}; |
}; |
169 |
|
HICON ico[2]; |
170 |
struct verlist_ctrl_s *v; |
struct verlist_ctrl_s *v; |
171 |
int j; |
int j; |
172 |
|
|
178 |
for(j=0; verlist[j].fieldname; j++) |
for(j=0; verlist[j].fieldname; j++) |
179 |
listview_add_column (v->lv, &verlist[j]); |
listview_add_column (v->lv, &verlist[j]); |
180 |
if (!fm_mode) |
if (!fm_mode) |
181 |
listview_set_column_width (v->lv, 0, 60); |
listview_set_column_width (v->lv, 0, 80); |
182 |
listview_set_ext_style (v->lv); |
listview_set_ext_style (v->lv); |
183 |
|
ico[0] = LoadIcon (glob_hinst, (LPCTSTR)IDI_SIG_GOOD); |
184 |
|
ico[1] = LoadIcon (glob_hinst, (LPCTSTR)IDI_SIG_BAD); |
185 |
|
listview_set_image_list (v->lv, 16, 16, ico, 2); |
186 |
*vlv = v; |
*vlv = v; |
187 |
} |
} |
188 |
|
|
210 |
int |
int |
211 |
verlist_add_sig (verlist_ctrl_t vlv, gpgme_signature_t sig) |
verlist_add_sig (verlist_ctrl_t vlv, gpgme_signature_t sig) |
212 |
{ |
{ |
213 |
struct listview_ctrl_s *lv; |
listview_ctrl_t lv; |
214 |
struct winpt_key_s key; |
struct winpt_key_s key; |
215 |
u32 key_attr; |
u32 key_attr; |
216 |
const char *attr; |
const char *attr; |
217 |
char keyid[32+1]; |
char keyid[32+1]; |
218 |
|
int is_bad; |
219 |
|
|
220 |
|
is_bad = sig->summary & GPGME_SIGSUM_RED? 1 : 0; |
221 |
lv = vlv->lv; |
lv = vlv->lv; |
222 |
if (listview_add_item (lv, " ")) |
if (listview_add_item_image (lv, " ", is_bad)) |
223 |
return WPTERR_GENERAL; |
return WPTERR_GENERAL; |
224 |
|
|
225 |
listview_add_sub_item (lv, 0, VER_COL_NAME, "Clipboard"); |
listview_add_sub_item (lv, 0, VER_COL_NAME, "Clipboard"); |