/pidgin/main: ddbc1337332c: Request API refactoring: introduce P...

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue Sep 10 07:06:25 EDT 2013


Changeset: ddbc1337332c01f4ba6ffa1951f223506e4b4957
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2013-09-10 13:06 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/ddbc1337332c

Description:

Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it

diffstat:

 finch/gntblist.c                        |    6 +-
 finch/gntcertmgr.c                      |    3 +-
 finch/gntrequest.c                      |    2 +-
 libpurple/account.c                     |    2 +-
 libpurple/plugins/buddynote.c           |    3 +-
 libpurple/protocols/jabber/buddy.c      |    3 +-
 libpurple/protocols/jabber/chat.c       |    2 +-
 libpurple/protocols/jabber/usernick.c   |    2 +-
 libpurple/protocols/msn/msn.c           |   10 +-
 libpurple/protocols/mxit/actions.c      |    2 +-
 libpurple/protocols/myspace/user.c      |    8 +-
 libpurple/protocols/oscar/oscar.c       |    8 +-
 libpurple/protocols/sametime/sametime.c |    4 +-
 libpurple/protocols/silc/buddy.c        |    2 +-
 libpurple/protocols/silc/chat.c         |    2 +-
 libpurple/protocols/silc/ops.c          |    2 +-
 libpurple/protocols/yahoo/libymsg.c     |    2 +-
 libpurple/request.c                     |  109 ++++++++++++++++++++++++++++--
 libpurple/request.h                     |  112 +++++++++++++++++++++++++++++--
 pidgin/gtkaccount.c                     |    4 +-
 pidgin/gtkblist.c                       |    3 +-
 pidgin/gtkcertmgr.c                     |    2 +-
 pidgin/gtkdialogs.c                     |    4 +-
 pidgin/gtkprivacy.c                     |    4 +-
 pidgin/gtkrequest.c                     |    4 +-
 pidgin/plugins/disco/gtkdisco.c         |    2 +-
 26 files changed, 241 insertions(+), 66 deletions(-)

diffs (truncated from 716 to 300 lines):

diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -853,8 +853,7 @@ finch_request_add_group(void)
 	purple_request_input(NULL, _("Add Group"), NULL, _("Enter the name of the group"),
 			NULL, FALSE, FALSE, NULL,
 			_("Add"), G_CALLBACK(add_group_cb), _("Cancel"), NULL,
-			NULL, NULL, NULL,
-			NULL);
+			NULL, NULL);
 }
 
 static PurpleBlistUiOps blist_ui_ops =
@@ -1406,8 +1405,7 @@ finch_blist_rename_node_cb(PurpleBlistNo
 	purple_request_input(node, text, prompt, _("Enter empty string to reset the name."),
 			name, FALSE, FALSE, NULL, text, G_CALLBACK(rename_blist_node),
 			_("Cancel"), NULL,
-			NULL, NULL, NULL,
-			node);
+			NULL, node);
 
 	g_free(prompt);
 }
diff --git a/finch/gntcertmgr.c b/finch/gntcertmgr.c
--- a/finch/gntcertmgr.c
+++ b/finch/gntcertmgr.c
@@ -89,8 +89,7 @@ tls_peers_mgmt_import_ok_cb(gpointer dat
 				default_hostname, FALSE, FALSE, NULL,
 				_("OK"), G_CALLBACK(tls_peers_mgmt_import_ok2_cb),
 				_("Cancel"), G_CALLBACK(tls_peers_mgmt_import_cancel2_cb),
-				NULL, NULL, NULL,
-				crt);
+				NULL, crt);
 		g_free(default_hostname);
 	} else {
 		gchar * secondary;
diff --git a/finch/gntrequest.c b/finch/gntrequest.c
--- a/finch/gntrequest.c
+++ b/finch/gntrequest.c
@@ -156,7 +156,7 @@ finch_request_input(const char *title, c
 		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,
+		PurpleRequestCommonParameters *cpar,
 		void *user_data)
 {
 	GntWidget *window, *box, *entry;
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -1684,7 +1684,7 @@ purple_account_request_change_user_info(
 					   (purple_connection_get_flags(gc) & PURPLE_CONNECTION_HTML) ? "html" : NULL),
 					   _("Save"), G_CALLBACK(set_user_info_cb),
 					   _("Cancel"), NULL,
-					   account, NULL, NULL,
+					   purple_request_cpar_from_account(account),
 					   account);
 }
 
