diff libpurple/request.c @ 21074:5908daa7dfe3

propagate from branch 'im.pidgin.pidgin' (head 584deef31dde531d5eb5786f3f0a24d55128e8dd) to branch 'org.maemo.garage.pidgin.pidgin.dialog-transience' (head abd196aa0518c9c5ade0bf2c3a1d5bbafc726028)
author Gabriel Schulhof <nix@go-nix.ca>
date Sat, 06 Oct 2007 22:27:01 +0000
parents bd1426679f36
children 8c9aad9479c0 0b67d509a305
line wrap: on
line diff
--- a/libpurple/request.c	Sat Oct 06 18:08:21 2007 +0000
+++ b/libpurple/request.c	Sat Oct 06 22:27:01 2007 +0000
@@ -1142,6 +1142,20 @@
 				   PurpleAccount *account, const char *who, PurpleConversation *conv,
 				   void *user_data)
 {
+	return purple_request_input_with_hint(
+		handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, ok_cb,
+		cancel_text, cancel_cb, account, who, conv, "blist", user_data);
+}
+
+void *
+purple_request_input_with_hint(void *handle, const char *title, const char *primary,
+				   const char *secondary, const char *default_value,
+				   gboolean multiline, gboolean masked, gchar *hint,
+				   const char *ok_text, GCallback ok_cb,
+				   const char *cancel_text, GCallback cancel_cb,
+				   PurpleAccount *account, const char *who, PurpleConversation *conv,
+				   const char *ui_hint, void *user_data)
+{
 	PurpleRequestUiOps *ops;
 
 	g_return_val_if_fail(ok_text != NULL, NULL);
@@ -1161,7 +1175,7 @@
 											 ok_text, ok_cb,
 											 cancel_text, cancel_cb,
 											 account, who, conv,
-											 user_data);
+											 ui_hint, user_data);
 
 		handles = g_list_append(handles, info);
 
@@ -1186,10 +1200,34 @@
 	g_return_val_if_fail(ok_cb   != NULL,  NULL);
 
 	va_start(args, user_data);
-	ui_handle = purple_request_choice_varg(handle, title, primary, secondary,
+	ui_handle = purple_request_choice_varg_with_hint(handle, title, primary, secondary,
 					     default_value, ok_text, ok_cb,
 					     cancel_text, cancel_cb,
-					     account, who, conv, user_data, args);
+					     account, who, conv, "blist", user_data, args);
+	va_end(args);
+
+	return ui_handle;
+}
+
+void *
+purple_request_choice_with_hint(void *handle, const char *title, const char *primary,
+					const char *secondary, int default_value,
+					const char *ok_text, GCallback ok_cb,
+					const char *cancel_text, GCallback cancel_cb,
+					PurpleAccount *account, const char *who, PurpleConversation *conv,
+					const char *ui_hint, 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);
+
+	va_start(args, user_data);
+	ui_handle = purple_request_choice_varg_with_hint(handle, title, primary, secondary,
+					     default_value, ok_text, ok_cb,
+					     cancel_text, cancel_cb,
+					     account, who, conv, ui_hint, user_data, args);
 	va_end(args);
 
 	return ui_handle;
@@ -1204,6 +1242,20 @@
 			 PurpleAccount *account, const char *who, PurpleConversation *conv,
 			 void *user_data, va_list choices)
 {
+	return purple_request_choice_varg_with_hint(
+		handle, title, primary, secondary, default_value, ok_text, ok_cb,
+		cancel_text, cancel_cb, account, who, conv, "blist", user_data, choices);
+}
+
+void *
+purple_request_choice_varg_with_hint(void *handle, const char *title,
+			 const char *primary, const char *secondary,
+			 int default_value,
+			 const char *ok_text, GCallback ok_cb,
+			 const char *cancel_text, GCallback cancel_cb,
+			 PurpleAccount *account, const char *who, PurpleConversation *conv,
+			 const char *ui_hint, void *user_data, va_list choices)
+{
 	PurpleRequestUiOps *ops;
 
 	g_return_val_if_fail(ok_text != NULL,  NULL);
@@ -1222,7 +1274,7 @@
 						      ok_text, ok_cb,
 						      cancel_text, cancel_cb,
 							  account, who, conv,
-						      user_data, choices);
+						      ui_hint, user_data, choices);
 
 		handles = g_list_append(handles, info);
 
@@ -1244,9 +1296,29 @@
 	g_return_val_if_fail(action_count > 0, NULL);
 
 	va_start(args, action_count);
