changeset 19814:9d198ce0ab65

Making plugins dialog work
author Gabriel Schulhof <nix@go-nix.ca>
date Wed, 08 Aug 2007 19:47:05 +0000
parents 9a31c183b470
children eae5a8fdc055
files libpurple/request.c libpurple/request.h pidgin/gtkblist.c pidgin/gtkconv.c pidgin/gtkdialogs.c pidgin/gtkdialogs.h pidgin/gtkplugin.c pidgin/gtkplugin.h pidgin/gtkrequest.c
diffstat 9 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/request.c	Wed Aug 08 19:19:48 2007 +0000
+++ b/libpurple/request.c	Wed Aug 08 19:47:05 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 *ui_data, void *user_data)
+					void *user_data)
 {
 	PurpleRequestUiOps *ops;
 
@@ -1308,7 +1308,7 @@
 											  fields, ok_text, ok_cb,
 											  cancel_text, cancel_cb,
 											  account, who, conv,
-											  ui_data, user_data);
+											  user_data);
 
 		handles = g_list_append(handles, info);
 
--- a/libpurple/request.h	Wed Aug 08 19:19:48 2007 +0000
+++ b/libpurple/request.h	Wed Aug 08 19:47:05 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 *ui_data, void *user_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 *ui_data, void *user_data);
+						  void *user_data);
 
 /**
  * Closes a request.
--- a/pidgin/gtkblist.c	Wed Aug 08 19:19:48 2007 +0000
+++ b/pidgin/gtkblist.c	Wed Aug 08 19:47:05 2007 +0000
@@ -2850,7 +2850,7 @@
 {
 	/* Buddies menu */
 	{ N_("/_Buddies"), NULL, NULL, 0, "<Branch>", NULL },
-	{ N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_blist_show_with_parent, (int)pidgin_dialogs_im, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW },
+	{ N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_dialogs_im, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW },
 	{ N_("/Buddies/Join a _Chat..."), "<CTL>C", pidgin_blist_joinchat_show, 0, "<Item>", NULL },
 	{ N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO },
 	{ N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL },
@@ -2874,7 +2874,7 @@
 	/* Tools */
 	{ N_("/_Tools"), NULL, NULL, 0, "<Branch>", NULL },
 	{ N_("/Tools/Buddy _Pounces"), NULL, pidgin_pounces_manager_show, 0, "<Item>", NULL },
-	{ N_("/Tools/Plu_gins"), "<CTL>U", pidgin_plugin_dialog_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS },
+	{ N_("/Tools/Plu_gins"), "<CTL>U", pidgin_blist_show_with_parent, (int)pidgin_plugin_dialog_show, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS },
 	{ N_("/Tools/Pr_eferences"), "<CTL>P", pidgin_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES },
 	{ N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "<Item>", NULL },
 	{ "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL },
--- a/pidgin/gtkconv.c	Wed Aug 08 19:19:48 2007 +0000
+++ b/pidgin/gtkconv.c	Wed Aug 08 19:47:05 2007 +0000
@@ -945,7 +945,7 @@
 static void
 menu_new_conv_cb(gpointer data, guint action, GtkWidget *widget)
 {
-	pidgin_dialogs_im(NULL);
+	pidgin_dialogs_im();
 }
 
 static void
--- a/pidgin/gtkdialogs.c	Wed Aug 08 19:19:48 2007 +0000
+++ b/pidgin/gtkdialogs.c	Wed Aug 08 19:47:05 2007 +0000
@@ -714,7 +714,7 @@
 }
 
 void
-pidgin_dialogs_im(GtkWindow *parent)
+pidgin_dialogs_im(void)
 {
 	PurpleRequestFields *fields;
 	PurpleRequestFieldGroup *group;
@@ -746,7 +746,7 @@
 						_("OK"), G_CALLBACK(pidgin_dialogs_im_cb),
 						_("Cancel"), NULL,
 						NULL, NULL, NULL,
-						parent, NULL);
+						NULL);
 }
 
 void
--- a/pidgin/gtkdialogs.h	Wed Aug 08 19:19:48 2007 +0000
+++ b/pidgin/gtkdialogs.h	Wed Aug 08 19:47:05 2007 +0000
@@ -32,7 +32,7 @@
 /* Functions in gtkdialogs.c (these should actually stay in this file) */
 void pidgin_dialogs_destroy_all(void);
 void pidgin_dialogs_about(void);
-void pidgin_dialogs_im(GtkWindow *parent);
+void pidgin_dialogs_im(void);
 void pidgin_dialogs_im_with_user(PurpleAccount *, const char *);
 void pidgin_dialogs_info(void);
 void pidgin_dialogs_log(void);
--- a/pidgin/gtkplugin.c	Wed Aug 08 19:19:48 2007 +0000
+++ b/pidgin/gtkplugin.c	Wed Aug 08 19:47:05 2007 +0000
@@ -513,7 +513,7 @@
 	plugin_dialog_response_cb(dialog, PIDGIN_RESPONSE_CONFIGURE, sel);
 }
 
-void pidgin_plugin_dialog_show()
+void pidgin_plugin_dialog_show(GtkWindow *parent)
 {
 	GtkWidget *sw;
 	GtkWidget *event_view;
@@ -523,6 +523,8 @@
 	GtkTreeSelection *sel;
 
 	if (plugin_dialog != NULL) {
+		if (parent)
+			gtk_window_set_transient_for(GTK_WINDOW(plugin_dialog), parent);
 		gtk_window_present(GTK_WINDOW(plugin_dialog));
 		return;
 	}
@@ -531,6 +533,8 @@
 						    NULL,
 						    GTK_DIALOG_NO_SEPARATOR,
 						    NULL);
+	if (parent)
+		gtk_window_set_transient_for(GTK_WINDOW(plugin_dialog), parent);
 	pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog),
 						_("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE);
 	gtk_dialog_add_button(GTK_DIALOG(plugin_dialog),
--- a/pidgin/gtkplugin.h	Wed Aug 08 19:19:48 2007 +0000
+++ b/pidgin/gtkplugin.h	Wed Aug 08 19:47:05 2007 +0000
@@ -74,6 +74,6 @@
 /**
  * Shows the Plugins dialog
  */
-void pidgin_plugin_dialog_show(void);
+void pidgin_plugin_dialog_show(GtkWindow *parent);
 
 #endif /* _PIDGINPLUGIN_H_ */
--- a/pidgin/gtkrequest.c	Wed Aug 08 19:19:48 2007 +0000
+++ b/pidgin/gtkrequest.c	Wed Aug 08 19:47:05 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 *ui_data, void *user_data)
+						void *user_data)
 {
 	PidginRequestData *data;
 	GtkWidget *win;
@@ -1062,7 +1062,6 @@
 	GtkWidget *button;
 	GtkWidget *img;
 	GtkWidget *sw;
-	GtkWindow *parent = GTK_WINDOW(ui_data);
 	GtkSizeGroup *sg;
 	GList *gl, *fl;
 	PurpleRequestFieldGroup *group;
@@ -1090,8 +1089,6 @@
 #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);