comparison finch/gntblist.c @ 16439:08db93bbd798

Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
author Evan Schoenberg <evan.s@dreskin.net>
date Thu, 26 Apr 2007 12:25:49 +0000
parents 4999bbc52881
children 0b97b224a829
comparison
equal deleted inserted replaced
16435:a46a0362dc34 16439:08db93bbd798
311 if (account) 311 if (account)
312 purple_request_field_account_set_value(field, account); 312 purple_request_field_account_set_value(field, account);
313 purple_request_field_group_add_field(group, field); 313 purple_request_field_group_add_field(group, field);
314 314
315 purple_request_fields(NULL, _("Add Buddy"), NULL, _("Please enter buddy information."), 315 purple_request_fields(NULL, _("Add Buddy"), NULL, _("Please enter buddy information."),
316 fields, _("Add"), G_CALLBACK(add_buddy_cb), _("Cancel"), NULL, NULL); 316 fields,
317 _("Add"), G_CALLBACK(add_buddy_cb),
318 _("Cancel"), NULL,
319 account, NULL, NULL,
320 NULL);
317 } 321 }
318 322
319 static void 323 static void
320 add_chat_cb(void *data, PurpleRequestFields *allfields) 324 add_chat_cb(void *data, PurpleRequestFields *allfields)
321 { 325 {
378 field = purple_request_field_string_new("group", _("Group"), grp ? grp->name : NULL, FALSE); 382 field = purple_request_field_string_new("group", _("Group"), grp ? grp->name : NULL, FALSE);
379 purple_request_field_group_add_field(group, field); 383 purple_request_field_group_add_field(group, field);
380 384
381 purple_request_fields(NULL, _("Add Chat"), NULL, 385 purple_request_fields(NULL, _("Add Chat"), NULL,
382 _("You can edit more information from the context menu later."), 386 _("You can edit more information from the context menu later."),
383 fields, _("Add"), G_CALLBACK(add_chat_cb), _("Cancel"), NULL, NULL); 387 fields, _("Add"), G_CALLBACK(add_chat_cb), _("Cancel"), NULL,
388 NULL, NULL, NULL,
389 NULL);
384 } 390 }
385 391
386 static void 392 static void
387 add_group_cb(gpointer null, const char *group) 393 add_group_cb(gpointer null, const char *group)
388 { 394 {
411 static void 417 static void
412 finch_request_add_group() 418 finch_request_add_group()
413 { 419 {
414 purple_request_input(NULL, _("Add Group"), NULL, _("Enter the name of the group"), 420 purple_request_input(NULL, _("Add Group"), NULL, _("Enter the name of the group"),
415 NULL, FALSE, FALSE, NULL, 421 NULL, FALSE, FALSE, NULL,
416 _("Add"), G_CALLBACK(add_group_cb), _("Cancel"), NULL, NULL); 422 _("Add"), G_CALLBACK(add_group_cb), _("Cancel"), NULL,
423 NULL, NULL, NULL,
424 NULL);
417 } 425 }
418 426
419 static PurpleBlistUiOps blist_ui_ops = 427 static PurpleBlistUiOps blist_ui_ops =
420 { 428 {
421 new_list, 429 new_list,
737 } 745 }
738 746
739 g_list_free(parts); 747 g_list_free(parts);
740 748
741 purple_request_fields(NULL, _("Edit Chat"), NULL, _("Please Update the necessary fields."), 749 purple_request_fields(NULL, _("Edit Chat"), NULL, _("Please Update the necessary fields."),
742 fields, _("Edit"), G_CALLBACK(chat_components_edit_ok), _("Cancel"), NULL, chat); 750 fields, _("Edit"), G_CALLBACK(chat_components_edit_ok), _("Cancel"), NULL,
751 NULL, NULL, NULL,
752 chat);
743 } 753 }
744 754
745 static void 755 static void
746 autojoin_toggled(GntMenuItem *item, gpointer data) 756 autojoin_toggled(GntMenuItem *item, gpointer data)
747 { 757 {
925 prompt = g_strdup_printf(_("Please enter the new name for %s"), name); 935 prompt = g_strdup_printf(_("Please enter the new name for %s"), name);
926 936
927 text = PURPLE_BLIST_NODE_IS_GROUP(node) ? _("Rename") : _("Alias"); 937 text = PURPLE_BLIST_NODE_IS_GROUP(node) ? _("Rename") : _("Alias");
928 purple_request_input(node, text, prompt, _("Enter empty string to reset the name."), 938 purple_request_input(node, text, prompt, _("Enter empty string to reset the name."),
929 name, FALSE, FALSE, NULL, text, G_CALLBACK(rename_blist_node), 939 name, FALSE, FALSE, NULL, text, G_CALLBACK(rename_blist_node),
930 _("Cancel"), NULL, node); 940 _("Cancel"), NULL,
941 NULL, NULL, NULL,
942 node);
931 943
932 g_free(prompt); 944 g_free(prompt);
933 } 945 }
934 946
935 /* Xeroxed from gtkdialogs.c:purple_gtkdialogs_remove_group_cb*/ 947 /* Xeroxed from gtkdialogs.c:purple_gtkdialogs_remove_group_cb*/
988 } 1000 }
989 1001
990 static void 1002 static void
991 finch_blist_remove_node_cb(PurpleBlistNode *node, PurpleBlistNode *selected) 1003 finch_blist_remove_node_cb(PurpleBlistNode *node, PurpleBlistNode *selected)
992 { 1004 {
1005 PurpleAccount *account = NULL;
993 char *primary; 1006 char *primary;
994 const char *name, *sec = NULL; 1007 const char *name, *sec = NULL;
995 1008
996 /* XXX: could be a contact */ 1009 /* XXX: could be a contact */
997 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { 1010 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
998 PurpleContact *c = (PurpleContact*)node; 1011 PurpleContact *c = (PurpleContact*)node;
999 name = purple_contact_get_alias(c); 1012 name = purple_contact_get_alias(c);
1000 if (c->totalsize > 1) 1013 if (c->totalsize > 1)
1001 sec = _("Removing this contact will also remove all the buddies in the contact"); 1014 sec = _("Removing this contact will also remove all the buddies in the contact");
1002 } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) 1015 } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
1003 name = purple_buddy_get_name((PurpleBuddy*)node); 1016 name = purple_buddy_get_name((PurpleBuddy*)node);
1004 else if (PURPLE_BLIST_NODE_IS_CHAT(node)) 1017 account = purple_buddy_get_account((PurpleBuddy*)node);
1018 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
1005 name = purple_chat_get_name((PurpleChat*)node); 1019 name = purple_chat_get_name((PurpleChat*)node);
1006 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) 1020 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
1007 {
1008 name = ((PurpleGroup*)node)->name; 1021 name = ((PurpleGroup*)node)->name;
1009 sec = _("Removing this group will also remove all the buddies in the group"); 1022 sec = _("Removing this group will also remove all the buddies in the group");
1010 } 1023 }
1011 else 1024 else
1012 return; 1025 return;
1014 primary = g_strdup_printf(_("Are you sure you want to remove %s?"), name); 1027 primary = g_strdup_printf(_("Are you sure you want to remove %s?"), name);
1015 1028
1016 /* XXX: anything to do with the returned ui-handle? */ 1029 /* XXX: anything to do with the returned ui-handle? */
1017 purple_request_action(node, _("Confirm Remove"), 1030 purple_request_action(node, _("Confirm Remove"),
1018 primary, sec, 1031 primary, sec,
1019 1, node, 2, 1032 1,
1033 account, name, NULL,
1034 node, 2,
1020 _("Remove"), finch_blist_remove_node, 1035 _("Remove"), finch_blist_remove_node,
1021 _("Cancel"), NULL); 1036 _("Cancel"), NULL);
1022 g_free(primary); 1037 g_free(primary);
1023 } 1038 }
1024 1039
2050 _("Please enter the screen name or alias of the person " 2065 _("Please enter the screen name or alias of the person "
2051 "you would like to IM."), 2066 "you would like to IM."),
2052 fields, 2067 fields,
2053 _("OK"), G_CALLBACK(send_im_select_cb), 2068 _("OK"), G_CALLBACK(send_im_select_cb),
2054 _("Cancel"), NULL, 2069 _("Cancel"), NULL,
2070 NULL, NULL, NULL,
2055 NULL); 2071 NULL);
2056 } 2072 }
2057 2073
2058 static void 2074 static void
2059 create_menu() 2075 create_menu()