changeset 6035:8c44020a958e

[gaim-migrate @ 6485] gaim_request_input() now takes a masked bool, which, if enabled, masks the text on the entry field so that it cannot be seen. Good for password input requests, and what do you know, that's why this is written! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 05 Jul 2003 21:54:19 +0000
parents 5a0060191a77
children 547ba881bc7e
files src/gtkrequest.c src/protocols/irc/irc.c src/protocols/msn/msn.c src/protocols/oscar/oscar.c src/protocols/yahoo/yahoo.c src/request.c src/request.h
diffstat 7 files changed, 25 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkrequest.c	Sat Jul 05 20:52:43 2003 +0000
+++ b/src/gtkrequest.c	Sat Jul 05 21:54:19 2003 +0000
@@ -180,7 +180,7 @@
 void *
 gaim_gtk_request_input(const char *title, const char *primary,
 					   const char *secondary, const char *default_value,
-					   gboolean multiline,
+					   gboolean multiline, gboolean masked,
 					   const char *ok_text, GCallback ok_cb,
 					   const char *cancel_text, GCallback cancel_cb,
 					   void *user_data)
@@ -288,6 +288,9 @@
 
 		if (default_value != NULL)
 			gtk_entry_set_text(GTK_ENTRY(entry), default_value);
+
+		if (masked)
+			gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
 	}
 
 	data->u.input.entry = entry;
--- a/src/protocols/irc/irc.c	Sat Jul 05 20:52:43 2003 +0000
+++ b/src/protocols/irc/irc.c	Sat Jul 05 21:54:19 2003 +0000
@@ -1097,7 +1097,8 @@
 	case 433:
 		gaim_request_input(gc, NULL, _("That nick is already in use.  "
 									   "Please enter a new nick"),
-						   NULL, gaim_connection_get_display_name(gc), FALSE,
+						   NULL, gaim_connection_get_display_name(gc),
+						   FALSE, FALSE,
 						   _("OK"), G_CALLBACK(irc_change_nick),
 						   _("Cancel"), NULL, gc);
 		break;
--- a/src/protocols/msn/msn.c	Sat Jul 05 20:52:43 2003 +0000
+++ b/src/protocols/msn/msn.c	Sat Jul 05 21:54:19 2003 +0000
@@ -166,7 +166,7 @@
 	gaim_request_input(gc, NULL, _("Set your friendly name."),
 					   _("This is the name that other MSN buddies will "
 						 "see you as."),
-					   gaim_connection_get_display_name(gc), FALSE,
+					   gaim_connection_get_display_name(gc), FALSE, FALSE,
 					   _("OK"), G_CALLBACK(msn_act_id),
 					   _("Cancel"), NULL, gc);
 }
@@ -177,7 +177,7 @@
 	MsnSession *session = gc->proto_data;
 
 	gaim_request_input(gc, NULL, _("Set your home phone number."), NULL,
-					   msn_user_get_home_phone(session->user), FALSE,
+					   msn_user_get_home_phone(session->user), FALSE, FALSE,
 					   _("OK"), G_CALLBACK(msn_set_home_phone_cb),
 					   _("Cancel"), NULL, gc);
 }
@@ -188,7 +188,7 @@
 	MsnSession *session = gc->proto_data;
 
 	gaim_request_input(gc, NULL, _("Set your work phone number."), NULL,
-					   msn_user_get_work_phone(session->user), FALSE,
+					   msn_user_get_work_phone(session->user), FALSE, FALSE,
 					   _("OK"), G_CALLBACK(msn_set_work_phone_cb),
 					   _("Cancel"), NULL, gc);
 }
@@ -199,7 +199,7 @@
 	MsnSession *session = gc->proto_data;
 
 	gaim_request_input(gc, NULL, _("Set your mobile phone number."), NULL,
-					   msn_user_get_mobile_phone(session->user), FALSE,
+					   msn_user_get_mobile_phone(session->user), FALSE, FALSE,
 					   _("OK"), G_CALLBACK(msn_set_mobile_phone_cb),
 					   _("Cancel"), NULL, gc);
 }
@@ -231,7 +231,7 @@
 	data->passport = passport;
 
 	gaim_request_input(gc, NULL, _("Send a mobile message."), NULL,
-					   NULL, TRUE,
+					   NULL, TRUE, FALSE,
 					   _("Page"), G_CALLBACK(send_to_mobile_cb),
 					   _("Close"), G_CALLBACK(close_mobile_page_cb),
 					   data);
