Mercurial > pidgin.yaz
annotate src/multi.c @ 1708:eeb0cfe710b1
[gaim-migrate @ 1718]
one of my friends requested this, and since i was bored i did it for him.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 13 Apr 2001 04:35:17 +0000 |
parents | 8b0c165a33f4 |
children | f42ce672c560 |
rev | line source |
---|---|
960 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
22 #include <gtk/gtk.h> | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
23 #include "prpl.h" |
960 | 24 #include "multi.h" |
25 #include "gaim.h" | |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1474
diff
changeset
|
26 #ifdef USE_APPLET |
1261
07f0bb41bbe1
[gaim-migrate @ 1271]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1254
diff
changeset
|
27 #include "applet.h" |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1474
diff
changeset
|
28 #endif |
960 | 29 |
30 #include "pixmaps/gnome_add.xpm" | |
31 #include "pixmaps/gnome_preferences.xpm" | |
32 #include "pixmaps/join.xpm" | |
33 #include "pixmaps/gnome_remove.xpm" | |
34 #include "pixmaps/cancel.xpm" | |
35 #include "pixmaps/ok.xpm" | |
36 | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
37 #define LOGIN_STEPS 5 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
38 |
960 | 39 GSList *connections; |
40 | |
41 static GtkWidget *acctedit = NULL; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
42 static GtkWidget *list = NULL; /* the clist of names in the accteditor */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
43 static GtkWidget *newmod = NULL; /* the dialog for creating a new account */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
44 static GtkWidget *newmain = NULL; /* the notebook that holds options */ |
960 | 45 static struct aim_user tmpusr; |
46 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
47 static void generate_prpl_options(struct aim_user *, GtkWidget *); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
48 |
960 | 49 struct mod_usr_opt { |
50 struct aim_user *user; | |
51 int opt; | |
52 }; | |
53 | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
54 struct gaim_connection *new_gaim_conn(struct aim_user *user) |
960 | 55 { |
56 struct gaim_connection *gc = g_new0(struct gaim_connection, 1); | |
1391
d606da211acb
[gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
57 gc->edittype = EDIT_GC; |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
58 gc->protocol = user->protocol; |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
59 gc->prpl = find_prpl(user->protocol); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
60 g_snprintf(gc->username, sizeof(gc->username), "%s", user->username); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
61 g_snprintf(gc->password, sizeof(gc->password), "%s", user->password); |
1153
3063e6743913
[gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1124
diff
changeset
|
62 gc->options = user->options; |
3063e6743913
[gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1124
diff
changeset
|
63 gc->keepalive = 0; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
993
diff
changeset
|
64 gc->inpa = -1; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
993
diff
changeset
|
65 gc->buddy_chats = NULL; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
66 gc->groups = NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
67 gc->permit = NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
68 gc->deny = NULL; |
960 | 69 |
70 connections = g_slist_append(connections, gc); | |
71 | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
72 user->gc = gc; |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
73 gc->user = user; |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
74 |
960 | 75 return gc; |
76 } | |
77 | |
78 void destroy_gaim_conn(struct gaim_connection *gc) | |
79 { | |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
80 GSList *g = gc->groups; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
81 GSList *h; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
82 struct group *m; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
83 struct buddy *n; |
960 | 84 connections = g_slist_remove(connections, gc); |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
85 while (g) { |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
86 m = (struct group *)g->data; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
87 g = g_slist_remove(g, m); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
88 h = m->members; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
89 while (h) { |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
90 n = (struct buddy *)h->data; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
91 h = g_slist_remove(h, n); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
92 g_free(n); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
93 } |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
94 g_free(m); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
95 } |
960 | 96 g_free(gc); |
97 redo_convo_menus(); | |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
98 #ifndef USE_APPLET |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
99 if (!connections && mainwindow) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
100 gtk_widget_show(mainwindow); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
101 #endif |
960 | 102 } |
103 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
104 struct gaim_connection *find_gaim_conn_by_name(char *name) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
105 { |
960 | 106 char *who = g_strdup(normalize(name)); |
107 GSList *c = connections; | |
108 struct gaim_connection *g = NULL; | |
109 | |
110 while (c) { | |
111 g = (struct gaim_connection *)c->data; | |
112 if (!strcmp(normalize(g->username), who)) { | |
113 g_free(who); | |
114 return g; | |
115 } | |
116 c = c->next; | |
117 } | |
118 | |
119 g_free(who); | |
120 return NULL; | |
121 } | |
122 | |
123 static void delete_acctedit(GtkWidget *w, gpointer d) | |
124 { | |
125 if (acctedit) { | |
126 save_prefs(); | |
127 gtk_widget_destroy(acctedit); | |
128 } | |
129 acctedit = NULL; | |
1666
8b0c165a33f4
[gaim-migrate @ 1676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1575
diff
changeset
|
130 list = NULL; |
1474
4e891576c226
[gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1473
diff
changeset
|
131 if (!d && !blist && !mainwindow && !connections) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1115
diff
changeset
|
132 gtk_main_quit(); |
960 | 133 } |
134 | |
135 static gint acctedit_close(GtkWidget *w, gpointer d) | |
136 { | |
137 gtk_widget_destroy(acctedit); | |
1474
4e891576c226
[gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1473
diff
changeset
|
138 if (!d && !blist && !mainwindow && !connections) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1115
diff
changeset
|
139 gtk_main_quit(); |
960 | 140 return FALSE; |
141 } | |
142 | |
143 static char *proto_name(int proto) | |
144 { | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
145 struct prpl *p = find_prpl(proto); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
146 if (p && p->name) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
147 return (*p->name)(); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
148 else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
149 return "Unknown"; |
960 | 150 } |
151 | |
152 static GtkWidget *generate_list() | |
153 { | |
154 GtkWidget *win; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
155 char *titles[4] = { "Screenname", "Currently Online", "Auto-login", "Protocol" }; |
960 | 156 GList *u = aim_users; |
157 struct aim_user *a; | |
158 int i; | |
159 | |
160 win = gtk_scrolled_window_new(0, 0); | |
161 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win), GTK_POLICY_AUTOMATIC, | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
162 GTK_POLICY_ALWAYS); |
960 | 163 |
164 list = gtk_clist_new_with_titles(4, titles); | |
165 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90); | |
166 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_BROWSE); | |
167 gtk_clist_column_titles_passive(GTK_CLIST(list)); | |
168 gtk_container_add(GTK_CONTAINER(win), list); | |
169 gtk_widget_show(list); | |
170 | |
171 while (u) { | |
172 a = (struct aim_user *)u->data; | |
173 titles[0] = a->username; | |
1074
2cff18c2f9c6
[gaim-migrate @ 1084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
174 titles[1] = a->gc ? "Yes" : "No"; |
960 | 175 titles[2] = (a->options & OPT_USR_AUTO) ? "True" : "False"; |
176 titles[3] = proto_name(a->protocol); | |
177 i = gtk_clist_append(GTK_CLIST(list), titles); | |
178 gtk_clist_set_row_data(GTK_CLIST(list), i, a); | |
179 u = u->next; | |
180 } | |
181 | |
182 gtk_widget_show(win); | |
183 return win; | |
184 } | |
185 | |
186 static void delmod(GtkWidget *w, struct aim_user *u) | |
187 { | |
188 gtk_widget_destroy(w); | |
189 if (u) { | |
190 u->mod = NULL; | |
191 } else { | |
192 newmod = NULL; | |
193 } | |
194 } | |
195 | |
196 static void mod_opt(GtkWidget *b, struct mod_usr_opt *m) | |
197 { | |
198 if (m->user) { | |
199 m->user->tmp_options = m->user->tmp_options ^ m->opt; | |
200 } else { | |
201 tmpusr.options = tmpusr.options ^ m->opt; | |
202 } | |
203 } | |
204 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
205 static void free_muo(GtkWidget *b, struct mod_usr_opt *m) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
206 { |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
207 g_free(m); |
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
208 } |
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
209 |
960 | 210 static GtkWidget *acct_button(const char *text, struct aim_user *u, int option, GtkWidget *box) |
211 { | |
212 GtkWidget *button; | |
213 struct mod_usr_opt *muo = g_new0(struct mod_usr_opt, 1); | |
214 button = gtk_check_button_new_with_label(text); | |
215 if (u) { | |
216 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (u->options & option)); | |
217 } else { | |
218 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (tmpusr.options & option)); | |
219 } | |
220 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
221 muo->user = u; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
222 muo->opt = option; |
960 | 223 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(mod_opt), muo); |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
224 gtk_signal_connect(GTK_OBJECT(button), "destroy", GTK_SIGNAL_FUNC(free_muo), muo); |
960 | 225 gtk_widget_show(button); |
226 return button; | |
227 } | |
228 | |
229 static void ok_mod(GtkWidget *w, struct aim_user *u) | |
230 { | |
231 char *txt; | |
232 int i; | |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
233 |
960 | 234 if (u) { |
235 u->options = u->tmp_options; | |
236 u->protocol = u->tmp_protocol; | |
237 txt = gtk_entry_get_text(GTK_ENTRY(u->pass)); | |
238 if (u->options & OPT_USR_REM_PASS) | |
239 g_snprintf(u->password, sizeof(u->password), "%s", txt); | |
240 else | |
241 u->password[0] = '\0'; | |
242 gtk_widget_destroy(u->mod); | |
243 i = gtk_clist_find_row_from_data(GTK_CLIST(list), u); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
244 gtk_clist_set_text(GTK_CLIST(list), i, 2, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
245 (u->options & OPT_USR_AUTO) ? "True" : "False"); |
960 | 246 gtk_clist_set_text(GTK_CLIST(list), i, 3, proto_name(u->protocol)); |
247 } else { | |
248 txt = gtk_entry_get_text(GTK_ENTRY(tmpusr.name)); | |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
249 u = new_user(txt, tmpusr.protocol, tmpusr.options); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
250 |
960 | 251 txt = gtk_entry_get_text(GTK_ENTRY(tmpusr.pass)); |
252 g_snprintf(u->password, sizeof(u->password), "%s", txt); | |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
253 |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
254 for (i = 0; i < 6; i++) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
255 g_snprintf(u->proto_opt[i], sizeof(u->proto_opt[i]), "%s", tmpusr.proto_opt[i]); |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
256 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
257 gtk_widget_destroy(newmod); |
960 | 258 } |
259 save_prefs(); | |
260 } | |
261 | |
262 static void cancel_mod(GtkWidget *w, struct aim_user *u) | |
263 { | |
264 if (u) { | |
265 gtk_widget_destroy(u->mod); | |
266 } else { | |
267 gtk_widget_destroy(newmod); | |
268 } | |
269 } | |
270 | |
271 static void set_prot(GtkWidget *opt, int proto) | |
272 { | |
273 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt)); | |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
274 if (u && (u->tmp_protocol != proto)) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
275 int i; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
276 for (i = 0; i < 6; i++) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
277 u->proto_opt[i][0] = '\0'; |
960 | 278 u->tmp_protocol = proto; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
279 generate_prpl_options(u, u->main); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
280 } else if (tmpusr.tmp_protocol != proto) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
281 int i; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
282 for (i = 0; i < 6; i++) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
283 tmpusr.proto_opt[i][0] = '\0'; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
284 tmpusr.tmp_protocol = tmpusr.protocol = proto; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
285 generate_prpl_options(NULL, newmain); |
960 | 286 } |
287 } | |
288 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
289 static GtkWidget *make_protocol_menu(GtkWidget *box, struct aim_user *u) |
960 | 290 { |
291 GtkWidget *optmenu; | |
292 GtkWidget *menu; | |
293 GtkWidget *opt; | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
294 GSList *p = protocols; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
295 struct prpl *e; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
296 int count = 0; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
297 gboolean found = FALSE; |
960 | 298 |
299 optmenu = gtk_option_menu_new(); | |
300 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5); | |
301 gtk_widget_show(optmenu); | |
302 | |
303 menu = gtk_menu_new(); | |
304 | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
305 while (p) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
306 e = (struct prpl *)p->data; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
307 if (u) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
308 if (e->protocol == u->tmp_protocol) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
309 found = TRUE; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
310 if (!found) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
311 count++; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
312 } else { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
313 if (e->protocol == tmpusr.tmp_protocol) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
314 found = TRUE; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
315 if (!found) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
316 count++; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
317 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
318 if (e->name) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
319 opt = gtk_menu_item_new_with_label((*e->name)()); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
320 else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
321 opt = gtk_menu_item_new_with_label("Unknown"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
322 gtk_object_set_user_data(GTK_OBJECT(opt), u); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
323 gtk_signal_connect(GTK_OBJECT(opt), "activate", |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
324 GTK_SIGNAL_FUNC(set_prot), (void *)e->protocol); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
325 gtk_menu_append(GTK_MENU(menu), opt); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
326 gtk_widget_show(opt); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
327 p = p->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
328 } |
960 | 329 |
330 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
331 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), count); |
960 | 332 |
333 return optmenu; | |
334 } | |
335 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
336 static void generate_general_options(struct aim_user *u, GtkWidget *book) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
337 { |
960 | 338 GtkWidget *vbox; |
339 GtkWidget *hbox; | |
340 GtkWidget *label; | |
341 GtkWidget *name; | |
342 GtkWidget *pass; | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
343 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
344 vbox = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
345 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
346 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new(_("General Options"))); |
960 | 347 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
348 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
349 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
350 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
351 label = gtk_label_new(_("Screenname:")); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
352 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
960 | 353 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
354 name = gtk_entry_new(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
355 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 0); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
356 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
357 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
358 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
960 | 359 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
360 label = gtk_label_new(_("Password:")); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
361 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
960 | 362 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
363 pass = gtk_entry_new(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
364 gtk_box_pack_start(GTK_BOX(hbox), pass, TRUE, TRUE, 0); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
365 gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
366 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
367 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
368 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
960 | 369 gtk_widget_show(hbox); |
370 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
371 label = gtk_label_new(_("Protocol:")); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
372 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
960 | 373 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
374 make_protocol_menu(hbox, u); |
960 | 375 |
376 acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox); | |
377 acct_button(_("Auto-Login"), u, OPT_USR_AUTO, vbox); | |
378 acct_button(_("Send KeepAlive packet (6 bytes/second)"), u, OPT_USR_KEEPALV, vbox); | |
379 | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
380 if (u) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
381 u->name = name; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
382 u->pass = pass; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
383 gtk_entry_set_text(GTK_ENTRY(name), u->username); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
384 gtk_entry_set_text(GTK_ENTRY(pass), u->password); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
385 gtk_entry_set_editable(GTK_ENTRY(name), FALSE); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
386 } else { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
387 tmpusr.name = name; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
388 tmpusr.pass = pass; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
389 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
390 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
391 gtk_widget_show_all(vbox); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
392 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
393 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
394 static void generate_prpl_options(struct aim_user *u, GtkWidget *book) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
395 { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
396 struct prpl *p; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
397 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
398 if (u) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
399 p = find_prpl(u->tmp_protocol); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
400 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
401 p = find_prpl(tmpusr.protocol); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
402 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
403 /* page 0 is general, keep it. page 1 is options for our |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
404 * particular protocol, so clear it out and make a new one. */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
405 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
406 gtk_notebook_remove_page(GTK_NOTEBOOK(book), 1); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
407 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
408 if (p && p->user_opts) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
409 if (u) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
410 (*p->user_opts)(book, u); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
411 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
412 (*p->user_opts)(book, &tmpusr); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
413 } |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
414 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
415 |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
416 static void show_acct_mod(struct aim_user *u) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
417 { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
418 /* here we can have all the aim_user options, including ones not shown in the main acctedit |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
419 * window. this can keep the size of the acctedit window small and readable, and make this |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
420 * one the powerful editor. this is where things like name/password are edited, but can |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
421 * also have toggles (and even more complex options) like whether to autologin or whether |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
422 * to send keepalives or whatever. this would be the perfect place to specify which protocol |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
423 * to use. make sure to account for the possibility of protocol plugins. */ |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
424 GtkWidget *mod; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
425 GtkWidget *box; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
426 GtkWidget *book; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
427 GtkWidget *hbox; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
428 GtkWidget *button; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
429 |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
430 if (!u && newmod) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
431 gtk_widget_show(newmod); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
432 return; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
433 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
434 if (u && u->mod) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
435 gtk_widget_show(u->mod); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
436 return; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
437 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
438 |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
439 mod = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
440 gtk_window_set_wmclass(GTK_WINDOW(mod), "account", "Gaim"); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
441 gtk_widget_realize(mod); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
442 aol_icon(mod->window); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
443 gtk_window_set_title(GTK_WINDOW(mod), _("Gaim - Modify Account")); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
444 gtk_window_set_policy(GTK_WINDOW(mod), FALSE, TRUE, TRUE); /* nothing odd here :) */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
445 gtk_signal_connect(GTK_OBJECT(mod), "destroy", GTK_SIGNAL_FUNC(delmod), u); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
446 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
447 box = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
448 gtk_container_border_width(GTK_CONTAINER(mod), 5); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
449 gtk_container_add(GTK_CONTAINER(mod), box); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
450 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
451 book = gtk_notebook_new(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
452 gtk_box_pack_start(GTK_BOX(box), book, FALSE, FALSE, 0); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
453 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
454 if (u) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
455 u->tmp_protocol = u->protocol; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
456 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
457 tmpusr.tmp_protocol = tmpusr.protocol; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
458 generate_general_options(u, book); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
459 generate_prpl_options(u, book); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
460 |
960 | 461 hbox = gtk_hbox_new(FALSE, 5); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
462 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
960 | 463 |
464 button = picture_button(mod, _("Cancel"), cancel_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
465 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
960 | 466 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_mod), u); |
467 | |
468 button = picture_button(mod, _("OK"), ok_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
469 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
960 | 470 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_mod), u); |
471 | |
472 if (u) { | |
473 u->mod = mod; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
474 u->main = book; /* sorry, i think i broke the joke :) */ |
960 | 475 u->tmp_options = u->options; |
476 } else { | |
477 newmod = mod; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
478 newmain = book; |
960 | 479 } |
480 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
481 gtk_widget_show_all(mod); |
960 | 482 } |
483 | |
484 static void add_acct(GtkWidget *w, gpointer d) | |
485 { | |
486 show_acct_mod(NULL); | |
487 } | |
488 | |
489 static void mod_acct(GtkWidget *w, gpointer d) | |
490 { | |
491 int row = -1; | |
492 struct aim_user *u; | |
493 if (GTK_CLIST(list)->selection) | |
494 row = (int)GTK_CLIST(list)->selection->data; | |
495 if (row != -1) { | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
496 u = g_list_nth_data(aim_users, row); |
960 | 497 if (u) |
498 show_acct_mod(u); | |
499 } | |
500 } | |
501 | |
502 static void pass_des(GtkWidget *w, struct aim_user *u) | |
503 { | |
504 gtk_widget_destroy(w); | |
505 u->passprmt = NULL; | |
506 } | |
507 | |
508 static void pass_cancel(GtkWidget *w, struct aim_user *u) | |
509 { | |
510 gtk_widget_destroy(u->passprmt); | |
511 u->passprmt = NULL; | |
512 } | |
513 | |
514 static void pass_signon(GtkWidget *w, struct aim_user *u) | |
515 { | |
516 char *txt = gtk_entry_get_text(GTK_ENTRY(u->passentry)); | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
517 g_snprintf(u->password, sizeof(u->password), "%s", txt); |
960 | 518 #ifdef USE_APPLET |
519 set_user_state(signing_on); | |
520 #endif | |
521 gtk_widget_destroy(u->passprmt); | |
522 u->passprmt = NULL; | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
523 serv_login(u); |
960 | 524 } |
525 | |
526 static void do_pass_dlg(struct aim_user *u) | |
527 { | |
528 /* we can safely assume that u is not NULL */ | |
529 GtkWidget *frame; | |
530 GtkWidget *vbox; | |
531 GtkWidget *hbox; | |
532 char buf[96]; | |
533 GtkWidget *label; | |
534 GtkWidget *button; | |
535 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
536 if (u->passprmt) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
537 gtk_widget_show(u->passprmt); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
538 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
539 } |
960 | 540 u->passprmt = gtk_window_new(GTK_WINDOW_DIALOG); |
541 gtk_window_set_wmclass(GTK_WINDOW(u->passprmt), "password", "Gaim"); | |
542 gtk_container_border_width(GTK_CONTAINER(u->passprmt), 5); | |
543 gtk_signal_connect(GTK_OBJECT(u->passprmt), "destroy", GTK_SIGNAL_FUNC(pass_des), u); | |
544 gtk_widget_realize(u->passprmt); | |
545 aol_icon(u->passprmt->window); | |
546 | |
547 frame = gtk_frame_new(_("Enter Password")); | |
548 gtk_container_add(GTK_CONTAINER(u->passprmt), frame); | |
549 gtk_widget_show(frame); | |
550 | |
551 vbox = gtk_vbox_new(FALSE, 5); | |
552 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
553 gtk_widget_show(vbox); | |
554 | |
555 hbox = gtk_hbox_new(FALSE, 5); | |
556 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
557 gtk_widget_show(hbox); | |
558 | |
559 g_snprintf(buf, sizeof(buf), "Password for %s:", u->username); | |
560 label = gtk_label_new(buf); | |
561 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
562 gtk_widget_show(label); | |
563 | |
564 u->passentry = gtk_entry_new(); | |
565 gtk_entry_set_visibility(GTK_ENTRY(u->passentry), FALSE); | |
566 gtk_box_pack_start(GTK_BOX(hbox), u->passentry, FALSE, FALSE, 5); | |
567 gtk_signal_connect(GTK_OBJECT(u->passentry), "activate", GTK_SIGNAL_FUNC(pass_signon), u); | |
568 gtk_widget_grab_focus(u->passentry); | |
569 gtk_widget_show(u->passentry); | |
570 | |
571 hbox = gtk_hbox_new(FALSE, 5); | |
572 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
573 gtk_widget_show(hbox); | |
574 | |
575 button = picture_button(u->passprmt, _("Cancel"), cancel_xpm); | |
576 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_cancel), u); | |
577 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); | |
578 | |
579 button = picture_button(u->passprmt, _("Signon"), ok_xpm); | |
580 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_signon), u); | |
581 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); | |
582 | |
583 gtk_widget_show(u->passprmt); | |
584 } | |
585 | |
586 static void acct_signin(GtkWidget *w, gpointer d) | |
587 { | |
588 int row = -1; | |
589 struct aim_user *u; | |
590 if (GTK_CLIST(list)->selection) | |
591 row = (int)GTK_CLIST(list)->selection->data; | |
592 if (row != -1) { | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
593 u = g_list_nth_data(aim_users, row); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
594 if (!u->gc) { |
960 | 595 if (!u->password[0]) { |
596 do_pass_dlg(u); | |
597 } else { | |
598 #ifdef USE_APPLET | |
599 set_user_state(signing_on); | |
600 #endif /* USE_APPLET */ | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
601 gtk_clist_set_text(GTK_CLIST(list), row, 1, "Attempting"); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
602 serv_login(u); |
960 | 603 } |
604 } else { | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
605 signoff(u->gc); |
960 | 606 } |
607 } | |
608 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
609 |
960 | 610 static void del_acct(GtkWidget *w, gpointer d) |
611 { | |
612 int row = -1; | |
613 struct aim_user *u; | |
614 if (GTK_CLIST(list)->selection) | |
615 row = (int)GTK_CLIST(list)->selection->data; | |
616 if (row != -1) { | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
617 u = g_list_nth_data(aim_users, row); |
960 | 618 if (u) { |
1058
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1056
diff
changeset
|
619 if (u->gc) |
4927ce25d8cc
[gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1056
diff
changeset
|
620 signoff(u->gc); |
960 | 621 aim_users = g_list_remove(aim_users, u); |
622 save_prefs(); | |
623 } | |
624 gtk_clist_remove(GTK_CLIST(list), row); | |
625 } | |
626 } | |
627 | |
628 void account_editor(GtkWidget *w, GtkWidget *W) | |
629 { | |
630 /* please kill me */ | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
631 GtkWidget *vbox; |
960 | 632 GtkWidget *hbox; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
633 GtkWidget *list; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
634 GtkWidget *button; /* used for many things */ |
960 | 635 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
636 if (acctedit) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
637 gtk_widget_show(acctedit); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
638 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
639 } |
960 | 640 |
641 acctedit = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
642 gtk_window_set_title(GTK_WINDOW(acctedit), _("Gaim - Account Editor")); | |
643 gtk_window_set_wmclass(GTK_WINDOW(acctedit), "accounteditor", "Gaim"); | |
644 gtk_widget_realize(acctedit); | |
645 aol_icon(acctedit->window); | |
646 gtk_widget_set_usize(acctedit, -1, 200); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
647 gtk_signal_connect(GTK_OBJECT(acctedit), "destroy", GTK_SIGNAL_FUNC(delete_acctedit), W); |
960 | 648 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
649 vbox = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
650 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
651 gtk_container_add(GTK_CONTAINER(acctedit), vbox); |
960 | 652 |
653 list = generate_list(); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
654 gtk_box_pack_start(GTK_BOX(vbox), list, TRUE, TRUE, 0); |
960 | 655 |
656 hbox = gtk_hbox_new(TRUE, 5); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
657 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
960 | 658 |
659 button = picture_button(acctedit, _("Add"), gnome_add_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
660 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 661 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(add_acct), NULL); |
662 | |
663 button = picture_button(acctedit, _("Modify"), gnome_preferences_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
664 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 665 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(mod_acct), NULL); |
666 | |
667 button = picture_button(acctedit, _("Sign On/Off"), join_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
668 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 669 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(acct_signin), NULL); |
670 | |
671 button = picture_button(acctedit, _("Delete"), gnome_remove_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
672 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 673 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(del_acct), NULL); |
674 | |
1436
f6a9bd50fd19
[gaim-migrate @ 1446]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1401
diff
changeset
|
675 button = picture_button(acctedit, _("Close"), cancel_xpm); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
676 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1005
diff
changeset
|
677 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(acctedit_close), W); |
960 | 678 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
679 gtk_widget_show_all(acctedit); |
960 | 680 } |
681 | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
682 void account_online(struct gaim_connection *gc) |
960 | 683 { |
684 int i; | |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
685 |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
686 /* first we hide the login progress meter */ |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
687 if (gc->meter) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
688 gtk_widget_destroy(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
689 gc->meter = NULL; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
690 |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
691 /* then we do the buddy list stuff */ |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
692 if (mainwindow) |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
693 gtk_widget_hide(mainwindow); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
694 show_buddy_list(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
695 |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
696 #ifdef USE_APPLET |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
697 if (general_options & OPT_GEN_APP_BUDDY_SHOW) { |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
698 refresh_buddy_window(); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
699 createOnlinePopup(); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
700 applet_buddy_show = TRUE; |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
701 } else { |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
702 gtk_widget_hide(blist); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
703 applet_buddy_show = FALSE; |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
704 } |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
705 set_user_state(online); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
706 #else |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
707 refresh_buddy_window(); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
708 #endif |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
709 setup_buddy_chats(); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
710 |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1115
diff
changeset
|
711 update_connection_dependent_prefs(); |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
712 do_away_menu(); |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1474
diff
changeset
|
713 do_proto_menu(); |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
714 redo_convo_menus(); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
715 gaim_setup(gc); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
716 |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
717 plugin_event(event_signon, gc, 0, 0, 0); |
1575
427e1409917c
[gaim-migrate @ 1585]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1499
diff
changeset
|
718 system_log(log_signon, gc, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
719 |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
720 /* away option given? */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
721 if (opt_away) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
722 away_on_login(opt_away_arg); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
723 /* don't do it again */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
724 opt_away = 0; |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
725 } else if (awaymessage) { |
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
726 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message); |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
727 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
728 if (opt_away_arg != NULL) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
729 g_free (opt_away_arg); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
730 opt_away_arg = NULL; |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
731 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
732 |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
733 /* everything for the account editor */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
734 if (!acctedit) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
735 return; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
736 i = gtk_clist_find_row_from_data(GTK_CLIST(list), gc->user); |
977
e5eac6b236f1
[gaim-migrate @ 987]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
969
diff
changeset
|
737 gtk_clist_set_text(GTK_CLIST(list), i, 1, "Yes"); |
960 | 738 gtk_clist_set_text(GTK_CLIST(list), i, 3, proto_name(gc->protocol)); |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
739 |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
740 return; |
960 | 741 } |
742 | |
743 void account_offline(struct gaim_connection *gc) | |
744 { | |
745 int i; | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
746 if (gc->meter) |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
747 gtk_widget_destroy(gc->meter); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
748 gc->meter = NULL; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
749 gc->user->gc = NULL; /* wasn't that awkward? */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
750 if (!acctedit) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
751 return; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
752 i = gtk_clist_find_row_from_data(GTK_CLIST(list), gc->user); |
977
e5eac6b236f1
[gaim-migrate @ 987]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
969
diff
changeset
|
753 gtk_clist_set_text(GTK_CLIST(list), i, 1, "No"); |
993
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
754 redo_convo_menus(); |
960 | 755 } |
756 | |
757 void auto_login() | |
758 { | |
759 GList *u = aim_users; | |
760 struct aim_user *a = NULL; | |
761 | |
762 while (u) { | |
763 a = (struct aim_user *)u->data; | |
764 if ((a->options & OPT_USR_AUTO) && (a->options & OPT_USR_REM_PASS)) { | |
765 #ifdef USE_APPLET | |
766 set_user_state(signing_on); | |
767 #endif /* USE_APPLET */ | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
768 serv_login(a); |
960 | 769 } |
770 u = u->next; | |
771 } | |
772 } | |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
773 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
774 static void cancel_signon(GtkWidget *button, struct gaim_connection *gc) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
775 { |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
776 signoff(gc); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
777 } |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
778 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
779 static gint meter_destroy(GtkWidget *meter, GdkEvent *evt, struct gaim_connection *gc) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
780 { |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
781 return TRUE; |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
782 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
783 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
784 void set_login_progress(struct gaim_connection *gc, float howfar, char *message) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
785 { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
786 if (mainwindow) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
787 gtk_widget_hide(mainwindow); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
788 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
789 if (!gc->meter) { |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
790 GtkWidget *box, *label, *button; |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
791 char buf[256]; |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
792 |
1172 | 793 gc->meter = gtk_window_new(GTK_WINDOW_DIALOG); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
794 gtk_window_set_policy(GTK_WINDOW(gc->meter), 0, 0, 1); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
795 gtk_window_set_wmclass(GTK_WINDOW(gc->meter), "signon", "Gaim"); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
796 gtk_container_set_border_width(GTK_CONTAINER(gc->meter), 5); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
797 g_snprintf(buf, sizeof(buf), "%s Signing On", gc->username); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
798 gtk_window_set_title(GTK_WINDOW(gc->meter), buf); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
799 gtk_signal_connect(GTK_OBJECT(gc->meter), "delete_event", |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
800 GTK_SIGNAL_FUNC(meter_destroy), gc); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
801 gtk_widget_realize(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
802 aol_icon(gc->meter->window); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
803 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
804 box = gtk_vbox_new(FALSE, 5); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
805 gtk_container_add(GTK_CONTAINER(gc->meter), box); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
806 gtk_widget_show(box); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
807 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
808 label = gtk_label_new(buf); |
1172 | 809 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
810 gtk_widget_show(label); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
811 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
812 gc->progress = gtk_progress_bar_new(); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
813 gtk_widget_set_usize(gc->progress, 150, 0); |
1172 | 814 gtk_box_pack_start(GTK_BOX(box), gc->progress, FALSE, FALSE, 0); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
815 gtk_widget_show(gc->progress); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
816 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
817 gc->status = gtk_statusbar_new(); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
818 gtk_widget_set_usize(gc->status, 150, 0); |
1172 | 819 gtk_box_pack_start(GTK_BOX(box), gc->status, FALSE, FALSE, 0); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
820 gtk_widget_show(gc->status); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
821 |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
822 button = gtk_button_new_with_label(_("Cancel")); |
1172 | 823 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
824 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_signon), gc); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
825 gtk_widget_show(button); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
826 |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
827 gtk_widget_show(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
828 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
829 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
830 gtk_progress_bar_update(GTK_PROGRESS_BAR(gc->progress), howfar / LOGIN_STEPS); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
831 gtk_statusbar_pop(GTK_STATUSBAR(gc->status), 1); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
832 gtk_statusbar_push(GTK_STATUSBAR(gc->status), 1, message); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
833 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
834 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
835 void hide_login_progress(struct gaim_connection *gc, char *why) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
836 { |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
837 char buf[2048]; |
1708
eeb0cfe710b1
[gaim-migrate @ 1718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1666
diff
changeset
|
838 sprintf(buf, _("%s\n%s was unable to sign on: %s"), full_date(), gc->username, why); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
839 do_error_dialog(buf, _("Signon Error")); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
840 if (gc->meter) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
841 gtk_widget_destroy(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
842 gc->meter = NULL; |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
843 } |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
844 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
845 struct aim_user *new_user(char *name, int proto, int opts) |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
846 { |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
847 char *titles[4]; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
848 int i; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
849 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
850 struct aim_user *u = g_new0(struct aim_user, 1); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
851 g_snprintf(u->username, sizeof(u->username), "%s", name); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
852 u->protocol = proto; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
853 u->options = opts; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
854 aim_users = g_list_append(aim_users, u); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
855 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
856 if (list) { |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
857 titles[0] = u->username; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
858 titles[1] = u->gc ? "Yes" : "No"; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
859 titles[2] = (u->options & OPT_USR_AUTO) ? "True" : "False"; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
860 titles[3] = proto_name(u->protocol); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
861 i = gtk_clist_append(GTK_CLIST(list), titles); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
862 gtk_clist_set_row_data(GTK_CLIST(list), i, u); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
863 } |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
864 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
865 return u; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
866 } |