| 584 |
587 |
| 585 /* Add the gtkwebview */ |
588 /* Add the gtkwebview */ |
| 586 frame = pidgin_create_webview(FALSE, &win->text, NULL); |
589 frame = pidgin_create_webview(FALSE, &win->text, NULL); |
| 587 pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(win->text), |
590 pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(win->text), |
| 588 PIDGIN_WEBVIEW_ALL ^ PIDGIN_WEBVIEW_SMILEY ^ PIDGIN_WEBVIEW_IMAGE); |
591 PIDGIN_WEBVIEW_ALL ^ PIDGIN_WEBVIEW_SMILEY ^ PIDGIN_WEBVIEW_IMAGE); |
| 589 pidgin_webview_load_html_string(PIDGIN_WEBVIEW(win->text), gtkdebug_html); |
592 resource = gtkdebug_get_resource(); |
| |
593 error = NULL; |
| |
594 resource_bytes = g_resource_lookup_data(resource, |
| |
595 "/im/pidgin/Pidgin/gtkdebug.html", |
| |
596 G_RESOURCE_LOOKUP_FLAGS_NONE, |
| |
597 &error); |
| |
598 if (G_UNLIKELY(resource_bytes == NULL || error != NULL)) { |
| |
599 gchar *msg = g_strdup_printf("Unable to load debug window HTML: %s\n", |
| |
600 error ? error->message : "Unknown error"); |
| |
601 g_clear_error(&error); |
| |
602 pidgin_webview_load_html_string(PIDGIN_WEBVIEW(win->text), msg); |
| |
603 g_free(msg); |
| |
604 } else { |
| |
605 gconstpointer gtkdebug_html; |
| |
606 gtkdebug_html = g_bytes_get_data(resource_bytes, NULL); |
| |
607 pidgin_webview_load_html_string(PIDGIN_WEBVIEW(win->text), |
| |
608 gtkdebug_html); |
| |
609 } |
| |
610 g_bytes_unref(resource_bytes); |
| 590 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
611 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
| 591 gtk_widget_show(frame); |
612 gtk_widget_show(frame); |
| 592 |
613 |
| 593 clear_cb(NULL, win); |
614 clear_cb(NULL, win); |
| 594 |
615 |