108 |
SetWindowText (dlg, _("Sign & Encrypt")); |
SetWindowText (dlg, _("Sign & Encrypt")); |
109 |
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
110 |
kc = keycache_get_ctx (KEYCACHE_PUB); |
kc = keycache_get_ctx (KEYCACHE_PUB); |
111 |
|
if (!kc) |
112 |
|
BUG (NULL); |
113 |
|
|
114 |
kl = keylist_load (GetDlgItem (dlg, IDC_SIGNENC_KEYLIST), |
kl = keylist_load (GetDlgItem (dlg, IDC_SIGNENC_KEYLIST), |
115 |
kc, NULL, KEYLIST_ENCRYPT_MIN, KEY_SORT_USERID); |
kc, NULL, KEYLIST_ENCRYPT_MIN, KEY_SORT_USERID); |
116 |
seclist_init (dlg, IDC_SIGNENC_SECLIST, KEYLIST_FLAG_SHORT, &list); |
seclist_init (dlg, IDC_SIGNENC_SECLIST, KEYLIST_FLAG_SHORT, &list); |
130 |
return FALSE; |
return FALSE; |
131 |
|
|
132 |
case WM_NOTIFY: |
case WM_NOTIFY: |
133 |
|
/* Wait until the dialog initialization is done */ |
134 |
|
if (kl == NULL) |
135 |
|
break; |
136 |
|
|
137 |
int ret; |
int ret; |
138 |
ret = keylist_listview_notify (dlg, kl->keys, |
ret = keylist_listview_notify (dlg, kl->keys, |
139 |
IDC_SIGNENC_KEYLIST, lparam); |
IDC_SIGNENC_KEYLIST, lparam); |
144 |
|
|
145 |
NMHDR *notify; |
NMHDR *notify; |
146 |
notify = (NMHDR *)lparam; |
notify = (NMHDR *)lparam; |
147 |
if (notify && notify->code == NM_DBLCLK |
if (notify && notify->code == NM_DBLCLK && |
148 |
&& notify->idFrom == IDC_SIGNENC_KEYLIST) |
notify->idFrom == IDC_SIGNENC_KEYLIST) |
149 |
PostMessage (dlg, WM_COMMAND, MAKEWPARAM (IDOK, 0), 0); |
PostMessage (dlg, WM_COMMAND, MAKEWPARAM (IDOK, 0), 0); |
150 |
|
|
151 |
if (notify && notify->code == LVN_COLUMNCLICK && |
if (notify && notify->code == LVN_COLUMNCLICK && |
165 |
else |
else |
166 |
keys_sortby = sortby; |
keys_sortby = sortby; |
167 |
keylist_sort (kl, keys_sortby); |
keylist_sort (kl, keys_sortby); |
168 |
} |
return TRUE; |
169 |
return TRUE; |
} |
170 |
|
break; |
171 |
|
|
172 |
case WM_COMMAND: |
case WM_COMMAND: |
173 |
if (HIWORD (wparam) == BN_CLICKED |
if (HIWORD (wparam) == BN_CLICKED && |
174 |
&& LOWORD (wparam) == IDC_SIGNENC_SELKEY) { |
LOWORD (wparam) == IDC_SIGNENC_SELKEY) { |
175 |
int enable = IsDlgButtonChecked (dlg, IDC_SIGNENC_SELKEY); |
int enable = IsDlgButtonChecked (dlg, IDC_SIGNENC_SELKEY); |
176 |
EnableWindow (GetDlgItem (dlg, IDC_SIGNENC_SECLIST), enable? TRUE : FALSE); |
EnableWindow (GetDlgItem (dlg, IDC_SIGNENC_SECLIST), enable? TRUE : FALSE); |
177 |
|
break; |
178 |
} |
} |
179 |
|
|
180 |
switch (LOWORD (wparam)) { |
switch (LOWORD (wparam)) { |
181 |
case IDOK: |
case IDOK: |
182 |
rset = keylist_get_recipients (kl, &force_trust, &n); |
rset = keylist_get_recipients (kl, &force_trust, &n); |