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

Diff of /trunk/Src/wptMainProc.cpp

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

revision 25 by twoaday, Wed Oct 12 10:04:26 2005 UTC revision 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC
# Line 48  static int wipe_contents = 0; Line 48  static int wipe_contents = 0;
48    
49  /* Dialog box procedure to display all insecure all ElGamal keys. */  /* Dialog box procedure to display all insecure all ElGamal keys. */
50  BOOL CALLBACK  BOOL CALLBACK
51  elgamal_warn_dlg_proc( HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam )  elgamal_warn_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
52  {  {
53      gpg_keycache_t pc;      gpg_keycache_t pc;
54      gpgme_key_t key;      gpgme_key_t key;
# Line 60  elgamal_warn_dlg_proc( HWND dlg, UINT ms Line 60  elgamal_warn_dlg_proc( HWND dlg, UINT ms
60          while (!gpg_keycache_next_key (pc, 0, &key)) {          while (!gpg_keycache_next_key (pc, 0, &key)) {
61              if (key->subkeys->pubkey_algo == GPGME_PK_ELG) {              if (key->subkeys->pubkey_algo == GPGME_PK_ELG) {
62                  _snprintf (tmp, sizeof (tmp)-1, "(0x%s) %s",                  _snprintf (tmp, sizeof (tmp)-1, "(0x%s) %s",
63                              key->subkeys->keyid+8, key->uids->uid);                             key->subkeys->keyid+8, key->uids->uid);
64                  SendDlgItemMessage( dlg, IDC_ELGWARN_LIST, LB_ADDSTRING,                  SendDlgItemMessage (dlg, IDC_ELGWARN_LIST, LB_ADDSTRING,
65                                      0, (LPARAM)(const char *) tmp );                                      0, (LPARAM)(const char *) tmp);
66              }              }
67          }          }
68          gpg_keycache_rewind (pc);          gpg_keycache_rewind (pc);
# Line 82  elgamal_warn_dlg_proc( HWND dlg, UINT ms Line 82  elgamal_warn_dlg_proc( HWND dlg, UINT ms
82  }  }
83    
84    
85    /* @unused
86  static int  static int
87  cleanup_tmp_files (void)  cleanup_tmp_files (void)
88  {  {
# Line 104  cleanup_tmp_files (void) Line 104  cleanup_tmp_files (void)
104      _findclose (hd);      _findclose (hd);
105      return 0;      return 0;
106  }  }
107    */
108    
109    
110  /* Dialog box procedure to confirm to delete the clipboard contents. */  /* Dialog box procedure to confirm to delete the clipboard contents. */
# Line 112  confirm_delclipboard_dlg (HWND dlg, UINT Line 113  confirm_delclipboard_dlg (HWND dlg, UINT
113  {  {
114      switch (msg) {      switch (msg) {
115      case WM_INITDIALOG:      case WM_INITDIALOG:
116            SetWindowText (dlg, _("Delete Clipboard Contents"));
117          center_window (dlg, NULL);          center_window (dlg, NULL);
118          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
119          break;          break;
# Line 142  static gpgme_error_t Line 144  static gpgme_error_t
144  currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set)  currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set)
145  {  {
146      gpgme_error_t err;      gpgme_error_t err;
147      gpg_pgptype_t type;      int type;
148            
149      if (ret_set)      if (ret_set)
150          *ret_set = 1;          *ret_set = 1;
# Line 206  static void Line 208  static void
208  clip_gpg_dlg (HWND hwnd, UINT id)  clip_gpg_dlg (HWND hwnd, UINT id)
209  {  {
210      gpgme_error_t err;      gpgme_error_t err;
211      gpg_pgptype_t type;      int type;
212      size_t size = 0;          size_t size = 0;    
213            
214      if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT)      if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT)
# Line 289  clip_gpg_dlg (HWND hwnd, UINT id) Line 291  clip_gpg_dlg (HWND hwnd, UINT id)
291  } /* clip_gpg_dlg */  } /* clip_gpg_dlg */
292    
293    
294  gpg_card_t  /* Load the Card Manager with the current card. */
295  smartcard_init (void)  static void
296    load_smartcard (void)
297  {  {
298      /*      gpg_card_t card;
299      pcsc_loadlib (scard_support);  
300      rc = show_card_status ();      card = gpg_card_load ();
301      if( rc )          if (card) {
302          break;          dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT,
303      */                            GetDesktopWindow (), card_edit_dlg_proc,
304      return gpg_load_scard ();                            (LPARAM)card,
305                              _("Card Edit"), IDS_WINPT_CARD_EDIT);
306            gpg_card_release (card);
307            card = NULL;    
308        }
309  }  }
310    
311    
# Line 330  winpt_main_proc (HWND hwnd, UINT msg, WP Line 337  winpt_main_proc (HWND hwnd, UINT msg, WP
337      int rc, set_wc = 0, has_data = 0;      int rc, set_wc = 0, has_data = 0;
338      INITCOMMONCONTROLSEX cce;      INITCOMMONCONTROLSEX cce;
339      gpgme_error_t err;      gpgme_error_t err;
     gpg_card_t card;  
