21 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
22 |
#include <config.h> |
#include <config.h> |
23 |
#endif |
#endif |
|
#define _WIN32_IE 0x500 |
|
24 |
#include <windows.h> |
#include <windows.h> |
25 |
#include <commctrl.h> |
#include <commctrl.h> |
26 |
#include <assert.h> |
#include <assert.h> |
118 |
|
|
119 |
|
|
120 |
/* Load the keylist in the list view @ctl. */ |
/* Load the keylist in the list view @ctl. */ |
121 |
static void |
static int |
122 |
keylist_load (HWND ctl) |
keylist_load (HWND ctl) |
123 |
{ |
{ |
124 |
gpgme_ctx_t ctx; |
gpgme_ctx_t ctx; |
125 |
gpgme_key_t key; |
gpgme_key_t key; |
126 |
gpgme_error_t err; |
gpgme_error_t err; |
127 |
|
int nkeys = 0; |
128 |
|
|
129 |
ListView_SetExtendedListViewStyle(ctl, LVS_EX_FULLROWSELECT); |
ListView_SetExtendedListViewStyle(ctl, LVS_EX_FULLROWSELECT); |
130 |
ListView_SetExtendedListViewStyle(ctl, LVS_EX_CHECKBOXES); |
ListView_SetExtendedListViewStyle(ctl, LVS_EX_CHECKBOXES); |
134 |
|
|
135 |
err = gpgme_new (&ctx); |
err = gpgme_new (&ctx); |
136 |
if (err) |
if (err) |
137 |
return; |
return 0; |
138 |
err = gpgme_op_keylist_start (ctx, NULL, 0); |
err = gpgme_op_keylist_start (ctx, NULL, 0); |
139 |
while (!err) { |
while (!err) { |
140 |
err = gpgme_op_keylist_next (ctx, &key); |
err = gpgme_op_keylist_next (ctx, &key); |
141 |
if (err) |
if (err) |
142 |
break; |
break; |
143 |
listview_add_key_item (ctl, key); |
listview_add_key_item (ctl, key); |
144 |
|
nkeys++; |
145 |
} |
} |
146 |
gpgme_release (ctx); |
gpgme_release (ctx); |
147 |
|
return nkeys; |
148 |
} |
} |
149 |
|
|
150 |
|
|
156 |
recip_list_t t; |
recip_list_t t; |
157 |
|
|
158 |
lb = GetDlgItem (dlg, IDC_ENCRYPT_KEYLIST); |
lb = GetDlgItem (dlg, IDC_ENCRYPT_KEYLIST); |
159 |
keylist_load (lb); |
if (keylist_load (lb) == 0) { |
160 |
|
MessageBox (dlg, _("No keys found in the keyring"), |
161 |
|
_("GPG Plug-in Error"), MB_ICONERROR|MB_OK); |
162 |
|
EndDialog (dlg, 0); |
163 |
|
} |
164 |
|
SetDlgItemText (dlg, IDOK, _("&OK")); |
165 |
|
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
166 |
SetDlgItemText (dlg, IDC_ENCRYPT_RECPMSG, _("Recipients which were NOT found")); |
SetDlgItemText (dlg, IDC_ENCRYPT_RECPMSG, _("Recipients which were NOT found")); |
167 |
lb = GetDlgItem (dlg, IDC_ENCRYPT_INVLIST); |
lb = GetDlgItem (dlg, IDC_ENCRYPT_INVLIST); |
168 |
for (t=((plugin_ctx_t)lparam)->rset; t; t = t->next) { |
for (t=((plugin_ctx_t)lparam)->rset; t; t = t->next) { |
191 |
assert (ctx); |
assert (ctx); |
192 |
on_init_dialog (dlg, msg, wparam, lparam); |
on_init_dialog (dlg, msg, wparam, lparam); |
193 |
return TRUE; |
return TRUE; |
|
|
|
|
case WM_DESTROY: |
|
|
return FALSE; |
|
194 |
|
|
195 |
case WM_NOTIFY: |
case WM_NOTIFY: |
196 |
notify = (NMHDR *)lparam; |
notify = (NMHDR *)lparam; |