Mercurial > pidgin
comparison src/conversation.c @ 308:e5fa88351dc8
[gaim-migrate @ 318]
Hopefully a few memleak fixes.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 02 Jun 2000 05:22:08 +0000 |
parents | 0f14e6d8a51b |
children | 97cdac04c0f5 |
comparison
equal
deleted
inserted
replaced
307:721d2dda7be3 | 308:e5fa88351dc8 |
---|---|
302 int alloc = 0, length; | 302 int alloc = 0, length; |
303 | 303 |
304 if (!(font_options & OPT_FONT_FACE)) | 304 if (!(font_options & OPT_FONT_FACE)) |
305 return; | 305 return; |
306 | 306 |
307 if (c->current_fontface && strcmp(c->current_fontface, "(null)")) | 307 if (c->current_fontface[0] && strcmp(c->current_fontface, "(null)")) |
308 { | 308 { |
309 pre_fontface = g_strconcat("<FONT FACE=\"", c->current_fontface, "\">", '\0'); | 309 pre_fontface = g_strconcat("<FONT FACE=\"", c->current_fontface, "\">", '\0'); |
310 alloc++; | 310 alloc++; |
311 } | 311 } |
312 else | 312 else |
949 GtkWidget *sw; | 949 GtkWidget *sw; |
950 GtkWidget *send; | 950 GtkWidget *send; |
951 GtkWidget *info; | 951 GtkWidget *info; |
952 GtkWidget *warn; | 952 GtkWidget *warn; |
953 GtkWidget *block; | 953 GtkWidget *block; |
954 GtkWidget *color; | 954 /* GtkWidget *color; */ |
955 GtkWidget *close; | 955 GtkWidget *close; |
956 GtkWidget *entry; | 956 GtkWidget *entry; |
957 GtkWidget *toolbar; | 957 GtkWidget *toolbar; |
958 GtkWidget *bbox; | 958 GtkWidget *bbox; |
959 GtkWidget *vbox; | 959 GtkWidget *vbox; |
975 c->window = win; | 975 c->window = win; |
976 | 976 |
977 send = gtk_button_new_with_label("Send"); | 977 send = gtk_button_new_with_label("Send"); |
978 info = gtk_button_new_with_label("Info"); | 978 info = gtk_button_new_with_label("Info"); |
979 warn = gtk_button_new_with_label("Warn"); | 979 warn = gtk_button_new_with_label("Warn"); |
980 color = gtk_button_new_with_label("Color"); | 980 /* color = gtk_button_new_with_label("Color"); */ |
981 close = gtk_button_new_with_label("Close"); | 981 close = gtk_button_new_with_label("Close"); |
982 if (find_buddy(c->name) != NULL) { | 982 if (find_buddy(c->name) != NULL) { |
983 add = gtk_button_new_with_label("Remove"); | 983 add = gtk_button_new_with_label("Remove"); |
984 } | 984 } |
985 else { | 985 else { |
1077 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Small", "Decrease font size", "Small", small_p, GTK_SIGNAL_FUNC(do_small), entry); | 1077 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Small", "Decrease font size", "Small", small_p, GTK_SIGNAL_FUNC(do_small), entry); |
1078 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Normal", "Normal font size", "Normal", normal_p, GTK_SIGNAL_FUNC(do_normal), entry); | 1078 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Normal", "Normal font size", "Normal", normal_p, GTK_SIGNAL_FUNC(do_normal), entry); |
1079 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Big", "Increase font size", "Big", big_p, GTK_SIGNAL_FUNC(do_big), entry); | 1079 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Big", "Increase font size", "Big", big_p, GTK_SIGNAL_FUNC(do_big), entry); |
1080 font = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Font", "Select Font", "Font", font_p, GTK_SIGNAL_FUNC(toggle_font), entry); | 1080 font = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Font", "Select Font", "Font", font_p, GTK_SIGNAL_FUNC(toggle_font), entry); |
1081 gtk_object_set_user_data(GTK_OBJECT(font), c); | 1081 gtk_object_set_user_data(GTK_OBJECT(font), c); |
1082 if (!(font_options & OPT_FONT_FACE)) | 1082 /* if (!(font_options & OPT_FONT_FACE)) */ |
1083 gtk_widget_set_sensitive(GTK_WIDGET(font), FALSE); | 1083 gtk_widget_set_sensitive(GTK_WIDGET(font), FALSE); |
1084 | 1084 |
1085 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); | 1085 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
1086 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), | 1086 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1087 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, "Link", "Insert Link", | 1087 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, "Link", "Insert Link", |
1117 c->underline = underline; | 1117 c->underline = underline; |
1118 c->log_button = wood; | 1118 c->log_button = wood; |
1119 c->palette = palette; | 1119 c->palette = palette; |
1120 c->link = link; | 1120 c->link = link; |
1121 c->add_button = add; | 1121 c->add_button = add; |
1122 c->font = font; | 1122 c->font = font; |
1123 | 1123 |
1124 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE); | 1124 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE); |
1125 | 1125 |
1126 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE); | 1126 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE); |
1127 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE); | 1127 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE); |
1167 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback), c); | 1167 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback), c); |
1168 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(add_callback), c); | 1168 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(add_callback), c); |
1169 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), c); | 1169 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), c); |
1170 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c); | 1170 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c); |
1171 gtk_signal_connect(GTK_OBJECT(block), "clicked", GTK_SIGNAL_FUNC(block_callback), c); | 1171 gtk_signal_connect(GTK_OBJECT(block), "clicked", GTK_SIGNAL_FUNC(block_callback), c); |
1172 gtk_signal_connect(GTK_OBJECT(color), "clicked", GTK_SIGNAL_FUNC(color_callback), c); | 1172 /* gtk_signal_connect(GTK_OBJECT(color), "clicked", GTK_SIGNAL_FUNC(color_callback), c); */ |
1173 | 1173 |
1174 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(user_keypress_callback), c); | 1174 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(user_keypress_callback), c); |
1175 gtk_widget_set_usize(entry, 300, 25); | 1175 gtk_widget_set_usize(entry, 300, 25); |
1176 | 1176 |
1177 gtk_box_pack_start(GTK_BOX(bbox), send, TRUE, TRUE, 5); | 1177 gtk_box_pack_start(GTK_BOX(bbox), send, TRUE, TRUE, 5); |
1178 gtk_box_pack_start(GTK_BOX(bbox), info, TRUE, TRUE, 5); | 1178 gtk_box_pack_start(GTK_BOX(bbox), info, TRUE, TRUE, 5); |
1179 gtk_box_pack_start(GTK_BOX(bbox), warn, TRUE, TRUE, 5); | 1179 gtk_box_pack_start(GTK_BOX(bbox), warn, TRUE, TRUE, 5); |
1180 gtk_box_pack_start(GTK_BOX(bbox), block, TRUE, TRUE, 5); | 1180 gtk_box_pack_start(GTK_BOX(bbox), block, TRUE, TRUE, 5); |
1181 gtk_box_pack_start(GTK_BOX(bbox), color, TRUE, TRUE, 5); | 1181 /* gtk_box_pack_start(GTK_BOX(bbox), color, TRUE, TRUE, 5); */ |
1182 gtk_box_pack_start(GTK_BOX(bbox), add, TRUE, TRUE, 5); | 1182 gtk_box_pack_start(GTK_BOX(bbox), add, TRUE, TRUE, 5); |
1183 gtk_box_pack_start(GTK_BOX(bbox), close, TRUE, TRUE, 5); | 1183 gtk_box_pack_start(GTK_BOX(bbox), close, TRUE, TRUE, 5); |
1184 | 1184 |
1185 /* pack and fill the rest */ | 1185 /* pack and fill the rest */ |
1186 | 1186 |
1217 | 1217 |
1218 gtk_signal_connect(GTK_OBJECT(win), "delete_event", GTK_SIGNAL_FUNC(delete_event_convo), c); | 1218 gtk_signal_connect(GTK_OBJECT(win), "delete_event", GTK_SIGNAL_FUNC(delete_event_convo), c); |
1219 gtk_signal_connect(GTK_OBJECT(entry), "insert-text", GTK_SIGNAL_FUNC(check_spelling), entry); | 1219 gtk_signal_connect(GTK_OBJECT(entry), "insert-text", GTK_SIGNAL_FUNC(check_spelling), entry); |
1220 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), entry); | 1220 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), entry); |
1221 | 1221 |
1222 c->current_fontface = g_strdup(fontface); | 1222 strncpy(c->current_fontface, fontface, sizeof(c->current_fontface)); |
1223 c->current_fontname = g_strdup(fontname); | 1223 strncpy(c->current_fontname, fontname, sizeof(c->current_fontname)); |
1224 | 1224 |
1225 set_font_face(NULL, c); | 1225 set_font_face(NULL, c); |
1226 | 1226 |
1227 gtk_widget_show(win); | 1227 gtk_widget_show(win); |
1228 } | 1228 } |