| 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 |
| 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 |
| 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; |
| 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); |