comparison src/multi.c @ 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 cef6d4e81aec
comparison
equal deleted inserted replaced
2203:14100685c95f 2204:5014b802eb41
152 return (*p->name)(); 152 return (*p->name)();
153 else 153 else
154 return "Unknown"; 154 return "Unknown";
155 } 155 }
156 156
157 static GtkWidget *generate_list() 157 void regenerate_user_list()
158 { 158 {
159 GtkWidget *win; 159 char *titles[4];
160 char *titles[4] = { "Screenname", "Currently Online", "Auto-login", "Protocol" };
161 GList *u = aim_users; 160 GList *u = aim_users;
162 struct aim_user *a; 161 struct aim_user *a;
163 int i; 162 int i;
164 163
165 win = gtk_scrolled_window_new(0, 0); 164 if (!acctedit)
166 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win), GTK_POLICY_AUTOMATIC, 165 return;
167 GTK_POLICY_ALWAYS); 166
168 167 gtk_clist_clear(GTK_CLIST(list));
169 list = gtk_clist_new_with_titles(4, titles);
170 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90);
171 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_MULTIPLE);
172 gtk_clist_column_titles_passive(GTK_CLIST(list));
173 gtk_container_add(GTK_CONTAINER(win), list);
174 gtk_widget_show(list);
175 168
176 while (u) { 169 while (u) {
177 a = (struct aim_user *)u->data; 170 a = (struct aim_user *)u->data;
178 titles[0] = a->username; 171 titles[0] = a->username;
179 titles[1] = a->gc ? "Yes" : "No"; 172 titles[1] = a->gc ? "Yes" : "No";
181 titles[3] = proto_name(a->protocol); 174 titles[3] = proto_name(a->protocol);
182 i = gtk_clist_append(GTK_CLIST(list), titles); 175 i = gtk_clist_append(GTK_CLIST(list), titles);
183 gtk_clist_set_row_data(GTK_CLIST(list), i, a); 176 gtk_clist_set_row_data(GTK_CLIST(list), i, a);
184 u = u->next; 177 u = u->next;
185 } 178 }
179 }
180
181 static GtkWidget *generate_list()
182 {
183 GtkWidget *win;
184 char *titles[4] = { "Screenname", "Currently Online", "Auto-login", "Protocol" };
185
186 win = gtk_scrolled_window_new(0, 0);
187 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win), GTK_POLICY_AUTOMATIC,
188 GTK_POLICY_ALWAYS);
189
190 list = gtk_clist_new_with_titles(4, titles);
191 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90);
192 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_MULTIPLE);
193 gtk_clist_column_titles_passive(GTK_CLIST(list));
194 gtk_container_add(GTK_CONTAINER(win), list);
195 gtk_widget_show(list);
196
197 regenerate_user_list();
186 198
187 gtk_widget_show(win); 199 gtk_widget_show(win);
188 return win; 200 return win;
189 } 201 }
190 202