340    
341      switch (msg) {      switch (msg) {
342      case WM_CREATE:      case WM_CREATE:
# Line 380  winpt_main_proc (HWND hwnd, UINT msg, WP Line 386  winpt_main_proc (HWND hwnd, UINT msg, WP
386                  set_clip_text (NULL, " ", 1);                  set_clip_text (NULL, " ", 1);
387              wipe_contents = 0;              wipe_contents = 0;
388          }          }
389          cleanup_tmp_files ();          debug_end ();
390            /*cleanup_tmp_files ();*/
391          Shell_NotifyIcon (NIM_DELETE, &NID);          Shell_NotifyIcon (NIM_DELETE, &NID);
392          PostQuitMessage (0);          PostQuitMessage (0);
393          ExitProcess (0);          ExitProcess (0);
# Line 410  winpt_main_proc (HWND hwnd, UINT msg, WP Line 417  winpt_main_proc (HWND hwnd, UINT msg, WP
417                  set_menu_state (popup, ID_WINPT_CDISKUNMOUNT, MF_DISABLED|MF_GRAYED);                  set_menu_state (popup, ID_WINPT_CDISKUNMOUNT, MF_DISABLED|MF_GRAYED);
418              }              }
419    
420              set_menu_text( popup, ID_WINPT_EDIT, _("Edit Clipboard") );              set_menu_text (popup, ID_WINPT_EDIT, _("Edit Clipboard"));
421              set_menu_text( popup, ID_WINPT_ABOUT, _("About...") );              set_menu_text (popup, ID_WINPT_ABOUT, _("About..."));
422              set_menu_text( popup, ID_WINPT_QUIT, _("Exit") );              set_menu_text (popup, ID_WINPT_QUIT, _("Exit"));
423              set_menu_text( popup, ID_WINPT_SYMENC, _("Symmetric") );              set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric"));
424  #if 0              set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt"));
425              set_menu_text( popup, ID_WINPT_ENCRYPT, _("Encrypt") );              set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt"));
426              set_menu_text( popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt") );              set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify"));
427              set_menu_text( popup, ID_WINPT_DECRYPT, _("Decrypt/Verify") );              set_menu_text (popup, ID_WINPT_VERIFY, _("Verify"));
428              set_menu_text( popup, ID_WINPT_VERIFY, _("Verify") );              set_menu_text (popup, ID_WINPT_CURRWND_ENCRYPT, _("Encrypt"));
429              set_menu_text( popup, ID_WINPT_CURRWND_ENCRYPT, _("Encrypt") );              set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt"));
430              set_menu_text( popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt") );              set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify"));
431              set_menu_text( popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify") );              set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign"));
432              set_menu_text( popup, ID_WINPT_CURRWND_SIGN, _("Sign") );              /* change popup texts */
433  #endif              set_menu_text_bypos (popup, 6, _("Clipboard"));
434                set_menu_text_bypos (popup, 7, _("Current Window"));
435                set_menu_text_bypos (popup, 9, _("Preferences"));
436    
437  #endif  #endif
438              TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL );              TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL );
439              PostMessage( hwnd, WM_USER, 0, 0 );              PostMessage( hwnd, WM_USER, 0, 0 );
# Line 553  winpt_main_proc (HWND hwnd, UINT msg, WP Line 563  winpt_main_proc (HWND hwnd, UINT msg, WP
563              break;              break;
564    
565          case ID_WINPT_CARD:          case ID_WINPT_CARD:
566              card = smartcard_init ();              load_smartcard ();
             if( card ) {  
                 dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CARD_EDIT,  
                                   GetDesktopWindow(), card_edit_dlg_proc,  
                                   (LPARAM)card,  
                                   _("Card Edit"), IDS_WINPT_CARD_EDIT );  
                 gpg_card_release( card ); card = NULL;  
             }  
567              break;              break;
568                            
569          case ID_WINPT_EDIT:          case ID_WINPT_EDIT:
# Line 614  winpt_main_proc (HWND hwnd, UINT msg, WP Line 617  winpt_main_proc (HWND hwnd, UINT msg, WP
617      }      }
618            
619      return DefWindowProc (hwnd, msg, wparam, lparam);      return DefWindowProc (hwnd, msg, wparam, lparam);
620  } /* winpt_main_proc */  }

Legend:
Removed from v.25  
changed lines
  Added in v.32

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26