comparison src/buddy.c @ 2725:f3c094e78609

[gaim-migrate @ 2738] this actually doesn't change anything, unless you want to use gtk2. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 15 Nov 2001 22:47:04 +0000
parents 37d80035e77f
children a9aabf1170f1
comparison
equal deleted inserted replaced
2724:7f3f4aa114ad 2725:f3c094e78609
498 return (TRUE); 498 return (TRUE);
499 } 499 }
500 500
501 #endif 501 #endif
502 502
503 void handle_click_group(GtkWidget *widget, GdkEventButton *event, struct group *g) 503 static int handle_click_group(GtkWidget *widget, GdkEventButton *event, struct group *g)
504 { 504 {
505 if (event->type == GDK_2BUTTON_PRESS) { 505 if (event->type == GDK_2BUTTON_PRESS) {
506 if (GTK_TREE_ITEM(widget)->expanded) 506 if (GTK_TREE_ITEM(widget)->expanded)
507 gtk_tree_item_collapse(GTK_TREE_ITEM(widget)); 507 gtk_tree_item_collapse(GTK_TREE_ITEM(widget));
508 else 508 else
509 gtk_tree_item_expand(GTK_TREE_ITEM(widget)); 509 gtk_tree_item_expand(GTK_TREE_ITEM(widget));
510 } else if ((event->type == GDK_BUTTON_PRESS) && (event->button == 3)) { 510 return TRUE;
511 } 511 }
512
513 return FALSE;
512 } 514 }
513 515
514 void pressed_im_bud(GtkWidget *widget, struct buddy *b) 516 void pressed_im_bud(GtkWidget *widget, struct buddy *b)
515 { 517 {
516 struct conversation *c; 518 struct conversation *c;
583 pbm->callback(pbm->gc, who); 585 pbm->callback(pbm->gc, who);
584 g_list_foreach(first, (GFunc)g_free, NULL); 586 g_list_foreach(first, (GFunc)g_free, NULL);
585 g_list_free(first); 587 g_list_free(first);
586 } 588 }
587 589
588 void handle_click_buddy(GtkWidget *widget, GdkEventButton *event, struct buddy_show *b) 590 static int handle_click_buddy(GtkWidget *widget, GdkEventButton *event, struct buddy_show *b)
589 { 591 {
590 if (!b->connlist) 592 if (!b->connlist)
591 return; 593 return FALSE;
592 if (event->type == GDK_2BUTTON_PRESS && event->button == 1) { 594 if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
593 struct conversation *c; 595 struct conversation *c;
594 596
595 c = find_conversation(b->name); 597 c = find_conversation(b->name);
596 598
706 708
707 } else { 709 } else {
708 710
709 /* Anything for other buttons? :) */ 711 /* Anything for other buttons? :) */
710 } 712 }
713
714 return FALSE;
711 } 715 }
712 716
713 static void un_alias(GtkWidget *a, struct buddy *b) 717 static void un_alias(GtkWidget *a, struct buddy *b)
714 { 718 {
715 struct group *g = find_group_by_buddy(b->gc, b->name); 719 struct group *g = find_group_by_buddy(b->gc, b->name);
732 int row, column; 736 int row, column;
733 GtkWidget *menu; 737 GtkWidget *menu;
734 GtkWidget *button; 738 GtkWidget *button;
735 739
736 if (event->button != 3 || event->type != GDK_BUTTON_PRESS) 740 if (event->button != 3 || event->type != GDK_BUTTON_PRESS)
737 return TRUE; 741 return FALSE;
738 742
739 if (!gtk_clist_get_selection_info(GTK_CLIST(edittree), event->x, event->y, &row, &column)) 743 if (!gtk_clist_get_selection_info(GTK_CLIST(edittree), event->x, event->y, &row, &column))
740 return TRUE; 744 return FALSE;
741 745
742 node = gtk_ctree_node_nth(GTK_CTREE(edittree), row); 746 node = gtk_ctree_node_nth(GTK_CTREE(edittree), row);
743 type = gtk_ctree_node_get_row_data(GTK_CTREE(edittree), node); 747 type = gtk_ctree_node_get_row_data(GTK_CTREE(edittree), node);
744 if (*type == EDIT_GROUP) { 748 if (*type == EDIT_GROUP) {
745 struct group *group = (struct group *)type; 749 struct group *group = (struct group *)type;
750 GTK_SIGNAL_FUNC(show_rename_group), group); 754 GTK_SIGNAL_FUNC(show_rename_group), group);
751 gtk_menu_append(GTK_MENU(menu), button); 755 gtk_menu_append(GTK_MENU(menu), button);
752 gtk_widget_show(button); 756 gtk_widget_show(button);
753 757
754 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time); 758 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
759
760 return TRUE;
755 } else if (*type == EDIT_BUDDY) { 761 } else if (*type == EDIT_BUDDY) {
756 struct buddy *b = (struct buddy *)type; 762 struct buddy *b = (struct buddy *)type;
757 menu = gtk_menu_new(); 763 menu = gtk_menu_new();
758 764
759 button = gtk_menu_item_new_with_label(_("IM")); 765 button = gtk_menu_item_new_with_label(_("IM"));
791 GTK_SIGNAL_FUNC(pressed_log), b->name); 797 GTK_SIGNAL_FUNC(pressed_log), b->name);
792 gtk_menu_append(GTK_MENU(menu), button); 798 gtk_menu_append(GTK_MENU(menu), button);
793 gtk_widget_show(button); 799 gtk_widget_show(button);
794 800
795 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time); 801 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
796 } 802
797 803 return TRUE;
798 return TRUE; 804 }
805
806 return FALSE;
799 } 807 }
800 808
801 809
802 void ui_remove_buddy(struct gaim_connection *gc, struct group *rem_g, struct buddy *rem_b) 810 void ui_remove_buddy(struct gaim_connection *gc, struct group *rem_g, struct buddy *rem_b)
803 { 811 {
2355 gtk_widget_show(blist); 2363 gtk_widget_show(blist);
2356 return; 2364 return;
2357 } 2365 }
2358 2366
2359 #ifdef USE_APPLET 2367 #ifdef USE_APPLET
2360 blist = gtk_window_new(GTK_WINDOW_DIALOG); 2368 GAIM_DIALOG(blist);
2361 #else 2369 #else
2362 blist = gtk_window_new(GTK_WINDOW_TOPLEVEL); 2370 blist = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2363 #endif 2371 #endif
2364 2372
2365 gtk_window_set_wmclass(GTK_WINDOW(blist), "buddy_list", "Gaim"); 2373 gtk_window_set_wmclass(GTK_WINDOW(blist), "buddy_list", "Gaim");