Mercurial > pidgin
comparison src/browser.c @ 4551:f61fb41fd1c4
[gaim-migrate @ 4831]
fix URLs with spaces
hopefully make galeon and opera respect the "Open new window by default" pref
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 07 Feb 2003 19:00:47 +0000 |
parents | 50ef0203fdbf |
children | 3fef2d45dce0 |
comparison
equal
deleted
inserted
replaced
4550:972af41f277c | 4551:f61fb41fd1c4 |
---|---|
334 } | 334 } |
335 | 335 |
336 return lock_data; | 336 return lock_data; |
337 } | 337 } |
338 | 338 |
339 static gboolean mozilla_remote_obtain_lock(GdkWindow * window) | 339 static void mozilla_remote_obtain_lock(GdkWindow * window) |
340 { | 340 { |
341 gboolean locked = False; | 341 gboolean locked = False; |
342 const char *lock_data = get_lock_data(); | 342 const char *lock_data = get_lock_data(); |
343 int result; | |
344 GdkAtom actual_type; | 343 GdkAtom actual_type; |
345 gint actual_format; | 344 gint actual_format; |
346 gint nitems; | 345 gint nitems; |
347 unsigned char *data = 0; | 346 unsigned char *data = 0; |
348 | 347 |
407 Atom actual_type, mozilla_response; | 406 Atom actual_type, mozilla_response; |
408 Window xid; | 407 Window xid; |
409 int actual_format; | 408 int actual_format; |
410 unsigned long nitems, bytes_after; | 409 unsigned long nitems, bytes_after; |
411 unsigned char *data = 0; | 410 unsigned char *data = 0; |
412 char *error = NULL; | |
413 | 411 |
414 if (window == NULL || GDK_WINDOW_OBJECT(window)->destroyed) { | 412 if (window == NULL || GDK_WINDOW_OBJECT(window)->destroyed) { |
415 do_error_dialog(_("Communication with the browser failed. Please close all " | 413 do_error_dialog(_("Communication with the browser failed. Please close all " |
416 "windows and try again."), NULL, GAIM_ERROR); | 414 "windows and try again."), NULL, GAIM_ERROR); |
417 debug_printf("netscape_response_cb called with NULL window.\n"); | 415 debug_printf("netscape_response_cb called with NULL window.\n"); |
459 return GDK_FILTER_REMOVE; | 457 return GDK_FILTER_REMOVE; |
460 } | 458 } |
461 | 459 |
462 static void mozilla_remote_command(GdkWindow * window, const char *command, Bool raise_p) | 460 static void mozilla_remote_command(GdkWindow * window, const char *command, Bool raise_p) |
463 { | 461 { |
464 int result = 0; | |
465 Bool done = False; | |
466 char *new_command = 0; | 462 char *new_command = 0; |
467 | 463 |
468 /* The -noraise option is implemented by passing a "noraise" argument | 464 /* The -noraise option is implemented by passing a "noraise" argument |
469 to each command to which it should apply. | 465 to each command to which it should apply. |
470 */ | 466 */ |
518 | 514 |
519 void open_url(GtkWidget *w, char *url) | 515 void open_url(GtkWidget *w, char *url) |
520 { | 516 { |
521 char *command = NULL; | 517 char *command = NULL; |
522 GError *error = NULL; | 518 GError *error = NULL; |
523 | 519 |
524 switch (web_browser) { | 520 switch (web_browser) { |
525 case BROWSER_NETSCAPE: { | 521 case BROWSER_NETSCAPE: { |
526 char *args = NULL; | 522 char *args = NULL; |
527 | 523 |
528 if (misc_options & OPT_MISC_BROWSER_POPUP) | 524 if (misc_options & OPT_MISC_BROWSER_POPUP) |
529 args = g_strdup_printf("OpenURL(%s, new-window)", url); | 525 args = g_strdup_printf("OpenURL(%s, new-window)", url); |
530 else | 526 else |
531 args = g_strdup_printf("OpenURL(%s)", url); | 527 args = g_strdup_printf("OpenURL(%s)", url); |
532 | 528 |
533 if (netscape_command(args)) { | 529 if (netscape_command(args)) { |
534 g_free(args); | 530 g_free(args); |
535 return; | 531 return; |
536 } | 532 } |
537 | 533 |
538 /* if netscape is running ... | 534 /* if netscape is running ... |
539 command = g_strdup_printf("netscape -remote %s", args); */ | 535 command = g_strdup_printf("netscape -remote %s", args); */ |
540 | 536 |
541 command = g_strdup_printf("netscape %s", url); | 537 command = g_strdup_printf("netscape \"%s\"", url); |
542 g_free(args); | 538 g_free(args); |
543 } break; | 539 } break; |
544 | 540 |
545 case BROWSER_OPERA: | 541 case BROWSER_OPERA: |
546 command = g_strdup_printf("opera -newwindow %s", url); | 542 if (misc_options & OPT_MISC_BROWSER_POPUP) |
543 command = g_strdup_printf("opera -newwindow \"%s\"", url); | |
544 else | |
545 command = g_strdup_printf("opera \"%s\"", url); | |
547 break; | 546 break; |
548 | 547 |
549 case BROWSER_KONQ: | 548 case BROWSER_KONQ: |
550 command = g_strdup_printf("kfmclient openURL %s", url); | 549 command = g_strdup_printf("kfmclient openURL \"%s\"", url); |
551 break; | 550 break; |
552 | 551 |
553 case BROWSER_GALEON: | 552 case BROWSER_GALEON: |
554 command = g_strdup_printf("galeon -w %s", url); | 553 if (misc_options & OPT_MISC_BROWSER_POPUP) |
555 command = g_strdup_printf("galeon %s", url); | 554 command = g_strdup_printf("galeon -w \"%s\"", url); |
555 else | |
556 command = g_strdup_printf("galeon \"%s\"", url); | |
556 break; | 557 break; |
557 | 558 |
558 case BROWSER_MOZILLA: | 559 case BROWSER_MOZILLA: |
559 command = g_strdup_printf("mozilla %s", url); | 560 command = g_strdup_printf("mozilla \"%s\"", url); |
560 break; | 561 break; |
561 | 562 |
562 case BROWSER_MANUAL: { | 563 case BROWSER_MANUAL: { |
563 char *space_free_url = NULL; | 564 char *space_free_url = NULL; |
564 | 565 |