Mercurial > pidgin
comparison src/conversation.c @ 1479:4c62ead808a2
[gaim-migrate @ 1489]
save conversation history
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 07 Feb 2001 21:46:40 +0000 |
parents | ae075ecc7c34 |
children | b72a33d07ce8 |
comparison
equal
deleted
inserted
replaced
1478:29d9feaf065b | 1479:4c62ead808a2 |
---|---|
35 #include <gdk/gdkkeysyms.h> | 35 #include <gdk/gdkkeysyms.h> |
36 #include "convo.h" | 36 #include "convo.h" |
37 #include "gtkspell.h" | 37 #include "gtkspell.h" |
38 #include "prpl.h" | 38 #include "prpl.h" |
39 | 39 |
40 #include "pixmaps/underline.xpm" | |
41 #include "pixmaps/bold.xpm" | 40 #include "pixmaps/bold.xpm" |
42 #include "pixmaps/italic.xpm" | 41 #include "pixmaps/italic.xpm" |
42 #include "pixmaps/underline.xpm" | |
43 #include "pixmaps/strike.xpm" | |
43 #include "pixmaps/small.xpm" | 44 #include "pixmaps/small.xpm" |
44 #include "pixmaps/normal.xpm" | 45 #include "pixmaps/normal.xpm" |
45 #include "pixmaps/big.xpm" | 46 #include "pixmaps/big.xpm" |
46 #include "pixmaps/fontface.xpm" | 47 #include "pixmaps/fontface.xpm" |
47 #include "pixmaps/speaker.xpm" | 48 #include "pixmaps/fgcolor.xpm" |
49 #include "pixmaps/bgcolor.xpm" | |
50 #include "pixmaps/link.xpm" | |
48 #include "pixmaps/smile_icon.xpm" | 51 #include "pixmaps/smile_icon.xpm" |
49 #include "pixmaps/wood.xpm" | 52 #include "pixmaps/wood.xpm" |
50 #include "pixmaps/link.xpm" | 53 #include "pixmaps/save_small.xpm" |
51 #include "pixmaps/strike.xpm" | 54 #include "pixmaps/speaker.xpm" |
52 #include "pixmaps/fgcolor.xpm" | |
53 #include "pixmaps/bgcolor.xpm" | |
54 | 55 |
55 #include "pixmaps/luke03.xpm" | 56 #include "pixmaps/luke03.xpm" |
56 #include "pixmaps/oneeye.xpm" | 57 #include "pixmaps/oneeye.xpm" |
57 | 58 |
58 int state_lock = 0; | 59 int state_lock = 0; |
126 /* do we want to do something here? */ ; | 127 /* do we want to do something here? */ ; |
127 } | 128 } |
128 | 129 |
129 if (connections) | 130 if (connections) |
130 c->gc = (struct gaim_connection *)connections->data; | 131 c->gc = (struct gaim_connection *)connections->data; |
132 c->history = g_string_new(""); | |
131 show_conv(c); | 133 show_conv(c); |
132 conversations = g_list_append(conversations, c); | 134 conversations = g_list_append(conversations, c); |
133 plugin_event(event_new_conversation, name, 0, 0, 0); | 135 plugin_event(event_new_conversation, name, 0, 0, 0); |
134 return c; | 136 return c; |
135 } | 137 } |
212 gtk_widget_destroy(c->smiley_dialog); | 214 gtk_widget_destroy(c->smiley_dialog); |
213 if (c->link_dialog) | 215 if (c->link_dialog) |
214 gtk_widget_destroy(c->link_dialog); | 216 gtk_widget_destroy(c->link_dialog); |
215 if (c->log_dialog) | 217 if (c->log_dialog) |
216 gtk_widget_destroy(c->log_dialog); | 218 gtk_widget_destroy(c->log_dialog); |
219 g_string_free(c->history, TRUE); | |
217 g_free(c); | 220 g_free(c); |
218 } | 221 } |
219 | 222 |
220 void update_log_convs() | 223 void update_log_convs() |
221 { | 224 { |
313 rm_log(find_log_info(c->name)); | 316 rm_log(find_log_info(c->name)); |
314 else if (GTK_TOGGLE_BUTTON(loggle)->active) | 317 else if (GTK_TOGGLE_BUTTON(loggle)->active) |
315 show_log_dialog(c); | 318 show_log_dialog(c); |
316 else | 319 else |
317 cancel_log(NULL, c); | 320 cancel_log(NULL, c); |
321 } | |
322 | |
323 static void do_save_convo(GtkObject *obj, GtkWidget *wid) | |
324 { | |
325 struct conversation *c = gtk_object_get_user_data(obj); | |
326 char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid)); | |
327 FILE *f; | |
328 if (file_is_dir(filename, wid)) | |
329 return; | |
330 if (g_list_find(conversations, c)) | |
331 filename = g_strdup(filename); | |
332 else | |
333 filename = NULL; | |
334 gtk_widget_destroy(wid); | |
335 if (!filename) | |
336 return; | |
337 f = fopen(filename, "w+"); | |
338 g_free(filename); | |
339 if (!f) | |
340 return; | |
341 fprintf(f, "%s", c->history->str); | |
342 fclose(f); | |
343 } | |
344 | |
345 void save_convo(GtkWidget *save, struct conversation *c) | |
346 { | |
347 char buf[BUF_LONG]; | |
348 GtkWidget *window = gtk_file_selection_new(_("Gaim - Save Conversation")); | |
349 g_snprintf(buf, sizeof(buf), "%s/%s.log", g_get_home_dir(), normalize(c->name)); | |
350 gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf); | |
351 gtk_object_set_user_data(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), c); | |
352 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), | |
353 "clicked", GTK_SIGNAL_FUNC(do_save_convo), window); | |
354 gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(window)->cancel_button), | |
355 "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), (gpointer)window); | |
356 gtk_widget_show(window); | |
318 } | 357 } |
319 | 358 |
320 void insert_smiley(GtkWidget *smiley, struct conversation *c) | 359 void insert_smiley(GtkWidget *smiley, struct conversation *c) |
321 { | 360 { |
322 if (state_lock) | 361 if (state_lock) |
1170 | 1209 |
1171 gtk_imhtml_append_text(GTK_IMHTML(c->text), what, 0); | 1210 gtk_imhtml_append_text(GTK_IMHTML(c->text), what, 0); |
1172 | 1211 |
1173 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", 0); | 1212 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", 0); |
1174 | 1213 |
1214 if (general_options & OPT_GEN_STRIP_HTML) { | |
1215 char *t1 = strip_html(what); | |
1216 c->history = g_string_append(c->history, t1); | |
1217 c->history = g_string_append(c->history, "\n"); | |
1218 g_free(what); | |
1219 } else { | |
1220 c->history = g_string_append(c->history, what); | |
1221 c->history = g_string_append(c->history, "<BR>\n"); | |
1222 } | |
1223 | |
1175 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { | 1224 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { |
1176 char *t1; | 1225 char *t1; |
1177 char nm[256]; | 1226 char nm[256]; |
1178 | 1227 |
1179 if (general_options & OPT_GEN_STRIP_HTML) { | 1228 if (general_options & OPT_GEN_STRIP_HTML) { |
1251 | 1300 |
1252 logstr = gtk_imhtml_append_text(GTK_IMHTML(c->text), what, gtk_font_options); | 1301 logstr = gtk_imhtml_append_text(GTK_IMHTML(c->text), what, gtk_font_options); |
1253 | 1302 |
1254 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", 0); | 1303 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", 0); |
1255 | 1304 |
1305 if (general_options & OPT_GEN_STRIP_HTML) { | |
1306 char *t1, *t2; | |
1307 t1 = strip_html(buf); | |
1308 t2 = strip_html(what); | |
1309 c->history = g_string_append(c->history, t1); | |
1310 c->history = g_string_append(c->history, t2); | |
1311 c->history = g_string_append(c->history, "\n"); | |
1312 g_free(t1); | |
1313 g_free(t2); | |
1314 } else { | |
1315 char *t1, *t2; | |
1316 t1 = html_logize(buf); | |
1317 t2 = html_logize(what); | |
1318 c->history = g_string_append(c->history, t1); | |
1319 c->history = g_string_append(c->history, t2); | |
1320 c->history = g_string_append(c->history, "\n"); | |
1321 c->history = g_string_append(c->history, logstr->str); | |
1322 c->history = g_string_append(c->history, "<BR>\n"); | |
1323 g_free(t1); | |
1324 g_free(t2); | |
1325 } | |
1326 | |
1256 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { | 1327 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { |
1257 char *t1, *t2; | 1328 char *t1, *t2; |
1258 char *nm = g_malloc(256); | 1329 char *nm = g_malloc(256); |
1259 if (c->is_chat) | 1330 if (c->is_chat) |
1260 g_snprintf(nm, 256, "%s.chat", c->name); | 1331 g_snprintf(nm, 256, "%s.chat", c->name); |
1304 | 1375 |
1305 | 1376 |
1306 GtkWidget *build_conv_toolbar(struct conversation *c) | 1377 GtkWidget *build_conv_toolbar(struct conversation *c) |
1307 { | 1378 { |
1308 GdkPixmap *strike_i, *small_i, *normal_i, *big_i, *bold_i, *italic_i, *underline_i, *speaker_i, | 1379 GdkPixmap *strike_i, *small_i, *normal_i, *big_i, *bold_i, *italic_i, *underline_i, *speaker_i, |
1309 *wood_i, *fgcolor_i, *bgcolor_i, *link_i, *font_i, *smiley_i; | 1380 *wood_i, *fgcolor_i, *bgcolor_i, *link_i, *font_i, *smiley_i, *save_i; |
1310 GtkWidget *strike_p, *small_p, *normal_p, *big_p, *bold_p, *italic_p, *underline_p, *speaker_p, | 1381 GtkWidget *strike_p, *small_p, *normal_p, *big_p, *bold_p, *italic_p, *underline_p, *speaker_p, |
1311 *wood_p, *fgcolor_p, *bgcolor_p, *link_p, *font_p, *smiley_p; | 1382 *wood_p, *fgcolor_p, *bgcolor_p, *link_p, *font_p, *smiley_p, *save_p; |
1312 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood, | 1383 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood, |
1313 *fgcolorbtn, *bgcolorbtn, *link, *font, *smiley; | 1384 *fgcolorbtn, *bgcolorbtn, *link, *font, *smiley, *save; |
1314 GdkBitmap *mask; | 1385 GdkBitmap *mask; |
1315 GtkWidget *toolbar; | 1386 GtkWidget *toolbar; |
1316 GtkWidget *win; | 1387 GtkWidget *win; |
1317 GtkWidget *entry; | 1388 GtkWidget *entry; |
1318 | 1389 |
1319 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); | 1390 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); |
1320 win = c->window; | 1391 win = c->window; |
1321 entry = c->entry; | 1392 entry = c->entry; |
1322 | 1393 |
1394 bold_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bold_xpm); | |
1395 bold_p = gtk_pixmap_new(bold_i, mask); | |
1396 gtk_widget_show(bold_p); | |
1397 gdk_bitmap_unref(mask); | |
1398 | |
1399 italic_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, italic_xpm); | |
1400 italic_p = gtk_pixmap_new(italic_i, mask); | |
1401 gtk_widget_show(italic_p); | |
1402 gdk_bitmap_unref(mask); | |
1403 | |
1404 underline_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, | |
1405 &win->style->white, underline_xpm); | |
1406 underline_p = gtk_pixmap_new(underline_i, mask); | |
1407 gtk_widget_show(underline_p); | |
1408 gdk_bitmap_unref(mask); | |
1409 | |
1410 strike_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, strike_xpm); | |
1411 strike_p = gtk_pixmap_new(strike_i, mask); | |
1412 gtk_widget_show(strike_p); | |
1413 gdk_bitmap_unref(mask); | |
1414 | |
1415 small_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, small_xpm); | |
1416 small_p = gtk_pixmap_new(small_i, mask); | |
1417 gtk_widget_show(small_p); | |
1418 gdk_bitmap_unref(mask); | |
1419 | |
1420 normal_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, normal_xpm); | |
1421 normal_p = gtk_pixmap_new(normal_i, mask); | |
1422 gtk_widget_show(normal_p); | |
1423 gdk_bitmap_unref(mask); | |
1424 | |
1425 big_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, big_xpm); | |
1426 big_p = gtk_pixmap_new(big_i, mask); | |
1427 gtk_widget_show(big_p); | |
1428 gdk_bitmap_unref(mask); | |
1429 | |
1430 font_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fontface_xpm); | |
1431 font_p = gtk_pixmap_new(font_i, mask); | |
1432 gtk_widget_show(font_p); | |
1433 gdk_bitmap_unref(mask); | |
1434 | |
1435 fgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fgcolor_xpm); | |
1436 fgcolor_p = gtk_pixmap_new(fgcolor_i, mask); | |
1437 gtk_widget_show(fgcolor_p); | |
1438 gdk_bitmap_unref(mask); | |
1439 | |
1440 bgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bgcolor_xpm); | |
1441 bgcolor_p = gtk_pixmap_new(bgcolor_i, mask); | |
1442 gtk_widget_show(bgcolor_p); | |
1443 gdk_bitmap_unref(mask); | |
1444 | |
1323 link_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, link_xpm); | 1445 link_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, link_xpm); |
1324 link_p = gtk_pixmap_new(link_i, mask); | 1446 link_p = gtk_pixmap_new(link_i, mask); |
1325 gtk_widget_show(link_p); | 1447 gtk_widget_show(link_p); |
1326 gdk_bitmap_unref(mask); | 1448 gdk_bitmap_unref(mask); |
1327 | 1449 |
1328 fgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fgcolor_xpm); | 1450 smiley_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, smile_icon_xpm); |
1329 fgcolor_p = gtk_pixmap_new(fgcolor_i, mask); | 1451 smiley_p = gtk_pixmap_new(smiley_i, mask); |
1330 gtk_widget_show(fgcolor_p); | 1452 gtk_widget_show(smiley_p); |
1331 gdk_bitmap_unref(mask); | |
1332 | |
1333 bgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bgcolor_xpm); | |
1334 bgcolor_p = gtk_pixmap_new(bgcolor_i, mask); | |
1335 gtk_widget_show(bgcolor_p); | |
1336 gdk_bitmap_unref(mask); | 1453 gdk_bitmap_unref(mask); |
1337 | 1454 |
1338 wood_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, wood_xpm); | 1455 wood_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, wood_xpm); |
1339 wood_p = gtk_pixmap_new(wood_i, mask); | 1456 wood_p = gtk_pixmap_new(wood_i, mask); |
1340 gtk_widget_show(wood_p); | 1457 gtk_widget_show(wood_p); |
1341 gdk_bitmap_unref(mask); | 1458 gdk_bitmap_unref(mask); |
1459 | |
1460 save_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, save_small_xpm); | |
1461 save_p = gtk_pixmap_new(save_i, mask); | |
1462 gtk_widget_show(save_p); | |
1463 gdk_bitmap_unref(mask); | |
1464 | |
1342 speaker_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, speaker_xpm); | 1465 speaker_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, speaker_xpm); |
1343 speaker_p = gtk_pixmap_new(speaker_i, mask); | 1466 speaker_p = gtk_pixmap_new(speaker_i, mask); |
1344 gtk_widget_show(speaker_p); | 1467 gtk_widget_show(speaker_p); |
1345 gdk_bitmap_unref(mask); | 1468 gdk_bitmap_unref(mask); |
1346 c->makesound = 1; | 1469 c->makesound = 1; |
1347 strike_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, strike_xpm); | |
1348 strike_p = gtk_pixmap_new(strike_i, mask); | |
1349 gtk_widget_show(strike_p); | |
1350 gdk_bitmap_unref(mask); | |
1351 bold_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bold_xpm); | |
1352 bold_p = gtk_pixmap_new(bold_i, mask); | |
1353 gtk_widget_show(bold_p); | |
1354 gdk_bitmap_unref(mask); | |
1355 italic_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, italic_xpm); | |
1356 italic_p = gtk_pixmap_new(italic_i, mask); | |
1357 gtk_widget_show(italic_p); | |
1358 gdk_bitmap_unref(mask); | |
1359 underline_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, | |
1360 &win->style->white, underline_xpm); | |
1361 underline_p = gtk_pixmap_new(underline_i, mask); | |
1362 gtk_widget_show(underline_p); | |
1363 gdk_bitmap_unref(mask); | |
1364 small_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, small_xpm); | |
1365 small_p = gtk_pixmap_new(small_i, mask); | |
1366 gtk_widget_show(small_p); | |
1367 gdk_bitmap_unref(mask); | |
1368 normal_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, normal_xpm); | |
1369 normal_p = gtk_pixmap_new(normal_i, mask); | |
1370 gtk_widget_show(normal_p); | |
1371 gdk_bitmap_unref(mask); | |
1372 big_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, big_xpm); | |
1373 big_p = gtk_pixmap_new(big_i, mask); | |
1374 gtk_widget_show(big_p); | |
1375 gdk_bitmap_unref(mask); | |
1376 font_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fontface_xpm); | |
1377 font_p = gtk_pixmap_new(font_i, mask); | |
1378 gtk_widget_show(font_p); | |
1379 gdk_bitmap_unref(mask); | |
1380 smiley_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, smile_icon_xpm); | |
1381 smiley_p = gtk_pixmap_new(smiley_i, mask); | |
1382 gtk_widget_show(smiley_p); | |
1383 gdk_bitmap_unref(mask); | |
1384 | 1470 |
1385 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), | 1471 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1386 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, | 1472 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, |
1387 _("Bold"), _("Bold Text"), _("Bold"), bold_p, | 1473 _("Bold"), _("Bold Text"), _("Bold"), bold_p, |
1388 GTK_SIGNAL_FUNC(do_bold), entry); | 1474 GTK_SIGNAL_FUNC(do_bold), entry); |
1397 GTK_SIGNAL_FUNC(do_underline), entry); | 1483 GTK_SIGNAL_FUNC(do_underline), entry); |
1398 strike = | 1484 strike = |
1399 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, | 1485 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, |
1400 _("Strike"), _("Strike through Text"), _("Strike"), strike_p, | 1486 _("Strike"), _("Strike through Text"), _("Strike"), strike_p, |
1401 GTK_SIGNAL_FUNC(do_strike), entry); | 1487 GTK_SIGNAL_FUNC(do_strike), entry); |
1488 | |
1402 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); | 1489 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
1490 | |
1403 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), | 1491 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), |
1404 _("Small"), _("Decrease font size"), _("Small"), | 1492 _("Small"), _("Decrease font size"), _("Small"), |
1405 small_p, GTK_SIGNAL_FUNC(do_small), entry); | 1493 small_p, GTK_SIGNAL_FUNC(do_small), entry); |
1406 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), | 1494 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), |
1407 _("Normal"), _("Normal font size"), _("Normal"), | 1495 _("Normal"), _("Normal font size"), _("Normal"), |
1441 | 1529 |
1442 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), | 1530 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1443 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, | 1531 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1444 NULL, _("Logging"), _("Enable logging"), | 1532 NULL, _("Logging"), _("Enable logging"), |
1445 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c); | 1533 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c); |
1534 state_lock = 1; | |
1535 if (find_log_info(c->name)) | |
1536 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE); | |
1537 else | |
1538 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE); | |
1539 state_lock = 0; | |
1540 | |
1541 save = gtk_toolbar_append_item (GTK_TOOLBAR(toolbar), | |
1542 _("Save"), _("Save Conversation"), | |
1543 _("Save"), save_p, GTK_SIGNAL_FUNC(save_convo), c); | |
1544 | |
1446 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), | 1545 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1447 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, | 1546 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1448 NULL, _("Sound"), _("Enable sounds"), | 1547 NULL, _("Sound"), _("Enable sounds"), |
1449 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option), | 1548 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option), |
1450 &c->makesound); | 1549 &c->makesound); |
1451 c->makesound = 0; | 1550 c->makesound = 0; |
1452 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE); | 1551 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE); |
1453 | 1552 |
1454 state_lock = 1; | |
1455 if (find_log_info(c->name)) | |
1456 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE); | |
1457 else | |
1458 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE); | |
1459 state_lock = 0; | |
1460 | |
1461 /* use a slicker look if the user wants to */ | 1553 /* use a slicker look if the user wants to */ |
1462 if (display_options & OPT_DISP_COOL_LOOK) { | 1554 if (display_options & OPT_DISP_COOL_LOOK) { |
1463 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE); | |
1464 gtk_button_set_relief(GTK_BUTTON(normal), GTK_RELIEF_NONE); | |
1465 gtk_button_set_relief(GTK_BUTTON(big), GTK_RELIEF_NONE); | |
1466 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE); | 1555 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE); |
1467 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE); | 1556 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE); |
1468 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE); | 1557 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE); |
1469 gtk_button_set_relief(GTK_BUTTON(speaker), GTK_RELIEF_NONE); | 1558 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE); |
1470 gtk_button_set_relief(GTK_BUTTON(wood), GTK_RELIEF_NONE); | 1559 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE); |
1560 gtk_button_set_relief(GTK_BUTTON(normal), GTK_RELIEF_NONE); | |
1561 gtk_button_set_relief(GTK_BUTTON(big), GTK_RELIEF_NONE); | |
1562 gtk_button_set_relief(GTK_BUTTON(font), GTK_RELIEF_NONE); | |
1471 gtk_button_set_relief(GTK_BUTTON(fgcolorbtn), GTK_RELIEF_NONE); | 1563 gtk_button_set_relief(GTK_BUTTON(fgcolorbtn), GTK_RELIEF_NONE); |
1472 gtk_button_set_relief(GTK_BUTTON(bgcolorbtn), GTK_RELIEF_NONE); | 1564 gtk_button_set_relief(GTK_BUTTON(bgcolorbtn), GTK_RELIEF_NONE); |
1473 gtk_button_set_relief(GTK_BUTTON(link), GTK_RELIEF_NONE); | 1565 gtk_button_set_relief(GTK_BUTTON(link), GTK_RELIEF_NONE); |
1474 gtk_button_set_relief(GTK_BUTTON(font), GTK_RELIEF_NONE); | |
1475 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE); | |
1476 gtk_button_set_relief(GTK_BUTTON(smiley), GTK_RELIEF_NONE); | 1566 gtk_button_set_relief(GTK_BUTTON(smiley), GTK_RELIEF_NONE); |
1567 gtk_button_set_relief(GTK_BUTTON(wood), GTK_RELIEF_NONE); | |
1568 gtk_button_set_relief(GTK_BUTTON(save), GTK_RELIEF_NONE); | |
1569 gtk_button_set_relief(GTK_BUTTON(speaker), GTK_RELIEF_NONE); | |
1477 } | 1570 } |
1478 | 1571 |
1479 gtk_widget_show(toolbar); | 1572 gtk_widget_show(toolbar); |
1480 | 1573 |
1481 gdk_pixmap_unref(link_i); | |
1482 gdk_pixmap_unref(fgcolor_i); | |
1483 gdk_pixmap_unref(bgcolor_i); | |
1484 gdk_pixmap_unref(wood_i); | |
1485 gdk_pixmap_unref(speaker_i); | |
1486 gdk_pixmap_unref(strike_i); | |
1487 gdk_pixmap_unref(bold_i); | 1574 gdk_pixmap_unref(bold_i); |
1488 gdk_pixmap_unref(italic_i); | 1575 gdk_pixmap_unref(italic_i); |
1489 gdk_pixmap_unref(underline_i); | 1576 gdk_pixmap_unref(underline_i); |
1577 gdk_pixmap_unref(strike_i); | |
1490 gdk_pixmap_unref(small_i); | 1578 gdk_pixmap_unref(small_i); |
1491 gdk_pixmap_unref(normal_i); | 1579 gdk_pixmap_unref(normal_i); |
1492 gdk_pixmap_unref(big_i); | 1580 gdk_pixmap_unref(big_i); |
1493 gdk_pixmap_unref(font_i); | 1581 gdk_pixmap_unref(font_i); |
1582 gdk_pixmap_unref(fgcolor_i); | |
1583 gdk_pixmap_unref(bgcolor_i); | |
1584 gdk_pixmap_unref(link_i); | |
1494 gdk_pixmap_unref(smiley_i); | 1585 gdk_pixmap_unref(smiley_i); |
1586 gdk_pixmap_unref(wood_i); | |
1587 gdk_pixmap_unref(save_i); | |
1588 gdk_pixmap_unref(speaker_i); | |
1495 | 1589 |
1496 c->bold = bold; | 1590 c->bold = bold; |
1497 c->strike = strike; | 1591 c->strike = strike; |
1498 c->italic = italic; | 1592 c->italic = italic; |
1499 c->underline = underline; | 1593 c->underline = underline; |