24 |
#include "../resource.h" |
#include "../resource.h" |
25 |
#include "wptErrors.h" |
#include "wptErrors.h" |
26 |
#include "wptAgent.h" |
#include "wptAgent.h" |
27 |
|
#include "wptCrypto.h" |
28 |
#include "wptGPG.h" |
#include "wptGPG.h" |
29 |
#include "wptCommonCtl.h" |
#include "wptCommonCtl.h" |
30 |
#include "wptKeylist.h" |
#include "wptKeylist.h" |
83 |
gpgme_data_release (plain); |
gpgme_data_release (plain); |
84 |
if (ciph) |
if (ciph) |
85 |
gpgme_data_release (ciph); |
gpgme_data_release (ciph); |
|
gpgme_key_release (key); |
|
86 |
return err; |
return err; |
87 |
} |
} |
88 |
|
|
93 |
{ |
{ |
94 |
static listview_ctrl_t lv = NULL; |
static listview_ctrl_t lv = NULL; |
95 |
static keylist_t list = NULL; |
static keylist_t list = NULL; |
96 |
static int enable = 0; |
gpg_keycache_t kc; |
|
gpgme_keycache_t kc; |
|
97 |
gpgme_key_t *rset; |
gpgme_key_t *rset; |
98 |
gpgme_error_t err; |
gpgme_error_t err; |
99 |
gpgme_ctx_t ctx; |
gpgme_ctx_t ctx; |
105 |
|
|
106 |
switch( msg ) { |
switch( msg ) { |
107 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
108 |
enable = 0; |
SetWindowText (dlg, _("Sign & Encrypt")); |
109 |
#ifndef LANG_DE |
|
|
SetWindowText( dlg, _("Sign & Encrypt") ); |
|
|
#endif |
|
110 |
kc = keycache_get_ctx( KEYCACHE_PUB ); |
kc = keycache_get_ctx( KEYCACHE_PUB ); |
111 |
if( !kc ) |
if( !kc ) |
112 |
BUG( NULL ); |
BUG( NULL ); |
125 |
seclist_destroy (&list); |
seclist_destroy (&list); |
126 |
reset_active_window (); |
reset_active_window (); |
127 |
if (lv) { |
if (lv) { |
128 |
keylist_delete( lv ); |
keylist_delete (lv); |
129 |
lv = NULL; |
lv = NULL; |
130 |
} |
} |
131 |
return FALSE; |
return FALSE; |
133 |
case WM_NOTIFY: |
case WM_NOTIFY: |
134 |
NMHDR * notify; |
NMHDR * notify; |
135 |
notify = (NMHDR *)lparam; |
notify = (NMHDR *)lparam; |
136 |
if( notify && notify->code == NM_DBLCLK |
if (notify && notify->code == NM_DBLCLK |
137 |
&& notify->idFrom == IDC_SIGNENC_KEYLIST ) |
&& notify->idFrom == IDC_SIGNENC_KEYLIST) |
138 |
PostMessage( dlg, WM_COMMAND, MAKEWPARAM(IDOK, 0), NULL ); |
PostMessage (dlg, WM_COMMAND, MAKEWPARAM (IDOK, 0), NULL); |
139 |
return TRUE; |
return TRUE; |
140 |
|
|
141 |
case WM_SYSCOMMAND: |
case WM_SYSCOMMAND: |
144 |
return FALSE; |
return FALSE; |
145 |
|
|
146 |
case WM_COMMAND: |
case WM_COMMAND: |
147 |
/* fixme: the enable seems to have a sync problem */ |
if (HIWORD (wparam) == BN_CLICKED |
148 |
if( HIWORD( wparam ) == BN_CLICKED |
&& LOWORD (wparam) == IDC_SIGNENC_SELKEY) { |
149 |
&& LOWORD( wparam ) == IDC_SIGNENC_SELKEY ) { |
int enable = IsDlgButtonChecked (dlg, IDC_SIGNENC_SELKEY); |
150 |
enable ^= 1; |
EnableWindow (GetDlgItem (dlg, IDC_SIGNENC_SECLIST), enable? TRUE : FALSE); |
|
EnableWindow( GetDlgItem( dlg, IDC_SIGNENC_SECLIST ), enable? TRUE : FALSE ); |
|
151 |
} |
} |
152 |
switch( LOWORD( wparam ) ) { |
switch( LOWORD( wparam ) ) { |
153 |
case IDOK: |
case IDOK: |