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; |
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); |
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 |
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 |
|
|
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); |
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); |
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); |
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 |
} |
} |