comparison src/multi.c @ 3075:c0928d7fdcf9

[gaim-migrate @ 3089] Can reorder accounts in the account editor. Thanks Luke. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 17 Mar 2002 21:49:56 +0000
parents 793fb2e9d53b
children 319a66fc131f
comparison
equal deleted inserted replaced
3074:793fb2e9d53b 3075:c0928d7fdcf9
162 return p->name(); 162 return p->name();
163 else 163 else
164 return "Unknown"; 164 return "Unknown";
165 } 165 }
166 166
167
168 static void reorder_list(GtkCList *cl, int from, int to, void *p)
169 {
170 struct aim_user *au;
171 if (from == to)
172 return; /* This shouldn't happen, but just in case */
173 au = (struct aim_user*)g_slist_nth_data(aim_users, from);
174 aim_users = g_slist_remove (aim_users, au);
175 aim_users = g_slist_insert(aim_users, au, to);
176 save_prefs();
177 }
178
167 void regenerate_user_list() 179 void regenerate_user_list()
168 { 180 {
169 char *titles[4]; 181 char *titles[4];
170 GSList *u = aim_users; 182 GSList *u = aim_users;
171 struct aim_user *a; 183 struct aim_user *a;
199 211
200 list = gtk_clist_new_with_titles(4, titles); 212 list = gtk_clist_new_with_titles(4, titles);
201 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90); 213 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90);
202 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_EXTENDED); 214 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_EXTENDED);
203 gtk_clist_column_titles_passive(GTK_CLIST(list)); 215 gtk_clist_column_titles_passive(GTK_CLIST(list));
216
204 gtk_container_add(GTK_CONTAINER(win), list); 217 gtk_container_add(GTK_CONTAINER(win), list);
205 gtk_widget_show(list); 218 gtk_widget_show(list);
206 219
207 regenerate_user_list(); 220 regenerate_user_list();
208 221 gtk_clist_set_reorderable (GTK_CLIST(list), TRUE);
222 gtk_clist_set_use_drag_icons (GTK_CLIST(list), TRUE);
223 gtk_signal_connect(GTK_OBJECT(list), "row-move", GTK_SIGNAL_FUNC(reorder_list), NULL);
224
209 gtk_widget_show(win); 225 gtk_widget_show(win);
210 return win; 226 return win;
211 } 227 }
212 228
213 static void delmod(GtkWidget *w, struct mod_user *u) 229 static void delmod(GtkWidget *w, struct mod_user *u)
921 "not have a login function."), _("Login Error")); 937 "not have a login function."), _("Login Error"));
922 } 938 }
923 l = l->next; 939 l = l->next;
924 } 940 }
925 } 941 }
926 942
927 static void do_del_acct(gpointer w, struct aim_user *u) 943 static void do_del_acct(gpointer w, struct aim_user *u)
928 { 944 {
929 if (u->gc) { 945 if (u->gc) {
930 u->gc->wants_to_die = TRUE; 946 u->gc->wants_to_die = TRUE;
931 signoff(u->gc); 947 signoff(u->gc);