diff src/request.c @ 10229:9aa0b6d11bbf

[gaim-migrate @ 11364] This is a heavily warmenhoved patch from Alceste Scalas. Here's what it changes: If the user drags an image file into the buddy list or conversation, it presents three options (when applicable): Set as buddy icon - sets this image to be the buddy icon for this buddy Send image file - Initiates a file transfer to send this image. Insert in message - Inserts in the gtkimhtml for use as an IM image. If the user drags a .desktop web link, it will insert a hyperlink in the conversation. All other types of .desktop files fail with an error dialog. If anyone can think of better ways to handle any of them, let me know. This also happens to implement gaim_request_choice, which had previously been unimplemented. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 22 Nov 2004 02:57:34 +0000
parents 578986136bac
children f0bc5f121684
line wrap: on
line diff
--- a/src/request.c	Sun Nov 21 20:36:15 2004 +0000
+++ b/src/request.c	Mon Nov 22 02:57:34 2004 +0000
@@ -1139,20 +1139,18 @@
 					const char *secondary, unsigned int default_value,
 					const char *ok_text, GCallback ok_cb,
 					const char *cancel_text, GCallback cancel_cb,
-					void *user_data, size_t choice_count, ...)
+					void *user_data, ...)
 {
 	void *ui_handle;
 	va_list args;
 
 	g_return_val_if_fail(ok_text != NULL,  NULL);
 	g_return_val_if_fail(ok_cb   != NULL,  NULL);
-	g_return_val_if_fail(choice_count > 0, NULL);
 
-	va_start(args, choice_count);
+	va_start(args, user_data);
 	ui_handle = gaim_request_choice_varg(handle, title, primary, secondary,
-										 default_value, ok_text, ok_cb,
-										 cancel_text, cancel_cb, user_data,
-										 choice_count, args);
+					     default_value, ok_text, ok_cb,
+					     cancel_text, cancel_cb, user_data, args);
 	va_end(args);
 
 	return ui_handle;
@@ -1160,18 +1158,16 @@
 
 void *
 gaim_request_choice_varg(void *handle, const char *title,
-						 const char *primary, const char *secondary,
-						 unsigned int default_value,
-						 const char *ok_text, GCallback ok_cb,
-						 const char *cancel_text, GCallback cancel_cb,
-						 void *user_data, size_t choice_count,
-						 va_list choices)
+			 const char *primary, const char *secondary,
+			 unsigned int default_value,
+			 const char *ok_text, GCallback ok_cb,
+			 const char *cancel_text, GCallback cancel_cb,
+			 void *user_data, va_list choices)
 {
 	GaimRequestUiOps *ops;
 
 	g_return_val_if_fail(ok_text != NULL,  NULL);
 	g_return_val_if_fail(ok_cb   != NULL,  NULL);
-	g_return_val_if_fail(choice_count > 0, NULL);
 
 	ops = gaim_request_get_ui_ops();
 
@@ -1182,11 +1178,10 @@
 		info->type      = GAIM_REQUEST_CHOICE;
 		info->handle    = handle;
 		info->ui_handle = ops->request_choice(title, primary, secondary,
-											  default_value,
-											  ok_text, ok_cb,
-											  cancel_text, cancel_cb,
-											  user_data, choice_count,
-											  choices);
+						      default_value,
+						      ok_text, ok_cb,
+						      cancel_text, cancel_cb,
+						      user_data, choices);
 
 		handles = g_list_append(handles, info);