diff --git a/libpurple/plugins/buddynote.c b/libpurple/plugins/buddynote.c
--- a/libpurple/plugins/buddynote.c
+++ b/libpurple/plugins/buddynote.c
@@ -49,8 +49,7 @@ buddynote_edit_cb(PurpleBlistNode *node,
 					   note, TRUE, FALSE, "html",
 					   _("Save"), G_CALLBACK(do_it_cb),
 					   _("Cancel"), G_CALLBACK(dont_do_it_cb),
-					   NULL, NULL, NULL,
-					   node);
+					   NULL, node);
 }
 
 static void
diff --git a/libpurple/protocols/jabber/buddy.c b/libpurple/protocols/jabber/buddy.c
--- a/libpurple/protocols/jabber/buddy.c
+++ b/libpurple/protocols/jabber/buddy.c
@@ -2284,8 +2284,7 @@ void jabber_user_search_begin(PurplePlug
 			FALSE, FALSE, NULL,
 			_("Search Directory"), PURPLE_CALLBACK(jabber_user_search),
 			_("Cancel"), NULL,
-			NULL, NULL, NULL,
-			js);
+			NULL, js);
 }
 
 gboolean
diff --git a/libpurple/protocols/jabber/chat.c b/libpurple/protocols/jabber/chat.c
--- a/libpurple/protocols/jabber/chat.c
+++ b/libpurple/protocols/jabber/chat.c
@@ -919,7 +919,7 @@ PurpleRoomlist *jabber_roomlist_get_list
 			FALSE, FALSE, NULL,
 			_("Find Rooms"), PURPLE_CALLBACK(roomlist_ok_cb),
 			_("Cancel"), PURPLE_CALLBACK(roomlist_cancel_cb),
-			purple_connection_get_account(gc), NULL, NULL,
+			purple_request_cpar_from_connection(gc),
 			js);
 
 	return js->roomlist;
diff --git a/libpurple/protocols/jabber/usernick.c b/libpurple/protocols/jabber/usernick.c
--- a/libpurple/protocols/jabber/usernick.c
+++ b/libpurple/protocols/jabber/usernick.c
@@ -81,7 +81,7 @@ static void do_nick_got_own_nick_cb(Jabb
 	purple_request_input(js->gc, _("Set User Nickname"), _("Please specify a new nickname for you."),
 		_("This information is visible to all contacts on your contact list, so choose something appropriate."),
 		oldnickname, FALSE, FALSE, NULL, _("Set"), PURPLE_CALLBACK(do_nick_set), _("Cancel"), NULL,
-		purple_connection_get_account(js->gc), NULL, NULL, js);
+		purple_request_cpar_from_connection(js->gc), js);
 	g_free(oldnickname);
 }
 
diff --git a/libpurple/protocols/msn/msn.c b/libpurple/protocols/msn/msn.c
--- a/libpurple/protocols/msn/msn.c
+++ b/libpurple/protocols/msn/msn.c
@@ -451,7 +451,7 @@ msn_show_set_friendly_name(PurplePluginA
 					   purple_connection_get_display_name(gc), FALSE, FALSE, NULL,
 					   _("OK"), G_CALLBACK(msn_act_id),
 					   _("Cancel"), NULL,
-					   account, NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);
 	g_free(tmp);
 }
@@ -654,7 +654,7 @@ msn_show_set_home_phone(PurplePluginActi
 					   msn_user_get_home_phone(session->user), FALSE, FALSE, NULL,
 					   _("OK"), G_CALLBACK(msn_set_home_phone_cb),
 					   _("Cancel"), NULL,
-					   purple_connection_get_account(gc), NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);
 }
 
