changeset 11358:fb702c34794b

[gaim-migrate @ 13580] New protocol option added. committer: Tailor Script <tailor@pidgin.im>
author Bartoz Oler <bartosz@pidgin.im>
date Sun, 28 Aug 2005 22:18:08 +0000
parents f0bc5f121684
children 9480e0d0f563
files src/gtkaccount.c src/prpl.h
diffstat 2 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkaccount.c	Sun Aug 28 22:16:17 2005 +0000
+++ b/src/gtkaccount.c	Sun Aug 28 22:18:08 2005 +0000
@@ -233,10 +233,17 @@
 	add_user_options(dialog,     dialog->top_vbox);
 	add_protocol_options(dialog, dialog->bottom_vbox);
 
-	if (!dialog->prpl_info || !dialog->prpl_info->register_user)
+	if (!dialog->prpl_info || !dialog->prpl_info->register_user) {
 		gtk_widget_hide(dialog->register_button);
-	else
+	} else {
+		if (dialog->prpl_info != NULL &&
+		   (dialog->prpl_info->options & OPT_PROTO_REGISTER_NOSCREENNAME)) {
+			gtk_widget_set_sensitive(dialog->register_button, TRUE);
+		} else {
+			gtk_widget_set_sensitive(dialog->register_button, FALSE);
+		}
 		gtk_widget_show(dialog->register_button);
+	}
 }
 
 static void
@@ -245,10 +252,13 @@
 	if (dialog->ok_button)
 		gtk_widget_set_sensitive(dialog->ok_button,
 				*gtk_entry_get_text(entry) != '\0');
-	if (dialog->register_button)
-		gtk_widget_set_sensitive(dialog->register_button,
-				*gtk_entry_get_text(entry) != '\0');
-
+	if (dialog->register_button) {
+		if (dialog->prpl_info != NULL && (dialog->prpl_info->options & OPT_PROTO_REGISTER_NOSCREENNAME))
+			gtk_widget_set_sensitive(dialog->register_button, TRUE);
+		else
+			gtk_widget_set_sensitive(dialog->register_button,
+					*gtk_entry_get_text(entry) != '\0');
+	}
 }
 
 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */
--- a/src/prpl.h	Sun Aug 28 22:16:17 2005 +0000
+++ b/src/prpl.h	Sun Aug 28 22:18:08 2005 +0000
@@ -153,7 +153,14 @@
 	 *
 	 * Probably just Jabber and Y!M
 	 */
-	OPT_PROTO_USE_POINTSIZE = 0x00000100
+	OPT_PROTO_USE_POINTSIZE = 0x00000100,
+
+	/**
+	 * Set the Register button active when screenname is not given.
+	 *
+	 * Gadu-Gadu doesn't need a screenname to register new account.
+	 */
+	OPT_PROTO_REGISTER_NOSCREENNAME = 0x00000200,
 
 } GaimProtocolOptions;