Mercurial > pidgin.yaz
annotate src/multi.c @ 2109:3110ea142888
[gaim-migrate @ 2119]
fun stuff.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 02 Aug 2001 05:42:15 +0000 |
parents | ff225036d434 |
children | 109669b3887e |
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 | |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
22 #include <string.h> |
960 | 23 #include <gtk/gtk.h> |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
24 #include "prpl.h" |
960 | 25 #include "multi.h" |
26 #include "gaim.h" | |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1474
diff
changeset
|
27 #ifdef USE_APPLET |
1261
07f0bb41bbe1
[gaim-migrate @ 1271]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1254
diff
changeset
|
28 #include "applet.h" |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1474
diff
changeset
|
29 #endif |
960 | 30 |
31 #include "pixmaps/gnome_add.xpm" | |
32 #include "pixmaps/gnome_preferences.xpm" | |
33 #include "pixmaps/join.xpm" | |
34 #include "pixmaps/gnome_remove.xpm" | |
35 #include "pixmaps/cancel.xpm" | |
36 #include "pixmaps/ok.xpm" | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
37 #include "pixmaps/tb_redo.xpm" |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
38 #include "pixmaps/tb_undo.xpm" |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
39 #include "pixmaps/tb_refresh.xpm" |
960 | 40 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
41 #define LOGIN_STEPS 5 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
42 |
960 | 43 GSList *connections; |
44 | |
45 static GtkWidget *acctedit = NULL; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
46 static GtkWidget *list = NULL; /* the clist of names in the accteditor */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
47 static GtkWidget *newmod = NULL; /* the dialog for creating a new account */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
48 static GtkWidget *newmain = NULL; /* the notebook that holds options */ |
1878
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
49 static struct aim_user tmpusr = { "", "", "", OPT_USR_REM_PASS, DEFAULT_PROTO, |
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
50 { "", "", "", "", "", "", "" }, NULL, NULL, NULL, NULL, NULL, |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
51 NULL, NULL, OPT_USR_REM_PASS, DEFAULT_PROTO, NULL, NULL, NULL }; |
960 | 52 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
53 static void generate_prpl_options(struct aim_user *, GtkWidget *); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
54 |
960 | 55 struct mod_usr_opt { |
56 struct aim_user *user; | |
57 int opt; | |
58 }; | |
59 | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
60 struct gaim_connection *new_gaim_conn(struct aim_user *user) |
960 | 61 { |
62 struct gaim_connection *gc = g_new0(struct gaim_connection, 1); | |
1391
d606da211acb
[gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
63 gc->edittype = EDIT_GC; |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
64 gc->protocol = user->protocol; |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
65 gc->prpl = find_prpl(user->protocol); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
66 g_snprintf(gc->username, sizeof(gc->username), "%s", user->username); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
67 g_snprintf(gc->password, sizeof(gc->password), "%s", user->password); |
1153
3063e6743913
[gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1124
diff
changeset
|
68 gc->options = user->options; |
3063e6743913
[gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1124
diff
changeset
|
69 gc->keepalive = 0; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
993
diff
changeset
|
70 gc->inpa = -1; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
993
diff
changeset
|
71 gc->buddy_chats = NULL; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
72 gc->groups = NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
73 gc->permit = NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
74 gc->deny = NULL; |
960 | 75 |
76 connections = g_slist_append(connections, gc); | |
77 | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
78 user->gc = gc; |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
79 gc->user = user; |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
80 |
960 | 81 return gc; |
82 } | |
83 | |
84 void destroy_gaim_conn(struct gaim_connection *gc) | |
85 { | |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
86 GSList *g = gc->groups; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
87 GSList *h; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
88 struct group *m; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
89 struct buddy *n; |
960 | 90 connections = g_slist_remove(connections, gc); |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
91 while (g) { |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
92 m = (struct group *)g->data; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
93 g = g_slist_remove(g, m); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
94 h = m->members; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
95 while (h) { |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
96 n = (struct buddy *)h->data; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
97 h = g_slist_remove(h, n); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
98 g_free(n); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
99 } |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
100 g_free(m); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
101 } |
960 | 102 g_free(gc); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
103 #ifndef USE_APPLET |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
104 if (!connections && mainwindow) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
105 gtk_widget_show(mainwindow); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
106 #endif |
960 | 107 } |
108 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
109 struct gaim_connection *find_gaim_conn_by_name(char *name) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
110 { |
960 | 111 char *who = g_strdup(normalize(name)); |
112 GSList *c = connections; | |
113 struct gaim_connection *g = NULL; | |
114 | |
115 while (c) { | |
116 g = (struct gaim_connection *)c->data; | |
117 if (!strcmp(normalize(g->username), who)) { | |
118 g_free(who); | |
119 return g; | |
120 } | |
121 c = c->next; | |
122 } | |
123 | |
124 g_free(who); | |
125 return NULL; | |
126 } | |
127 | |
128 static void delete_acctedit(GtkWidget *w, gpointer d) | |
129 { | |
130 if (acctedit) { | |
131 save_prefs(); | |
132 gtk_widget_destroy(acctedit); | |
133 } | |
134 acctedit = NULL; | |
1666
8b0c165a33f4
[gaim-migrate @ 1676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1575
diff
changeset
|
135 list = NULL; |
1474
4e891576c226
[gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1473
diff
changeset
|
136 if (!d && !blist && !mainwindow && !connections) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1115
diff
changeset
|
137 gtk_main_quit(); |
960 | 138 } |
139 | |
140 static gint acctedit_close(GtkWidget *w, gpointer d) | |
141 { | |
142 gtk_widget_destroy(acctedit); | |
1474
4e891576c226
[gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1473
diff
changeset
|
143 if (!d && !blist && !mainwindow && !connections) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1115
diff
changeset
|
144 gtk_main_quit(); |
960 | 145 return FALSE; |
146 } | |
147 | |
148 static char *proto_name(int proto) | |
149 { | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
150 struct prpl *p = find_prpl(proto); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
151 if (p && p->name) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
152 return (*p->name)(); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
153 else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
154 return "Unknown"; |
960 | 155 } |
156 | |
157 static GtkWidget *generate_list() | |
158 { | |
159 GtkWidget *win; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
160 char *titles[4] = { "Screenname", "Currently Online", "Auto-login", "Protocol" }; |
960 | 161 GList *u = aim_users; |
162 struct aim_user *a; | |
163 int i; | |
164 | |
165 win = gtk_scrolled_window_new(0, 0); | |
166 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
|
167 GTK_POLICY_ALWAYS); |
960 | 168 |
169 list = gtk_clist_new_with_titles(4, titles); | |
170 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90); | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
171 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_MULTIPLE); |
960 | 172 gtk_clist_column_titles_passive(GTK_CLIST(list)); |
173 gtk_container_add(GTK_CONTAINER(win), list); | |
174 gtk_widget_show(list); | |
175 | |
176 while (u) { | |
177 a = (struct aim_user *)u->data; | |
178 titles[0] = a->username; | |
1074
2cff18c2f9c6
[gaim-migrate @ 1084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
179 titles[1] = a->gc ? "Yes" : "No"; |
960 | 180 titles[2] = (a->options & OPT_USR_AUTO) ? "True" : "False"; |
181 titles[3] = proto_name(a->protocol); | |
182 i = gtk_clist_append(GTK_CLIST(list), titles); | |
183 gtk_clist_set_row_data(GTK_CLIST(list), i, a); | |
184 u = u->next; | |
185 } | |
186 | |
187 gtk_widget_show(win); | |
188 return win; | |
189 } | |
190 | |
191 static void delmod(GtkWidget *w, struct aim_user *u) | |
192 { | |
193 gtk_widget_destroy(w); | |
194 if (u) { | |
195 u->mod = NULL; | |
196 } else { | |
197 newmod = NULL; | |
198 } | |
199 } | |
200 | |
201 static void mod_opt(GtkWidget *b, struct mod_usr_opt *m) | |
202 { | |
203 if (m->user) { | |
204 m->user->tmp_options = m->user->tmp_options ^ m->opt; | |
205 } else { | |
206 tmpusr.options = tmpusr.options ^ m->opt; | |
207 } | |
208 } | |
209 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
210 static void free_muo(GtkWidget *b, struct mod_usr_opt *m) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
211 { |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
212 g_free(m); |
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
213 } |
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
214 |
960 | 215 static GtkWidget *acct_button(const char *text, struct aim_user *u, int option, GtkWidget *box) |
216 { | |
217 GtkWidget *button; | |
218 struct mod_usr_opt *muo = g_new0(struct mod_usr_opt, 1); | |
219 button = gtk_check_button_new_with_label(text); | |
220 if (u) { | |
221 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (u->options & option)); | |
222 } else { | |
223 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (tmpusr.options & option)); | |
224 } | |
225 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
|
226 muo->user = u; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
227 muo->opt = option; |
960 | 228 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
|
229 gtk_signal_connect(GTK_OBJECT(button), "destroy", GTK_SIGNAL_FUNC(free_muo), muo); |
960 | 230 gtk_widget_show(button); |
231 return button; | |
232 } | |
233 | |
234 static void ok_mod(GtkWidget *w, struct aim_user *u) | |
235 { | |
1954
c15c3a3f6cd4
[gaim-migrate @ 1964]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
236 const char *txt; |
960 | 237 int i; |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
238 |
960 | 239 if (u) { |
240 u->options = u->tmp_options; | |
241 u->protocol = u->tmp_protocol; | |
242 txt = gtk_entry_get_text(GTK_ENTRY(u->pass)); | |
243 if (u->options & OPT_USR_REM_PASS) | |
244 g_snprintf(u->password, sizeof(u->password), "%s", txt); | |
245 else | |
246 u->password[0] = '\0'; | |
247 gtk_widget_destroy(u->mod); | |
248 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
|
249 gtk_clist_set_text(GTK_CLIST(list), i, 2, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
250 (u->options & OPT_USR_AUTO) ? "True" : "False"); |
960 | 251 gtk_clist_set_text(GTK_CLIST(list), i, 3, proto_name(u->protocol)); |
252 } else { | |
253 txt = gtk_entry_get_text(GTK_ENTRY(tmpusr.name)); | |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
254 u = new_user(txt, tmpusr.protocol, tmpusr.options); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
255 |
960 | 256 txt = gtk_entry_get_text(GTK_ENTRY(tmpusr.pass)); |
257 g_snprintf(u->password, sizeof(u->password), "%s", txt); | |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
258 |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
259 for (i = 0; i < 6; i++) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
260 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
|
261 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
262 gtk_widget_destroy(newmod); |
960 | 263 } |
264 save_prefs(); | |
265 } | |
266 | |
267 static void cancel_mod(GtkWidget *w, struct aim_user *u) | |
268 { | |
269 if (u) { | |
270 gtk_widget_destroy(u->mod); | |
271 } else { | |
272 gtk_widget_destroy(newmod); | |
273 } | |
274 } | |
275 | |
276 static void set_prot(GtkWidget *opt, int proto) | |
277 { | |
278 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt)); | |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
279 struct prpl *p, *q; |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
280 q = find_prpl(proto); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
281 if (u && (u->tmp_protocol != proto)) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
282 int i; |
1878
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
283 for (i = 0; i < 7; i++) |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
284 u->proto_opt[i][0] = '\0'; |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
285 p = find_prpl(u->tmp_protocol); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
286 if (!(p->options & OPT_PROTO_NO_PASSWORD) && |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
287 (q->options & OPT_PROTO_NO_PASSWORD)) { |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
288 gtk_widget_hide(u->pwdbox); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
289 gtk_widget_hide(u->rempass); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
290 } else if ((p->options & OPT_PROTO_NO_PASSWORD) && |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
291 !(q->options & OPT_PROTO_NO_PASSWORD)) { |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
292 gtk_widget_show(u->pwdbox); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
293 gtk_widget_show(u->rempass); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
294 } |
960 | 295 u->tmp_protocol = proto; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
296 generate_prpl_options(u, u->main); |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
297 } else if (!u && (tmpusr.tmp_protocol != proto)) { |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
298 int i; |
1878
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
299 for (i = 0; i < 7; i++) |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
300 tmpusr.proto_opt[i][0] = '\0'; |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
301 p = find_prpl(tmpusr.tmp_protocol); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
302 if (!(p->options & OPT_PROTO_NO_PASSWORD) && |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
303 (q->options & OPT_PROTO_NO_PASSWORD)) { |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
304 gtk_widget_hide(tmpusr.pwdbox); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
305 gtk_widget_hide(tmpusr.rempass); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
306 } else if ((p->options & OPT_PROTO_NO_PASSWORD) && |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
307 !(q->options & OPT_PROTO_NO_PASSWORD)) { |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
308 gtk_widget_show(tmpusr.pwdbox); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
309 gtk_widget_show(tmpusr.rempass); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
310 } |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
311 tmpusr.tmp_protocol = tmpusr.protocol = proto; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
312 generate_prpl_options(NULL, newmain); |
960 | 313 } |
314 } | |
315 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
316 static GtkWidget *make_protocol_menu(GtkWidget *box, struct aim_user *u) |
960 | 317 { |
318 GtkWidget *optmenu; | |
319 GtkWidget *menu; | |
320 GtkWidget *opt; | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
321 GSList *p = protocols; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
322 struct prpl *e; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
323 int count = 0; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
324 gboolean found = FALSE; |
960 | 325 |
326 optmenu = gtk_option_menu_new(); | |
327 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5); | |
328 gtk_widget_show(optmenu); | |
329 | |
330 menu = gtk_menu_new(); | |
331 | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
332 while (p) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
333 e = (struct prpl *)p->data; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
334 if (u) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
335 if (e->protocol == u->tmp_protocol) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
336 found = TRUE; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
337 if (!found) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
338 count++; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
339 } else { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
340 if (e->protocol == tmpusr.tmp_protocol) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
341 found = TRUE; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
342 if (!found) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
343 count++; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
344 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
345 if (e->name) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
346 opt = gtk_menu_item_new_with_label((*e->name)()); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
347 else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
348 opt = gtk_menu_item_new_with_label("Unknown"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
349 gtk_object_set_user_data(GTK_OBJECT(opt), u); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
350 gtk_signal_connect(GTK_OBJECT(opt), "activate", |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
351 GTK_SIGNAL_FUNC(set_prot), (void *)e->protocol); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
352 gtk_menu_append(GTK_MENU(menu), opt); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
353 gtk_widget_show(opt); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
354 p = p->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
355 } |
960 | 356 |
357 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
358 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), count); |
960 | 359 |
360 return optmenu; | |
361 } | |
362 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
363 static void generate_general_options(struct aim_user *u, GtkWidget *book) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
364 { |
960 | 365 GtkWidget *vbox; |
366 GtkWidget *hbox; | |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
367 GtkWidget *pwdbox; |
960 | 368 GtkWidget *label; |
369 GtkWidget *name; | |
370 GtkWidget *pass; | |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
371 GtkWidget *rempass; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
372 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
373 vbox = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
374 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
375 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new(_("General Options"))); |
960 | 376 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
377 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
378 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
|
379 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
380 label = gtk_label_new(_("Screenname:")); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
381 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
960 | 382 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
383 name = gtk_entry_new(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
384 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 0); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
385 |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
386 pwdbox = gtk_hbox_new(FALSE, 5); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
387 gtk_box_pack_start(GTK_BOX(vbox), pwdbox, FALSE, FALSE, 0); |
960 | 388 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
389 label = gtk_label_new(_("Password:")); |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
390 gtk_box_pack_start(GTK_BOX(pwdbox), label, FALSE, FALSE, 0); |
960 | 391 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
392 pass = gtk_entry_new(); |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
393 gtk_box_pack_start(GTK_BOX(pwdbox), pass, TRUE, TRUE, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
394 gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE); |
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 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
397 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
960 | 398 gtk_widget_show(hbox); |
399 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
400 label = gtk_label_new(_("Protocol:")); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
401 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
960 | 402 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
403 make_protocol_menu(hbox, u); |
960 | 404 |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
405 rempass = acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox); |
960 | 406 acct_button(_("Auto-Login"), u, OPT_USR_AUTO, vbox); |
1772
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1710
diff
changeset
|
407 /*acct_button(_("Send KeepAlive packet (6 bytes/second)"), u, OPT_USR_KEEPALV, vbox);*/ |
960 | 408 |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
409 gtk_widget_show_all(vbox); |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
410 |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
411 if (u) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
412 u->name = name; |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
413 u->pwdbox = pwdbox; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
414 u->pass = pass; |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
415 u->rempass = rempass; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
416 gtk_entry_set_text(GTK_ENTRY(name), u->username); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
417 gtk_entry_set_text(GTK_ENTRY(pass), u->password); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
418 gtk_entry_set_editable(GTK_ENTRY(name), FALSE); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
419 } else { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
420 tmpusr.name = name; |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
421 tmpusr.pwdbox = pwdbox; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
422 tmpusr.pass = pass; |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
423 tmpusr.rempass = rempass; |
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
424 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
425 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
426 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
427 static void generate_prpl_options(struct aim_user *u, GtkWidget *book) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
428 { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
429 struct prpl *p; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
430 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
431 if (u) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
432 p = find_prpl(u->tmp_protocol); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
433 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
434 p = find_prpl(tmpusr.protocol); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
435 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
436 /* 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
|
437 * particular protocol, so clear it out and make a new one. */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
438 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
439 gtk_notebook_remove_page(GTK_NOTEBOOK(book), 1); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
440 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
441 if (p && p->user_opts) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
442 if (u) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
443 (*p->user_opts)(book, u); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
444 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
445 (*p->user_opts)(book, &tmpusr); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
446 } |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
447 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
448 |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
449 static void show_acct_mod(struct aim_user *u) |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
450 { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
451 /* 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
|
452 * 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
|
453 * 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
|
454 * 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
|
455 * 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
|
456 * 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
|
457 GtkWidget *mod; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
458 GtkWidget *box; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
459 GtkWidget *book; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
460 GtkWidget *hbox; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
461 GtkWidget *button; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
462 |
2101
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
463 struct prpl *p; |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
464 |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
465 if (!u && newmod) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
466 gtk_widget_show(newmod); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
467 return; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
468 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
469 if (u && u->mod) { |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
470 gtk_widget_show(u->mod); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
471 return; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
472 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
473 |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
474 mod = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
475 gtk_window_set_wmclass(GTK_WINDOW(mod), "account", "Gaim"); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
476 gtk_widget_realize(mod); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
477 aol_icon(mod->window); |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
478 gtk_window_set_title(GTK_WINDOW(mod), _("Gaim - Modify Account")); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
479 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
|
480 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
|
481 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
482 box = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
483 gtk_container_border_width(GTK_CONTAINER(mod), 5); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
484 gtk_container_add(GTK_CONTAINER(mod), box); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
485 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
486 book = gtk_notebook_new(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
487 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
|
488 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
489 if (u) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
490 u->tmp_protocol = u->protocol; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
491 else |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
492 tmpusr.tmp_protocol = tmpusr.protocol; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
493 generate_general_options(u, book); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
494 generate_prpl_options(u, book); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
495 |
960 | 496 hbox = gtk_hbox_new(FALSE, 5); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
497 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
960 | 498 |
499 button = picture_button(mod, _("Cancel"), cancel_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
500 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
960 | 501 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_mod), u); |
502 | |
503 button = picture_button(mod, _("OK"), ok_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
504 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
960 | 505 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_mod), u); |
506 | |
507 if (u) { | |
508 u->mod = mod; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
509 u->main = book; /* sorry, i think i broke the joke :) */ |
960 | 510 u->tmp_options = u->options; |
511 } else { | |
512 newmod = mod; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
513 newmain = book; |
960 | 514 } |
515 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
516 gtk_widget_show_all(mod); |
2101
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
517 |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
518 if (u) { |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
519 p = find_prpl(u->tmp_protocol); |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
520 if (p->options & OPT_PROTO_NO_PASSWORD) { |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
521 gtk_widget_hide(u->pwdbox); |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
522 gtk_widget_hide(u->rempass); |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
523 } |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
524 } else { |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
525 p = find_prpl(tmpusr.tmp_protocol); |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
526 if (p->options & OPT_PROTO_NO_PASSWORD) { |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
527 gtk_widget_hide(tmpusr.pwdbox); |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
528 gtk_widget_hide(tmpusr.rempass); |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
529 } |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
530 } |
960 | 531 } |
532 | |
533 static void add_acct(GtkWidget *w, gpointer d) | |
534 { | |
535 show_acct_mod(NULL); | |
536 } | |
537 | |
538 static void mod_acct(GtkWidget *w, gpointer d) | |
539 { | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
540 GList *l = GTK_CLIST(list)->selection; |
960 | 541 int row = -1; |
542 struct aim_user *u; | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
543 while (l) { |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
544 row = (int)l->data; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
545 if (row != -1) { |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
546 u = g_list_nth_data(aim_users, row); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
547 if (u) |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
548 show_acct_mod(u); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
549 } |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
550 l = l->next; |
960 | 551 } |
552 } | |
553 | |
554 static void pass_des(GtkWidget *w, struct aim_user *u) | |
555 { | |
556 gtk_widget_destroy(w); | |
557 u->passprmt = NULL; | |
558 } | |
559 | |
560 static void pass_cancel(GtkWidget *w, struct aim_user *u) | |
561 { | |
562 gtk_widget_destroy(u->passprmt); | |
563 u->passprmt = NULL; | |
564 } | |
565 | |
566 static void pass_signon(GtkWidget *w, struct aim_user *u) | |
567 { | |
1954
c15c3a3f6cd4
[gaim-migrate @ 1964]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
568 const char *txt = gtk_entry_get_text(GTK_ENTRY(u->passentry)); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
569 g_snprintf(u->password, sizeof(u->password), "%s", txt); |
960 | 570 #ifdef USE_APPLET |
571 set_user_state(signing_on); | |
572 #endif | |
573 gtk_widget_destroy(u->passprmt); | |
574 u->passprmt = NULL; | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
575 serv_login(u); |
960 | 576 } |
577 | |
578 static void do_pass_dlg(struct aim_user *u) | |
579 { | |
580 /* we can safely assume that u is not NULL */ | |
581 GtkWidget *frame; | |
582 GtkWidget *vbox; | |
583 GtkWidget *hbox; | |
584 char buf[96]; | |
585 GtkWidget *label; | |
586 GtkWidget *button; | |
587 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
588 if (u->passprmt) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
589 gtk_widget_show(u->passprmt); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
590 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
591 } |
1956
c9c20663e05b
[gaim-migrate @ 1966]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1954
diff
changeset
|
592 u->passprmt = gtk_window_new(GTK_WINDOW_DIALOG); |
960 | 593 gtk_window_set_wmclass(GTK_WINDOW(u->passprmt), "password", "Gaim"); |
594 gtk_container_border_width(GTK_CONTAINER(u->passprmt), 5); | |
595 gtk_signal_connect(GTK_OBJECT(u->passprmt), "destroy", GTK_SIGNAL_FUNC(pass_des), u); | |
596 gtk_widget_realize(u->passprmt); | |
597 aol_icon(u->passprmt->window); | |
598 | |
599 frame = gtk_frame_new(_("Enter Password")); | |
600 gtk_container_add(GTK_CONTAINER(u->passprmt), frame); | |
601 gtk_widget_show(frame); | |
602 | |
603 vbox = gtk_vbox_new(FALSE, 5); | |
604 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
605 gtk_widget_show(vbox); | |
606 | |
607 hbox = gtk_hbox_new(FALSE, 5); | |
608 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
609 gtk_widget_show(hbox); | |
610 | |
611 g_snprintf(buf, sizeof(buf), "Password for %s:", u->username); | |
612 label = gtk_label_new(buf); | |
613 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
614 gtk_widget_show(label); | |
615 | |
616 u->passentry = gtk_entry_new(); | |
617 gtk_entry_set_visibility(GTK_ENTRY(u->passentry), FALSE); | |
618 gtk_box_pack_start(GTK_BOX(hbox), u->passentry, FALSE, FALSE, 5); | |
619 gtk_signal_connect(GTK_OBJECT(u->passentry), "activate", GTK_SIGNAL_FUNC(pass_signon), u); | |
620 gtk_widget_grab_focus(u->passentry); | |
621 gtk_widget_show(u->passentry); | |
622 | |
623 hbox = gtk_hbox_new(FALSE, 5); | |
624 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
625 gtk_widget_show(hbox); | |
626 | |
627 button = picture_button(u->passprmt, _("Cancel"), cancel_xpm); | |
628 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_cancel), u); | |
629 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); | |
630 | |
631 button = picture_button(u->passprmt, _("Signon"), ok_xpm); | |
632 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_signon), u); | |
633 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); | |
634 | |
635 gtk_widget_show(u->passprmt); | |
636 } | |
637 | |
638 static void acct_signin(GtkWidget *w, gpointer d) | |
639 { | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
640 GList *l = GTK_CLIST(list)->selection; |
960 | 641 int row = -1; |
642 struct aim_user *u; | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
643 while (l) { |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
644 row = (int)l->data; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
645 u = g_list_nth_data(aim_users, row); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
646 if (!u->gc) { |
2101
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
647 struct prpl *p = find_prpl(u->protocol); |
dd3aa315519d
[gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2100
diff
changeset
|
648 if (p && !(p->options & OPT_PROTO_NO_PASSWORD) && !u->password[0]) { |
960 | 649 do_pass_dlg(u); |
650 } else { | |
651 #ifdef USE_APPLET | |
652 set_user_state(signing_on); | |
653 #endif /* USE_APPLET */ | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
654 gtk_clist_set_text(GTK_CLIST(list), row, 1, "Attempting"); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
655 serv_login(u); |
960 | 656 } |
657 } else { | |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
658 u->gc->wants_to_die = TRUE; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
659 signoff(u->gc); |
960 | 660 } |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
661 l = l->next; |
960 | 662 } |
663 } | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
664 |
2007
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
665 static void do_del_acct(gpointer w, struct aim_user *u) |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
666 { |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
667 if (u->gc) { |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
668 u->gc->wants_to_die = TRUE; |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
669 signoff(u->gc); |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
670 } |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
671 gtk_clist_remove(GTK_CLIST(list), g_list_index(aim_users, u)); |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
672 aim_users = g_list_remove(aim_users, u); |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
673 save_prefs(); |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
674 } |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
675 |
960 | 676 static void del_acct(GtkWidget *w, gpointer d) |
677 { | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
678 GList *l = GTK_CLIST(list)->selection; |
2007
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
679 char buf[8192]; |
960 | 680 int row = -1; |
681 struct aim_user *u; | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
682 while (l) { |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
683 row = (int)l->data; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
684 u = g_list_nth_data(aim_users, row); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
685 if (!u) |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
686 return; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
687 |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
688 g_snprintf(buf, sizeof(buf), _("Are you sure you want to delete %s?"), u->username); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
689 do_ask_dialog(buf, u, do_del_acct, NULL); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
690 l = l->next; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
691 } |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
692 } |
2007
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
693 |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
694 static void sel_auto(gpointer w, gpointer d) |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
695 { |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
696 GList *l = aim_users; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
697 struct aim_user *u; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
698 int i = 0; /* faster than doing g_list_index each time */ |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
699 while (l) { |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
700 u = l->data; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
701 l = l->next; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
702 if (u->options & OPT_USR_AUTO) |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
703 gtk_clist_select_row(GTK_CLIST(list), i, -1); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
704 else |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
705 gtk_clist_unselect_row(GTK_CLIST(list), i, -1); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
706 i++; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
707 } |
960 | 708 } |
709 | |
710 void account_editor(GtkWidget *w, GtkWidget *W) | |
711 { | |
712 /* please kill me */ | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
713 GtkWidget *vbox; |
960 | 714 GtkWidget *hbox; |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
715 GtkWidget *vbox2; |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
716 GtkWidget *sw; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
717 GtkWidget *button; /* used for many things */ |
960 | 718 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
719 if (acctedit) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
720 gtk_widget_show(acctedit); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
721 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
722 } |
960 | 723 |
724 acctedit = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
725 gtk_window_set_title(GTK_WINDOW(acctedit), _("Gaim - Account Editor")); | |
726 gtk_window_set_wmclass(GTK_WINDOW(acctedit), "accounteditor", "Gaim"); | |
727 gtk_widget_realize(acctedit); | |
728 aol_icon(acctedit->window); | |
729 gtk_widget_set_usize(acctedit, -1, 200); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
730 gtk_signal_connect(GTK_OBJECT(acctedit), "destroy", GTK_SIGNAL_FUNC(delete_acctedit), W); |
960 | 731 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
732 vbox = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
733 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
734 gtk_container_add(GTK_CONTAINER(acctedit), vbox); |
960 | 735 |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
736 hbox = gtk_hbox_new(FALSE, 5); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
737 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
738 |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
739 sw = generate_list(); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
740 |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
741 vbox2 = gtk_vbox_new(TRUE, 5); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
742 gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, 0); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
743 |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
744 button = picture_button2(acctedit, _("Select All"), tb_refresh_xpm, 2); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
745 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
746 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
747 GTK_SIGNAL_FUNC(gtk_clist_select_all), GTK_OBJECT(list)); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
748 |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
749 button = picture_button2(acctedit, _("Select Autos"), tb_redo_xpm, 2); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
750 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
751 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(sel_auto), NULL); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
752 |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
753 button = picture_button2(acctedit, _("Select None"), tb_undo_xpm, 2); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
754 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
755 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
756 GTK_SIGNAL_FUNC(gtk_clist_unselect_all), GTK_OBJECT(list)); |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
757 |
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
758 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0); |
960 | 759 |
760 hbox = gtk_hbox_new(TRUE, 5); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
761 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
960 | 762 |
763 button = picture_button(acctedit, _("Add"), gnome_add_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
764 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 765 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(add_acct), NULL); |
766 | |
767 button = picture_button(acctedit, _("Modify"), gnome_preferences_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
768 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 769 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(mod_acct), NULL); |
770 | |
771 button = picture_button(acctedit, _("Sign On/Off"), join_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
772 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 773 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(acct_signin), NULL); |
774 | |
775 button = picture_button(acctedit, _("Delete"), gnome_remove_xpm); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
776 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); |
960 | 777 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(del_acct), NULL); |
778 | |
1436
f6a9bd50fd19
[gaim-migrate @ 1446]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1401
diff
changeset
|
779 button = picture_button(acctedit, _("Close"), cancel_xpm); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
780 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
|
781 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(acctedit_close), W); |
960 | 782 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
783 gtk_widget_show_all(acctedit); |
960 | 784 } |
785 | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
786 void account_online(struct gaim_connection *gc) |
960 | 787 { |
788 int i; | |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
789 |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
790 /* first we hide the login progress meter */ |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
791 if (gc->meter) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
792 gtk_widget_destroy(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
793 gc->meter = NULL; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
794 |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
795 /* then we do the buddy list stuff */ |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
796 if (mainwindow) |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
797 gtk_widget_hide(mainwindow); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
798 |
2105
ff225036d434
[gaim-migrate @ 2115]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2101
diff
changeset
|
799 show_buddy_list(); |
ff225036d434
[gaim-migrate @ 2115]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2101
diff
changeset
|
800 refresh_buddy_window(); |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
801 #ifdef USE_APPLET |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
802 if (general_options & OPT_GEN_APP_BUDDY_SHOW) { |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
803 createOnlinePopup(); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
804 applet_buddy_show = TRUE; |
1928
b1fad054b4f0
[gaim-migrate @ 1938]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1918
diff
changeset
|
805 } else if (!blist) { |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
806 gtk_widget_hide(blist); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
807 applet_buddy_show = FALSE; |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
808 } |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
809 set_user_state(online); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
810 #endif |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
811 setup_buddy_chats(); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
812 |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1115
diff
changeset
|
813 update_connection_dependent_prefs(); |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
814 do_away_menu(); |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1474
diff
changeset
|
815 do_proto_menu(); |
2109
3110ea142888
[gaim-migrate @ 2119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2105
diff
changeset
|
816 redo_convo_menus(NULL); |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
817 gaim_setup(gc); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
818 |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
819 plugin_event(event_signon, gc, 0, 0, 0); |
1575
427e1409917c
[gaim-migrate @ 1585]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1499
diff
changeset
|
820 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
|
821 |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
822 /* away option given? */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
823 if (opt_away) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
824 away_on_login(opt_away_arg); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
825 /* don't do it again */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
826 opt_away = 0; |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
827 } else if (awaymessage) { |
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
828 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message); |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
829 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
830 if (opt_away_arg != NULL) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
831 g_free (opt_away_arg); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
832 opt_away_arg = NULL; |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
833 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
834 |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
835 /* everything for the account editor */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
836 if (!acctedit) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
837 return; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
838 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
|
839 gtk_clist_set_text(GTK_CLIST(list), i, 1, "Yes"); |
960 | 840 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
|
841 |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
842 return; |
960 | 843 } |
844 | |
845 void account_offline(struct gaim_connection *gc) | |
846 { | |
847 int i; | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
848 if (gc->meter) |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
849 gtk_widget_destroy(gc->meter); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
850 gc->meter = NULL; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
851 gc->user->gc = NULL; /* wasn't that awkward? */ |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
852 if (!acctedit) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
853 return; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
854 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
|
855 gtk_clist_set_text(GTK_CLIST(list), i, 1, "No"); |
960 | 856 } |
857 | |
858 void auto_login() | |
859 { | |
860 GList *u = aim_users; | |
861 struct aim_user *a = NULL; | |
862 | |
863 while (u) { | |
864 a = (struct aim_user *)u->data; | |
865 if ((a->options & OPT_USR_AUTO) && (a->options & OPT_USR_REM_PASS)) { | |
866 #ifdef USE_APPLET | |
867 set_user_state(signing_on); | |
868 #endif /* USE_APPLET */ | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
869 serv_login(a); |
960 | 870 } |
871 u = u->next; | |
872 } | |
873 } | |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
874 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
875 static void cancel_signon(GtkWidget *button, struct gaim_connection *gc) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
876 { |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
877 gc->wants_to_die = TRUE; |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
878 signoff(gc); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
879 } |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
880 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
881 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
|
882 { |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
883 return TRUE; |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
884 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
885 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
886 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
|
887 { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
888 if (mainwindow) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
889 gtk_widget_hide(mainwindow); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
890 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
891 if (!gc->meter) { |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
892 GtkWidget *box, *label, *button; |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
893 char buf[256]; |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
894 |
1956
c9c20663e05b
[gaim-migrate @ 1966]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1954
diff
changeset
|
895 gc->meter = gtk_window_new(GTK_WINDOW_DIALOG); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
896 gtk_window_set_policy(GTK_WINDOW(gc->meter), 0, 0, 1); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
897 gtk_window_set_wmclass(GTK_WINDOW(gc->meter), "signon", "Gaim"); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
898 gtk_container_set_border_width(GTK_CONTAINER(gc->meter), 5); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
899 g_snprintf(buf, sizeof(buf), "%s Signing On", gc->username); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
900 gtk_window_set_title(GTK_WINDOW(gc->meter), buf); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
901 gtk_signal_connect(GTK_OBJECT(gc->meter), "delete_event", |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
902 GTK_SIGNAL_FUNC(meter_destroy), gc); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
903 gtk_widget_realize(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
904 aol_icon(gc->meter->window); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
905 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
906 box = gtk_vbox_new(FALSE, 5); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
907 gtk_container_add(GTK_CONTAINER(gc->meter), box); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
908 gtk_widget_show(box); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
909 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
910 label = gtk_label_new(buf); |
1172 | 911 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
|
912 gtk_widget_show(label); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
913 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
914 gc->progress = gtk_progress_bar_new(); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
915 gtk_widget_set_usize(gc->progress, 150, 0); |
1172 | 916 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
|
917 gtk_widget_show(gc->progress); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
918 |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
919 gc->status = gtk_statusbar_new(); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
920 gtk_widget_set_usize(gc->status, 150, 0); |
1172 | 921 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
|
922 gtk_widget_show(gc->status); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
923 |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
924 button = gtk_button_new_with_label(_("Cancel")); |
1172 | 925 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
|
926 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
|
927 gtk_widget_show(button); |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
928 |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
929 gtk_widget_show(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
930 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
931 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
932 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
|
933 gtk_statusbar_pop(GTK_STATUSBAR(gc->status), 1); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
934 gtk_statusbar_push(GTK_STATUSBAR(gc->status), 1, message); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
935 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
936 |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
937 static void set_kick_null(GtkObject *obj, struct aim_user *u) |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
938 { |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
939 u->kick_dlg = NULL; |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
940 } |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
941 |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
942 void hide_login_progress(struct gaim_connection *gc, char *why) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
943 { |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
944 char buf[2048]; |
1708
eeb0cfe710b1
[gaim-migrate @ 1718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1666
diff
changeset
|
945 sprintf(buf, _("%s\n%s was unable to sign on: %s"), full_date(), gc->username, why); |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
946 if (gc->user->kick_dlg) |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
947 gtk_widget_destroy(gc->user->kick_dlg); |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
948 gc->user->kick_dlg = do_error_dialog(buf, _("Signon Error")); |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
949 gtk_signal_connect(GTK_OBJECT(gc->user->kick_dlg), "destroy", |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
950 GTK_SIGNAL_FUNC(set_kick_null), gc->user); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
951 if (gc->meter) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
952 gtk_widget_destroy(gc->meter); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
953 gc->meter = NULL; |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
954 } |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
955 |
1942
ba421d552093
[gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1928
diff
changeset
|
956 struct aim_user *new_user(const char *name, int proto, int opts) |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
957 { |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
958 char *titles[4]; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
959 int i; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
960 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
961 struct aim_user *u = g_new0(struct aim_user, 1); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
962 g_snprintf(u->username, sizeof(u->username), "%s", name); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
963 u->protocol = proto; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
964 u->options = opts; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
965 aim_users = g_list_append(aim_users, u); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
966 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
967 if (list) { |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
968 titles[0] = u->username; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
969 titles[1] = u->gc ? "Yes" : "No"; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
970 titles[2] = (u->options & OPT_USR_AUTO) ? "True" : "False"; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
971 titles[3] = proto_name(u->protocol); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
972 i = gtk_clist_append(GTK_CLIST(list), titles); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
973 gtk_clist_set_row_data(GTK_CLIST(list), i, u); |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
974 } |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
975 |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
976 return u; |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
977 } |