@@ -671,7 +671,7 @@ msn_show_set_work_phone(PurplePluginActi
 					   msn_user_get_work_phone(session->user), FALSE, FALSE, NULL,
 					   _("OK"), G_CALLBACK(msn_set_work_phone_cb),
 					   _("Cancel"), NULL,
-					   purple_connection_get_account(gc), NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);
 }
 
@@ -688,7 +688,7 @@ msn_show_set_mobile_phone(PurplePluginAc
 					   msn_user_get_mobile_phone(session->user), FALSE, FALSE, NULL,
 					   _("OK"), G_CALLBACK(msn_set_mobile_phone_cb),
 					   _("Cancel"), NULL,
-					   purple_connection_get_account(gc), NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);
 }
 
@@ -793,7 +793,7 @@ show_send_to_mobile_cb(PurpleBlistNode *
 					   NULL, TRUE, FALSE, NULL,
 					   _("Page"), G_CALLBACK(send_to_mobile_cb),
 					   _("Close"), G_CALLBACK(close_mobile_page_cb),
-					   account, name, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   data);
 }
 
diff --git a/libpurple/protocols/mxit/actions.c b/libpurple/protocols/mxit/actions.c
--- a/libpurple/protocols/mxit/actions.c
+++ b/libpurple/protocols/mxit/actions.c
@@ -499,7 +499,7 @@ static void mxit_user_search_action( Pur
 		NULL, FALSE, FALSE, NULL,
 		_( "_Search" ), G_CALLBACK( mxit_user_search_cb ),
 		_( "_Cancel" ), NULL,
-		purple_connection_get_account( gc ), NULL, NULL,
+		purple_request_cpar_from_connection(gc),
 		gc );
 }
 
diff --git a/libpurple/protocols/myspace/user.c b/libpurple/protocols/myspace/user.c
--- a/libpurple/protocols/myspace/user.c
+++ b/libpurple/protocols/myspace/user.c
@@ -834,9 +834,7 @@ static void msim_username_is_available_c
 				"", FALSE, FALSE, NULL,
 				_("OK"), G_CALLBACK(msim_check_username_availability_cb),
 				_("Cancel"), G_CALLBACK(msim_do_not_set_username_cb),
-				session->account,
-				NULL,
-				NULL,
+				purple_request_cpar_from_connection(session->gc),
 				session->gc);
 	}
 }
@@ -895,8 +893,6 @@ void msim_set_username_cb(PurpleConnecti
 			"", FALSE, FALSE, NULL,
 			_("OK"), G_CALLBACK(msim_check_username_availability_cb),
 			_("Cancel"), G_CALLBACK(msim_do_not_set_username_cb),
-			purple_connection_get_account(gc),
-			NULL,
-			NULL,
+			purple_request_cpar_from_connection(gc),
 			gc);
 }
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -1047,7 +1047,7 @@ purple_parse_auth_securid_request(OscarD
 					   FALSE, FALSE, NULL,
 					   _("_OK"), G_CALLBACK(purple_parse_auth_securid_request_yes_cb),
 					   _("_Cancel"), G_CALLBACK(purple_parse_auth_securid_request_no_cb),
-					   account, NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);
 	g_free(primary);
 
@@ -4732,7 +4732,7 @@ static void oscar_buddycb_edit_comment(P
 					   comment_utf8, TRUE, FALSE, NULL,
 					   _("_OK"), G_CALLBACK(oscar_ssi_editcomment),
 					   _("_Cancel"), G_CALLBACK(oscar_free_name_data),
-					   account, data->name, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   data);
 	g_free(title);
 
@@ -5072,7 +5072,7 @@ static void oscar_show_change_email(Purp
 					   FALSE, FALSE, NULL,
 					   _("_OK"), G_CALLBACK(oscar_change_email),
 					   _("_Cancel"), NULL,
-					   purple_connection_get_account(gc), NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);
 }
 
