pidgin/win32/winpidgin.c

changeset 23870
de158d6a6c24
parent 23869
e650ca347f69
equal deleted inserted replaced
23869:e650ca347f69 23870:de158d6a6c24
87 ret = TRUE; 87 ret = TRUE;
88 else { 88 else {
89 const char *err_msg = get_win32_error_message(retv); 89 const char *err_msg = get_win32_error_message(retv);
90 90
91 printf("Could not read reg key '%s' subkey '%s' value: '%s'.\nMessage: (%ld) %s\n", 91 printf("Could not read reg key '%s' subkey '%s' value: '%s'.\nMessage: (%ld) %s\n",
92 (key == HKEY_LOCAL_MACHINE) ? "HKLM" 92 ((key == HKEY_LOCAL_MACHINE) ? "HKLM" :
93 : ((key == HKEY_CURRENT_USER) ? "HKCU" : "???"), 93 (key == HKEY_CURRENT_USER) ? "HKCU" :
94 "???"),
94 sub_key, val_name, retv, err_msg); 95 sub_key, val_name, retv, err_msg);
95 } 96 }
96 RegCloseKey(hkey); 97 RegCloseKey(hkey);
97 } 98 }
98 else { 99 else {
213 } 214 }
214 215
215 216
216 /* Set up the settings dir base to be \\path\to 217 /* Set up the settings dir base to be \\path\to
217 * The actual settings dir will be \\path\to\.purple */ 218 * The actual settings dir will be \\path\to\.purple */
218 _snprintf(path2, sizeof(path2), "PURPLEHOME=%s", path); 219 snprintf(path2, sizeof(path2), "PURPLEHOME=%s", path);
219 printf("Setting settings dir: %s\n", path2); 220 printf("Setting settings dir: %s\n", path2);
220 _putenv(path2); 221 putenv(path2);
221 222
222 _snprintf(path2, sizeof(path2), "PIDGIN_ASPELL_DIR=%s\\Aspell\\bin", path); 223 snprintf(path2, sizeof(path2), "PIDGIN_ASPELL_DIR=%s\\Aspell\\bin", path);
223 printf("%s\n", path2); 224 printf("%s\n", path2);
224 _putenv(path2); 225 putenv(path2);
225 226
226 /* set the GTK+ path to be \\path\to\GTK\bin */ 227 /* set the GTK+ path to be \\path\to\GTK\bin */
227 strcat(path, "\\GTK\\bin"); 228 strcat(path, "\\GTK\\bin");
228 229
229 common_dll_prep(path); 230 common_dll_prep(path);
318 posix = "nn"; break; 319 posix = "nn"; break;
319 } 320 }
320 break; 321 break;
321 case LANG_PUNJABI: posix = "pa"; break; 322 case LANG_PUNJABI: posix = "pa"; break;
322 case LANG_POLISH: posix = "pl"; break; 323 case LANG_POLISH: posix = "pl"; break;
323 // case LANG_PASHTO: posix = "ps"; break; 324 case LANG_PASHTO: posix = "ps"; break;
324 case LANG_PORTUGUESE: 325 case LANG_PORTUGUESE:
325 switch (sub_id) { 326 switch (sub_id) {
326 case SUBLANG_PORTUGUESE_BRAZILIAN: 327 case SUBLANG_PORTUGUESE_BRAZILIAN:
327 posix = "pt_BR"; break; 328 posix = "pt_BR"; break;
328 default: 329 default:
434 const char *locale = NULL; 435 const char *locale = NULL;
435 char envstr[25]; 436 char envstr[25];
436 437
437 locale = winpidgin_get_locale(); 438 locale = winpidgin_get_locale();
438 439
439 _snprintf(envstr, 25, "LANG=%s", locale); 440 snprintf(envstr, 25, "LANG=%s", locale);
440 printf("Setting locale: %s\n", envstr); 441 printf("Setting locale: %s\n", envstr);
441 _putenv(envstr); 442 putenv(envstr);
442 } 443 }
443 444
444 #define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13) 445 #define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13)
445 #define PIDGIN_WM_PROTOCOL_HANDLE (WM_APP + 14) 446 #define PIDGIN_WM_PROTOCOL_HANDLE (WM_APP + 14)
446 447
475 476
476 #define PROTO_HANDLER_SWITCH "--protocolhandler=" 477 #define PROTO_HANDLER_SWITCH "--protocolhandler="
477 478
478 static void handle_protocol(char *cmd) { 479 static void handle_protocol(char *cmd) {
479 char *remote_msg, *tmp1, *tmp2; 480 char *remote_msg, *tmp1, *tmp2;
480 SIZE_T len; 481 int len;
481 SIZE_T len_written; 482 SIZE_T len_written;
482 HWND msg_win; 483 HWND msg_win;
483 DWORD pid; 484 DWORD pid;
484 HANDLE process; 485 HANDLE process;
485 486
595 prev[0] = '\0'; 596 prev[0] = '\0';
596 } 597 }
597 } else { 598 } else {
598 DWORD dw = GetLastError(); 599 DWORD dw = GetLastError();
599 const char *err_msg = get_win32_error_message(dw); 600 const char *err_msg = get_win32_error_message(dw);
600 _snprintf(errbuf, 512, 601 snprintf(errbuf, 512,
601 "Error getting module filename.\nError: (%u) %s", 602 "Error getting module filename.\nError: (%u) %s",
602 (UINT) dw, err_msg); 603 (UINT) dw, err_msg);
603 printf("%s\n", errbuf); 604 printf("%s", errbuf);
604 MessageBox(NULL, errbuf, NULL, MB_OK | MB_TOPMOST); 605 MessageBox(NULL, errbuf, NULL, MB_OK | MB_TOPMOST);
605 pidgin_dir[0] = '\0'; 606 pidgin_dir[0] = '\0';
606 } 607 }
607 608
608 /* Determine if we're running in portable mode */ 609 /* Determine if we're running in portable mode */
642 if (!pidgin_main) { 643 if (!pidgin_main) {
643 DWORD dw = GetLastError(); 644 DWORD dw = GetLastError();
644 BOOL mod_not_found = (dw == ERROR_MOD_NOT_FOUND || dw == ERROR_DLL_NOT_FOUND); 645 BOOL mod_not_found = (dw == ERROR_MOD_NOT_FOUND || dw == ERROR_DLL_NOT_FOUND);
645 const char *err_msg = get_win32_error_message(dw); 646 const char *err_msg = get_win32_error_message(dw);
646 647
647 _snprintf(errbuf, 512, "Error loading pidgin.dll.\nError: (%u) %s%s%s", 648 snprintf(errbuf, 512, "Error loading pidgin.dll.\nError: (%u) %s%s%s",
648 (UINT) dw, err_msg, 649 (UINT) dw, err_msg,
649 mod_not_found ? "\n" : "", 650 mod_not_found ? "\n" : "",
650 mod_not_found ? "This probably means that GTK+ can't be found." : ""); 651 mod_not_found ? "This probably means that GTK+ can't be found." : "");
651 printf("%s\n", errbuf); 652 printf("%s", errbuf);
652 MessageBox(NULL, errbuf, TEXT("Error"), MB_OK | MB_TOPMOST); 653 MessageBox(NULL, errbuf, TEXT("Error"), MB_OK | MB_TOPMOST);
653 654
654 return 0; 655 return 0;
655 } 656 }
656 657

mercurial