changeset 19813:9a31c183b470

Adding parameter void *ui_data for parent window
author Gabriel Schulhof <nix@go-nix.ca>
date Wed, 08 Aug 2007 19:19:48 +0000
parents c11c4afe9024
children 9d198ce0ab65
files libpurple/request.c libpurple/request.h pidgin/gtkdialogs.c pidgin/gtkrequest.c
diffstat 4 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/request.c	Wed Aug 08 18:56:57 2007 +0000
+++ b/libpurple/request.c	Wed Aug 08 19:19:48 2007 +0000
@@ -1288,7 +1288,7 @@
 					const char *ok_text, GCallback ok_cb,
 					const char *cancel_text, GCallback cancel_cb,
 					PurpleAccount *account, const char *who, PurpleConversation *conv,
-					void *user_data)
+					void *ui_data, void *user_data)
 {
 	PurpleRequestUiOps *ops;
 
@@ -1308,7 +1308,7 @@
 											  fields, ok_text, ok_cb,
 											  cancel_text, cancel_cb,
 											  account, who, conv,
-											  user_data);
+											  ui_data, user_data);
 
 		handles = g_list_append(handles, info);
 
--- a/libpurple/request.h	Wed Aug 08 18:56:57 2007 +0000
+++ b/libpurple/request.h	Wed Aug 08 19:19:48 2007 +0000
@@ -205,7 +205,7 @@
 							const char *ok_text, GCallback ok_cb,
 							const char *cancel_text, GCallback cancel_cb,
 							PurpleAccount *account, const char *who, PurpleConversation *conv,
-							void *user_data);
+							void *ui_data, void *user_data);
 	void *(*request_file)(const char *title, const char *filename,
 						  gboolean savedialog, GCallback ok_cb, GCallback cancel_cb,
 						  PurpleAccount *account, const char *who, PurpleConversation *conv,
@@ -1349,7 +1349,7 @@
 						  const char *ok_text, GCallback ok_cb,
 						  const char *cancel_text, GCallback cancel_cb,
 						  PurpleAccount *account, const char *who, PurpleConversation *conv,
-						  void *user_data);
+						  void *ui_data, void *user_data);
 
 /**
  * Closes a request.
--- a/pidgin/gtkdialogs.c	Wed Aug 08 18:56:57 2007 +0000
+++ b/pidgin/gtkdialogs.c	Wed Aug 08 19:19:48 2007 +0000
@@ -738,7 +738,6 @@
 	purple_request_field_set_required(field, TRUE);
 	purple_request_field_group_add_field(group, field);
 
-	g_print("pidgin_dialogs_im: Calling purple_request_fields\n");
 	purple_request_fields(purple_get_blist(), _("New Instant Message"),
 						NULL,
 						_("Please enter the screen name or alias of the person "
@@ -747,8 +746,7 @@
 						_("OK"), G_CALLBACK(pidgin_dialogs_im_cb),
 						_("Cancel"), NULL,
 						NULL, NULL, NULL,
-						NULL);
-	g_print("pidgin_dialogs_im: Called purple_request_fields\n");
+						parent, NULL);
 }
 
 void
--- a/pidgin/gtkrequest.c	Wed Aug 08 18:56:57 2007 +0000
+++ b/pidgin/gtkrequest.c	Wed Aug 08 19:19:48 2007 +0000
@@ -1048,7 +1048,7 @@
 						const char *ok_text, GCallback ok_cb,
 						const char *cancel_text, GCallback cancel_cb,
 					    PurpleAccount *account, const char *who, PurpleConversation *conv,
-						void *user_data)
+						void *ui_data, void *user_data)
 {
 	PidginRequestData *data;
 	GtkWidget *win;
@@ -1062,6 +1062,7 @@
 	GtkWidget *button;
 	GtkWidget *img;
 	GtkWidget *sw;
+	GtkWindow *parent = GTK_WINDOW(ui_data);
 	GtkSizeGroup *sg;
 	GList *gl, *fl;
 	PurpleRequestFieldGroup *group;
@@ -1089,6 +1090,8 @@
 #else /* !_WIN32 */
 	data->dialog = win = pidgin_create_window(title, PIDGIN_HIG_BORDER, "multifield", TRUE) ;
 #endif /* _WIN32 */
+	if (parent)
+		gtk_window_set_transient_for(GTK_WINDOW(data->dialog), parent);
 
 	g_signal_connect(G_OBJECT(win), "delete_event",
 					 G_CALLBACK(destroy_multifield_cb), data);