Mercurial > pidgin.yaz
comparison pidgin/win32/winpidgin.c @ 16021:5b9a35f9b2e4
Fix some overzealous s/gaim/purple/ stuff.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 09 Apr 2007 02:04:03 +0000 |
parents | 66dff3dfdea6 |
children | bb6cfc641496 |
comparison
equal
deleted
inserted
replaced
16018:5e5b7f9fcda8 | 16021:5b9a35f9b2e4 |
---|---|
109 static void dll_prep() { | 109 static void dll_prep() { |
110 char path[MAX_PATH + 1]; | 110 char path[MAX_PATH + 1]; |
111 HMODULE hmod; | 111 HMODULE hmod; |
112 HKEY hkey; | 112 HKEY hkey; |
113 #ifdef PORTABLE | 113 #ifdef PORTABLE |
114 /* We assume that GTK+ is installed under \\path\to\Purple\..\GTK | 114 /* We assume that GTK+ is installed under \\path\to\Pidgin\..\GTK |
115 * First we find \\path\to | 115 * First we find \\path\to |
116 */ | 116 */ |
117 if (GetModuleFileName(NULL, path, MAX_PATH) != 0) { | 117 if (GetModuleFileName(NULL, path, MAX_PATH) != 0) { |
118 char *tmp = path; | 118 char *tmp = path; |
119 char *prev = NULL; | 119 char *prev = NULL; |
134 "Assuming GTK+ is in the PATH.\n"); | 134 "Assuming GTK+ is in the PATH.\n"); |
135 } | 135 } |
136 | 136 |
137 if (path) { | 137 if (path) { |
138 /* Set up the settings dir base to be \\path\to | 138 /* Set up the settings dir base to be \\path\to |
139 * The actual settings dir will be \\path\to\.purple */ | 139 * The actual settings dir will be \\path\to\.pidgin */ |
140 char settingsdir[strlen(path) + strlen("PURPLEHOME=") + 1]; | 140 char settingsdir[strlen(path) + strlen("PIDGINHOME=") + 1]; |
141 char aspelldir[strlen(path) + strlen("PURPLE_ASPELL_DIR=\\Aspell\\bin") + 1]; | 141 char aspelldir[strlen(path) + strlen("PIDGIN_ASPELL_DIR=\\Aspell\\bin") + 1]; |
142 | 142 |
143 snprintf(settingsdir, sizeof(settingsdir), "PURPLEHOME=%s", path); | 143 snprintf(settingsdir, sizeof(settingsdir), "PIDGINHOME=%s", path); |
144 printf("Setting settings dir: %s\n", settingsdir); | 144 printf("Setting settings dir: %s\n", settingsdir); |
145 putenv(settingsdir); | 145 putenv(settingsdir); |
146 | 146 |
147 snprintf(aspelldir, sizeof(aspelldir), "PURPLE_ASPELL_DIR=%s\\Aspell\\bin", path); | 147 snprintf(aspelldir, sizeof(aspelldir), "PIDGIN_ASPELL_DIR=%s\\Aspell\\bin", path); |
148 printf("%s", aspelldir); | 148 printf("%s", aspelldir); |
149 putenv(aspelldir); | 149 putenv(aspelldir); |
150 | 150 |
151 /* set the GTK+ path to be \\path\to\GTK\bin */ | 151 /* set the GTK+ path to be \\path\to\GTK\bin */ |
152 strcat(path, "\\GTK\\bin"); | 152 strcat(path, "\\GTK\\bin"); |
388 } | 388 } |
389 | 389 |
390 return posix; | 390 return posix; |
391 } | 391 } |
392 | 392 |
393 /* Determine and set Purple locale as follows (in order of priority): | 393 /* Determine and set Pidgin locale as follows (in order of priority): |
394 - Check PURPLELANG env var | 394 - Check PIDGINLANG env var |
395 - Check NSIS Installer Language reg value | 395 - Check NSIS Installer Language reg value |
396 - Use default user locale | 396 - Use default user locale |
397 */ | 397 */ |
398 static const char *winpidgin_get_locale() { | 398 static const char *winpidgin_get_locale() { |
399 const char *locale = NULL; | 399 const char *locale = NULL; |
401 #ifndef PORTABLE | 401 #ifndef PORTABLE |
402 char data[10]; | 402 char data[10]; |
403 DWORD datalen = 10; | 403 DWORD datalen = 10; |
404 #endif | 404 #endif |
405 | 405 |
406 /* Check if user set PURPLELANG env var */ | 406 /* Check if user set PIDGINLANG env var */ |
407 if ((locale = getenv("PURPLELANG"))) | 407 if ((locale = getenv("PIDGINLANG"))) |
408 return locale; | 408 return locale; |
409 | 409 |
410 #ifndef PORTABLE | 410 #ifndef PORTABLE |
411 if (read_reg_string(HKEY_CURRENT_USER, "SOFTWARE\\purple", | 411 if (read_reg_string(HKEY_CURRENT_USER, "SOFTWARE\\pidgin", |
412 "Installer Language", (LPBYTE) &data, &datalen)) { | 412 "Installer Language", (LPBYTE) &data, &datalen)) { |
413 if ((locale = winpidgin_lcid_to_posix(atoi(data)))) | 413 if ((locale = winpidgin_lcid_to_posix(atoi(data)))) |
414 return locale; | 414 return locale; |
415 } | 415 } |
416 #endif | 416 #endif |
579 printf("%s", errbuf); | 579 printf("%s", errbuf); |
580 MessageBox(NULL, errbuf, NULL, MB_OK | MB_TOPMOST); | 580 MessageBox(NULL, errbuf, NULL, MB_OK | MB_TOPMOST); |
581 } | 581 } |
582 | 582 |
583 #ifndef PORTABLE | 583 #ifndef PORTABLE |
584 if (!getenv("PURPLE_NO_DLL_CHECK")) | 584 if (!getenv("PIDGIN_NO_DLL_CHECK")) |
585 #endif | 585 #endif |
586 dll_prep(); | 586 dll_prep(); |
587 | 587 |
588 winpidgin_set_locale(); | 588 winpidgin_set_locale(); |
589 /* If help or version flag used, do not check Mutex */ | 589 /* If help or version flag used, do not check Mutex */ |
590 if (!strstr(lpszCmdLine, "-h") && !strstr(lpszCmdLine, "-v")) | 590 if (!strstr(lpszCmdLine, "-h") && !strstr(lpszCmdLine, "-v")) |
591 if (!getenv("PURPLE_MULTI_INST") && !winpidgin_set_running()) | 591 if (!getenv("PIDGIN_MULTI_INST") && !winpidgin_set_running()) |
592 return 0; | 592 return 0; |
593 | 593 |
594 /* Now we are ready for Purple .. */ | 594 /* Now we are ready for Pidgin .. */ |
595 if ((hmod = LoadLibrary("pidgin.dll"))) { | 595 if ((hmod = LoadLibrary("pidgin.dll"))) { |
596 pidgin_main = (LPFNPIDGINMAIN) GetProcAddress(hmod, "pidgin_main"); | 596 pidgin_main = (LPFNPIDGINMAIN) GetProcAddress(hmod, "pidgin_main"); |
597 } | 597 } |
598 | 598 |
599 if (!pidgin_main) { | 599 if (!pidgin_main) { |