changeset 2204:5014b802eb41

[gaim-migrate @ 2214] if you load a protocol for an unknown account or unload one, update the account editor. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 31 Aug 2001 18:09:27 +0000
parents 14100685c95f
children cff4fbe01c7b
files src/multi.c src/multi.h src/prpl.c
diffstat 3 files changed, 35 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/multi.c	Fri Aug 31 17:09:24 2001 +0000
+++ b/src/multi.c	Fri Aug 31 18:09:27 2001 +0000
@@ -154,13 +154,34 @@
 		return "Unknown";
 }
 
+void regenerate_user_list()
+{
+	char *titles[4];
+	GList *u = aim_users;
+	struct aim_user *a;
+	int i;
+
+	if (!acctedit)
+		return;
+
+	gtk_clist_clear(GTK_CLIST(list));
+
+	while (u) {
+		a = (struct aim_user *)u->data;
+		titles[0] = a->username;
+		titles[1] = a->gc ? "Yes" : "No";
+		titles[2] = (a->options & OPT_USR_AUTO) ? "True" : "False";
+		titles[3] = proto_name(a->protocol);
+		i = gtk_clist_append(GTK_CLIST(list), titles);
+		gtk_clist_set_row_data(GTK_CLIST(list), i, a);
+		u = u->next;
+	}
+}
+
 static GtkWidget *generate_list()
 {
 	GtkWidget *win;
 	char *titles[4] = { "Screenname", "Currently Online", "Auto-login", "Protocol" };
-	GList *u = aim_users;
-	struct aim_user *a;
-	int i;
 
 	win = gtk_scrolled_window_new(0, 0);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win), GTK_POLICY_AUTOMATIC,
@@ -173,16 +194,7 @@
 	gtk_container_add(GTK_CONTAINER(win), list);
 	gtk_widget_show(list);
 
-	while (u) {
-		a = (struct aim_user *)u->data;
-		titles[0] = a->username;
-		titles[1] = a->gc ? "Yes" : "No";
-		titles[2] = (a->options & OPT_USR_AUTO) ? "True" : "False";
-		titles[3] = proto_name(a->protocol);
-		i = gtk_clist_append(GTK_CLIST(list), titles);
-		gtk_clist_set_row_data(GTK_CLIST(list), i, a);
-		u = u->next;
-	}
+	regenerate_user_list();
 
 	gtk_widget_show(win);
 	return win;
--- a/src/multi.h	Fri Aug 31 17:09:24 2001 +0000
+++ b/src/multi.h	Fri Aug 31 18:09:27 2001 +0000
@@ -94,6 +94,13 @@
 	struct gaim_connection *gc;
 };
 
+struct proto_chat_entry {
+	char *label;
+	gboolean is_int;
+	int min;
+	int max;
+};
+
 /* now that we have our struct, we're going to need lots of them. Maybe even a list of them. */
 extern GSList *connections;
 
@@ -104,6 +111,7 @@
 struct gaim_connection *find_gaim_conn_by_name(char *);
 
 void account_editor(GtkWidget *, GtkWidget *);
+void regenerate_user_list();
 
 void account_online(struct gaim_connection *);
 void account_offline(struct gaim_connection *);
--- a/src/prpl.c	Fri Aug 31 17:09:24 2001 +0000
+++ b/src/prpl.c	Fri Aug 31 18:09:27 2001 +0000
@@ -84,6 +84,7 @@
 	protocols = g_slist_insert_sorted(protocols, p, (GCompareFunc)proto_compare);
 	if (regdialog)
 		gtk_widget_destroy(regdialog);
+	regenerate_user_list();
 }
 
 void unload_protocol(struct prpl *p)
@@ -105,6 +106,7 @@
 	}
 	protocols = g_slist_remove(protocols, p);
 	g_free(p);
+	regenerate_user_list();
 }
 
 STATIC_PROTO_INIT