142 |
clip_encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
clip_encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
143 |
{ |
{ |
144 |
static listview_ctrl_t lv = NULL; |
static listview_ctrl_t lv = NULL; |
145 |
|
static int keys_sortby = 0; |
146 |
gpg_keycache_t kc; |
gpg_keycache_t kc; |
147 |
gpgme_key_t *rset; |
gpgme_key_t *rset; |
148 |
gpgme_ctx_t ctx=NULL; |
gpgme_ctx_t ctx=NULL; |
177 |
notify->idFrom == IDC_ENCRYPT_KEYLIST) |
notify->idFrom == IDC_ENCRYPT_KEYLIST) |
178 |
PostMessage( dlg, WM_COMMAND, MAKEWPARAM( IDOK, 0 ), 0 ); |
PostMessage( dlg, WM_COMMAND, MAKEWPARAM( IDOK, 0 ), 0 ); |
179 |
if (notify && notify->code == LVN_COLUMNCLICK && |
if (notify && notify->code == LVN_COLUMNCLICK && |
180 |
notify->idFrom == IDC_ENCRYPT_KEYLIST ) { |
notify->idFrom == IDC_ENCRYPT_KEYLIST) { |
181 |
NMLISTVIEW *p = (LPNMLISTVIEW) lparam; |
NMLISTVIEW *p = (LPNMLISTVIEW) lparam; |
182 |
int sortby = 0; |
int sortby = 0; |
183 |
|
|
188 |
case 4: sortby = KEY_SORT_VALIDITY; break; |
case 4: sortby = KEY_SORT_VALIDITY; break; |
189 |
default: sortby = KEY_SORT_USERID; break; |
default: sortby = KEY_SORT_USERID; break; |
190 |
} |
} |
191 |
keylist_sort (lv, sortby); |
if ((keys_sortby & ~KEYLIST_SORT_DESC) == sortby) |
192 |
|
keys_sortby ^= KEYLIST_SORT_DESC; |
193 |
|
else |
194 |
|
keys_sortby = sortby; |
195 |
|
keylist_sort (lv, keys_sortby); |
196 |
} |
} |
197 |
return TRUE; |
return TRUE; |
198 |
|
|
199 |
case WM_COMMAND: |
case WM_COMMAND: |
200 |
switch( LOWORD( wparam ) ) { |
switch (LOWORD (wparam)) { |
201 |
case IDOK: |
case IDOK: |
202 |
rset = keylist_get_recipients (lv, &force_trust, &n); |
rset = keylist_get_recipients (lv, &force_trust, &n); |
203 |
if (!n) { |
if (!n) { |