comparison pidgin/gtkdialogs.c @ 32521:67143ecbddb1

propagate from branch 'im.pidgin.pidgin' (head 9b3deec2188b0d6cd5015cc06c8de2f7d5696a59) to branch 'im.pidgin.soc.2009.webkitmessageview' (head f4f724d0d7a1a3cf374b8eff0a2ce1e07ab7fb41)
author tdrhq@soc.pidgin.im
date Mon, 27 Jul 2009 03:14:08 +0000
parents cc8f641d2fde fe75cd926073
children c410e48a31c6
comparison
equal deleted inserted replaced
28029:7a456d5da878 32521:67143ecbddb1
36 #include "util.h" 36 #include "util.h"
37 #include "core.h" 37 #include "core.h"
38 38
39 #include "gtkblist.h" 39 #include "gtkblist.h"
40 #include "gtkdialogs.h" 40 #include "gtkdialogs.h"
41 #include "gtkimhtml.h"
42 #include "gtkimhtmltoolbar.h"
43 #include "gtklog.h" 41 #include "gtklog.h"
44 #include "gtkutils.h" 42 #include "gtkutils.h"
43 #include "gtkwebview.h"
45 #include "pidginstock.h" 44 #include "pidginstock.h"
45
46
46 47
47 static GList *dialogwindows = NULL; 48 static GList *dialogwindows = NULL;
48 49
49 static GtkWidget *about = NULL; 50 static GtkWidget *about = NULL;
50 51
397 398
398 void pidgin_dialogs_about() 399 void pidgin_dialogs_about()
399 { 400 {
400 GtkWidget *vbox; 401 GtkWidget *vbox;
401 GtkWidget *logo; 402 GtkWidget *logo;
402 GtkWidget *frame; 403 GtkWidget *scrolled_window;
403 GtkWidget *text;
404 GtkWidget *button; 404 GtkWidget *button;
405 GtkTextIter iter; 405 GtkWidget *web_view;
406
406 GString *str; 407 GString *str;
407 AtkObject *obj; 408 AtkObject *obj;
408 char* filename, *tmp; 409 char* filename, *tmp;
409 GdkPixbuf *pixbuf; 410 GdkPixbuf *pixbuf;
410 PidginBuddyList *buddylist; 411 PidginBuddyList *buddylist;
438 tmp = g_strconcat(PIDGIN_NAME, " " DISPLAY_VERSION, NULL); 439 tmp = g_strconcat(PIDGIN_NAME, " " DISPLAY_VERSION, NULL);
439 atk_object_set_description(obj, tmp); 440 atk_object_set_description(obj, tmp);
440 g_free(tmp); 441 g_free(tmp);
441 gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); 442 gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0);
442 443
443 frame = pidgin_create_imhtml(FALSE, &text, NULL, NULL); 444 scrolled_window = gtk_scrolled_window_new (NULL, NULL);
444 gtk_imhtml_set_format_functions(GTK_IMHTML(text), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY); 445 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_IN);
445 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); 446 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
447
448 web_view = gtk_webview_new ();
449 gtk_container_add (GTK_CONTAINER (scrolled_window), web_view);
450
451 gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
446 452
447 str = g_string_sized_new(4096); 453 str = g_string_sized_new(4096);
448 454
449 g_string_append_printf(str, 455 g_string_append_printf(str,
450 "<CENTER><FONT SIZE=\"4\"><B>%s %s</B></FONT></CENTER><BR>(libpurple %s)<BR>%s<BR><BR>", PIDGIN_NAME, DISPLAY_VERSION, purple_core_get_version(), REVISION); 456 "<CENTER><FONT SIZE=\"4\"><B>%s %s</B></FONT></CENTER><BR>(libpurple %s)<BR>%s<BR><BR>", PIDGIN_NAME, DISPLAY_VERSION, purple_core_get_version(), REVISION);
681 #endif 687 #endif
682 #endif 688 #endif
683 689
684 /* End of not to be translated section */ 690 /* End of not to be translated section */
685 691
686 gtk_imhtml_append_text(GTK_IMHTML(text), str->str, GTK_IMHTML_NO_SCROLL); 692 webkit_web_view_load_html_string (WEBKIT_WEB_VIEW(web_view), str->str, "");
687 g_string_free(str, TRUE); 693 g_string_free(str, TRUE);
688 694
689 gtk_text_buffer_get_start_iter(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), &iter);
690 gtk_text_buffer_place_cursor(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), &iter);
691 695
692 /* Close Button */ 696 /* Close Button */
693 button = pidgin_dialog_add_button(GTK_DIALOG(about), GTK_STOCK_CLOSE, 697 button = pidgin_dialog_add_button(GTK_DIALOG(about), GTK_STOCK_CLOSE,
694 G_CALLBACK(destroy_about), about); 698 G_CALLBACK(destroy_about), about);
695 699