43 |
Return value: 0 on success. */ |
Return value: 0 on success. */ |
44 |
static void |
static void |
45 |
siglist_build (listview_ctrl_t *lv, HWND ctrl) |
siglist_build (listview_ctrl_t *lv, HWND ctrl) |
46 |
{ |
{ |
|
listview_ctrl_t c; |
|
47 |
struct listview_column_s implist[] = { |
struct listview_column_s implist[] = { |
48 |
{0, 240, (char *)_("User ID")}, |
{0, 240, (char *)_("User ID")}, |
49 |
{1, 50, (char *)_("Valid")}, |
{1, 50, (char *)_("Valid")}, |
54 |
{6, 56, (char *)_("Algorithm")}, |
{6, 56, (char *)_("Algorithm")}, |
55 |
{0, 0, NULL} |
{0, 0, NULL} |
56 |
}; |
}; |
57 |
int j; |
listview_ctrl_t c; |
58 |
|
|
59 |
listview_new (&c, ctrl); |
listview_new (&c, ctrl); |
60 |
for (j=0; implist[j].fieldname != NULL; j++) |
for (int j=0; implist[j].fieldname != NULL; j++) |
61 |
listview_add_column (c, &implist[j]); |
listview_add_column (c, &implist[j]); |
62 |
listview_set_ext_style (c); |
listview_set_ext_style (c); |
63 |
listview_del_all_items (c); |
listview_del_all_items (c); |
82 |
{ |
{ |
83 |
char *p; |
char *p; |
84 |
int i; |
int i; |
85 |
|
|
86 |
p = new char[strlen (old) + 1 + ilvl]; |
p = new char[strlen (old) + 1 + ilvl]; |
87 |
if (!p) |
if (!p) |
88 |
BUG (NULL); |
BUG (NULL); |
94 |
|
|
95 |
|
|
96 |
/* Add an item at the given pos @pos with the opaque param @ks. */ |
/* Add an item at the given pos @pos with the opaque param @ks. */ |
97 |
int |
static int |
98 |
add_keysig_item (listview_ctrl_t ctx, int pos, gpgme_key_sig_t ks) |
add_keysig_item (listview_ctrl_t ctx, int pos, gpgme_key_sig_t ks) |
99 |
{ |
{ |
100 |
LV_ITEM lvi; |
LV_ITEM lvi; |
139 |
} |
} |
140 |
else |
else |
141 |
attr = uid->uid; |
attr = uid->uid; |
142 |
if (attr && strlen (attr)) { |
if (attr && strlen (attr) > 0) { |
143 |
char *p = uid? m_strdup (attr) : indent_string (attr, 2); |
char *p = uid? m_strdup (attr) : indent_string (attr, 2); |
144 |
listview_add_sub_item (lv, pos, SL_COL_UID, p); |
listview_add_sub_item (lv, pos, SL_COL_UID, p); |
145 |
free_if_alloc (p); |
free_if_alloc (p); |
160 |
case GPG_ERR_BAD_SIGNATURE:s = _("NO"); break; |
case GPG_ERR_BAD_SIGNATURE:s = _("NO"); break; |
161 |
default: s = _("ERROR"); break; |
default: s = _("ERROR"); break; |
162 |
} |
} |
163 |
if (no_uid) |
if (ks->revoked) |
164 |
|
s = _("REVOKED"); |
165 |
|
else if (no_uid) |
166 |
s = _("NOKEY"); |
s = _("NOKEY"); |
167 |
listview_add_sub_item (lv, pos, SL_COL_VALID, s); |
listview_add_sub_item (lv, pos, SL_COL_VALID, s); |
168 |
|
|
176 |
strcat (t, " "); |
strcat (t, " "); |
177 |
if (!ks->exportable) |
if (!ks->exportable) |
178 |
strcat (t, "L"); |
strcat (t, "L"); |
|
/* XXX: if gpgme supports non-revocable status, add 'R' */ |
|
179 |
listview_add_sub_item (lv, pos, SL_COL_CLASS, t); |
listview_add_sub_item (lv, pos, SL_COL_CLASS, t); |
180 |
|
|
181 |
s = get_key_created (ks->timestamp); |
s = get_key_created (ks->timestamp); |