/[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 172 by twoaday, Mon Jan 30 13:47:35 2006 UTC revision 181 by twoaday, Tue Mar 14 11:01:22 2006 UTC
# Line 70  update_keycache (HWND hwnd) Line 70  update_keycache (HWND hwnd)
70  /* Set GPGME debug mode. If @val is 0, the debug mode is disabled. */  /* Set GPGME debug mode. If @val is 0, the debug mode is disabled. */
71  void  void
72  gpg_set_debug_mode (int val)  gpg_set_debug_mode (int val)
73  {        {
74        /* XXX: create the file in $user\$temp */
75      if (val)      if (val)
76          putenv ("GPGME_DEBUG=5:gpgme.dbg");          putenv ("GPGME_DEBUG=5:gpgme.dbg");
77      else      else
# Line 368  enable_mobile_mode (void) Line 369  enable_mobile_mode (void)
369      reg_prefs.auto_backup = 0;      reg_prefs.auto_backup = 0;
370      reg_prefs.cache_time = 0;      reg_prefs.cache_time = 0;
371      reg_prefs.expert = 0;      reg_prefs.expert = 0;
     reg_prefs.keylist_mode = 1;  
372      reg_prefs.kserv_conf = m_strdup ("keyserver.conf");      reg_prefs.kserv_conf = m_strdup ("keyserver.conf");
373      reg_prefs.no_zip_mmedia = 1;      reg_prefs.no_zip_mmedia = 1;
374      reg_prefs.use_tmpfiles = 1;      reg_prefs.use_tmpfiles = 1;
# Line 377  enable_mobile_mode (void) Line 377  enable_mobile_mode (void)
377  }  }
378    
379    
380    void
381    set_default_keyserver (void)
382    {
383        char *host = get_reg_entry_keyserver ("Default");
384        char *str_port = get_reg_entry_keyserver ("Default_Port");
385        WORD port = HKP_PORT;
386    
387        if (!host)
388            keyserver_set_default (NULL, 0);
389        else {
390            if (str_port && *str_port)
391                port = atoi (str_port);
392            keyserver_set_default (host, port);
393        }
394        free_if_alloc (host);
395        free_if_alloc (str_port);
396    }
397    
398    
399  /* Main entry point. */  /* Main entry point. */
400  int WINAPI  int WINAPI
401  WinMain (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int showcmd)  WinMain (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int showcmd)
# Line 452  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 471  WinMain (HINSTANCE hinst, HINSTANCE hpre
471          mobile = 1;          mobile = 1;
472      }      }
473    
474      set_default_kserver ();      set_default_keyserver ();
475      load_gettext (winpt_inst_found);      load_gettext (winpt_inst_found);
476    
477      if (!mobile) {      if (!mobile) {
# Line 470  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 489  WinMain (HINSTANCE hinst, HINSTANCE hpre
489          reg_prefs.use_tmpfiles = 1; /* default */          reg_prefs.use_tmpfiles = 1; /* default */
490          reg_prefs.fm.progress = 0; /* XXX: fix the bug and enable it again */          reg_prefs.fm.progress = 0; /* XXX: fix the bug and enable it again */
491          get_reg_winpt_prefs (&reg_prefs);          get_reg_winpt_prefs (&reg_prefs);
         if (!reg_prefs.no_hotkeys)  
             hotkeys_modify ();  
492          gnupg_load_config ();          gnupg_load_config ();
493      }      }
     else { /* default settings. */  
         reg_prefs.keylist_mode = 1;  
     }  
494    
495      if (is_gpg4win_installed ())      if (is_gpg4win_installed ())
496          load_gpg_env (); /* XXX: check return code. */          load_gpg_env (); /* XXX: check return code. */
# Line 690  start: Line 704  start:
704          }          }
705      }      }
706      else {      else {
707          gpg_keycache_t c;          gpg_keycache_t c, sec_c;
708          update_keycache (hwnd);          update_keycache (hwnd);
709          c = keycache_get_ctx (1);          c = keycache_get_ctx (1);
710          if (!c || !gpg_keycache_get_size (c)) {          if (!c || !gpg_keycache_get_size (c)) {
# Line 712  start: Line 726  start:
726                  return 0;                  return 0;
727              }              }
728          }          }
729          if (check_default_key (c)) {          sec_c = keycache_get_ctx (0);
730            if (check_default_key (sec_c)) {
731              char *p = get_gnupg_default_key ();              char *p = get_gnupg_default_key ();
732              log_box (_("WinPT Error"), MB_ERR,              log_box (_("WinPT Error"), MB_ERR,
733                       _("Default key from the GPG options file could not be found.\n"                       _("Default key (from the GPG config file) could not be found.\n"
734                         "Please check your gpg.conf (options) to correct this:\n\n"                         "Please check your gpg.conf or set a new default key to correct it:\n\n"
735                         "%s: public key not found."), p? p : "[null]");                         "%s: public key not found."), p? p : "[null]");
736              free_if_alloc (p);              free_if_alloc (p);
737              DestroyWindow (hwnd);              DestroyWindow (hwnd);

Legend:
Removed from v.172  
changed lines
  Added in v.181

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26