/[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 2 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 5 by twoaday, Mon Mar 7 13:21:36 2005 UTC
# Line 127  get_prog_part (const char * fname, int u Line 127  get_prog_part (const char * fname, int u
127              return NULL;              return NULL;
128          strncpy (currdir, cmd, 255);          strncpy (currdir, cmd, 255);
129          j = strlen (currdir);          j = strlen (currdir);
130          while (j--)          while (j--) {
         {        
131              if (currdir[j] == '\\')              if (currdir[j] == '\\')
132                  break;                            break;          
133          }          }
# Line 207  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 206  WinMain (HINSTANCE hinst, HINSTANCE hpre
206      gpgme_set_pgm_string ("WinPT "PGM_VERSION);      gpgme_set_pgm_string ("WinPT "PGM_VERSION);
207    
208      s = PTD_get_version ();      s = PTD_get_version ();
209      if (strcmp (s, "0.8.0"))      if (strcmp (s, "0.8.0")) {
     {  
210          log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR,          log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR,
211                   _("Please update your PTD.dll to the newest version, "                   _("Please update your PTD.dll to the newest version, "
212                     "the version (%s) you use is too old."), s);                     "the version (%s) you use is too old."), s);
213          return 0;          return 0;
214      }      }
215    
216      if (gpg_md_selftest ())      if (gpg_md_selftest ()) {
     {  
217          msg_box (NULL, _("Cryptographic selftest failed."),          msg_box (NULL, _("Cryptographic selftest failed."),
218                   _("WinPT Error"), MB_ERR);                   _("WinPT Error"), MB_ERR);
219          return 0;          return 0;
# Line 225  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 222  WinMain (HINSTANCE hinst, HINSTANCE hpre
222      set_default_kserver ();      set_default_kserver ();
223      regist_inst_gnupg (1);      regist_inst_gnupg (1);
224      regist_inst_winpt (1, &created);      regist_inst_winpt (1, &created);
225      if (!created)      if (!created) {
     {  
226          memset (&reg_prefs, 0, sizeof (reg_prefs));          memset (&reg_prefs, 0, sizeof (reg_prefs));
227          reg_prefs.use_tmpfiles = 1; /* default */          reg_prefs.use_tmpfiles = 1; /* default */
228            reg_prefs.fm.progress = 0; /* XXX: fix the bug and enable it again */
229          get_reg_winpt_prefs (&reg_prefs);          get_reg_winpt_prefs (&reg_prefs);
230          if (!reg_prefs.no_hotkeys)          if (!reg_prefs.no_hotkeys)
231              hotkeys_modify ();              hotkeys_modify ();
232      }      }
233    
234      rc = gnupg_check_homedir ();      rc = gnupg_check_homedir ();
235      if (rc)      if (rc) {
     {  
236          log_box (_("WinPT Error"), MB_ERR,          log_box (_("WinPT Error"), MB_ERR,
237                   _("GPG home directory is not set correctly.\n"                   _("GPG home directory is not set correctly.\n"
238                     "Please check the GPG registry settings:\n%s."),                     "Please check the GPG registry settings:\n%s."),
# Line 265  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 261  WinMain (HINSTANCE hinst, HINSTANCE hpre
261                  gnupg_check_homedir (); /* change gpgProgram if needed */                  gnupg_check_homedir (); /* change gpgProgram if needed */
262              }              }
263          }          }
264          else          else {
         {  
265              msg_box (NULL, _("GPG home directory could not be determited."),              msg_box (NULL, _("GPG home directory could not be determited."),
266                       _("WinPT Error"), MB_ERR);                       _("WinPT Error"), MB_ERR);
267              goto start;              goto start;
# Line 274  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 269  WinMain (HINSTANCE hinst, HINSTANCE hpre
269      }      }
270    
271      rc = check_gnupg_prog ();      rc = check_gnupg_prog ();
272      if (rc)      if (rc) {
     {  
273          if (msg_box (NULL, _("Could not find the GPG binary (gpg.exe).\n"          if (msg_box (NULL, _("Could not find the GPG binary (gpg.exe).\n"
274                               "Do you want to start the GPG preferences to "                               "Do you want to start the GPG preferences to "
275                               "correct  this problem?"), _("WinPT Error"),                               "correct  this problem?"), _("WinPT Error"),
# Line 429  start: Line 423  start:
423                                   hwnd, keygen_wizard_dlg_proc, (LPARAM)&c);                                   hwnd, keygen_wizard_dlg_proc, (LPARAM)&c);
424              if (!rc)              if (!rc)
425                  goto start;                  goto start;
             update_keycache (hwnd);  
             check_crypto_engine ();  
426              break;              break;
427    
428          case SETUP_IMPORT:          case SETUP_IMPORT:
# Line 439  start: Line 431  start:
431                  msg_box (hwnd, winpt_strerror (rc), _("WinPT Error"), MB_ERR);                  msg_box (hwnd, winpt_strerror (rc), _("WinPT Error"), MB_ERR);
432                  goto start;                  goto start;
433              }              }
             update_keycache (hwnd);  
             check_crypto_engine ();  
434              break;              break;
435    
436          case SETUP_EXISTING:          case SETUP_EXISTING:
437              break; /* todo */              DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd,
438                                gpgprefs_dlg_proc, NULL);
439                break;
440    
441          case -1:          case -1:
442              DestroyWindow (hwnd);              DestroyWindow (hwnd);
443              free_gnupg_table ();              free_gnupg_table ();
444              return 0;              return 0;
445          }          }
446            update_keycache (hwnd);
447            check_crypto_engine ();
448      }      }
449      else {      else {
450          gpgme_keycache_t c;          gpgme_keycache_t c;

Legend:
Removed from v.2  
changed lines
  Added in v.5

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26