changeset 2100:a93aeb6f813d

[gaim-migrate @ 2110] implemented OPT_PROTO_NO_PASSWORD. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 01 Aug 2001 19:11:42 +0000
parents 33a3b6b903d9
children dd3aa315519d
files ChangeLog TODO src/gaim.h src/multi.c src/protocols/irc/irc.c src/protocols/zephyr/zephyr.c src/prpl.h
diffstat 7 files changed, 53 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Aug 01 18:33:25 2001 +0000
+++ b/ChangeLog	Wed Aug 01 19:11:42 2001 +0000
@@ -1,12 +1,14 @@
 GAIM: The Pimpin' Penguin IM Clone thats good for the soul! 
 
-version 0.11.0-pre15:
+version 0.11.0:
 	* MSN works again
 	* Fixed a little segfault when images are links
 	* Redid the about box again.
 	* Fixed a nice little bug with the manual browser command
 	* Oscar Unicode fix (Thanks John Matthews)
 	* Added Russian Translation
+	* Can select which protocols are compiled statically
+	  (e.g.: ./configure --with-static-prpls=oscar,jabber)
 
 version 0.11.0-pre14 (06/17/2001):
 	* Fixed a segfault with Oscar's account confirmation
--- a/TODO	Wed Aug 01 18:33:25 2001 +0000
+++ b/TODO	Wed Aug 01 19:11:42 2001 +0000
@@ -1,13 +1,9 @@
---- STUFF FOR 0.11.0 RELEASE ---
-
 THE CORE:
 	Status labels in buddy list (mostly just for yahoo/msn)
 	Transparency for GtkIMHtml
 	GPG Encryption of messages
 	Better way of showing away state - and possibly in main window
 	Implement:
-		OPT_PROTO_NO_PASSWORD (mainly for IRC/Zephyr) - should hide password
-			dialog in account editor
 		OPT_PROTO_MAILCHECK (mainly for Yahoo/MSN) - with appropriate toggle
 			on account editor modify thing for whether or not to display
 			it (and also move Yahoo/MSN dialog to prpl.c and have both of
--- a/src/gaim.h	Wed Aug 01 18:33:25 2001 +0000
+++ b/src/gaim.h	Wed Aug 01 19:11:42 2001 +0000
@@ -132,7 +132,9 @@
 	GtkWidget *mod;
 	GtkWidget *main;
 	GtkWidget *name;
+	GtkWidget *pwdbox;
 	GtkWidget *pass;
+	GtkWidget *rempass;
 	int tmp_options;
 	int tmp_protocol;
 
--- a/src/multi.c	Wed Aug 01 18:33:25 2001 +0000
+++ b/src/multi.c	Wed Aug 01 19:11:42 2001 +0000
@@ -19,6 +19,7 @@
  *
  */
 
+#include <string.h>
 #include <gtk/gtk.h>
 #include "prpl.h"
 #include "multi.h"
@@ -47,7 +48,7 @@
 static GtkWidget *newmain = NULL;	/* the notebook that holds options */
 static struct aim_user tmpusr = { "", "", "", OPT_USR_REM_PASS, DEFAULT_PROTO,
 		{ "", "", "", "", "", "", "" }, NULL, NULL, NULL, NULL, NULL,
-		OPT_USR_REM_PASS, DEFAULT_PROTO, NULL, NULL, NULL };
+		NULL, NULL, OPT_USR_REM_PASS, DEFAULT_PROTO, NULL, NULL, NULL };
 
 static void generate_prpl_options(struct aim_user *, GtkWidget *);
 
@@ -275,16 +276,38 @@
 static void set_prot(GtkWidget *opt, int proto)
 {
 	struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt));
+	struct prpl *p, *q;
+	q = find_prpl(proto);
 	if (u && (u->tmp_protocol != proto)) {
 		int i;
 		for (i = 0; i < 7; i++)
 			u->proto_opt[i][0] = '\0';
+		p = find_prpl(u->tmp_protocol);
+		if (!(p->options & OPT_PROTO_NO_PASSWORD) &&
+		     (q->options & OPT_PROTO_NO_PASSWORD)) {
+			gtk_widget_hide(u->pwdbox);
+			gtk_widget_hide(u->rempass);
+		} else if ((p->options & OPT_PROTO_NO_PASSWORD) &&
+			  !(q->options & OPT_PROTO_NO_PASSWORD)) {
+			gtk_widget_show(u->pwdbox);
+			gtk_widget_show(u->rempass);
+		}
 		u->tmp_protocol = proto;
 		generate_prpl_options(u, u->main);
-	} else if (tmpusr.tmp_protocol != proto) {
+	} else if (!u && (tmpusr.tmp_protocol != proto)) {
 		int i;
 		for (i = 0; i < 7; i++)
 			tmpusr.proto_opt[i][0] = '\0';
+		p = find_prpl(tmpusr.tmp_protocol);
+		if (!(p->options & OPT_PROTO_NO_PASSWORD) &&
+		     (q->options & OPT_PROTO_NO_PASSWORD)) {
+			gtk_widget_hide(tmpusr.pwdbox);
+			gtk_widget_hide(tmpusr.rempass);
+		} else if ((p->options & OPT_PROTO_NO_PASSWORD) &&
+			  !(q->options & OPT_PROTO_NO_PASSWORD)) {
+			gtk_widget_show(tmpusr.pwdbox);
+			gtk_widget_show(tmpusr.rempass);
+		}
 		tmpusr.tmp_protocol = tmpusr.protocol = proto;
 		generate_prpl_options(NULL, newmain);
 	}
