/[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 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC revision 34 by twoaday, Wed Oct 26 11:20:09 2005 UTC
# Line 90  get_gettext_lang (void) Line 90  get_gettext_lang (void)
90    
91  /* Initialize the gettext sub system. */  /* Initialize the gettext sub system. */
92  static void  static void
93  load_gettext (void)  load_gettext (int prev_inst)
94  {  {
95      char *nls = NULL;      char *nls = NULL;
96      char *file = NULL;      char *file = NULL;
# Line 100  load_gettext (void) Line 100  load_gettext (void)
100          set_gettext_file ("winpt", nls);          set_gettext_file ("winpt", nls);
101          file = make_filename (nls, "winpt", "mo");          file = make_filename (nls, "winpt", "mo");
102          if (!file_exist_check (nls) && init_file_lock (&mo_file, file))  {          if (!file_exist_check (nls) && init_file_lock (&mo_file, file))  {
103              msg_box (NULL, _("Could not initizalize file lock.\n"              if (!prev_inst)
104                               "Native Language Support"),                  msg_box (NULL, _("Could not initizalize file lock.\n"
105                       _("WinPT Error"), MB_ERR);                                   "Native Language Support"),
106                             _("WinPT Error"), MB_ERR);
107          }          }
108          free_if_alloc (nls);          free_if_alloc (nls);
109          free_if_alloc (file);          free_if_alloc (file);
# Line 230  enable_mobile_mode (void) Line 231  enable_mobile_mode (void)
231      reg_prefs.use_viewer = 0; /* XXX */      reg_prefs.use_viewer = 0; /* XXX */
232  }  }
233    
234    char* multi_gnupg_path (void);
235    
236  /* Main entry point. */  /* Main entry point. */
237  int WINAPI  int WINAPI
# Line 239  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 241  WinMain (HINSTANCE hinst, HINSTANCE hpre
241      HACCEL accel_tab;      HACCEL accel_tab;
242      int rc, ec, created = 0, use_cwd = 0, nfiles = 0;      int rc, ec, created = 0, use_cwd = 0, nfiles = 0;
243      int first_start = 0, start_gpgprefs = 0;      int first_start = 0, start_gpgprefs = 0;
244      const char * s;      int winpt_inst_found = 0;
245        const char *s;
246      MSG msg;      MSG msg;
247      HWND hwnd = NULL;      HWND hwnd = NULL;
248    
# Line 271  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 274  WinMain (HINSTANCE hinst, HINSTANCE hpre
274          return 0;          return 0;
275      }      }
276    
277        CreateMutex (NULL, TRUE, PGM_NAME);
278        if (GetLastError () == ERROR_ALREADY_EXISTS)
279            winpt_inst_found = 1;
280    
281      if (cmdline && stristr (cmdline, "--mobile")) {      if (cmdline && stristr (cmdline, "--mobile")) {
282          msg_box (NULL, "WARNING: mobile modus is not fully implemented yet!",          msg_box (NULL, "WARNING: mobile modus is not fully implemented yet!",
283                   "WinPT", MB_INFO);                   "WinPT", MB_INFO);
# Line 314  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 321  WinMain (HINSTANCE hinst, HINSTANCE hpre
321              if (!p)              if (!p)
322                  BUG (0);                  BUG (0);
323              n = p - s;              n = p - s;
324              if (n)              if (n) {
             {  
325                  char * file = new char[n+1];                  char * file = new char[n+1];
326                  if (!file)                  if (!file)
327                      BUG (NULL);                      BUG (NULL);
# Line 373  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 379  WinMain (HINSTANCE hinst, HINSTANCE hpre
379              return 0;              return 0;
380      }      }
381    
382      load_gettext ();      load_gettext (winpt_inst_found);
383      init_gnupg_table ();      init_gnupg_table ();
384    
385      nfiles = fm_parse_command_line (cmdline);      nfiles = fm_parse_command_line (cmdline);
# Line 413  WinMain (HINSTANCE hinst, HINSTANCE hpre Line 419  WinMain (HINSTANCE hinst, HINSTANCE hpre
419          return 0;          return 0;
420      }      }
421    
422      CreateMutex (NULL, TRUE, PGM_NAME);      /* If we found another WinPT instance, just quit to avoid it
423      if (GetLastError () == ERROR_ALREADY_EXISTS) {         will be executed twice. */
424        if (winpt_inst_found) {
425            log_debug ("%s", "WinMain: WinPT is already running.");
426          free_gnupg_table ();          free_gnupg_table ();
427          return 0;          return 0;
428      }      }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26