comparison src/conversation.c @ 1587:69a004b5820a

[gaim-migrate @ 1597] requested keybindings, and also handle nick format changes better committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 16 Mar 2001 07:30:14 +0000
parents 78effb5b2e4b
children b4e54a752676
comparison
equal deleted inserted replaced
1586:bb97d3e8a54d 1587:69a004b5820a
642 buf, strlen(buf), &pos); 642 buf, strlen(buf), &pos);
643 } 643 }
644 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); 644 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
645 } 645 }
646 } 646 }
647 if (display_options & OPT_DISP_ONE_WINDOW) {
648 if (event->keyval == GDK_Left) {
649 gtk_notebook_prev_page(GTK_NOTEBOOK(convo_notebook));
650 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
651 } else if (event->keyval == GDK_Right) {
652 gtk_notebook_next_page(GTK_NOTEBOOK(convo_notebook));
653 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
654 } else if (event->keyval == GDK_Tab) {
655 GList *cnv = conversations;
656 struct conversation *c;
657 while (cnv) {
658 c = cnv->data;
659 if (c->unseen)
660 break;
661 cnv = cnv->next;
662 c = NULL;
663 }
664 if (c) {
665 gtk_notebook_set_page(GTK_NOTEBOOK(convo_notebook),
666 g_list_index(conversations, c));
667 }
668 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
669 }
670 }
647 } 671 }
648 672
649 return TRUE; 673 return TRUE;
650
651 } 674 }
652 675
653 676
654 void send_callback(GtkWidget *widget, struct conversation *c) 677 void send_callback(GtkWidget *widget, struct conversation *c)
655 { 678 {
1401 g_list_index(conversations, c))); 1424 g_list_index(conversations, c)));
1402 GtkStyle *style = gtk_style_new(); 1425 GtkStyle *style = gtk_style_new();
1403 if (!GTK_WIDGET_REALIZED(label)) 1426 if (!GTK_WIDGET_REALIZED(label))
1404 gtk_widget_realize(label); 1427 gtk_widget_realize(label);
1405 gdk_font_unref(style->font); 1428 gdk_font_unref(style->font);
1406 style->font = label->style->font; 1429 style->font = gdk_font_ref(label->style->font);
1407 gdk_font_ref(style->font);
1408 style->fg[0].red = 0xcccc; 1430 style->fg[0].red = 0xcccc;
1409 style->fg[0].green = 0x0000; 1431 style->fg[0].green = 0x0000;
1410 style->fg[0].blue = 0x0000; 1432 style->fg[0].blue = 0x0000;
1411 gtk_widget_set_style(label, style); 1433 gtk_widget_set_style(label, style);
1412 gtk_style_unref(style); 1434 gtk_style_unref(style);
1435 c->unseen = TRUE;
1413 } 1436 }
1414 1437
1415 g_free(smiley); 1438 g_free(smiley);
1416 g_free(buf); 1439 g_free(buf);
1417 } 1440 }
1813 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); 1836 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry);
1814 if (!GTK_WIDGET_REALIZED(label)) 1837 if (!GTK_WIDGET_REALIZED(label))
1815 return; 1838 return;
1816 style = gtk_style_new(); 1839 style = gtk_style_new();
1817 gdk_font_unref(style->font); 1840 gdk_font_unref(style->font);
1818 style->font = label->style->font; 1841 style->font = gdk_font_ref(label->style->font);
1819 gdk_font_ref(style->font);
1820 gtk_widget_set_style(label, style); 1842 gtk_widget_set_style(label, style);
1821 gtk_style_unref(style); 1843 gtk_style_unref(style);
1844 c->unseen = FALSE;
1822 } 1845 }
1823 1846
1824 1847
1825 void show_conv(struct conversation *c) 1848 void show_conv(struct conversation *c)
1826 { 1849 {
2167 gtk_widget_destroy(all_convos); 2190 gtk_widget_destroy(all_convos);
2168 all_convos = NULL; 2191 all_convos = NULL;
2169 conversations = m; 2192 conversations = m;
2170 } 2193 }
2171 } 2194 }
2195
2196 void set_convo_tab_label(struct conversation *c, char *text)
2197 {
2198 gtk_label_set_text(GTK_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(convo_notebook),
2199 gtk_notebook_get_nth_page(GTK_NOTEBOOK(convo_notebook),
2200 g_list_index(conversations, c)))), text);
2201 }