@@ -5129,7 +5129,7 @@ static void oscar_show_find_email(Purple
 					   NULL, FALSE, FALSE, NULL,
 					   _("_Search"), G_CALLBACK(search_by_email_cb),
 					   _("_Cancel"), NULL,
-					   purple_connection_get_account(gc), NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);
 }
 
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -5503,7 +5503,7 @@ static void remote_group_action(PurplePl
 		     FALSE, FALSE, NULL,
 		     _("Add"), G_CALLBACK(remote_group_action_cb),
 		     _("Cancel"), NULL,
-			 purple_connection_get_account(gc), NULL, NULL,
+		     purple_request_cpar_from_connection(gc),
 		     gc);
 }
 
@@ -5628,7 +5628,7 @@ static void search_action(PurplePluginAc
 		     FALSE, FALSE, NULL,
 		     _("Search"), G_CALLBACK(search_action_cb),
 		     _("Cancel"), NULL,
-			 purple_connection_get_account(gc), NULL, NULL,
+		     purple_request_cpar_from_connection(gc),
 			 gc);
 }
 
diff --git a/libpurple/protocols/silc/buddy.c b/libpurple/protocols/silc/buddy.c
--- a/libpurple/protocols/silc/buddy.c
+++ b/libpurple/protocols/silc/buddy.c
@@ -457,7 +457,7 @@ silcpurple_buddy_privkey(PurpleConnectio
 	                     _("Set IM Password"), NULL, FALSE, TRUE, NULL,
 	                     _("OK"), G_CALLBACK(silcpurple_buddy_privkey_cb),
 	                     _("Cancel"), G_CALLBACK(silcpurple_buddy_privkey_cb),
-	                     purple_connection_get_account(gc), NULL, NULL, p);
+	                     purple_request_cpar_from_connection(gc), p);
 
 	silc_client_list_free(sg->client, sg->conn, clients);
 }
diff --git a/libpurple/protocols/silc/chat.c b/libpurple/protocols/silc/chat.c
--- a/libpurple/protocols/silc/chat.c
+++ b/libpurple/protocols/silc/chat.c
@@ -754,7 +754,7 @@ silcpurple_chat_ulimit(PurpleBlistNode *
 			   tmp, FALSE, FALSE, NULL,
 			   _("OK"), G_CALLBACK(silcpurple_chat_ulimit_cb),
 			   _("Cancel"), G_CALLBACK(silcpurple_chat_ulimit_cb),
-			   purple_connection_get_account(gc), NULL, NULL, s);
+			   purple_request_cpar_from_connection(gc), s);
 }
 
 static void
diff --git a/libpurple/protocols/silc/ops.c b/libpurple/protocols/silc/ops.c
--- a/libpurple/protocols/silc/ops.c
+++ b/libpurple/protocols/silc/ops.c
@@ -1833,7 +1833,7 @@ silc_ask_passphrase(SilcClient client, S
 			     _("Passphrase required"), NULL, FALSE, TRUE, NULL,
 			     _("OK"), G_CALLBACK(silc_ask_passphrase_cb),
 			     _("Cancel"), G_CALLBACK(silc_ask_passphrase_cb),
-			     purple_connection_get_account(gc), NULL, NULL, internal);
+			     purple_request_cpar_from_connection(gc), internal);
 }
 
 
diff --git a/libpurple/protocols/yahoo/libymsg.c b/libpurple/protocols/yahoo/libymsg.c
--- a/libpurple/protocols/yahoo/libymsg.c
+++ b/libpurple/protocols/yahoo/libymsg.c
@@ -4210,7 +4210,7 @@ static void yahoo_show_chat_goto(PurpleP
 					   "", FALSE, FALSE, NULL,
 					   _("OK"), G_CALLBACK(yahoo_chat_goto),
 					   _("Cancel"), NULL,
-					   purple_connection_get_account(gc), NULL, NULL,
+					   purple_request_cpar_from_connection(gc),
 					   gc);



More information about the Commits mailing list