comparison src/buddy.c @ 921:d2e865d64dd8

[gaim-migrate @ 931] bah. maybe i'll get this working for the next release, but i don't think it's possible to get it working. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 16 Sep 2000 00:54:29 +0000
parents 972a180e9429
children 5e6ca3dd4d02
comparison
equal deleted inserted replaced
920:972a180e9429 921:d2e865d64dd8
866 b->label = gtk_label_new(buddy); 866 b->label = gtk_label_new(buddy);
867 gtk_misc_set_alignment(GTK_MISC(b->label), 0.0, 0.5); 867 gtk_misc_set_alignment(GTK_MISC(b->label), 0.0, 0.5);
868 868
869 b->idletime = gtk_label_new(""); 869 b->idletime = gtk_label_new("");
870 870
871 /* gtk_tree_append(GTK_TREE(g->tree),b->item);*/ 871 gtk_tree_append(GTK_TREE(g->tree),b->item);
872 gtk_container_add(GTK_CONTAINER(b->item), box); 872 gtk_container_add(GTK_CONTAINER(b->item), box);
873 873
874 gtk_box_pack_start(GTK_BOX(box), b->pix, FALSE, FALSE, 1); 874 gtk_box_pack_start(GTK_BOX(box), b->pix, FALSE, FALSE, 1);
875 gtk_box_pack_start(GTK_BOX(box), b->label, TRUE, TRUE, 1); 875 gtk_box_pack_start(GTK_BOX(box), b->label, TRUE, TRUE, 1);
876 gtk_box_pack_start(GTK_BOX(box), b->idletime, FALSE, FALSE, 1); 876 gtk_box_pack_start(GTK_BOX(box), b->idletime, FALSE, FALSE, 1);
883 gtk_signal_connect(GTK_OBJECT(b->item), "button_press_event", 883 gtk_signal_connect(GTK_OBJECT(b->item), "button_press_event",
884 GTK_SIGNAL_FUNC(handle_click_buddy), b); 884 GTK_SIGNAL_FUNC(handle_click_buddy), b);
885 885
886 return b; 886 return b;
887 } 887 }
888
888 889
889 struct group *add_group(char *group) 890 struct group *add_group(char *group)
890 { 891 {
891 struct group *g = find_group(group); 892 struct group *g = find_group(group);
892 if (g) 893 if (g)
1313 1314
1314 b->log_timer = 0; 1315 b->log_timer = 0;
1315 1316
1316 if (!b->present) { 1317 if (!b->present) {
1317 int count = 0; 1318 int count = 0;
1319 gtk_widget_hide(b->item);
1318 g = find_group_by_buddy(name); 1320 g = find_group_by_buddy(name);
1319
1320 if (g && g->tree && b->item->parent) {
1321 gtk_widget_ref(b->item);
1322 gtk_tree_remove_item(GTK_TREE(g->tree), b->item);
1323 }
1324 mem = g->members; 1321 mem = g->members;
1325 while (mem) { 1322 while (mem) {
1326 b = (struct buddy *)mem->data; 1323 b = (struct buddy *)mem->data;
1327 if (b->present) { 1324 if (b->present) {
1328 count++; 1325 count++;
1486 1483
1487 } 1484 }
1488 } 1485 }
1489 1486
1490 1487
1491 { 1488 { struct group *g = find_group_by_buddy(b->name);
1492 struct group *g = find_group_by_buddy(b->name); 1489 gtk_widget_show(g->item); }
1493 gtk_widget_show(g->item); 1490 gtk_widget_show(b->item);
1494 if (!b->item->parent) {
1495 GList *mem = g->members; int cn = 0;
1496 struct buddy *BB;
1497 while (mem) {
1498 BB = (struct buddy *)mem->data;
1499 if (BB == b)
1500 break;
1501 if (BB->present) cn++;
1502 mem = mem->next;
1503 }
1504 if (cn)
1505 gtk_tree_insert(GTK_TREE(g->tree),
1506 b->item, cn);
1507 else
1508 gtk_tree_prepend(GTK_TREE(g->tree),
1509 b->item);
1510 }
1511 gtk_widget_show(b->item);
1512 }
1513 gtk_widget_show(b->label); 1491 gtk_widget_show(b->label);
1514 b->log_timer = gtk_timeout_add(10000, (GtkFunction) log_timeout, b->name); 1492 b->log_timer = gtk_timeout_add(10000, (GtkFunction) log_timeout, b->name);
1515 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER ) 1493 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
1516 gtk_timeout_add(10000, (GtkFunction) BuddyTickerLogonTimeout, b->name); 1494 gtk_timeout_add(10000, (GtkFunction) BuddyTickerLogonTimeout, b->name);
1517 update_num_groups(); 1495 update_num_groups();