@@ -341,9 +364,13 @@
 {
 	GtkWidget *vbox;
 	GtkWidget *hbox;
+	GtkWidget *pwdbox;
 	GtkWidget *label;
 	GtkWidget *name;
 	GtkWidget *pass;
+	GtkWidget *rempass;
+	
+	struct prpl *p = NULL;
 
 	vbox = gtk_vbox_new(FALSE, 5);
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
@@ -358,14 +385,14 @@
 	name = gtk_entry_new();
 	gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 0);
 
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+	pwdbox = gtk_hbox_new(FALSE, 5);
+	gtk_box_pack_start(GTK_BOX(vbox), pwdbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new(_("Password:"));
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(pwdbox), label, FALSE, FALSE, 0);
 
 	pass = gtk_entry_new();
-	gtk_box_pack_start(GTK_BOX(hbox), pass, TRUE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(pwdbox), pass, TRUE, TRUE, 0);
 	gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE);
 
 	hbox = gtk_hbox_new(FALSE, 5);
@@ -377,22 +404,32 @@
 
 	make_protocol_menu(hbox, u);
 
-	acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox);
+	rempass = acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox);
 	acct_button(_("Auto-Login"), u, OPT_USR_AUTO, vbox);
 	/*acct_button(_("Send KeepAlive packet (6 bytes/second)"), u, OPT_USR_KEEPALV, vbox);*/
 
+	gtk_widget_show_all(vbox);
+
 	if (u) {
 		u->name = name;
+		u->pwdbox = pwdbox;
 		u->pass = pass;
+		u->rempass = rempass;
 		gtk_entry_set_text(GTK_ENTRY(name), u->username);
 		gtk_entry_set_text(GTK_ENTRY(pass), u->password);
 		gtk_entry_set_editable(GTK_ENTRY(name), FALSE);
+		p = find_prpl(u->tmp_protocol);
 	} else {
 		tmpusr.name = name;
+		tmpusr.pwdbox = pwdbox;
 		tmpusr.pass = pass;
+		tmpusr.rempass = rempass;
+		p = find_prpl(tmpusr.tmp_protocol);
 	}
-
-	gtk_widget_show_all(vbox);
+	if (p->options & OPT_PROTO_NO_PASSWORD) {
+		gtk_widget_hide(pwdbox);
+		gtk_widget_hide(rempass);
+	}
 }
 
 static void generate_prpl_options(struct aim_user *u, GtkWidget *book)
--- a/src/protocols/irc/irc.c	Wed Aug 01 18:33:25 2001 +0000
+++ b/src/protocols/irc/irc.c	Wed Aug 01 19:11:42 2001 +0000
@@ -2094,7 +2094,7 @@
 void irc_init(struct prpl *ret)
 {
 	ret->protocol = PROTO_IRC;
-	ret->options = OPT_PROTO_CHAT_TOPIC;
+	ret->options = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_NO_PASSWORD;
 	ret->name = irc_name;
 	ret->list_icon = irc_list_icon;
 	ret->buddy_menu = irc_buddy_menu;
--- a/src/protocols/zephyr/zephyr.c	Wed Aug 01 18:33:25 2001 +0000
+++ b/src/protocols/zephyr/zephyr.c	Wed Aug 01 19:11:42 2001 +0000
@@ -930,6 +930,7 @@
 void zephyr_init(struct prpl *ret)
 {
 	ret->protocol = PROTO_ZEPHYR;
+	ret->options = OPT_PROTO_NO_PASSWORD;
 	ret->name = zephyr_name;
 	ret->login = zephyr_login;
 	ret->close = zephyr_close;
--- a/src/prpl.h	Wed Aug 01 18:33:25 2001 +0000
+++ b/src/prpl.h	Wed Aug 01 19:11:42 2001 +0000
@@ -54,8 +54,6 @@
 #define OPT_PROTO_CHAT_TOPIC      0x00000008
 /* IRC and Zephyr don't require passwords, so there's no need for a password prompt */
 #define OPT_PROTO_NO_PASSWORD     0x00000010
-/* ICQ, Yahoo, others? let you send offline messages */
-#define OPT_PROTO_OFFLINE         0x00000020
 
 #define GAIM_AWAY_CUSTOM "Custom"