--- a/src/protocols/oscar/oscar.c	Sat Jul 05 20:52:43 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Jul 05 21:54:19 2003 +0000
@@ -2434,7 +2434,7 @@
 
 static void gaim_auth_request_msgprompt(struct name_data *data) {
 	gaim_request_input(data->gc, NULL, _("Authorization Request Message:"),
-					   NULL, _("Please authorize me!"), TRUE,
+					   NULL, _("Please authorize me!"), TRUE, FALSE,
 					   _("OK"), G_CALLBACK(gaim_auth_request),
 					   _("Cancel"), G_CALLBACK(oscar_free_name_data),
 					   data);
@@ -2514,7 +2514,7 @@
 
 static void gaim_auth_dontgrant_msgprompt(struct name_data *data) {
 	gaim_request_input(data->gc, NULL, _("Authorization Denied Message:"),
-					   NULL, _("No reason given."), TRUE,
+					   NULL, _("No reason given."), TRUE, FALSE,
 					   _("OK"), G_CALLBACK(gaim_auth_dontgrant),
 					   _("Cancel"), G_CALLBACK(oscar_free_name_data),
 					   data);
@@ -5926,7 +5926,7 @@
 static void oscar_show_format_screenname(GaimConnection *gc)
 {
 	gaim_request_input(gc, NULL, _("New screenname formatting:"), NULL,
-					   gaim_connection_get_display_name(gc), FALSE,
+					   gaim_connection_get_display_name(gc), FALSE, FALSE,
 					   _("OK"), G_CALLBACK(oscar_format_screenname),
 					   _("Cancel"), NULL,
 					   gc);
@@ -5974,7 +5974,8 @@
 
 static void oscar_show_change_email(GaimConnection *gc)
 {
-	gaim_request_input(gc, NULL, _("Change Address To:"), NULL, NULL, FALSE,
+	gaim_request_input(gc, NULL, _("Change Address To:"), NULL, NULL,
+					   FALSE, FALSE,
 					   _("OK"), G_CALLBACK(oscar_change_email),
 					   _("Cancel"), NULL,
 					   gc);
@@ -6034,7 +6035,7 @@
 static void oscar_show_setavailmsg(GaimConnection *gc)
 {
 	gaim_request_input(gc, NULL, _("Available Message:"),
-					   NULL, _("Please talk to me, I'm lonely! (and single)"), TRUE,
+					   NULL, _("Please talk to me, I'm lonely! (and single)"), TRUE, FALSE,
 					   _("OK"), G_CALLBACK(oscar_setavailmsg),
 					   _("Cancel"), NULL,
 					   gc);
--- a/src/protocols/yahoo/yahoo.c	Sat Jul 05 20:52:43 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sat Jul 05 21:54:19 2003 +0000
@@ -1178,7 +1178,7 @@
 static void yahoo_show_act_id(GaimConnection *gc)
 {
 	gaim_request_input(gc, NULL, _("Active which ID?"), NULL,
-					   gaim_connection_get_display_name(gc), FALSE,
+					   gaim_connection_get_display_name(gc), FALSE, FALSE,
 					   _("OK"), G_CALLBACK(yahoo_act_id),
 					   _("Cancel"), NULL, gc);
 }
--- a/src/request.c	Sat Jul 05 20:52:43 2003 +0000
+++ b/src/request.c	Sat Jul 05 21:54:19 2003 +0000
@@ -581,7 +581,7 @@
 void *
 gaim_request_input(void *handle, const char *title, const char *primary,
 				   const char *secondary, const char *default_value,
-				   gboolean multiline,
+				   gboolean multiline, gboolean masked,
 				   const char *ok_text, GCallback ok_cb,
 				   const char *cancel_text, GCallback cancel_cb,
 				   void *user_data)
@@ -601,7 +601,8 @@
 		info->type      = GAIM_REQUEST_INPUT;
 		info->handle    = handle;
 		info->ui_handle = ops->request_input(title, primary, secondary,
-											 default_value, multiline,
+											 default_value,
+											 multiline, masked,
 											 ok_text, ok_cb,
 											 cancel_text, cancel_cb,
 											 user_data);
--- a/src/request.h	Sat Jul 05 20:52:43 2003 +0000
+++ b/src/request.h	Sat Jul 05 21:54:19 2003 +0000
@@ -132,7 +132,7 @@
 {
 	void *(*request_input)(const char *title, const char *primary,
 						   const char *secondary, const char *default_value,
-						   gboolean multiline,
+						   gboolean multiline, gboolean masked,
 						   const char *ok_text, GCallback ok_cb,
 						   const char *cancel_text, GCallback cancel_cb,
 						   void *user_data);
@@ -642,6 +642,7 @@
  * @param secondary     The secondary information.
  * @param default_value The default value.
  * @param multiline     TRUE if the inputted text can span multiple lines.
+ * @param masked        TRUE if the inputted text should be masked in some way.
  * @param ok_text       The text for the OK button.
  * @param ok_cb         The callback for the OK button.
  * @param cancel_text   The text for the cancel button.
@@ -652,7 +653,8 @@
  */
 void *gaim_request_input(void *handle, const char *title,
 						 const char *primary, const char *secondary,
-						 const char *default_value, gboolean multiline,
+						 const char *default_value,
+						 gboolean multiline, gboolean masked,
 						 const char *ok_text, GCallback ok_cb,
 						 const char *cancel_text, GCallback cancel_cb,
 						 void *user_data);