comparison src/conversation.c @ 2313:bd9d403fb15b

[gaim-migrate @ 2323] more room committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 20 Sep 2001 01:23:04 +0000
parents f5bf315e6104
children bde2481bb4db
comparison
equal deleted inserted replaced
2312:766603034af8 2313:bd9d403fb15b
88 88
89 void gaim_setup_imhtml(GtkWidget *imhtml) 89 void gaim_setup_imhtml(GtkWidget *imhtml)
90 { 90 {
91 g_return_if_fail(imhtml != NULL); 91 g_return_if_fail(imhtml != NULL);
92 g_return_if_fail(GTK_IS_IMHTML(imhtml)); 92 g_return_if_fail(GTK_IS_IMHTML(imhtml));
93 if (!(display_options & OPT_DISP_SHOW_SMILEY)) 93 if (!(convo_options & OPT_CONVO_SHOW_SMILEY))
94 gtk_imhtml_show_smileys(GTK_IMHTML(imhtml), FALSE); 94 gtk_imhtml_show_smileys(GTK_IMHTML(imhtml), FALSE);
95 gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url_nw), NULL); 95 gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url_nw), NULL);
96 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm); 96 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm);
97 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", luke03_xpm); 97 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", luke03_xpm);
98 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", oneeye_xpm); 98 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", oneeye_xpm);
204 if (cnv) { 204 if (cnv) {
205 if (!(logging_options & OPT_LOG_ALL)) 205 if (!(logging_options & OPT_LOG_ALL))
206 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name); 206 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name);
207 else 207 else
208 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name); 208 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name);
209 if (!(display_options & OPT_DISP_ONE_WINDOW)) 209 if (!(im_options & OPT_IM_ONE_WINDOW))
210 gtk_window_set_title(GTK_WINDOW(cnv->window), buf); 210 gtk_window_set_title(GTK_WINDOW(cnv->window), buf);
211 } 211 }
212 } 212 }
213 213
214 struct log_conversation *find_log_info(char *name) 214 struct log_conversation *find_log_info(char *name)
399 return; 399 return;
400 } 400 }
401 401
402 int close_callback(GtkWidget *widget, struct conversation *c) 402 int close_callback(GtkWidget *widget, struct conversation *c)
403 { 403 {
404 if (c->is_chat && (widget == c->close) && !(display_options & OPT_DISP_ONE_CHAT_WINDOW)) { 404 if (c->is_chat && (widget == c->close) && !(chat_options & OPT_CHAT_ONE_WINDOW)) {
405 GtkWidget *tmp = c->window; 405 GtkWidget *tmp = c->window;
406 debug_printf("chat clicked close button\n"); 406 debug_printf("chat clicked close button\n");
407 c->window = NULL; 407 c->window = NULL;
408 gtk_widget_destroy(tmp); 408 gtk_widget_destroy(tmp);
409 return FALSE; 409 return FALSE;
410 } 410 }
411 411
412 debug_printf("conversation close callback\n"); 412 debug_printf("conversation close callback\n");
413 413
414 if (general_options & OPT_GEN_CHECK_SPELLING) 414 if (convo_options & OPT_CONVO_CHECK_SPELLING)
415 gtkspell_detach(GTK_TEXT(c->entry)); 415 gtkspell_detach(GTK_TEXT(c->entry));
416 416
417 if (!c->is_chat) { 417 if (!c->is_chat) {
418 GSList *cn = connections; 418 GSList *cn = connections;
419 while (cn) { 419 while (cn) {
422 if (gc->prpl->convo_closed) 422 if (gc->prpl->convo_closed)
423 (*gc->prpl->convo_closed)(gc, c->name); 423 (*gc->prpl->convo_closed)(gc, c->name);
424 } 424 }
425 remove_icon(c); 425 remove_icon(c);
426 remove_checkbox(c); 426 remove_checkbox(c);
427 if (display_options & OPT_DISP_ONE_WINDOW) { 427 if (im_options & OPT_IM_ONE_WINDOW) {
428 if (g_list_length(conversations) > 1) { 428 if (g_list_length(conversations) > 1) {
429 gtk_notebook_remove_page(GTK_NOTEBOOK(convo_notebook), 429 gtk_notebook_remove_page(GTK_NOTEBOOK(convo_notebook),
430 g_list_index(conversations, c)); 430 g_list_index(conversations, c));
431 } else { 431 } else {
432 if (c->window) 432 if (c->window)
439 if (c->window) 439 if (c->window)
440 gtk_widget_destroy(c->window); 440 gtk_widget_destroy(c->window);
441 c->window = NULL; 441 c->window = NULL;
442 } 442 }
443 } else { 443 } else {
444 if (display_options & OPT_DISP_ONE_CHAT_WINDOW) { 444 if (chat_options & OPT_CHAT_ONE_WINDOW) {
445 if (g_list_length(chats) > 1) { 445 if (g_list_length(chats) > 1) {
446 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook), 446 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook),
447 g_list_index(chats, c)); 447 g_list_index(chats, c));
448 } else { 448 } else {
449 if (c->window) 449 if (c->window)
578 578
579 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c) 579 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c)
580 { 580 {
581 int pos; 581 int pos;
582 if (event->keyval == GDK_Escape) { 582 if (event->keyval == GDK_Escape) {
583 if (general_options & OPT_GEN_ESC_CAN_CLOSE) { 583 if (convo_options & OPT_CONVO_ESC_CAN_CLOSE) {
584 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 584 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
585 close_callback(c->close, c); 585 close_callback(c->close, c);
586 } 586 }
587 } else if ((event->keyval == GDK_F2) && (general_options & OPT_GEN_F2_TOGGLES)) { 587 } else if ((event->keyval == GDK_F2) && (convo_options & OPT_CONVO_F2_TOGGLES)) {
588 gtk_imhtml_show_comments(GTK_IMHTML(c->text), !GTK_IMHTML(c->text)->comments); 588 gtk_imhtml_show_comments(GTK_IMHTML(c->text), !GTK_IMHTML(c->text)->comments);
589 } else if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) { 589 } else if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) {
590 if ((event->state & GDK_CONTROL_MASK) && (general_options & OPT_GEN_CTL_ENTER)) { 590 if ((event->state & GDK_CONTROL_MASK) && (convo_options & OPT_CONVO_CTL_ENTER)) {
591 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c); 591 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
592 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 592 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
593 } else if (!(event->state & GDK_SHIFT_MASK) && (general_options & OPT_GEN_ENTER_SENDS)) { 593 } else if (!(event->state & GDK_SHIFT_MASK) && (convo_options & OPT_CONVO_ENTER_SENDS)) {
594 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c); 594 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
595 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 595 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
596 } else { 596 } else {
597 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 597 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
598 pos = gtk_editable_get_position(GTK_EDITABLE(entry)); 598 pos = gtk_editable_get_position(GTK_EDITABLE(entry));
599 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos); 599 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos);
600 } 600 }
601 } else if (event->state & GDK_CONTROL_MASK) { 601 } else if (event->state & GDK_CONTROL_MASK) {
602 if (general_options & OPT_GEN_CTL_CHARS) { 602 if (convo_options & OPT_CONVO_CTL_CHARS) {
603 switch (event->keyval) { 603 switch (event->keyval) {
604 case 'i': 604 case 'i':
605 case 'I': 605 case 'I':
606 quiet_set(c->italic, 606 quiet_set(c->italic,
607 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->italic))); 607 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->italic)));
630 do_strike(c->strike, c->entry); 630 do_strike(c->strike, c->entry);
631 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 631 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
632 break; 632 break;
633 } 633 }
634 } 634 }
635 if (general_options & OPT_GEN_CTL_SMILEYS) { 635 if (convo_options & OPT_CONVO_CTL_SMILEYS) {
636 char buf[7]; 636 char buf[7];
637 buf[0] = '\0'; 637 buf[0] = '\0';
638 switch (event->keyval) { 638 switch (event->keyval) {
639 case '1': 639 case '1':
640 sprintf(buf, ":-)"); 640 sprintf(buf, ":-)");
696 buf, strlen(buf), &pos); 696 buf, strlen(buf), &pos);
697 } 697 }
698 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 698 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
699 } 699 }
700 } 700 }
701 if ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) || 701 if ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) ||
702 ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) { 702 ( c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) {
703 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); 703 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
704 if (event->keyval == '[') { 704 if (event->keyval == '[') {
705 gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); 705 gtk_notebook_prev_page(GTK_NOTEBOOK(notebook));
706 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 706 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
707 } else if (event->keyval == ']') { 707 } else if (event->keyval == ']') {
747 } 747 }
748 } 748 }
749 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 749 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
750 } 750 }
751 } 751 }
752 } else if (((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) || 752 } else if (((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) ||
753 ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) && 753 ( c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) &&
754 (event->state & GDK_MOD1_MASK) && isdigit(event->keyval) && 754 (event->state & GDK_MOD1_MASK) && isdigit(event->keyval) &&
755 (event->keyval > '0')) { 755 (event->keyval > '0')) {
756 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); 756 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
757 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), event->keyval - '1'); 757 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), event->keyval - '1');
758 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 758 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
782 } 782 }
783 783
784 buf2 = g_malloc(limit); 784 buf2 = g_malloc(limit);
785 785
786 if (c->gc->prpl->options & OPT_PROTO_HTML) { 786 if (c->gc->prpl->options & OPT_PROTO_HTML) {
787 if (general_options & OPT_GEN_SEND_LINKS) 787 if (convo_options & OPT_CONVO_SEND_LINKS)
788 linkify_text(buf); 788 linkify_text(buf);
789 789
790 if (font_options & OPT_FONT_BOLD) { 790 if (font_options & OPT_FONT_BOLD) {
791 g_snprintf(buf2, limit, "<B>%s</B>", buf); 791 g_snprintf(buf2, limit, "<B>%s</B>", buf);
792 strcpy(buf, buf2); 792 strcpy(buf, buf2);
895 else 895 else
896 do_error_dialog(_("Unable to send message: Unknown reason"), _("Message Error")); 896 do_error_dialog(_("Unable to send message: Unknown reason"), _("Message Error"));
897 } else { 897 } else {
898 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1); 898 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1);
899 899
900 if (general_options & OPT_GEN_BACK_ON_IM) { 900 if (away_options & OPT_AWAY_BACK_ON_IM) {
901 if (awaymessage != NULL) { 901 if (awaymessage != NULL) {
902 do_im_back(); 902 do_im_back();
903 } else if (c->gc->away) { 903 } else if (c->gc->away) {
904 serv_set_away(c->gc, GAIM_AWAY_CUSTOM, NULL); 904 serv_set_away(c->gc, GAIM_AWAY_CUSTOM, NULL);
905 } 905 }
1061 { 1061 {
1062 int temp, pos = GTK_EDITABLE(entry)->current_pos; 1062 int temp, pos = GTK_EDITABLE(entry)->current_pos;
1063 int dummy; 1063 int dummy;
1064 int start, finish; 1064 int start, finish;
1065 1065
1066 if (general_options & OPT_GEN_CHECK_SPELLING) { 1066 if (convo_options & OPT_CONVO_CHECK_SPELLING) {
1067 gtkspell_detach(GTK_TEXT(entry)); 1067 gtkspell_detach(GTK_TEXT(entry));
1068 } 1068 }
1069 1069
1070 if (GTK_EDITABLE(entry)->has_selection) { 1070 if (GTK_EDITABLE(entry)->has_selection) {
1071 remove_tags(entry, pre); 1071 remove_tags(entry, pre);
1095 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy); 1095 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
1096 gtk_editable_set_position(GTK_EDITABLE(entry), pos); 1096 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
1097 } 1097 }
1098 } 1098 }
1099 1099
1100 if (general_options & OPT_GEN_CHECK_SPELLING) { 1100 if (convo_options & OPT_CONVO_CHECK_SPELLING) {
1101 gtkspell_attach(GTK_TEXT(entry)); 1101 gtkspell_attach(GTK_TEXT(entry));
1102 } 1102 }
1103 1103
1104 gtk_widget_grab_focus(entry); 1104 gtk_widget_grab_focus(entry);
1105 } 1105 }
1330 1330
1331 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime)); 1331 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime));
1332 1332
1333 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS; 1333 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS;
1334 1334
1335 if (display_options & OPT_DISP_IGNORE_COLOUR) 1335 if (convo_options & OPT_CONVO_IGNORE_COLOUR)
1336 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS; 1336 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS;
1337 1337
1338 if (display_options & OPT_DISP_IGNORE_FONTS) 1338 if (convo_options & OPT_CONVO_IGNORE_FONTS)
1339 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_FONTS; 1339 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_FONTS;
1340 1340
1341 if (display_options & OPT_DISP_IGNORE_SIZES) 1341 if (convo_options & OPT_CONVO_IGNORE_SIZES)
1342 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_SIZES; 1342 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_SIZES;
1343 1343
1344 if (!(logging_options & OPT_LOG_STRIP_HTML)) 1344 if (!(logging_options & OPT_LOG_STRIP_HTML))
1345 gtk_font_options = gtk_font_options ^ GTK_IMHTML_RETURN_LOG; 1345 gtk_font_options = gtk_font_options ^ GTK_IMHTML_RETURN_LOG;
1346 1346
1368 } 1368 }
1369 } 1369 }
1370 1370
1371 1371
1372 if (flags & WFLAG_SYSTEM) { 1372 if (flags & WFLAG_SYSTEM) {
1373 if (general_options & OPT_DISP_SHOW_TIME) 1373 if (convo_options & OPT_CONVO_SHOW_TIME)
1374 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what); 1374 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what);
1375 else 1375 else
1376 g_snprintf(buf, BUF_LONG, "<B>%s</B>", what); 1376 g_snprintf(buf, BUF_LONG, "<B>%s</B>", what);
1377 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>", 1377 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>",
1378 mdate, what); 1378 mdate, what);
1447 else if (flags & WFLAG_SEND) 1447 else if (flags & WFLAG_SEND)
1448 strcpy(colour, "#0000ff"); 1448 strcpy(colour, "#0000ff");
1449 } 1449 }
1450 } 1450 }
1451 1451
1452 if (general_options & OPT_DISP_SHOW_TIME) 1452 if (convo_options & OPT_CONVO_SHOW_TIME)
1453 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>" 1453 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>"
1454 "<B>%s</B></FONT> ", colour, mdate, str); 1454 "<B>%s</B></FONT> ", colour, mdate, str);
1455 else 1455 else
1456 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str); 1456 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str);
1457 g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>" 1457 g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>"
1525 NULL, (gchar **)aimicon2_xpm); 1525 NULL, (gchar **)aimicon2_xpm);
1526 gdk_window_set_icon(c->window->window, NULL, dark_icon_pm, dark_icon_bm); 1526 gdk_window_set_icon(c->window->window, NULL, dark_icon_pm, dark_icon_bm);
1527 } 1527 }
1528 */ 1528 */
1529 1529
1530 if ((c->is_chat && (general_options & OPT_GEN_POPUP_CHAT)) || 1530 if ((c->is_chat && (chat_options & OPT_CHAT_POPUP)) ||
1531 (!c->is_chat && (general_options & OPT_GEN_POPUP_WINDOWS))) 1531 (!c->is_chat && (im_options & OPT_IM_POPUP)))
1532 gdk_window_show(c->window->window); 1532 gdk_window_show(c->window->window);
1533 1533
1534 if (((flags & WFLAG_RECV) || (flags & WFLAG_SYSTEM)) && 1534 if (((flags & WFLAG_RECV) || (flags & WFLAG_SYSTEM)) &&
1535 ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW) && 1535 ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW) &&
1536 (gtk_notebook_get_current_page(GTK_NOTEBOOK(convo_notebook)) 1536 (gtk_notebook_get_current_page(GTK_NOTEBOOK(convo_notebook))
1537 != g_list_index(conversations, c))) || 1537 != g_list_index(conversations, c))) ||
1538 ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW) && 1538 ( c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW) &&
1539 (gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_notebook)) 1539 (gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_notebook))
1540 != g_list_index(chats, c))))) { 1540 != g_list_index(chats, c))))) {
1541 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); 1541 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
1542 GList *ws = (c->is_chat ? chats : conversations); 1542 GList *ws = (c->is_chat ? chats : conversations);
1543 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), 1543 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook),
1733 &c->makesound); 1733 &c->makesound);
1734 c->makesound = 0; 1734 c->makesound = 0;
1735 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE); 1735 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE);
1736 1736
1737 /* use a slicker look if the user wants to */ 1737 /* use a slicker look if the user wants to */
1738 if (display_options & OPT_DISP_COOL_LOOK) { 1738 if (misc_options & OPT_MISC_COOL_LOOK) {
1739 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE); 1739 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE);
1740 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE); 1740 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE);
1741 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE); 1741 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE);
1742 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE); 1742 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE);
1743 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE); 1743 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE);
2048 c->bgcol = bgcolor; 2048 c->bgcol = bgcolor;
2049 c->hasbg = 0; 2049 c->hasbg = 0;
2050 c->fgcol = fgcolor; 2050 c->fgcol = fgcolor;
2051 c->hasfg = 0; 2051 c->hasfg = 0;
2052 2052
2053 if (display_options & OPT_DISP_ONE_WINDOW) { 2053 if (im_options & OPT_IM_ONE_WINDOW) {
2054 if (!all_convos) { 2054 if (!all_convos) {
2055 win = all_convos = c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 2055 win = all_convos = c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2056 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim"); 2056 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim");
2057 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); 2057 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
2058 gtk_container_border_width(GTK_CONTAINER(win), 0); 2058 gtk_container_border_width(GTK_CONTAINER(win), 0);
2061 gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Conversations")); 2061 gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Conversations"));
2062 gtk_signal_connect(GTK_OBJECT(win), "delete_event", 2062 gtk_signal_connect(GTK_OBJECT(win), "delete_event",
2063 GTK_SIGNAL_FUNC(delete_all_convo), NULL); 2063 GTK_SIGNAL_FUNC(delete_all_convo), NULL);
2064 2064
2065 convo_notebook = gtk_notebook_new(); 2065 convo_notebook = gtk_notebook_new();
2066 if (display_options & OPT_DISP_CONV_SIDE_TAB) { 2066 if (im_options & OPT_IM_SIDE_TAB) {
2067 if (display_options & OPT_DISP_CONV_BR_TAB) { 2067 if (im_options & OPT_IM_BR_TAB) {
2068 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2068 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2069 GTK_POS_RIGHT); 2069 GTK_POS_RIGHT);
2070 } else { 2070 } else {
2071 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2071 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2072 GTK_POS_LEFT); 2072 GTK_POS_LEFT);
2073 } 2073 }
2074 } else { 2074 } else {
2075 if (display_options & OPT_DISP_CONV_BR_TAB) { 2075 if (im_options & OPT_IM_BR_TAB) {
2076 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2076 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2077 GTK_POS_BOTTOM); 2077 GTK_POS_BOTTOM);
2078 } else { 2078 } else {
2079 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2079 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2080 GTK_POS_TOP); 2080 GTK_POS_TOP);
2130 text = gtk_imhtml_new(NULL, NULL); 2130 text = gtk_imhtml_new(NULL, NULL);
2131 c->text = text; 2131 c->text = text;
2132 gtk_container_add(GTK_CONTAINER(sw), text); 2132 gtk_container_add(GTK_CONTAINER(sw), text);
2133 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0; 2133 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0;
2134 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0; 2134 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0;
2135 if (display_options & OPT_DISP_SHOW_TIME) 2135 if (convo_options & OPT_CONVO_SHOW_TIME)
2136 gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE); 2136 gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE);
2137 gaim_setup_imhtml(text); 2137 gaim_setup_imhtml(text);
2138 gtk_widget_show(text); 2138 gtk_widget_show(text);
2139 2139
2140 vbox2 = gtk_vbox_new(FALSE, 5); 2140 vbox2 = gtk_vbox_new(FALSE, 5);
2159 gtk_box_pack_start(GTK_BOX(vbox2), c->lbox, FALSE, FALSE, 0); 2159 gtk_box_pack_start(GTK_BOX(vbox2), c->lbox, FALSE, FALSE, 0);
2160 gtk_widget_show(c->lbox); 2160 gtk_widget_show(c->lbox);
2161 2161
2162 entry = gtk_text_new(NULL, NULL); 2162 entry = gtk_text_new(NULL, NULL);
2163 c->entry = entry; 2163 c->entry = entry;
2164 if (!(display_options & OPT_DISP_ONE_WINDOW)) 2164 if (!(im_options & OPT_IM_ONE_WINDOW))
2165 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); 2165 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry);
2166 2166
2167 toolbar = build_conv_toolbar(c); 2167 toolbar = build_conv_toolbar(c);
2168 gtk_box_pack_start(GTK_BOX(vbox2), toolbar, FALSE, FALSE, 0); 2168 gtk_box_pack_start(GTK_BOX(vbox2), toolbar, FALSE, FALSE, 0);
2169 2169
2174 2174
2175 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(send_callback), c); 2175 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(send_callback), c);
2176 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), c); 2176 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), c);
2177 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), 2177 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed),
2178 entry); 2178 entry);
2179 if (general_options & OPT_GEN_CHECK_SPELLING) 2179 if (convo_options & OPT_CONVO_CHECK_SPELLING)
2180 gtkspell_attach(GTK_TEXT(c->entry)); 2180 gtkspell_attach(GTK_TEXT(c->entry));
2181 gtk_box_pack_start(GTK_BOX(vbox2), entry, TRUE, TRUE, 0); 2181 gtk_box_pack_start(GTK_BOX(vbox2), entry, TRUE, TRUE, 0);
2182 gtk_widget_show(entry); 2182 gtk_widget_show(entry);
2183 2183
2184 c->bbox = bbox = gtk_hbox_new(FALSE, 5); 2184 c->bbox = bbox = gtk_hbox_new(FALSE, 5);
2253 GSList *con = connections; 2253 GSList *con = connections;
2254 struct gaim_connection *gc; 2254 struct gaim_connection *gc;
2255 2255
2256 while (cnv) { 2256 while (cnv) {
2257 c = (struct conversation *)cnv->data; 2257 c = (struct conversation *)cnv->data;
2258 if (general_options & OPT_GEN_CHECK_SPELLING) 2258 if (convo_options & OPT_CONVO_CHECK_SPELLING)
2259 gtkspell_attach(GTK_TEXT(c->entry)); 2259 gtkspell_attach(GTK_TEXT(c->entry));
2260 else 2260 else
2261 gtkspell_detach(GTK_TEXT(c->entry)); 2261 gtkspell_detach(GTK_TEXT(c->entry));
2262 cnv = cnv->next; 2262 cnv = cnv->next;
2263 } 2263 }
2265 while (con) { 2265 while (con) {
2266 gc = (struct gaim_connection *)con->data; 2266 gc = (struct gaim_connection *)con->data;
2267 cht = gc->buddy_chats; 2267 cht = gc->buddy_chats;
2268 while (cht) { 2268 while (cht) {
2269 c = (struct conversation *)cht->data; 2269 c = (struct conversation *)cht->data;
2270 if (general_options & OPT_GEN_CHECK_SPELLING) 2270 if (convo_options & OPT_CONVO_CHECK_SPELLING)
2271 gtkspell_attach(GTK_TEXT(c->entry)); 2271 gtkspell_attach(GTK_TEXT(c->entry));
2272 else 2272 else
2273 gtkspell_detach(GTK_TEXT(c->entry)); 2273 gtkspell_detach(GTK_TEXT(c->entry));
2274 cht = cht->next; 2274 cht = cht->next;
2275 } 2275 }
2285 GSList *con = connections; 2285 GSList *con = connections;
2286 struct gaim_connection *gc; 2286 struct gaim_connection *gc;
2287 2287
2288 while (cnv) { 2288 while (cnv) {
2289 c = (struct conversation *)cnv->data; 2289 c = (struct conversation *)cnv->data;
2290 if (display_options & OPT_DISP_SHOW_TIME) 2290 if (convo_options & OPT_CONVO_SHOW_TIME)
2291 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE); 2291 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE);
2292 else 2292 else
2293 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE); 2293 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE);
2294 cnv = cnv->next; 2294 cnv = cnv->next;
2295 } 2295 }
2297 while (con) { 2297 while (con) {
2298 gc = (struct gaim_connection *)con->data; 2298 gc = (struct gaim_connection *)con->data;
2299 cht = gc->buddy_chats; 2299 cht = gc->buddy_chats;
2300 while (cht) { 2300 while (cht) {
2301 c = (struct conversation *)cht->data; 2301 c = (struct conversation *)cht->data;
2302 if (display_options & OPT_DISP_SHOW_TIME) 2302 if (convo_options & OPT_CONVO_SHOW_TIME)
2303 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE); 2303 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE);
2304 else 2304 else
2305 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE); 2305 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE);
2306 cht = cht->next; 2306 cht = cht->next;
2307 } 2307 }
2317 GSList *con = connections; 2317 GSList *con = connections;
2318 struct gaim_connection *gc; 2318 struct gaim_connection *gc;
2319 2319
2320 while (cnv) { 2320 while (cnv) {
2321 c = (struct conversation *)cnv->data; 2321 c = (struct conversation *)cnv->data;
2322 if (display_options & OPT_DISP_SHOW_SMILEY) 2322 if (convo_options & OPT_CONVO_SHOW_SMILEY)
2323 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE); 2323 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE);
2324 else 2324 else
2325 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE); 2325 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE);
2326 cnv = cnv->next; 2326 cnv = cnv->next;
2327 } 2327 }
2329 while (con) { 2329 while (con) {
2330 gc = (struct gaim_connection *)con->data; 2330 gc = (struct gaim_connection *)con->data;
2331 cht = gc->buddy_chats; 2331 cht = gc->buddy_chats;
2332 while (cht) { 2332 while (cht) {
2333 c = (struct conversation *)cht->data; 2333 c = (struct conversation *)cht->data;
2334 if (display_options & OPT_DISP_SHOW_SMILEY) 2334 if (convo_options & OPT_CONVO_SHOW_SMILEY)
2335 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE); 2335 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE);
2336 else 2336 else
2337 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE); 2337 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE);
2338 cht = cht->next; 2338 cht = cht->next;
2339 } 2339 }
2342 } 2342 }
2343 2343
2344 void tabize() 2344 void tabize()
2345 { 2345 {
2346 /* evil, evil i tell you! evil! */ 2346 /* evil, evil i tell you! evil! */
2347 if (display_options & OPT_DISP_ONE_WINDOW) { 2347 if (im_options & OPT_IM_ONE_WINDOW) {
2348 GList *x = conversations; 2348 GList *x = conversations;
2349 while (x) { 2349 while (x) {
2350 struct conversation *c = x->data; 2350 struct conversation *c = x->data;
2351 GtkWidget *imhtml, *win; 2351 GtkWidget *imhtml, *win;
2352 2352
2406 } 2406 }
2407 2407
2408 void update_im_tabs() { 2408 void update_im_tabs() {
2409 if (!convo_notebook || !all_convos) 2409 if (!convo_notebook || !all_convos)
2410 return; 2410 return;
2411 if (display_options & OPT_DISP_CONV_SIDE_TAB) { 2411 if (im_options & OPT_IM_SIDE_TAB) {
2412 if (display_options & OPT_DISP_CONV_BR_TAB) { 2412 if (im_options & OPT_IM_BR_TAB) {
2413 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2413 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2414 GTK_POS_RIGHT); 2414 GTK_POS_RIGHT);
2415 } else { 2415 } else {
2416 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2416 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2417 GTK_POS_LEFT); 2417 GTK_POS_LEFT);
2418 } 2418 }
2419 } else { 2419 } else {
2420 if (display_options & OPT_DISP_CONV_BR_TAB) { 2420 if (im_options & OPT_IM_BR_TAB) {
2421 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2421 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2422 GTK_POS_BOTTOM); 2422 GTK_POS_BOTTOM);
2423 } else { 2423 } else {
2424 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), 2424 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2425 GTK_POS_TOP); 2425 GTK_POS_TOP);
2428 } 2428 }
2429 2429
2430 void update_chat_tabs() { 2430 void update_chat_tabs() {
2431 if (!chat_notebook || !all_chats) 2431 if (!chat_notebook || !all_chats)
2432 return; 2432 return;
2433 if (display_options & OPT_DISP_CHAT_SIDE_TAB) { 2433 if (chat_options & OPT_CHAT_SIDE_TAB) {
2434 if (display_options & OPT_DISP_CHAT_BR_TAB) { 2434 if (chat_options & OPT_CHAT_BR_TAB) {
2435 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 2435 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
2436 GTK_POS_RIGHT); 2436 GTK_POS_RIGHT);
2437 } else { 2437 } else {
2438 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 2438 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
2439 GTK_POS_LEFT); 2439 GTK_POS_LEFT);
2440 } 2440 }
2441 } else { 2441 } else {
2442 if (display_options & OPT_DISP_CHAT_BR_TAB) { 2442 if (chat_options & OPT_CHAT_BR_TAB) {
2443 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 2443 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
2444 GTK_POS_BOTTOM); 2444 GTK_POS_BOTTOM);
2445 } else { 2445 } else {
2446 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), 2446 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
2447 GTK_POS_TOP); 2447 GTK_POS_TOP);