/[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 30 by twoaday, Sat Oct 22 10:17:59 2005 UTC revision 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC
# Line 38  Line 38 
38    
39  #define MIN_GPG_VER   "1.4.3"   /* Minimal GPG version. */  #define MIN_GPG_VER   "1.4.3"   /* Minimal GPG version. */
40  #define MIN_GPGME_VER "1.2.0"   /* Minimal GPGME version. */  #define MIN_GPGME_VER "1.2.0"   /* Minimal GPGME version. */
41    #define MIN_PTD_VER   "0.8.1"   /* Minimal PTD version. */
42    
43    
44  HINSTANCE glob_hinst;   /* global instance for the dialogs */  HINSTANCE glob_hinst;   /* global instance for the dialogs */
# Line 130  check_default_key (gpg_keycache_t kc) Line 131  check_default_key (gpg_keycache_t kc)
131  static const char *  static const char *
132  get_prog_part (const char * fname, int use_cwd)  get_prog_part (const char * fname, int use_cwd)
133  {  {
134      static char program[1024];      static char program[512];
135      char currdir[256], * cmd = NULL;      char currdir[256];
136        char *cmd = NULL;
137      int j;      int j;
138                    
139      memset (currdir, 0, DIM (currdir));      memset (currdir, 0, DIM (currdir));
# Line 145  get_prog_part (const char * fname, int u Line 147  get_prog_part (const char * fname, int u
147          cmd = GetCommandLine ();          cmd = GetCommandLine ();
148          if (cmd == NULL)          if (cmd == NULL)
149              return NULL;              return NULL;
150          strncpy (currdir, cmd, 255);          strncpy (currdir, cmd, sizeof (currdir)-1);
151          j = strlen (currdir);          j = strlen (currdir);
152          while (j--) {          while (j--) {
153              if (currdir[j] == '\\')              if (currdir[j] == '\\')
154                  break;                            break;
155          }          }
156          currdir[j] = 0;          currdir[j] = 0;
157          _snprintf (program, DIM (program)-1, "%s\\%s", currdir + 1, fname);          _snprintf (program, DIM (program)-1, "%s\\%s", currdir + 1, fname);
# Line 211  load_keyserver_conf (int quiet) Line 213  load_keyserver_conf (int quiet)
213  }  }
214    
215    
216    /* Enable the mobility mode. */
217  static void  static void
218  enable_mobile_mode (void)  enable_mobile_mode (void)
219  {  {
# Line 248  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 251  WinMain (HINSTANCE hinst, HINSTANCE hpre
251      #endif      #endif
252    
253      s = PTD_get_version ();      s = PTD_get_version ();
254      if (strcmp (s, "0.8.0")) {      if (strcmp (s, MIN_PTD_VER)) {
255          log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR,          log_box (_("Privacy Tray Dynamic (PTD)"), MB_ERR,
256                   _("Please update your PTD.dll to the newest version, "                   _("Please update your PTD.dll to the newest version, "
257                     "the version (%s) you use is too old."), s);                     "the version (%s) you use is too old."), s);
# Line 346  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 349  WinMain (HINSTANCE hinst, HINSTANCE hpre
349      }      }
350    
351      rc = gnupg_access_files ();      rc = gnupg_access_files ();
352      if (!start_gpgprefs && rc)      if (!start_gpgprefs && rc) {
353      {          if (rc == WPTERR_GPG_KEYRINGS || rc == WPTERR_GPG_OPT_KEYRINGS) {
         if (rc == WPTERR_GPG_KEYRINGS || rc == WPTERR_GPG_OPT_KEYRINGS)  
         {  
354              ec = msg_box (NULL,              ec = msg_box (NULL,
355                  _("Could not access and/or find the public and secret keyring.\n"                  _("Could not access and/or find the public and secret keyring.\n"
356                    "If this is an accident, quit the program and fix it.\n\n"                    "If this is an accident, quit the program and fix it.\n\n"
# Line 358  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 359  WinMain (HINSTANCE hinst, HINSTANCE hpre
359              if (ec == IDYES)              if (ec == IDYES)
360                  first_start = 1;                  first_start = 1;
361          }          }
362          if (!first_start)          if (!first_start) {
         {  
363              msg_box (NULL, winpt_strerror (rc), _("WinPT Error"), MB_ERR);              msg_box (NULL, winpt_strerror (rc), _("WinPT Error"), MB_ERR);
364              return 0;              return 0;
365          }          }
366      }      }
367    
368      if (!first_start)      if (!first_start) {
     {  
369          rc = gpg_check_permissions (1);          rc = gpg_check_permissions (1);
370          if (rc && rc == 2)          if (rc && rc == 2)
371              gpg_read_only = 1;              gpg_read_only = 1;
# Line 378  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 377  WinMain (HINSTANCE hinst, HINSTANCE hpre
377      init_gnupg_table ();      init_gnupg_table ();
378    
379      nfiles = fm_parse_command_line (cmdline);      nfiles = fm_parse_command_line (cmdline);
380      if (nfiles > 0)      if (nfiles > 0) {
381            free_gnupg_table ();
382          return 0;          return 0;
383        }
384    
385      if (cmdline && stristr (cmdline, "--wipe-freespace")) {      if (cmdline && stristr (cmdline, "--wipe-freespace")) {
386          dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_SPACE_SECDEL,          dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_SPACE_SECDEL,

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26