-	ui_handle = purple_request_action_varg(handle, title, primary, secondary,
+	ui_handle = purple_request_action_varg_with_hint(handle, title, primary, secondary,
 										 default_action, account, who, conv,
-										 user_data, action_count, args);
+										 "blist", user_data, action_count, args);
+	va_end(args);
+
+	return ui_handle;
+}
+
+void *
+purple_request_action_with_hint(void *handle, const char *title, const char *primary,
+					const char *secondary, int default_action,
+					PurpleAccount *account, const char *who, PurpleConversation *conv,
+					const char *ui_hint, void *user_data, size_t action_count, ...)
+{
+	void *ui_handle;
+	va_list args;
+
+	g_return_val_if_fail(action_count > 0, NULL);
+
+	va_start(args, action_count);
+	ui_handle = purple_request_action_varg_with_hint(handle, title, primary, secondary,
+										 default_action, account, who, conv,
+										 ui_hint, user_data, action_count, args);
 	va_end(args);
 
 	return ui_handle;
@@ -1257,7 +1329,19 @@
 						 const char *primary, const char *secondary,
 						 int default_action,
 						 PurpleAccount *account, const char *who, PurpleConversation *conv,
-						  void *user_data, size_t action_count, va_list actions)
+						 void *user_data, size_t action_count, va_list actions)
+{
+	return purple_request_action_varg_with_hint(
+		handle, title, primary, secondary, default_action, account, who, conv,
+		"blist", user_data, action_count, actions);
+}
+
+void *
+purple_request_action_varg_with_hint(void *handle, const char *title,
+						 const char *primary, const char *secondary,
+						 int default_action,
+						 PurpleAccount *account, const char *who, PurpleConversation *conv,
+						 const char *ui_hint, void *user_data, size_t action_count, va_list actions)
 {
 	PurpleRequestUiOps *ops;
 
@@ -1273,7 +1357,7 @@
 		info->handle    = handle;
 		info->ui_handle = ops->request_action(title, primary, secondary,
 											  default_action, account, who, conv,
-											  user_data, action_count, actions);
+											  ui_hint, user_data, action_count, actions);
 
 		handles = g_list_append(handles, info);
 
@@ -1291,6 +1375,19 @@
 					PurpleAccount *account, const char *who, PurpleConversation *conv,
 					void *user_data)
 {
+	return purple_request_fields_with_hint(
+		handle, title, primary, secondary, fields, ok_text, ok_cb,
+		cancel_text, cancel_cb, account, who, conv, "blist", user_data);
+}
+
+void *
+purple_request_fields_with_hint(void *handle, const char *title, const char *primary,
+					const char *secondary, PurpleRequestFields *fields,
+					const char *ok_text, GCallback ok_cb,
+					const char *cancel_text, GCallback cancel_cb,
+					PurpleAccount *account, const char *who, PurpleConversation *conv,
+					const char *ui_hint, void *user_data)
+{
 	PurpleRequestUiOps *ops;
 
 	g_return_val_if_fail(fields  != NULL, NULL);
@@ -1309,7 +1406,7 @@
 											  fields, ok_text, ok_cb,
 											  cancel_text, cancel_cb,
 											  account, who, conv,
-											  user_data);
+											  ui_hint, user_data);
 
 		handles = g_list_append(handles, info);
 
@@ -1326,6 +1423,17 @@
 				  PurpleAccount *account, const char *who, PurpleConversation *conv,
 				  void *user_data)
 {
+	return purple_request_file_with_hint(
+		handle, title, filename, savedialog, ok_cb, cancel_cb, account, who, conv, "blist", user_data);
+}
+
+void *
+purple_request_file_with_hint(void *handle, const char *title, const char *filename,
+				  gboolean savedialog,
+				  GCallback ok_cb, GCallback cancel_cb,
+				  PurpleAccount *account, const char *who, PurpleConversation *conv,
+				  const char *ui_hint, void *user_data)
+{
 	PurpleRequestUiOps *ops;
 
 	ops = purple_request_get_ui_ops();
@@ -1338,7 +1446,7 @@
 		info->handle    = handle;
 		info->ui_handle = ops->request_file(title, filename, savedialog,
 											ok_cb, cancel_cb,
-											account, who, conv, user_data);
+											account, who, conv, ui_hint, user_data);
 		handles = g_list_append(handles, info);
 		return info->ui_handle;
 	}
@@ -1352,6 +1460,16 @@
 				  PurpleAccount *account, const char *who, PurpleConversation *conv,
 				  void *user_data)
 {
+	return purple_request_folder_with_hint(
+		handle, title, dirname, ok_cb, cancel_cb, account, who, conv, "blist", user_data);
+}
+
+void *
+purple_request_folder_with_hint(void *handle, const char *title, const char *dirname,
+				  GCallback ok_cb, GCallback cancel_cb,
+				  PurpleAccount *account, const char *who, PurpleConversation *conv,
+				  const char *ui_hint, void *user_data)
+{
 	PurpleRequestUiOps *ops;
 
 	ops = purple_request_get_ui_ops();
@@ -1365,7 +1483,7 @@
 		info->ui_handle = ops->request_folder(title, dirname,
 											ok_cb, cancel_cb,
 											account, who, conv,
-											user_data);
+											ui_hint, user_data);
 		handles = g_list_append(handles, info);
 		return info->ui_handle;
 	}