comparison src/buddy.c @ 920:972a180e9429

[gaim-migrate @ 930] yay committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 16 Sep 2000 00:40:24 +0000
parents 8de59874f5ce
children d2e865d64dd8
comparison
equal deleted inserted replaced
919:2999319f9eca 920:972a180e9429
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
889 888
890 struct group *add_group(char *group) 889 struct group *add_group(char *group)
891 { 890 {
892 struct group *g = find_group(group); 891 struct group *g = find_group(group);
893 if (g) 892 if (g)
1314 1313
1315 b->log_timer = 0; 1314 b->log_timer = 0;
1316 1315
1317 if (!b->present) { 1316 if (!b->present) {
1318 int count = 0; 1317 int count = 0;
1319 gtk_widget_hide(b->item);
1320 g = find_group_by_buddy(name); 1318 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 }
1321 mem = g->members; 1324 mem = g->members;
1322 while (mem) { 1325 while (mem) {
1323 b = (struct buddy *)mem->data; 1326 b = (struct buddy *)mem->data;
1324 if (b->present) { 1327 if (b->present) {
1325 count++; 1328 count++;
1483 1486
1484 } 1487 }
1485 } 1488 }
1486 1489
1487 1490
1488 { struct group *g = find_group_by_buddy(b->name); 1491 {
1489 gtk_widget_show(g->item); } 1492 struct group *g = find_group_by_buddy(b->name);
1490 gtk_widget_show(b->item); 1493 gtk_widget_show(g->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 }
1491 gtk_widget_show(b->label); 1513 gtk_widget_show(b->label);
1492 b->log_timer = gtk_timeout_add(10000, (GtkFunction) log_timeout, b->name); 1514 b->log_timer = gtk_timeout_add(10000, (GtkFunction) log_timeout, b->name);
1493 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER ) 1515 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
1494 gtk_timeout_add(10000, (GtkFunction) BuddyTickerLogonTimeout, b->name); 1516 gtk_timeout_add(10000, (GtkFunction) BuddyTickerLogonTimeout, b->name);
1495 update_num_groups(); 1517 update_num_groups();