Mercurial > pidgin
comparison src/buddy.c @ 430:0cd2ba801eb4
[gaim-migrate @ 440]
First pass at a buddy ticker.
committer: Tailor Script <tailor@pidgin.im>
| author | Syd Logan <slogan> |
|---|---|
| date | Sat, 24 Jun 2000 23:15:48 +0000 |
| parents | 0d4e80bdb96b |
| children | 5741dca6cc8a |
comparison
equal
deleted
inserted
replaced
| 429:ccf7fc40263f | 430:0cd2ba801eb4 |
|---|---|
| 82 GtkWidget *blist = NULL; | 82 GtkWidget *blist = NULL; |
| 83 GtkWidget *bpmenu; | 83 GtkWidget *bpmenu; |
| 84 GtkWidget *buddies; | 84 GtkWidget *buddies; |
| 85 int permdeny; | 85 int permdeny; |
| 86 | 86 |
| 87 void BuddyTickerLogonTimeout( gpointer data ); | |
| 88 void BuddyTickerLogoutTimeout( gpointer data ); | |
| 87 | 89 |
| 88 /* Predefine some functions */ | 90 /* Predefine some functions */ |
| 89 static void new_bp_callback(GtkWidget *w, char *name); | 91 static void new_bp_callback(GtkWidget *w, char *name); |
| 90 static void log_callback(GtkWidget *w, char *name); | 92 static void log_callback(GtkWidget *w, char *name); |
| 91 | 93 |
| 906 | 908 |
| 907 gtk_object_set_user_data(GTK_OBJECT(b->item), b); | 909 gtk_object_set_user_data(GTK_OBJECT(b->item), b); |
| 908 | 910 |
| 909 gtk_signal_connect(GTK_OBJECT(b->item), "button_press_event", | 911 gtk_signal_connect(GTK_OBJECT(b->item), "button_press_event", |
| 910 GTK_SIGNAL_FUNC(handle_click_buddy), b); | 912 GTK_SIGNAL_FUNC(handle_click_buddy), b); |
| 911 | 913 |
| 912 return b; | 914 return b; |
| 913 } | 915 } |
| 914 | 916 |
| 915 | 917 |
| 916 struct group *add_group(char *group) | 918 struct group *add_group(char *group) |
| 1505 gtk_widget_hide(b->pix); | 1507 gtk_widget_hide(b->pix); |
| 1506 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1508 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1507 if (display_options & OPT_DISP_SHOW_PIXMAPS) | 1509 if (display_options & OPT_DISP_SHOW_PIXMAPS) |
| 1508 gtk_widget_show(b->pix); | 1510 gtk_widget_show(b->pix); |
| 1509 | 1511 |
| 1512 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1513 NULL, (gchar **)login_icon_xpm); | |
| 1514 | |
| 1515 BuddyTickerAddUser( b->name, pm, bm ); | |
| 1516 | |
| 1510 if (display_options & OPT_DISP_SHOW_LOGON) { | 1517 if (display_options & OPT_DISP_SHOW_LOGON) { |
| 1511 struct conversation *c = find_conversation(b->name); | 1518 struct conversation *c = find_conversation(b->name); |
| 1512 if (c) { | 1519 if (c) { |
| 1513 char tmp[1024]; | 1520 char tmp[1024]; |
| 1514 | 1521 |
| 1525 | 1532 |
| 1526 | 1533 |
| 1527 gtk_widget_show(b->item); | 1534 gtk_widget_show(b->item); |
| 1528 gtk_widget_show(b->label); | 1535 gtk_widget_show(b->label); |
| 1529 b->log_timer = gtk_timeout_add(10000, (GtkFunction) log_timeout, b->name); | 1536 b->log_timer = gtk_timeout_add(10000, (GtkFunction) log_timeout, b->name); |
| 1537 gtk_timeout_add(10000, (GtkFunction) BuddyTickerLogonTimeout, b->name); | |
| 1530 update_num_groups(); | 1538 update_num_groups(); |
| 1531 update_show_idlepix(); | 1539 update_show_idlepix(); |
| 1532 setup_buddy_chats(); | 1540 setup_buddy_chats(); |
| 1533 return; | 1541 return; |
| 1534 } | 1542 } |
| 1553 } | 1561 } |
| 1554 #endif | 1562 #endif |
| 1555 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | 1563 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, |
| 1556 NULL, (gchar **)away_icon_xpm); | 1564 NULL, (gchar **)away_icon_xpm); |
| 1557 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1565 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1566 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1567 NULL, (gchar **)away_icon_xpm); | |
| 1568 BuddyTickerSetPixmap(b->name, pm, bm); | |
| 1558 } else if (b->uc & UC_AOL) { | 1569 } else if (b->uc & UC_AOL) { |
| 1559 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | 1570 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, |
| 1560 NULL, (gchar **)aol_icon_xpm); | 1571 NULL, (gchar **)aol_icon_xpm); |
| 1561 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1572 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1573 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1574 NULL, (gchar **)aol_icon_xpm); | |
| 1575 BuddyTickerSetPixmap(b->name, pm, bm); | |
| 1562 } else if (b->uc & UC_NORMAL) { | 1576 } else if (b->uc & UC_NORMAL) { |
| 1563 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | 1577 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, |
| 1564 NULL, (gchar **)free_icon_xpm); | 1578 NULL, (gchar **)free_icon_xpm); |
| 1565 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1579 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1580 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1581 NULL, (gchar **)free_icon_xpm); | |
| 1582 BuddyTickerSetPixmap(b->name, pm, bm); | |
| 1566 } else if (b->uc & UC_ADMIN) { | 1583 } else if (b->uc & UC_ADMIN) { |
| 1567 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | 1584 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, |
| 1568 NULL, (gchar **)admin_icon_xpm); | 1585 NULL, (gchar **)admin_icon_xpm); |
| 1569 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1586 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1587 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1588 NULL, (gchar **)admin_icon_xpm); | |
| 1589 BuddyTickerSetPixmap(b->name, pm, bm); | |
| 1570 } else if (b->uc & UC_UNCONFIRMED) { | 1590 } else if (b->uc & UC_UNCONFIRMED) { |
| 1571 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | 1591 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, |
| 1572 NULL, (gchar **)dt_icon_xpm); | 1592 NULL, (gchar **)dt_icon_xpm); |
| 1573 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1593 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1594 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1595 NULL, (gchar **)dt_icon_xpm); | |
| 1596 BuddyTickerSetPixmap(b->name, pm, bm); | |
| 1574 } else { | 1597 } else { |
| 1575 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | 1598 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, |
| 1576 NULL, (gchar **)no_icon_xpm); | 1599 NULL, (gchar **)no_icon_xpm); |
| 1577 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1600 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1601 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1602 NULL, (gchar **)no_icon_xpm); | |
| 1603 BuddyTickerSetPixmap(b->name, pm, bm); | |
| 1578 } | 1604 } |
| 1579 if (display_options & OPT_DISP_SHOW_PIXMAPS) | 1605 if (display_options & OPT_DISP_SHOW_PIXMAPS) |
| 1580 gtk_widget_show(b->pix); | 1606 gtk_widget_show(b->pix); |
| 1581 } | 1607 } |
| 1582 | 1608 |
| 1601 play_sound(BUDDY_LEAVE); | 1627 play_sound(BUDDY_LEAVE); |
| 1602 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | 1628 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, |
| 1603 NULL, (gchar **)logout_icon_xpm); | 1629 NULL, (gchar **)logout_icon_xpm); |
| 1604 gtk_widget_hide(b->pix); | 1630 gtk_widget_hide(b->pix); |
| 1605 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); | 1631 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm); |
| 1632 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, | |
| 1633 NULL, (gchar **)logout_icon_xpm); | |
| 1634 BuddyTickerSetPixmap( b->name, pm, bm ); | |
| 1606 if (display_options & OPT_DISP_SHOW_PIXMAPS) | 1635 if (display_options & OPT_DISP_SHOW_PIXMAPS) |
| 1607 gtk_widget_show(b->pix); | 1636 gtk_widget_show(b->pix); |
| 1608 if (display_options & OPT_DISP_SHOW_LOGON) { | 1637 if (display_options & OPT_DISP_SHOW_LOGON) { |
| 1609 struct conversation *c = find_conversation(b->name); | 1638 struct conversation *c = find_conversation(b->name); |
| 1610 if (c) { | 1639 if (c) { |
| 1619 write_to_conv(c, tmp, WFLAG_SYSTEM); | 1648 write_to_conv(c, tmp, WFLAG_SYSTEM); |
| 1620 | 1649 |
| 1621 } | 1650 } |
| 1622 } | 1651 } |
| 1623 b->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, b->name); | 1652 b->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, b->name); |
| 1653 gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogoutTimeout, b->name); | |
| 1624 update_num_groups(); | 1654 update_num_groups(); |
| 1625 update_show_idlepix(); | 1655 update_show_idlepix(); |
| 1626 } | 1656 } |
| 1627 } | 1657 } |
| 1628 setup_buddy_chats(); | 1658 setup_buddy_chats(); |
