pidgin/gtkconv.c

changeset 33005
65e95df8daea
parent 32999
c5a6f28a75ab
child 33051
2e75223c078e
equal deleted inserted replaced
33004:2a86ad923464 33005:65e95df8daea
1064 } 1064 }
1065 1065
1066 static void 1066 static void
1067 savelog_writefile_cb(void *user_data, const char *filename) 1067 savelog_writefile_cb(void *user_data, const char *filename)
1068 { 1068 {
1069 /* TODO WEBKIT: I don't know how to support this using webkit yet. */
1070 #if 0
1071 PurpleConversation *conv = (PurpleConversation *)user_data; 1069 PurpleConversation *conv = (PurpleConversation *)user_data;
1070 GtkWebView *webview;
1072 FILE *fp; 1071 FILE *fp;
1073 const char *name; 1072 const char *name;
1074 char **lines;
1075 gchar *text; 1073 gchar *text;
1076 1074
1077 if ((fp = g_fopen(filename, "w+")) == NULL) { 1075 if ((fp = g_fopen(filename, "w+")) == NULL) {
1078 purple_notify_error(PIDGIN_CONVERSATION(conv), NULL, _("Unable to open file."), NULL); 1076 purple_notify_error(PIDGIN_CONVERSATION(conv), NULL, _("Unable to open file."), NULL);
1079 return; 1077 return;
1080 } 1078 }
1081 1079
1080 webview = GTK_WEBVIEW(PIDGIN_CONVERSATION(conv)->webview);
1082 name = purple_conversation_get_name(conv); 1081 name = purple_conversation_get_name(conv);
1083 fprintf(fp, "<html>\n<head>\n"); 1082 fprintf(fp, "<html>\n");
1083
1084 fprintf(fp, "<head>\n");
1084 fprintf(fp, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n"); 1085 fprintf(fp, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n");
1085 fprintf(fp, "<title>%s</title>\n</head>\n<body>\n", name); 1086 fprintf(fp, "<title>%s</title>\n", name);
1086 fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name); 1087 text = gtk_webview_get_head_html(webview);
1087
1088 lines = gtk_imhtml_get_markup_lines(
1089 GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml));
1090 text = g_strjoinv("<br>\n", lines);
1091 fprintf(fp, "%s", text); 1088 fprintf(fp, "%s", text);
1092 g_free(text); 1089 g_free(text);
1093 g_strfreev(lines); 1090 fprintf(fp, "</head>\n");
1094 1091
1095 fprintf(fp, "\n</body>\n</html>\n"); 1092 fprintf(fp, "<body>\n");
1093 fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name);
1094 text = gtk_webview_get_body_html(webview);
1095 fprintf(fp, "%s", text);
1096 g_free(text);
1097 fprintf(fp, "\n</body>\n");
1098
1099 fprintf(fp, "</html>\n");
1096 fclose(fp); 1100 fclose(fp);
1097 #endif /* if 0 */
1098 } 1101 }
1099 1102
1100 /* 1103 /*
1101 * It would be kinda cool if this gave the option of saving a 1104 * It would be kinda cool if this gave the option of saving a
1102 * plaintext v. HTML file. 1105 * plaintext v. HTML file.

mercurial