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

Diff of /trunk/Src/WinPT.cpp

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

revision 24 by twoaday, Sat Oct 8 10:43:08 2005 UTC revision 25 by twoaday, Wed Oct 12 10:04:26 2005 UTC
# Line 45  int mobile = 0; Line 45  int mobile = 0;
45  int gpg_read_only = 0;  int gpg_read_only = 0;
46  char gpgver[3];  char gpgver[3];
47    
 /* Internal IPC */  
 int start_keymanager = 0;  
   
48  static void  static void
49  update_keycache (HWND hwnd)  update_keycache (HWND hwnd)
50  {  {
# Line 105  load_gettext (void) Line 102  load_gettext (void)
102  /* check if the default key from the gpg.conf file is available in the  /* check if the default key from the gpg.conf file is available in the
103     keyring. if not, bail out because encryption won't work properly then. */     keyring. if not, bail out because encryption won't work properly then. */
104  static int  static int
105  check_default_key (gpgme_keycache_t kc)  check_default_key (gpg_keycache_t kc)
106  {  {
107      gpgme_key_t key;      gpgme_key_t key;
108      gpgme_error_t err = GPG_ERR_NO_ERROR;      gpgme_error_t err = GPG_ERR_NO_ERROR;
# Line 113  check_default_key (gpgme_keycache_t kc) Line 110  check_default_key (gpgme_keycache_t kc)
110    
111      defkey = get_gnupg_default_key ();      defkey = get_gnupg_default_key ();
112      if (defkey)      if (defkey)
113          err = gpgme_keycache_find_key (kc, defkey, 0, &key);          err = gpg_keycache_find_key (kc, defkey, 0, &key);
114      free_if_alloc (defkey);      free_if_alloc (defkey);
115      return err? -1 : 0;      return err? -1 : 0;
116  } /* check_default_key */  } /* check_default_key */
# Line 218  enable_mobile_mode (void) Line 215  enable_mobile_mode (void)
215  char* get_subkey_fingerprint (gpgme_ctx_t ctx, const char *keyid);  char* get_subkey_fingerprint (gpgme_ctx_t ctx, const char *keyid);
216    
217  int WINAPI  int WINAPI
218  #ifndef WINPT_IPC  
219  WinMain (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int showcmd)  WinMain (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int showcmd)
 #else  
 win_main (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int showcmd)  
 #endif  
220  {  {
221      WNDCLASS wc = {0, winpt_main_proc, 0, 0, hinst, 0, 0, 0, 0, PGM_NAME};      WNDCLASS wc = {0, winpt_main_proc, 0, 0, hinst, 0, 0, 0, 0, PGM_NAME};
222      HACCEL accel_tab;      HACCEL accel_tab;
# Line 292  win_main (HINSTANCE hinst, HINSTANCE hpr Line 286  win_main (HINSTANCE hinst, HINSTANCE hpr
286                   _("GPG home directory is not set correctly.\n"                   _("GPG home directory is not set correctly.\n"
287                     "Please check the GPG registry settings:\n%s."),                     "Please check the GPG registry settings:\n%s."),
288                   winpt_strerror (rc));                   winpt_strerror (rc));
289          const char * s = get_filename_dlg (GetActiveWindow (), FILE_OPEN,          const char * s = get_fileopen_dlg (GetActiveWindow (),
290                                             _("Select GPG Public Keyring"),                                             _("Select GPG Public Keyring"),
291                                             _("GPG Keyrings (*.gpg)\0*.gpg\0\0"),                                             _("GPG Keyrings (*.gpg)\0*.gpg\0\0"),
292                                             NULL);                                             NULL);
# Line 381  win_main (HINSTANCE hinst, HINSTANCE hpr Line 375  win_main (HINSTANCE hinst, HINSTANCE hpr
375      }      }
376    
377      load_keyserver_conf (cmdline? 1 : 0);      load_keyserver_conf (cmdline? 1 : 0);
     if (start_keymanager) {  
         dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_KEYMISC,  
                             GetDesktopWindow(), keymanager_dlg_proc, NULL,  
                             _("Key Manager"), IDS_WINPT_KEYMISC);  
         keycache_release ();  
         free_gnupg_table ();  
         return 0;  
     }  
378    
379      if (cmdline && (stristr (cmdline, "--keymanager")      if (cmdline && (stristr (cmdline, "--keymanager")
380                  || stristr (cmdline, "--cardmanager"))) {                  || stristr (cmdline, "--cardmanager"))) {
# Line 406  win_main (HINSTANCE hinst, HINSTANCE hpr Line 392  win_main (HINSTANCE hinst, HINSTANCE hpr
392                                    IDS_WINPT_CARD_EDIT);                                    IDS_WINPT_CARD_EDIT);
393              gpg_card_release (crd);              gpg_card_release (crd);
394          }          }
395          keycache_release ();          keycache_release (0);
396          free_gnupg_table ();          free_gnupg_table ();
397          return 0;          return 0;
398      }      }
# Line 506  start: Line 492  start:
492          check_crypto_engine ();          check_crypto_engine ();
493      }      }
494      else {      else {
495          gpgme_keycache_t c;          gpg_keycache_t c;
496          update_keycache (hwnd);          update_keycache (hwnd);
497          c = keycache_get_ctx (1);          c = keycache_get_ctx (1);
498          if (!c || !gpgme_keycache_count (c)) {          if (!c || !gpg_keycache_get_size (c)) {
499              gnupg_display_error ();              gnupg_display_error ();
500              msg_box (hwnd, _("The keycache was not initialized or is empty.\n"              msg_box (hwnd, _("The keycache was not initialized or is empty.\n"
501                               "Please check your GPG config (keyrings, pathes...)"),                               "Please check your GPG config (keyrings, pathes...)"),

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26