pidgin/gtkdialogs.c

changeset 15562
8c8249fe5e3c
parent 15498
2ee3112b6f24
child 15563
9eea2b8c2846
equal deleted inserted replaced
15561:bdb019a1f485 15562:8c8249fe5e3c
231 {"Hylke Bons", "h.bons@student.rug.nl"}, 231 {"Hylke Bons", "h.bons@student.rug.nl"},
232 {NULL, NULL} 232 {NULL, NULL}
233 }; 233 };
234 234
235 void 235 void
236 gaim_gtkdialogs_destroy_all() 236 pidgindialogs_destroy_all()
237 { 237 {
238 while (dialogwindows) { 238 while (dialogwindows) {
239 gtk_widget_destroy(dialogwindows->data); 239 gtk_widget_destroy(dialogwindows->data);
240 dialogwindows = g_list_remove(dialogwindows, dialogwindows->data); 240 dialogwindows = g_list_remove(dialogwindows, dialogwindows->data);
241 } 241 }
249 } 249 }
250 250
251 /* This function puts the version number onto the pixmap we use in the 'about' 251 /* This function puts the version number onto the pixmap we use in the 'about'
252 * screen in Gaim. */ 252 * screen in Gaim. */
253 static void 253 static void
254 gaim_gtk_logo_versionize(GdkPixbuf **original, GtkWidget *widget) { 254 pidgin_logo_versionize(GdkPixbuf **original, GtkWidget *widget) {
255 GdkPixmap *pixmap; 255 GdkPixmap *pixmap;
256 GtkStyle *style; 256 GtkStyle *style;
257 PangoContext *context; 257 PangoContext *context;
258 PangoLayout *layout; 258 PangoLayout *layout;
259 gchar *markup; 259 gchar *markup;
284 0, 0, 0, 0, 284 0, 0, 0, 0,
285 width, height); 285 width, height);
286 g_object_unref(G_OBJECT(pixmap)); 286 g_object_unref(G_OBJECT(pixmap));
287 } 287 }
288 288
289 void gaim_gtkdialogs_about() 289 void pidgindialogs_about()
290 { 290 {
291 GtkWidget *hbox; 291 GtkWidget *hbox;
292 GtkWidget *vbox; 292 GtkWidget *vbox;
293 GtkWidget *logo; 293 GtkWidget *logo;
294 GtkWidget *frame; 294 GtkWidget *frame;
324 logo = gtk_window_new(GTK_WINDOW_TOPLEVEL); 324 logo = gtk_window_new(GTK_WINDOW_TOPLEVEL);
325 gtk_widget_realize(logo); 325 gtk_widget_realize(logo);
326 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "logo.png", NULL); 326 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "logo.png", NULL);
327 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); 327 pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
328 g_free(filename); 328 g_free(filename);
329 gaim_gtk_logo_versionize(&pixbuf, logo); 329 pidgin_logo_versionize(&pixbuf, logo);
330 gtk_widget_destroy(logo); 330 gtk_widget_destroy(logo);
331 logo = gtk_image_new_from_pixbuf(pixbuf); 331 logo = gtk_image_new_from_pixbuf(pixbuf);
332 gdk_pixbuf_unref(pixbuf); 332 gdk_pixbuf_unref(pixbuf);
333 /* Insert the logo */ 333 /* Insert the logo */
334 obj = gtk_widget_get_accessible(logo); 334 obj = gtk_widget_get_accessible(logo);
335 atk_object_set_description(obj, PIDGIN_NAME " " VERSION); 335 atk_object_set_description(obj, PIDGIN_NAME " " VERSION);
336 gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); 336 gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0);
337 337
338 frame = gaim_gtk_create_imhtml(FALSE, &text, NULL, NULL); 338 frame = pidgin_create_imhtml(FALSE, &text, NULL, NULL);
339 gtk_imhtml_set_format_functions(GTK_IMHTML(text), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY); 339 gtk_imhtml_set_format_functions(GTK_IMHTML(text), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY);
340 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); 340 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
341 341
342 str = g_string_sized_new(4096); 342 str = g_string_sized_new(4096);
343 343
663 gtk_widget_show_all(about); 663 gtk_widget_show_all(about);
664 gtk_window_present(GTK_WINDOW(about)); 664 gtk_window_present(GTK_WINDOW(about));
665 } 665 }
666 666
667 static void 667 static void
668 gaim_gtkdialogs_im_cb(gpointer data, GaimRequestFields *fields) 668 pidgindialogs_im_cb(gpointer data, GaimRequestFields *fields)
669 { 669 {
670 GaimAccount *account; 670 GaimAccount *account;
671 const char *username; 671 const char *username;
672 672
673 account = gaim_request_fields_get_account(fields, "account"); 673 account = gaim_request_fields_get_account(fields, "account");
674 username = gaim_request_fields_get_string(fields, "screenname"); 674 username = gaim_request_fields_get_string(fields, "screenname");
675 675
676 gaim_gtkdialogs_im_with_user(account, username); 676 pidgindialogs_im_with_user(account, username);
677 } 677 }
678 678
679 void 679 void
680 gaim_gtkdialogs_im(void) 680 pidgindialogs_im(void)
681 { 681 {
682 GaimRequestFields *fields; 682 GaimRequestFields *fields;
683 GaimRequestFieldGroup *group; 683 GaimRequestFieldGroup *group;
684 GaimRequestField *field; 684 GaimRequestField *field;
685 685
704 gaim_request_fields(gaim_get_blist(), _("New Instant Message"), 704 gaim_request_fields(gaim_get_blist(), _("New Instant Message"),
705 NULL, 705 NULL,
706 _("Please enter the screen name or alias of the person " 706 _("Please enter the screen name or alias of the person "
707 "you would like to IM."), 707 "you would like to IM."),
708 fields, 708 fields,
709 _("OK"), G_CALLBACK(gaim_gtkdialogs_im_cb), 709 _("OK"), G_CALLBACK(pidgindialogs_im_cb),
710 _("Cancel"), NULL, 710 _("Cancel"), NULL,
711 NULL); 711 NULL);
712 } 712 }
713 713
714 void 714 void
715 gaim_gtkdialogs_im_with_user(GaimAccount *account, const char *username) 715 pidgindialogs_im_with_user(GaimAccount *account, const char *username)
716 { 716 {
717 GaimConversation *conv; 717 GaimConversation *conv;
718 718
719 g_return_if_fail(account != NULL); 719 g_return_if_fail(account != NULL);
720 g_return_if_fail(username != NULL); 720 g_return_if_fail(username != NULL);
722 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, username, account); 722 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, username, account);
723 723
724 if (conv == NULL) 724 if (conv == NULL)
725 conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, username); 725 conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, username);
726 726
727 gaim_gtkconv_present_conversation(conv); 727 pidginconv_present_conversation(conv);
728 } 728 }
729 729
730 static gboolean 730 static gboolean
731 gaim_gtkdialogs_ee(const char *ee) 731 pidgindialogs_ee(const char *ee)
732 { 732 {
733 GtkWidget *window; 733 GtkWidget *window;
734 GtkWidget *hbox; 734 GtkWidget *hbox;
735 GtkWidget *label; 735 GtkWidget *label;
736 GtkWidget *img; 736 GtkWidget *img;
791 gtk_widget_show_all(window); 791 gtk_widget_show_all(window);
792 return TRUE; 792 return TRUE;
793 } 793 }
794 794
795 static void 795 static void
796 gaim_gtkdialogs_info_cb(gpointer data, GaimRequestFields *fields) 796 pidgindialogs_info_cb(gpointer data, GaimRequestFields *fields)
797 { 797 {
798 char *username; 798 char *username;
799 gboolean found = FALSE; 799 gboolean found = FALSE;
800 GaimAccount *account; 800 GaimAccount *account;
801 801
803 803
804 username = g_strdup(gaim_normalize(account, 804 username = g_strdup(gaim_normalize(account,
805 gaim_request_fields_get_string(fields, "screenname"))); 805 gaim_request_fields_get_string(fields, "screenname")));
806 806
807 if (username != NULL && gaim_str_has_suffix(username, "rocksmyworld")) 807 if (username != NULL && gaim_str_has_suffix(username, "rocksmyworld"))
808 found = gaim_gtkdialogs_ee(username); 808 found = pidgindialogs_ee(username);
809 809
810 if (!found && username != NULL && *username != '\0' && account != NULL) 810 if (!found && username != NULL && *username != '\0' && account != NULL)
811 serv_get_info(gaim_account_get_connection(account), username); 811 serv_get_info(gaim_account_get_connection(account), username);
812 812
813 g_free(username); 813 g_free(username);
814 } 814 }
815 815
816 void 816 void
817 gaim_gtkdialogs_info(void) 817 pidgindialogs_info(void)
818 { 818 {
819 GaimRequestFields *fields; 819 GaimRequestFields *fields;
820 GaimRequestFieldGroup *group; 820 GaimRequestFieldGroup *group;
821 GaimRequestField *field; 821 GaimRequestField *field;
822 822
841 gaim_request_fields(gaim_get_blist(), _("Get User Info"), 841 gaim_request_fields(gaim_get_blist(), _("Get User Info"),
842 NULL, 842 NULL,
843 _("Please enter the screen name or alias of the person " 843 _("Please enter the screen name or alias of the person "
844 "whose info you would like to view."), 844 "whose info you would like to view."),
845 fields, 845 fields,
846 _("OK"), G_CALLBACK(gaim_gtkdialogs_info_cb), 846 _("OK"), G_CALLBACK(pidgindialogs_info_cb),
847 _("Cancel"), NULL, 847 _("Cancel"), NULL,
848 NULL); 848 NULL);
849 } 849 }
850 850
851 static void 851 static void
852 gaim_gtkdialogs_log_cb(gpointer data, GaimRequestFields *fields) 852 pidgindialogs_log_cb(gpointer data, GaimRequestFields *fields)
853 { 853 {
854 char *username; 854 char *username;
855 GaimAccount *account; 855 GaimAccount *account;
856 GSList *cur; 856 GSList *cur;
857 857
860 username = g_strdup(gaim_normalize(account, 860 username = g_strdup(gaim_normalize(account,
861 gaim_request_fields_get_string(fields, "screenname"))); 861 gaim_request_fields_get_string(fields, "screenname")));
862 862
863 if (username != NULL && *username != '\0' && account != NULL) 863 if (username != NULL && *username != '\0' && account != NULL)
864 { 864 {
865 GaimGtkBuddyList *gtkblist = gaim_gtk_blist_get_default_gtk_blist(); 865 PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist();
866 GSList *buddies; 866 GSList *buddies;
867 867
868 gaim_gtk_set_cursor(gtkblist->window, GDK_WATCH); 868 pidgin_set_cursor(gtkblist->window, GDK_WATCH);
869 869
870 buddies = gaim_find_buddies(account, username); 870 buddies = gaim_find_buddies(account, username);
871 for (cur = buddies; cur != NULL; cur = cur->next) 871 for (cur = buddies; cur != NULL; cur = cur->next)
872 { 872 {
873 GaimBlistNode *node = cur->data; 873 GaimBlistNode *node = cur->data;
874 if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) 874 if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL)))
875 { 875 {
876 gaim_gtk_log_show_contact((GaimContact *)node->parent); 876 pidgin_log_show_contact((GaimContact *)node->parent);
877 g_slist_free(buddies); 877 g_slist_free(buddies);
878 gaim_gtk_clear_cursor(gtkblist->window); 878 pidgin_clear_cursor(gtkblist->window);
879 g_free(username); 879 g_free(username);
880 return; 880 return;
881 } 881 }
882 } 882 }
883 g_slist_free(buddies); 883 g_slist_free(buddies);
884 884
885 gaim_gtk_log_show(GAIM_LOG_IM, username, account); 885 pidgin_log_show(GAIM_LOG_IM, username, account);
886 886
887 gaim_gtk_clear_cursor(gtkblist->window); 887 pidgin_clear_cursor(gtkblist->window);
888 } 888 }
889 889
890 g_free(username); 890 g_free(username);
891 } 891 }
892 892
893 /* 893 /*
894 * TODO - This needs to deal with logs of all types, not just IM logs. 894 * TODO - This needs to deal with logs of all types, not just IM logs.
895 */ 895 */
896 void 896 void
897 gaim_gtkdialogs_log(void) 897 pidgindialogs_log(void)
898 { 898 {
899 GaimRequestFields *fields; 899 GaimRequestFields *fields;
900 GaimRequestFieldGroup *group; 900 GaimRequestFieldGroup *group;
901 GaimRequestField *field; 901 GaimRequestField *field;
902 902
932 gaim_request_fields(gaim_get_blist(), _("View User Log"), 932 gaim_request_fields(gaim_get_blist(), _("View User Log"),
933 NULL, 933 NULL,
934 _("Please enter the screen name or alias of the person " 934 _("Please enter the screen name or alias of the person "
935 "whose log you would like to view."), 935 "whose log you would like to view."),
936 fields, 936 fields,
937 _("OK"), G_CALLBACK(gaim_gtkdialogs_log_cb), 937 _("OK"), G_CALLBACK(pidgindialogs_log_cb),
938 _("Cancel"), NULL, 938 _("Cancel"), NULL,
939 NULL); 939 NULL);
940 } 940 }
941 941
942 static void 942 static void
943 gaim_gtkdialogs_alias_contact_cb(GaimContact *contact, const char *new_alias) 943 pidgindialogs_alias_contact_cb(GaimContact *contact, const char *new_alias)
944 { 944 {
945 gaim_contact_set_alias(contact, new_alias); 945 gaim_contact_set_alias(contact, new_alias);
946 } 946 }
947 947
948 void 948 void
949 gaim_gtkdialogs_alias_contact(GaimContact *contact) 949 pidgindialogs_alias_contact(GaimContact *contact)
950 { 950 {
951 g_return_if_fail(contact != NULL); 951 g_return_if_fail(contact != NULL);
952 952
953 gaim_request_input(NULL, _("Alias Contact"), NULL, 953 gaim_request_input(NULL, _("Alias Contact"), NULL,
954 _("Enter an alias for this contact."), 954 _("Enter an alias for this contact."),
955 contact->alias, FALSE, FALSE, NULL, 955 contact->alias, FALSE, FALSE, NULL,
956 _("Alias"), G_CALLBACK(gaim_gtkdialogs_alias_contact_cb), 956 _("Alias"), G_CALLBACK(pidgindialogs_alias_contact_cb),
957 _("Cancel"), NULL, contact); 957 _("Cancel"), NULL, contact);
958 } 958 }
959 959
960 static void 960 static void
961 gaim_gtkdialogs_alias_buddy_cb(GaimBuddy *buddy, const char *new_alias) 961 pidgindialogs_alias_buddy_cb(GaimBuddy *buddy, const char *new_alias)
962 { 962 {
963 gaim_blist_alias_buddy(buddy, new_alias); 963 gaim_blist_alias_buddy(buddy, new_alias);
964 serv_alias_buddy(buddy); 964 serv_alias_buddy(buddy);
965 } 965 }
966 966
967 void 967 void
968 gaim_gtkdialogs_alias_buddy(GaimBuddy *buddy) 968 pidgindialogs_alias_buddy(GaimBuddy *buddy)
969 { 969 {
970 gchar *secondary; 970 gchar *secondary;
971 971
972 g_return_if_fail(buddy != NULL); 972 g_return_if_fail(buddy != NULL);
973 973
974 secondary = g_strdup_printf(_("Enter an alias for %s."), buddy->name); 974 secondary = g_strdup_printf(_("Enter an alias for %s."), buddy->name);
975 975
976 gaim_request_input(NULL, _("Alias Buddy"), NULL, 976 gaim_request_input(NULL, _("Alias Buddy"), NULL,
977 secondary, buddy->alias, FALSE, FALSE, NULL, 977 secondary, buddy->alias, FALSE, FALSE, NULL,
978 _("Alias"), G_CALLBACK(gaim_gtkdialogs_alias_buddy_cb), 978 _("Alias"), G_CALLBACK(pidgindialogs_alias_buddy_cb),
979 _("Cancel"), NULL, buddy); 979 _("Cancel"), NULL, buddy);
980 980
981 g_free(secondary); 981 g_free(secondary);
982 } 982 }
983 983
984 static void 984 static void
985 gaim_gtkdialogs_alias_chat_cb(GaimChat *chat, const char *new_alias) 985 pidgindialogs_alias_chat_cb(GaimChat *chat, const char *new_alias)
986 { 986 {
987 gaim_blist_alias_chat(chat, new_alias); 987 gaim_blist_alias_chat(chat, new_alias);
988 } 988 }
989 989
990 void 990 void
991 gaim_gtkdialogs_alias_chat(GaimChat *chat) 991 pidgindialogs_alias_chat(GaimChat *chat)
992 { 992 {
993 g_return_if_fail(chat != NULL); 993 g_return_if_fail(chat != NULL);
994 994
995 gaim_request_input(NULL, _("Alias Chat"), NULL, 995 gaim_request_input(NULL, _("Alias Chat"), NULL,
996 _("Enter an alias for this chat."), 996 _("Enter an alias for this chat."),
997 chat->alias, FALSE, FALSE, NULL, 997 chat->alias, FALSE, FALSE, NULL,
998 _("Alias"), G_CALLBACK(gaim_gtkdialogs_alias_chat_cb), 998 _("Alias"), G_CALLBACK(pidgindialogs_alias_chat_cb),
999 _("Cancel"), NULL, chat); 999 _("Cancel"), NULL, chat);
1000 } 1000 }
1001 1001
1002 static void 1002 static void
1003 gaim_gtkdialogs_remove_contact_cb(GaimContact *contact) 1003 pidgindialogs_remove_contact_cb(GaimContact *contact)
1004 { 1004 {
1005 GaimBlistNode *bnode, *cnode; 1005 GaimBlistNode *bnode, *cnode;
1006 GaimGroup *group; 1006 GaimGroup *group;
1007 1007
1008 cnode = (GaimBlistNode *)contact; 1008 cnode = (GaimBlistNode *)contact;
1014 } 1014 }
1015 gaim_blist_remove_contact(contact); 1015 gaim_blist_remove_contact(contact);
1016 } 1016 }
1017 1017
1018 void 1018 void
1019 gaim_gtkdialogs_remove_contact(GaimContact *contact) 1019 pidgindialogs_remove_contact(GaimContact *contact)
1020 { 1020 {
1021 GaimBuddy *buddy = gaim_contact_get_priority_buddy(contact); 1021 GaimBuddy *buddy = gaim_contact_get_priority_buddy(contact);
1022 1022
1023 g_return_if_fail(contact != NULL); 1023 g_return_if_fail(contact != NULL);
1024 g_return_if_fail(buddy != NULL); 1024 g_return_if_fail(buddy != NULL);
1025 1025
1026 if (((GaimBlistNode*)contact)->child == (GaimBlistNode*)buddy && 1026 if (((GaimBlistNode*)contact)->child == (GaimBlistNode*)buddy &&
1027 !((GaimBlistNode*)buddy)->next) { 1027 !((GaimBlistNode*)buddy)->next) {
1028 gaim_gtkdialogs_remove_buddy(buddy); 1028 pidgindialogs_remove_buddy(buddy);
1029 } else { 1029 } else {
1030 gchar *text; 1030 gchar *text;
1031 text = g_strdup_printf( 1031 text = g_strdup_printf(
1032 ngettext( 1032 ngettext(
1033 "You are about to remove the contact containing %s " 1033 "You are about to remove the contact containing %s "
1037 "and %d other buddies from your buddy list. Do you " 1037 "and %d other buddies from your buddy list. Do you "
1038 "want to continue?", contact->totalsize - 1), 1038 "want to continue?", contact->totalsize - 1),
1039 buddy->name, contact->totalsize - 1); 1039 buddy->name, contact->totalsize - 1);
1040 1040
1041 gaim_request_action(contact, NULL, _("Remove Contact"), text, 0, contact, 2, 1041 gaim_request_action(contact, NULL, _("Remove Contact"), text, 0, contact, 2,
1042 _("_Remove Contact"), G_CALLBACK(gaim_gtkdialogs_remove_contact_cb), 1042 _("_Remove Contact"), G_CALLBACK(pidgindialogs_remove_contact_cb),
1043 _("Cancel"), NULL); 1043 _("Cancel"), NULL);
1044 1044
1045 g_free(text); 1045 g_free(text);
1046 } 1046 }
1047 } 1047 }
1051 g_free(ggp->new_name); 1051 g_free(ggp->new_name);
1052 g_free(ggp); 1052 g_free(ggp);
1053 } 1053 }
1054 1054
1055 static void 1055 static void
1056 gaim_gtkdialogs_merge_groups_cb(struct _GaimGroupMergeObject *GGP) 1056 pidgindialogs_merge_groups_cb(struct _GaimGroupMergeObject *GGP)
1057 { 1057 {
1058 gaim_blist_rename_group(GGP->parent, GGP->new_name); 1058 gaim_blist_rename_group(GGP->parent, GGP->new_name);
1059 free_ggmo(GGP); 1059 free_ggmo(GGP);
1060 } 1060 }
1061 1061
1062 void 1062 void
1063 gaim_gtkdialogs_merge_groups(GaimGroup *source, const char *new_name) 1063 pidgindialogs_merge_groups(GaimGroup *source, const char *new_name)
1064 { 1064 {
1065 gchar *text; 1065 gchar *text;
1066 struct _GaimGroupMergeObject *ggp; 1066 struct _GaimGroupMergeObject *ggp;
1067 1067
1068 g_return_if_fail(source != NULL); 1068 g_return_if_fail(source != NULL);
1075 ggp = g_new(struct _GaimGroupMergeObject, 1); 1075 ggp = g_new(struct _GaimGroupMergeObject, 1);
1076 ggp->parent = source; 1076 ggp->parent = source;
1077 ggp->new_name = g_strdup(new_name); 1077 ggp->new_name = g_strdup(new_name);
1078 1078
1079 gaim_request_action(source, NULL, _("Merge Groups"), text, 0, ggp, 2, 1079 gaim_request_action(source, NULL, _("Merge Groups"), text, 0, ggp, 2,
1080 _("_Merge Groups"), G_CALLBACK(gaim_gtkdialogs_merge_groups_cb), 1080 _("_Merge Groups"), G_CALLBACK(pidgindialogs_merge_groups_cb),
1081 _("Cancel"), G_CALLBACK(free_ggmo)); 1081 _("Cancel"), G_CALLBACK(free_ggmo));
1082 1082
1083 g_free(text); 1083 g_free(text);
1084 } 1084 }
1085 1085
1086 static void 1086 static void
1087 gaim_gtkdialogs_remove_group_cb(GaimGroup *group) 1087 pidgindialogs_remove_group_cb(GaimGroup *group)
1088 { 1088 {
1089 GaimBlistNode *cnode, *bnode; 1089 GaimBlistNode *cnode, *bnode;
1090 1090
1091 cnode = ((GaimBlistNode*)group)->child; 1091 cnode = ((GaimBlistNode*)group)->child;
1092 1092
1119 1119
1120 gaim_blist_remove_group(group); 1120 gaim_blist_remove_group(group);
1121 } 1121 }
1122 1122
1123 void 1123 void
1124 gaim_gtkdialogs_remove_group(GaimGroup *group) 1124 pidgindialogs_remove_group(GaimGroup *group)
1125 { 1125 {
1126 gchar *text; 1126 gchar *text;
1127 1127
1128 g_return_if_fail(group != NULL); 1128 g_return_if_fail(group != NULL);
1129 1129
1130 text = g_strdup_printf(_("You are about to remove the group %s and all its members from your buddy list. Do you want to continue?"), 1130 text = g_strdup_printf(_("You are about to remove the group %s and all its members from your buddy list. Do you want to continue?"),
1131 group->name); 1131 group->name);
1132 1132
1133 gaim_request_action(group, NULL, _("Remove Group"), text, 0, group, 2, 1133 gaim_request_action(group, NULL, _("Remove Group"), text, 0, group, 2,
1134 _("_Remove Group"), G_CALLBACK(gaim_gtkdialogs_remove_group_cb), 1134 _("_Remove Group"), G_CALLBACK(pidgindialogs_remove_group_cb),
1135 _("Cancel"), NULL); 1135 _("Cancel"), NULL);
1136 1136
1137 g_free(text); 1137 g_free(text);
1138 } 1138 }
1139 1139
1140 /* XXX - Some of this should be moved into the core, methinks. */ 1140 /* XXX - Some of this should be moved into the core, methinks. */
1141 static void 1141 static void
1142 gaim_gtkdialogs_remove_buddy_cb(GaimBuddy *buddy) 1142 pidgindialogs_remove_buddy_cb(GaimBuddy *buddy)
1143 { 1143 {
1144 GaimGroup *group; 1144 GaimGroup *group;
1145 gchar *name; 1145 gchar *name;
1146 GaimAccount *account; 1146 GaimAccount *account;
1147 1147
1156 1156
1157 g_free(name); 1157 g_free(name);
1158 } 1158 }
1159 1159
1160 void 1160 void
1161 gaim_gtkdialogs_remove_buddy(GaimBuddy *buddy) 1161 pidgindialogs_remove_buddy(GaimBuddy *buddy)
1162 { 1162 {
1163 gchar *text; 1163 gchar *text;
1164 1164
1165 g_return_if_fail(buddy != NULL); 1165 g_return_if_fail(buddy != NULL);
1166 1166
1167 text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"), 1167 text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"),
1168 buddy->name); 1168 buddy->name);
1169 1169
1170 gaim_request_action(buddy, NULL, _("Remove Buddy"), text, 0, buddy, 2, 1170 gaim_request_action(buddy, NULL, _("Remove Buddy"), text, 0, buddy, 2,
1171 _("_Remove Buddy"), G_CALLBACK(gaim_gtkdialogs_remove_buddy_cb), 1171 _("_Remove Buddy"), G_CALLBACK(pidgindialogs_remove_buddy_cb),
1172 _("Cancel"), NULL); 1172 _("Cancel"), NULL);
1173 1173
1174 g_free(text); 1174 g_free(text);
1175 } 1175 }
1176 1176
1177 static void 1177 static void
1178 gaim_gtkdialogs_remove_chat_cb(GaimChat *chat) 1178 pidgindialogs_remove_chat_cb(GaimChat *chat)
1179 { 1179 {
1180 gaim_blist_remove_chat(chat); 1180 gaim_blist_remove_chat(chat);
1181 } 1181 }
1182 1182
1183 void 1183 void
1184 gaim_gtkdialogs_remove_chat(GaimChat *chat) 1184 pidgindialogs_remove_chat(GaimChat *chat)
1185 { 1185 {
1186 const gchar *name; 1186 const gchar *name;
1187 gchar *text; 1187 gchar *text;
1188 1188
1189 g_return_if_fail(chat != NULL); 1189 g_return_if_fail(chat != NULL);
1191 name = gaim_chat_get_name(chat); 1191 name = gaim_chat_get_name(chat);
1192 text = g_strdup_printf(_("You are about to remove the chat %s from your buddy list. Do you want to continue?"), 1192 text = g_strdup_printf(_("You are about to remove the chat %s from your buddy list. Do you want to continue?"),
1193 name ? name : ""); 1193 name ? name : "");
1194 1194
1195 gaim_request_action(chat, NULL, _("Remove Chat"), text, 0, chat, 2, 1195 gaim_request_action(chat, NULL, _("Remove Chat"), text, 0, chat, 2,
1196 _("_Remove Chat"), G_CALLBACK(gaim_gtkdialogs_remove_chat_cb), 1196 _("_Remove Chat"), G_CALLBACK(pidgindialogs_remove_chat_cb),
1197 _("Cancel"), NULL); 1197 _("Cancel"), NULL);
1198 1198
1199 g_free(text); 1199 g_free(text);
1200 } 1200 }

mercurial