/[winpt]/trunk/Src/wptClipEncryptDlg.cpp
ViewVC logotype

Diff of /trunk/Src/wptClipEncryptDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC revision 175 by twoaday, Tue Feb 7 08:58:04 2006 UTC
# Line 18  Line 18 
18   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
19   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20   */   */
   
21  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
22  #include <config.h>  #include <config.h>
23  #endif  #endif
# Line 57  gpg_clip_encrypt (gpgme_key_t rset[], in Line 56  gpg_clip_encrypt (gpgme_key_t rset[], in
56          return err;          return err;
57            
58      gpgme_set_armor (ctx, 1);      gpgme_set_armor (ctx, 1);
59        gpgme_set_textmode (ctx, 1);
60            
61      err = gpg_data_new_from_clipboard (&plain, 0);      err = gpg_data_new_from_clipboard (&plain, 0);
62      if (err)      if (err)
63          goto leave;          goto leave;
64      err = gpgme_data_new (&ciph);      err = gpgme_data_new (&ciph);
65      if (err)      if (err)
66          goto leave;          goto leave;    
67      err = gpgme_op_encrypt (ctx, rset,      err = gpgme_op_encrypt (ctx, rset,
68                              always_trust?GPGME_ENCRYPT_ALWAYS_TRUST : (gpgme_encrypt_flags_t)0,                              always_trust?GPGME_ENCRYPT_ALWAYS_TRUST : (gpgme_encrypt_flags_t)0,
69                              plain, ciph);                              plain, ciph);
# Line 109  show_invalid_recipients (HWND dlg, gpgme Line 109  show_invalid_recipients (HWND dlg, gpgme
109      p = (char *)calloc (1, len+64);      p = (char *)calloc (1, len+64);
110      if (!p)      if (!p)
111          BUG (NULL);          BUG (NULL);
112      sprintf (p, _("Recipients unsuable for encryption:\n"));      strcpy (p, _("Recipients unsuable for encryption:\n"));
113      for (k = res->invalid_recipients; k; k = k->next) {      for (k = res->invalid_recipients; k; k = k->next) {
114          get_pubkey (k->fpr, &key);          get_pubkey (k->fpr, &key);
115          strcat (p, key->subkeys->keyid+8);          strcat (p, key->subkeys->keyid+8);
# Line 132  clip_encrypt_dlg_proc (HWND dlg, UINT ms Line 132  clip_encrypt_dlg_proc (HWND dlg, UINT ms
132      gpgme_key_t *rset;      gpgme_key_t *rset;
133      gpgme_ctx_t ctx=NULL;      gpgme_ctx_t ctx=NULL;
134      gpgme_error_t err;      gpgme_error_t err;
135      refresh_cache_s rcs = {0};      int force_trust = 0;
     int force_trust = 0, opt = 0;  
136      int kmode = reg_prefs.keylist_mode? KEYLIST_ENCRYPT_MIN : KEYLIST_ENCRYPT;      int kmode = reg_prefs.keylist_mode? KEYLIST_ENCRYPT_MIN : KEYLIST_ENCRYPT;
137      int n;      int n;
138            
139      switch( msg ) {      switch( msg ) {
140      case WM_INITDIALOG:      case WM_INITDIALOG:
141          SetWindowText( dlg, _("Encryption") );          SetWindowText (dlg, _("Encryption"));
142            SetDlgItemText (dlg, IDC_ENCRYPT_FNDCMD, _("&Find"));
143            SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
144          kc = keycache_get_ctx( KEYCACHE_PUB );          kc = keycache_get_ctx( KEYCACHE_PUB );
145          if( !kc )          if( !kc )
146              BUG( NULL );              BUG( NULL );
# Line 147  clip_encrypt_dlg_proc (HWND dlg, UINT ms Line 148  clip_encrypt_dlg_proc (HWND dlg, UINT ms
148                             kmode, KEY_SORT_USERID);                             kmode, KEY_SORT_USERID);
149          center_window( dlg, NULL );          center_window( dlg, NULL );
150          SetForegroundWindow( dlg );          SetForegroundWindow( dlg );
         set_active_window( dlg );  
151          return TRUE;          return TRUE;
152                    
153      case WM_DESTROY:      case WM_DESTROY:
         reset_active_window( );  
154          if( lv ) {          if( lv ) {
155              keylist_delete( lv );              keylist_delete( lv );
156              lv = NULL;              lv = NULL;
# Line 164  clip_encrypt_dlg_proc (HWND dlg, UINT ms Line 163  clip_encrypt_dlg_proc (HWND dlg, UINT ms
163          notify = (NMHDR *)lparam;          notify = (NMHDR *)lparam;
164          if (notify && notify->code == NM_DBLCLK &&          if (notify && notify->code == NM_DBLCLK &&
165              notify->idFrom == IDC_ENCRYPT_KEYLIST)              notify->idFrom == IDC_ENCRYPT_KEYLIST)
166              PostMessage( dlg, WM_COMMAND, MAKEWPARAM( IDOK, 0 ), NULL );              PostMessage( dlg, WM_COMMAND, MAKEWPARAM( IDOK, 0 ), 0 );
167          if (notify && notify->code == LVN_COLUMNCLICK &&          if (notify && notify->code == LVN_COLUMNCLICK &&
168              notify->idFrom == IDC_ENCRYPT_KEYLIST ) {              notify->idFrom == IDC_ENCRYPT_KEYLIST ) {
169              NMLISTVIEW *p = (LPNMLISTVIEW) lparam;              NMLISTVIEW *p = (LPNMLISTVIEW) lparam;
# Line 218  clip_encrypt_dlg_proc (HWND dlg, UINT ms Line 217  clip_encrypt_dlg_proc (HWND dlg, UINT ms
217          case IDC_ENCRYPT_FNDCMD:          case IDC_ENCRYPT_FNDCMD:
218          {          {
219              char tmpbuf[64];              char tmpbuf[64];
             int n;  
220    
221              n = GetDlgItemText (dlg, IDC_ENCRYPT_FIND, tmpbuf, DIM (tmpbuf)-1);              n = GetDlgItemText (dlg, IDC_ENCRYPT_FIND, tmpbuf, DIM (tmpbuf)-1);
222              if (!n)              if (!n)

Legend:
Removed from v.48  
changed lines
  Added in v.175

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26