annotate src/multi.c @ 2558:78a1cee07540

[gaim-migrate @ 2571] copy and paste is fun. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 19 Oct 2001 21:27:07 +0000
parents 4fc6aac9da94
children e49ab50736bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /*
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 * gaim
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 *
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 *
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 * (at your option) any later version.
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 *
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 * GNU General Public License for more details.
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 *
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 *
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 */
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
22 #include <string.h>
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 #include <gtk/gtk.h>
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
24 #include "prpl.h"
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 #include "multi.h"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 #include "pixmaps/gnome_add.xpm"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 #include "pixmaps/gnome_preferences.xpm"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 #include "pixmaps/join.xpm"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 #include "pixmaps/gnome_remove.xpm"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 #include "pixmaps/cancel.xpm"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 GSList *connections;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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 */
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
47
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
48 static GSList *mod_users = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
50 static struct mod_user *find_mod_user(struct aim_user *a)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
51 {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
52 GSList *m = mod_users;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
53 while (m) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
54 struct mod_user *u = m->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
55 if (u->user == a)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
56 return u;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
57 m = m->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
58 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
59 return NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
60 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
61
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
62 static void generate_protocol_options(struct mod_user *, GtkWidget *);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
63
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 struct mod_usr_opt {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
65 struct mod_user *user;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 int opt;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 };
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
69 struct gaim_connection *new_gaim_conn(struct aim_user *user)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 struct gaim_connection *gc = g_new0(struct gaim_connection, 1);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1355
diff changeset
72 gc->edittype = EDIT_GC;
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
73 gc->protocol = user->protocol;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
74 gc->prpl = find_prpl(user->protocol);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
75 g_snprintf(gc->username, sizeof(gc->username), "%s", user->username);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
76 g_snprintf(gc->password, sizeof(gc->password), "%s", user->password);
1153
3063e6743913 [gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1124
diff changeset
77 gc->keepalive = 0;
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
78 gc->inpa = 0;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 993
diff changeset
79 gc->buddy_chats = NULL;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
80 gc->groups = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
81 gc->permit = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
82 gc->deny = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 connections = g_slist_append(connections, gc);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
86 user->gc = gc;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
87 gc->user = user;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
88
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89 return gc;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 void destroy_gaim_conn(struct gaim_connection *gc)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 {
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
94 GSList *g = gc->groups;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
95 GSList *h;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
96 struct group *m;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
97 struct buddy *n;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 connections = g_slist_remove(connections, gc);
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
99 while (g) {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
100 m = (struct group *)g->data;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
101 g = g_slist_remove(g, m);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
102 h = m->members;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
103 while (h) {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
104 n = (struct buddy *)h->data;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
105 h = g_slist_remove(h, n);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
106 g_free(n);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
107 }
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
108 g_free(m);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
109 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 g_free(gc);
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
111 #ifndef USE_APPLET
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
112 if (!connections && mainwindow)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
113 gtk_widget_show(mainwindow);
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
114 #endif
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 static void delete_acctedit(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119 if (acctedit) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 save_prefs();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 gtk_widget_destroy(acctedit);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 acctedit = NULL;
1666
8b0c165a33f4 [gaim-migrate @ 1676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1575
diff changeset
124 list = NULL;
1474
4e891576c226 [gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1473
diff changeset
125 if (!d && !blist && !mainwindow && !connections)
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1115
diff changeset
126 gtk_main_quit();
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129 static gint acctedit_close(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 gtk_widget_destroy(acctedit);
1474
4e891576c226 [gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1473
diff changeset
132 if (!d && !blist && !mainwindow && !connections)
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1115
diff changeset
133 gtk_main_quit();
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 return FALSE;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 static char *proto_name(int proto)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 {
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
139 struct prpl *p = find_prpl(proto);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
140 if (p && p->name)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
141 return (*p->name)();
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
142 else
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
143 return "Unknown";
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
146 void regenerate_user_list()
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
147 {
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
148 char *titles[4];
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
149 GSList *u = aim_users;
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
150 struct aim_user *a;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
151 int i;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
152
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
153 if (!acctedit)
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
154 return;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
155
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
156 gtk_clist_clear(GTK_CLIST(list));
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
157
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
158 while (u) {
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
159 a = (struct aim_user *)u->data;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
160 titles[0] = a->username;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
161 titles[1] = a->gc ? "Yes" : "No";
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
162 titles[2] = (a->options & OPT_USR_AUTO) ? "True" : "False";
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
163 titles[3] = proto_name(a->protocol);
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
164 i = gtk_clist_append(GTK_CLIST(list), titles);
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
165 gtk_clist_set_row_data(GTK_CLIST(list), i, a);
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
166 u = u->next;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
167 }
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
168 }
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
169
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
170 static GtkWidget *generate_list()
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
171 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
172 GtkWidget *win;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
173 char *titles[4] = { "Screenname", "Currently Online", "Auto-login", "Protocol" };
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
174
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
175 win = gtk_scrolled_window_new(0, 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176 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
177 GTK_POLICY_ALWAYS);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
179 list = gtk_clist_new_with_titles(4, titles);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
180 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90);
2364
94314b9dbda4 [gaim-migrate @ 2377]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
181 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_EXTENDED);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 gtk_clist_column_titles_passive(GTK_CLIST(list));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183 gtk_container_add(GTK_CONTAINER(win), list);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184 gtk_widget_show(list);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
186 regenerate_user_list();
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
187
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
188 gtk_widget_show(win);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
189 return win;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
190 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
191
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
192 static void delmod(GtkWidget *w, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
193 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
194 mod_users = g_slist_remove(mod_users, u);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
195 g_free(u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
196 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
197
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198 static void mod_opt(GtkWidget *b, struct mod_usr_opt *m)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
199 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
200 m->user->options = m->user->options ^ m->opt;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
201 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
202
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
203 static void free_muo(GtkWidget *b, struct mod_usr_opt *m)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
204 {
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
205 g_free(m);
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
206 }
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
207
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
208 static GtkWidget *acct_button(const char *text, struct mod_user *u, int option, GtkWidget *box)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
209 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210 GtkWidget *button;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
211 struct mod_usr_opt *muo = g_new0(struct mod_usr_opt, 1);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
212 button = gtk_check_button_new_with_label(text);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
213 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (u->options & option));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
214 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
215 muo->user = u;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
216 muo->opt = option;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
217 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
218 gtk_signal_connect(GTK_OBJECT(button), "destroy", GTK_SIGNAL_FUNC(free_muo), muo);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
219 gtk_widget_show(button);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
220 return button;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
221 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
223 static void ok_mod(GtkWidget *w, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
224 {
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
225 GList *tmp;
1954
c15c3a3f6cd4 [gaim-migrate @ 1964]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1942
diff changeset
226 const char *txt;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
227 int i;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
228 struct aim_user *a;
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
229
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
230 if (!u->user) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
231 txt = gtk_entry_get_text(GTK_ENTRY(u->name));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
232 u->user = new_user(txt, u->protocol, u->options);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
233 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
234 a = u->user;
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
235
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
236 a->options = u->options;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
237 a->protocol = u->protocol;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
238 txt = gtk_entry_get_text(GTK_ENTRY(u->pass));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
239 if (a->options & OPT_USR_REM_PASS)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
240 g_snprintf(a->password, sizeof(a->password), "%s", txt);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
241 else
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
242 a->password[0] = '\0';
2190
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
243
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
244 i = gtk_clist_find_row_from_data(GTK_CLIST(list), a);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
245 gtk_clist_set_text(GTK_CLIST(list), i, 2,
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
246 (a->options & OPT_USR_AUTO) ? "True" : "False");
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
247 gtk_clist_set_text(GTK_CLIST(list), i, 3, proto_name(a->protocol));
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
248
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
249 tmp = u->opt_entries;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
250 while (tmp) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
251 GtkEntry *entry = tmp->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
252 int pos = (int)gtk_object_get_user_data(GTK_OBJECT(entry));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
253 g_snprintf(a->proto_opt[pos], sizeof(a->proto_opt[pos]), "%s",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
254 gtk_entry_get_text(entry));
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
255 tmp = tmp->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
256 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
257 if (u->opt_entries)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
258 g_list_free(u->opt_entries);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
259 u->opt_entries = NULL;
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
260
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
261 g_snprintf(a->iconfile, sizeof(a->iconfile), "%s", u->iconfile);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
262 if (u->icondlg)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
263 gtk_widget_destroy(u->icondlg);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
264 u->icondlg = NULL;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
265
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
266 gtk_widget_destroy(u->mod);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
267
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
268 save_prefs();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
269 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
270
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
271 static void cancel_mod(GtkWidget *w, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
272 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
273 if (u->opt_entries)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
274 g_list_free(u->opt_entries);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
275 u->opt_entries = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
276 if (u->icondlg)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
277 gtk_widget_destroy(u->icondlg);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
278 u->icondlg = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
279 gtk_widget_destroy(u->mod);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
280 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
281
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
282 static void set_prot(GtkWidget *opt, int proto)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
283 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
284 struct mod_user *u = gtk_object_get_user_data(GTK_OBJECT(opt));
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
285 struct prpl *p, *q;
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
286 q = find_prpl(proto);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
287 if (u->protocol != proto) {
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
288 int i;
1878
75643b9f4261 [gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
289 for (i = 0; i < 7; i++)
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
290 u->proto_opt[i][0] = '\0';
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
291 p = find_prpl(u->protocol);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
292
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
293 if (!(p->options & OPT_PROTO_NO_PASSWORD) && (q->options & OPT_PROTO_NO_PASSWORD)) {
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
294 gtk_widget_hide(u->pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
295 gtk_widget_hide(u->rempass);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
296 } else if ((p->options & OPT_PROTO_NO_PASSWORD) && !(q->options & OPT_PROTO_NO_PASSWORD)) {
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
297 gtk_widget_show(u->pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
298 gtk_widget_show(u->rempass);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
299 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
300 if (!(p->options & OPT_PROTO_MAIL_CHECK) && (q->options & OPT_PROTO_MAIL_CHECK)) {
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
301 gtk_widget_show(u->checkmail);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
302 } else if ((p->options & OPT_PROTO_MAIL_CHECK) && !(q->options & OPT_PROTO_MAIL_CHECK)) {
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
303 gtk_widget_hide(u->checkmail);
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
304 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
305
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
306 if (!(p->options & OPT_PROTO_BUDDY_ICON) && (q->options & OPT_PROTO_BUDDY_ICON)) {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
307 gtk_widget_show(u->iconsel);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
308 } else if ((p->options & OPT_PROTO_BUDDY_ICON) && !(q->options & OPT_PROTO_BUDDY_ICON)) {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
309 gtk_widget_hide(u->iconsel);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
310 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
311
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
312 if ((q->options & OPT_PROTO_BUDDY_ICON) || (q->options & OPT_PROTO_MAIL_CHECK))
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
313 gtk_widget_show(u->user_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
314 else
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
315 gtk_widget_hide(u->user_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
316
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
317 u->protocol = proto;
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
318 generate_protocol_options(u, u->main);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
319 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
320 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
321
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
322 static GtkWidget *make_protocol_menu(GtkWidget *box, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
323 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
324 GtkWidget *optmenu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
325 GtkWidget *menu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
326 GtkWidget *opt;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
327 GSList *p = protocols;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
328 struct prpl *e;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
329 int count = 0;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
330 gboolean found = FALSE;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
331
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
332 optmenu = gtk_option_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
333 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
334 gtk_widget_show(optmenu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
335
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
336 menu = gtk_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
337
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
338 while (p) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
339 e = (struct prpl *)p->data;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
340 if (e->protocol == u->protocol)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
341 found = TRUE;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
342 if (!found)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
343 count++;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
344 if (e->name)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
345 opt = gtk_menu_item_new_with_label((*e->name)());
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
346 else
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
347 opt = gtk_menu_item_new_with_label("Unknown");
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
348 gtk_object_set_user_data(GTK_OBJECT(opt), u);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
349 gtk_signal_connect(GTK_OBJECT(opt), "activate",
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
350 GTK_SIGNAL_FUNC(set_prot), (void *)e->protocol);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
351 gtk_menu_append(GTK_MENU(menu), opt);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
352 gtk_widget_show(opt);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
353 p = p->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
354 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
355
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
356 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
357 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), count);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
358
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
359 return optmenu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
360 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
361
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
362 static void des_icon_sel(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
363 {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
364 w = u->icondlg;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
365 if (u->icondlg)
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
366 u->icondlg = NULL;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
367 if (w)
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
368 gtk_widget_destroy(w);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
369 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
370
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
371 static void set_icon(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
372 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
373 GtkWidget *sel = u->icondlg;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
374 char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sel));
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
375
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
376 if (file_is_dir(file, sel))
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
377 return;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
378
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
379 gtk_entry_set_text(GTK_ENTRY(u->iconentry), file);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
380 g_snprintf(u->iconfile, sizeof(u->iconfile), "%s", file);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
381 u->icondlg = NULL;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
382
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
383 gtk_widget_destroy(sel);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
384 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
385
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
386 static void sel_icon_dlg(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
387 {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
388 GtkWidget *dlg;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
389 char buf[256];
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
390
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
391 if (u->icondlg) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
392 gtk_widget_show(u->icondlg);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
393 return;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
394 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
395
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
396 dlg = gtk_file_selection_new(_("Gaim - Load Buddy Icon"));
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
397 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dlg));
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
398 if (u->iconfile) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
399 char *tmp = g_dirname(u->iconfile);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
400 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dlg), tmp);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
401 g_free(tmp);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
402 } else {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
403 g_snprintf(buf, sizeof(buf), "%s/", g_get_home_dir());
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
404 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dlg), buf);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
405 }
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
406
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
407 gtk_signal_connect(GTK_OBJECT(dlg), "destroy", GTK_SIGNAL_FUNC(des_icon_sel), u);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
408 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(dlg)->cancel_button), "clicked",
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
409 GTK_SIGNAL_FUNC(des_icon_sel), u);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
410 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(dlg)->ok_button), "clicked",
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
411 GTK_SIGNAL_FUNC(set_icon), u);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
412
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
413 u->icondlg = dlg;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
414
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
415 gtk_widget_show(dlg);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
416 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
417
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
418 static void reset_icon(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
419 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
420 u->iconfile[0] = 0;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
421 gtk_entry_set_text(GTK_ENTRY(u->iconentry), "");
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
422 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
423
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
424 static GtkWidget *build_icon_selection(struct mod_user *u, GtkWidget *box)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
425 {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
426 GtkWidget *hbox;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
427 GtkWidget *label;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
428 GtkWidget *name;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
429 GtkWidget *browse;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
430 GtkWidget *reset;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
431
2444
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
432 if (u->user)
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
433 g_snprintf(u->iconfile, sizeof(u->iconfile), "%s", u->user->iconfile);
2431
5948060f486c [gaim-migrate @ 2444]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2411
diff changeset
434
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
435 hbox = gtk_hbox_new(FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
436 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
437 gtk_widget_show(hbox);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
438
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
439 label = gtk_label_new(_("Buddy Icon File:"));
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
440 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
441 gtk_widget_show(label);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
442
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
443 name = gtk_entry_new();
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
444 gtk_entry_set_text(GTK_ENTRY(name), u->iconfile);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
445 gtk_entry_set_editable(GTK_ENTRY(name), FALSE);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
446 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 5);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
447 gtk_widget_show(name);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
448 u->iconentry = name;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
449
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
450 browse = gtk_button_new_with_label(_("Browse"));
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
451 gtk_signal_connect(GTK_OBJECT(browse), "clicked", GTK_SIGNAL_FUNC(sel_icon_dlg), u);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
452 gtk_box_pack_start(GTK_BOX(hbox), browse, FALSE, FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
453 gtk_widget_show(browse);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
454
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
455 reset = gtk_button_new_with_label(_("Reset"));
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
456 gtk_signal_connect(GTK_OBJECT(reset), "clicked", GTK_SIGNAL_FUNC(reset_icon), u);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
457 gtk_box_pack_start(GTK_BOX(hbox), reset, FALSE, FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
458 gtk_widget_show(reset);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
459
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
460 return hbox;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
461 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
462
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
463 static void generate_login_options(struct mod_user *u, GtkWidget *box)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
464 {
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
465 GtkWidget *frame;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
466 GtkWidget *vbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
467 GtkWidget *hbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
468 GtkWidget *label;
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
469
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
470 struct prpl *p;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
471
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
472 frame = gtk_frame_new("Login Options");
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
473 gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
474
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
475 vbox = gtk_vbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
476 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
477 gtk_container_add(GTK_CONTAINER(frame), vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
478
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
479 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
480 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
481
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
482 label = gtk_label_new(_("Screenname:"));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
483 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
484
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
485 u->name = gtk_entry_new();
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
486 gtk_box_pack_start(GTK_BOX(hbox), u->name, TRUE, TRUE, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
487
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
488 u->pwdbox = gtk_hbox_new(FALSE, 5);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
489 gtk_box_pack_start(GTK_BOX(vbox), u->pwdbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
490
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
491 label = gtk_label_new(_("Password:"));
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
492 gtk_box_pack_start(GTK_BOX(u->pwdbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
493
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
494 u->pass = gtk_entry_new();
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
495 gtk_box_pack_start(GTK_BOX(u->pwdbox), u->pass, TRUE, TRUE, 0);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
496 gtk_entry_set_visibility(GTK_ENTRY(u->pass), FALSE);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
497
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
498 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
499 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
500 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
501
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
502 label = gtk_label_new(_("Protocol:"));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
503 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
504
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
505 make_protocol_menu(hbox, u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
506
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
507 u->rempass = acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
508 acct_button(_("Auto-Login"), u, OPT_USR_AUTO, vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
509
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
510 gtk_widget_show_all(frame);
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
511
2444
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
512 if (u->user) {
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
513 gtk_entry_set_text(GTK_ENTRY(u->name), u->user->username);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
514 gtk_entry_set_text(GTK_ENTRY(u->pass), u->user->password);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
515 gtk_entry_set_editable(GTK_ENTRY(u->name), FALSE);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
516 }
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
517
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
518 p = find_prpl(u->protocol);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
519 if (p && (p->options & OPT_PROTO_NO_PASSWORD)) {
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
520 gtk_widget_hide(u->pwdbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
521 gtk_widget_hide(u->rempass);
2444
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
522 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
523 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
524
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
525 static void generate_user_options(struct mod_user *u, GtkWidget *box)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
526 {
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
527 /* This function will add the appropriate (depending on the current
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
528 * protocol) widgets to frame and return TRUE if there anything
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
529 * was added (meaning the frame should be shown)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
530 * Eric will most likely change this (as he does all other submitted code)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
531 * so that it will accept the vbox as an argument and create, add, and show
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
532 * the frame itself (like generate_protocol_options). I'd do it myself, but I'm
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
533 * tired and I don't care. */
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
534 /* Sean was right. I did do that. I told him I would. */
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
535
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
536 GtkWidget *vbox;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
537
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
538 struct prpl *p = find_prpl(u->protocol);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
539
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
540 u->user_frame = gtk_frame_new("User Options");
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
541 gtk_box_pack_start(GTK_BOX(box), u->user_frame, FALSE, FALSE, 0);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
542 gtk_widget_show(u->user_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
543
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
544 vbox = gtk_vbox_new(FALSE, 5);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
545 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
546 gtk_container_add(GTK_CONTAINER(u->user_frame), vbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
547 gtk_widget_show(vbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
548
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
549 u->checkmail = acct_button(_("New Mail Notifications"), u, OPT_USR_MAIL_CHECK, vbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
550 u->iconsel = build_icon_selection(u, vbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
551
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
552 if (!p) {
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
553 gtk_widget_hide(u->user_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
554 return;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
555 }
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
556
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
557 if (!(p->options & OPT_PROTO_MAIL_CHECK))
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
558 gtk_widget_hide(u->checkmail);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
559 if (!(p->options & OPT_PROTO_BUDDY_ICON))
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
560 gtk_widget_hide(u->iconsel);
2525
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
561
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
562 if ((p->options & OPT_PROTO_BUDDY_ICON) || (p->options & OPT_PROTO_MAIL_CHECK))
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
563 return;
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
564 gtk_widget_hide(u->user_frame);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
565 }
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
566
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
567 static void generate_protocol_options(struct mod_user *u, GtkWidget *box)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
568 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
569 struct prpl *p = find_prpl(u->protocol);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
570
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
571 GList *op, *tmp;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
572
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
573 GtkWidget *vbox;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
574 GtkWidget *hbox;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
575 GtkWidget *label;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
576 GtkWidget *entry;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
577
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
578 char buf[256];
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
579
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
580 if (u->proto_frame)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
581 gtk_widget_destroy(u->proto_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
582 u->proto_frame = NULL;
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
583
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
584 if (u->opt_entries) {
2190
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
585 g_list_free(u->opt_entries);
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
586 u->opt_entries = NULL;
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
587 }
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
588
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
589 if (!p)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
590 return;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
591
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
592 if (!p->user_opts)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
593 return;
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
594
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
595 tmp = op = (*p->user_opts)();
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
596
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
597 if (!op)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
598 return;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
599
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
600 g_snprintf(buf, sizeof(buf), "%s Options", (*p->name)());
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
601 u->proto_frame = gtk_frame_new(buf);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
602 gtk_box_pack_start(GTK_BOX(box), u->proto_frame, FALSE, FALSE, 0);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
603 gtk_widget_show(u->proto_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
604
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
605 vbox = gtk_vbox_new(FALSE, 5);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
606 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
607 gtk_container_add(GTK_CONTAINER(u->proto_frame), vbox);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
608 gtk_widget_show(vbox);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
609
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
610 while (op) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
611 struct proto_user_opt *puo = op->data;
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
612
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
613 hbox = gtk_hbox_new(FALSE, 5);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
614 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
615 gtk_widget_show(hbox);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
616
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
617 label = gtk_label_new(puo->label);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
618 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
619 gtk_widget_show(label);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
620
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
621 entry = gtk_entry_new();
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
622 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
623 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)puo->pos);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
624 if (u->proto_opt[puo->pos][0]) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
625 debug_printf("setting text %s\n", u->proto_opt[puo->pos]);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
626 gtk_entry_set_text(GTK_ENTRY(entry), u->proto_opt[puo->pos]);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
627 } else {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
628 gtk_entry_set_text(GTK_ENTRY(entry), puo->def);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
629 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
630 gtk_widget_show(entry);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
631
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
632 u->opt_entries = g_list_append(u->opt_entries, entry);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
633
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
634 g_free(puo);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
635 op = op->next;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
636 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
637 g_list_free(tmp);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
638 }
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
639
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
640 static void show_acct_mod(struct aim_user *a)
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
641 {
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
642 /* This is the fucking modify account dialog. I've fucking seperated it into
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
643 * three fucking frames:
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
644 * a fucking Login Options frame, a fucking User Options frame and a fucking
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
645 * Protcol Options frame. This fucking removes the two fucking tabs, which were
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
646 * quite fucking uneccessary. Fuck. */
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
647 /* -- SeanEgan */
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
648 GtkWidget *hbox;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
649 GtkWidget *button;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
650
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
651 struct mod_user *u = find_mod_user(a);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
652
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
653 if (!u) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
654 u = g_new0(struct mod_user, 1);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
655 u->user = a;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
656 mod_users = g_slist_append(mod_users, u);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
657
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
658 if (a) {
2458
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
659 int i;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
660 u->options = a->options;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
661 if (find_prpl(a->protocol))
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
662 u->protocol = a->protocol;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
663 else if (protocols)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
664 u->protocol = ((struct prpl *)protocols->data)->protocol;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
665 else
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
666 u->protocol = -1;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
667 g_snprintf(u->iconfile, sizeof(u->iconfile), "%s", a->iconfile);
2458
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
668 for (i = 0; i < 7; i++)
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
669 g_snprintf(u->proto_opt[i], sizeof(u->proto_opt[i]), "%s",
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
670 a->proto_opt[i]);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
671 } else {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
672 u->options = OPT_USR_REM_PASS;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
673 if (find_prpl(DEFAULT_PROTO))
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
674 u->protocol = DEFAULT_PROTO;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
675 else if (protocols)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
676 u->protocol = ((struct prpl *)protocols->data)->protocol;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
677 else
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
678 u->protocol = -1;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
679 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
680 } else {
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
681 gtk_widget_show(u->mod);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
682 return;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
683 }
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
684
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
685 u->mod = gtk_window_new(GTK_WINDOW_TOPLEVEL);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
686 gtk_window_set_wmclass(GTK_WINDOW(u->mod), "account", "Gaim");
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
687 gtk_widget_realize(u->mod);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
688 aol_icon(u->mod->window);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
689 gtk_window_set_title(GTK_WINDOW(u->mod), _("Gaim - Modify Account"));
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
690 gtk_window_set_policy(GTK_WINDOW(u->mod), FALSE, TRUE, TRUE); /* nothing odd here :) */
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
691 gtk_signal_connect(GTK_OBJECT(u->mod), "destroy", GTK_SIGNAL_FUNC(delmod), u);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
692
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
693 u->main = gtk_vbox_new(FALSE, 5);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
694 gtk_container_border_width(GTK_CONTAINER(u->main), 5);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
695 gtk_container_add(GTK_CONTAINER(u->mod), u->main);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
696 gtk_widget_show(u->main);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
697
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
698 generate_login_options(u, u->main);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
699 generate_user_options(u, u->main);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
700 generate_protocol_options(u, u->main);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
701
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
702 hbox = gtk_hbox_new(FALSE, 5);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
703 gtk_box_pack_end(GTK_BOX(u->main), hbox, FALSE, FALSE, 0);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
704 gtk_widget_show(hbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
705
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
706 button = picture_button(u->mod, _("Cancel"), cancel_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
707 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
708 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_mod), u);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
709 gtk_widget_show(button);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
710
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
711 button = picture_button(u->mod, _("OK"), ok_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
712 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
713 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_mod), u);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
714 gtk_widget_show(button);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
715
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
716 gtk_widget_show(u->mod);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
717 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
718
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
719 static void add_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
720 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
721 show_acct_mod(NULL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
722 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
723
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
724 static void mod_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
725 {
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
726 GList *l = GTK_CLIST(list)->selection;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
727 int row = -1;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
728 struct aim_user *u;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
729 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
730 row = (int)l->data;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
731 if (row != -1) {
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
732 u = g_slist_nth_data(aim_users, row);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
733 if (u)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
734 show_acct_mod(u);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
735 }
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
736 l = l->next;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
737 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
738 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
739
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
740 struct pass_prompt {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
741 struct aim_user *u;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
742 GtkWidget *win;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
743 GtkWidget *entry;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
744 };
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
745 static GSList *passes = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
746
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
747 static struct pass_prompt *find_pass_prompt(struct aim_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
748 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
749 GSList *p = passes;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
750 while (p) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
751 struct pass_prompt *r = p->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
752 if (r->u == u)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
753 return r;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
754 p = p->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
755 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
756 return NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
757 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
758
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
759 static void pass_des(GtkWidget *w, struct pass_prompt *p)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
760 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
761 passes = g_slist_remove(passes, p);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
762 g_free(p);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
763 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
764
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
765 static void pass_cancel(GtkWidget *w, struct pass_prompt *p)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
766 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
767 gtk_widget_destroy(p->win);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
768 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
769
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
770 static void pass_signon(GtkWidget *w, struct pass_prompt *p)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
771 {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
772 const char *txt = gtk_entry_get_text(GTK_ENTRY(p->entry));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
773 g_snprintf(p->u->password, sizeof(p->u->password), "%s", txt);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
774 #ifdef USE_APPLET
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
775 set_user_state(signing_on);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
776 #endif
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
777 serv_login(p->u);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
778 gtk_widget_destroy(p->win);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
779 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
780
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
781 static void do_pass_dlg(struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
782 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
783 /* we can safely assume that u is not NULL */
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
784 GtkWidget *frame;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
785 GtkWidget *vbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
786 GtkWidget *hbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
787 char buf[96];
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
788 GtkWidget *label;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
789 GtkWidget *button;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
790 struct pass_prompt *p = find_pass_prompt(u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
791
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
792 if (p) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
793 gtk_widget_show(p->win);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
794 return;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
795 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
796
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
797 p = g_new0(struct pass_prompt, 1);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
798 p->u = u;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
799 passes = g_slist_append(passes, p);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
800
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
801 p->win = gtk_window_new(GTK_WINDOW_DIALOG);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
802 gtk_window_set_wmclass(GTK_WINDOW(p->win), "password", "Gaim");
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
803 gtk_container_border_width(GTK_CONTAINER(p->win), 5);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
804 gtk_signal_connect(GTK_OBJECT(p->win), "destroy", GTK_SIGNAL_FUNC(pass_des), p);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
805 gtk_widget_realize(p->win);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
806 aol_icon(p->win->window);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
807
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
808 frame = gtk_frame_new(_("Enter Password"));
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
809 gtk_container_add(GTK_CONTAINER(p->win), frame);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
810 gtk_widget_show(frame);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
811
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
812 vbox = gtk_vbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
813 gtk_container_add(GTK_CONTAINER(frame), vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
814 gtk_widget_show(vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
815
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
816 hbox = gtk_hbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
817 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
818 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
819
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
820 g_snprintf(buf, sizeof(buf), "Password for %s:", u->username);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
821 label = gtk_label_new(buf);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
822 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
823 gtk_widget_show(label);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
824
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
825 p->entry = gtk_entry_new();
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
826 gtk_entry_set_visibility(GTK_ENTRY(p->entry), FALSE);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
827 gtk_box_pack_start(GTK_BOX(hbox), p->entry, FALSE, FALSE, 5);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
828 gtk_signal_connect(GTK_OBJECT(p->entry), "activate", GTK_SIGNAL_FUNC(pass_signon), p);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
829 gtk_widget_grab_focus(p->entry);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
830 gtk_widget_show(p->entry);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
831
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
832 hbox = gtk_hbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
833 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
834 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
835
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
836 button = picture_button(p->win, _("Cancel"), cancel_xpm);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
837 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_cancel), p);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
838 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
839
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
840 button = picture_button(p->win, _("Signon"), ok_xpm);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
841 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_signon), p);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
842 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
843
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
844 gtk_widget_show(p->win);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
845 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
846
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
847 static void acct_signin(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
848 {
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
849 GList *l = GTK_CLIST(list)->selection;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
850 int row = -1;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
851 struct aim_user *u;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
852 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
853 row = (int)l->data;
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
854 u = g_slist_nth_data(aim_users, row);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
855 if (!u->gc) {
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
856 struct prpl *p = find_prpl(u->protocol);
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
857 if (p && !(p->options & OPT_PROTO_NO_PASSWORD) && !u->password[0]) {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
858 do_pass_dlg(u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
859 } else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
860 #ifdef USE_APPLET
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
861 set_user_state(signing_on);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
862 #endif /* USE_APPLET */
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
863 gtk_clist_set_text(GTK_CLIST(list), row, 1, "Attempting");
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 977
diff changeset
864 serv_login(u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
865 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
866 } else {
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
867 u->gc->wants_to_die = TRUE;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
868 signoff(u->gc);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
869 }
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
870 l = l->next;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
871 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
872 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
873
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
874 static void do_del_acct(gpointer w, struct aim_user *u)
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
875 {
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
876 if (u->gc) {
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
877 u->gc->wants_to_die = TRUE;
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
878 signoff(u->gc);
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
879 }
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
880 gtk_clist_remove(GTK_CLIST(list), g_slist_index(aim_users, u));
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
881 aim_users = g_slist_remove(aim_users, u);
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
882 save_prefs();
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
883 }
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
884
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
885 static void del_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
886 {
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
887 GList *l = GTK_CLIST(list)->selection;
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
888 char buf[8192];
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
889 int row = -1;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
890 struct aim_user *u;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
891 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
892 row = (int)l->data;
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
893 u = g_slist_nth_data(aim_users, row);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
894 if (!u)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
895 return;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
896
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
897 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
898 do_ask_dialog(buf, u, do_del_acct, NULL);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
899 l = l->next;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
900 }
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
901 }
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
902
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
903 static void sel_auto(gpointer w, gpointer d)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
904 {
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
905 GSList *l = aim_users;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
906 struct aim_user *u;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
907 int i = 0; /* faster than doing g_list_index each time */
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
908 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
909 u = l->data;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
910 l = l->next;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
911 if (u->options & OPT_USR_AUTO)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
912 gtk_clist_select_row(GTK_CLIST(list), i, -1);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
913 else
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
914 gtk_clist_unselect_row(GTK_CLIST(list), i, -1);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
915 i++;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
916 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
917 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
918
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
919 void account_editor(GtkWidget *w, GtkWidget *W)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
920 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
921 /* please kill me */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
922 GtkWidget *vbox;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
923 GtkWidget *hbox;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
924 GtkWidget *vbox2;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
925 GtkWidget *sw;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
926 GtkWidget *button; /* used for many things */
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
927
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
928 if (acctedit) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
929 gtk_widget_show(acctedit);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
930 return;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
931 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
932
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
933 acctedit = gtk_window_new(GTK_WINDOW_TOPLEVEL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
934 gtk_window_set_title(GTK_WINDOW(acctedit), _("Gaim - Account Editor"));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
935 gtk_window_set_wmclass(GTK_WINDOW(acctedit), "accounteditor", "Gaim");
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
936 gtk_widget_realize(acctedit);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
937 aol_icon(acctedit->window);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
938 gtk_widget_set_usize(acctedit, -1, 200);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
939 gtk_signal_connect(GTK_OBJECT(acctedit), "destroy", GTK_SIGNAL_FUNC(delete_acctedit), W);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
940
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
941 vbox = gtk_vbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
942 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
943 gtk_container_add(GTK_CONTAINER(acctedit), vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
944
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
945 hbox = gtk_hbox_new(FALSE, 5);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
946 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
947
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
948 sw = generate_list();
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
949
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
950 vbox2 = gtk_vbox_new(TRUE, 5);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
951 gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
952
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
953 button = picture_button2(acctedit, _("Select All"), tb_refresh_xpm, 2);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
954 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
955 gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
956 GTK_SIGNAL_FUNC(gtk_clist_select_all), GTK_OBJECT(list));
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
957
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
958 button = picture_button2(acctedit, _("Select Autos"), tb_redo_xpm, 2);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
959 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
960 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
961
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
962 button = picture_button2(acctedit, _("Select None"), tb_undo_xpm, 2);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
963 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
964 gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
965 GTK_SIGNAL_FUNC(gtk_clist_unselect_all), GTK_OBJECT(list));
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
966
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
967 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
968
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
969 hbox = gtk_hbox_new(TRUE, 5);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
970 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
971
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
972 button = picture_button(acctedit, _("Add"), gnome_add_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
973 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
974 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(add_acct), NULL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
975
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
976 button = picture_button(acctedit, _("Modify"), gnome_preferences_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
977 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
978 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(mod_acct), NULL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
979
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
980 button = picture_button(acctedit, _("Sign On/Off"), join_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
981 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
982 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(acct_signin), NULL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
983
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
984 button = picture_button(acctedit, _("Delete"), gnome_remove_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
985 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
986 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(del_acct), NULL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
987
1436
f6a9bd50fd19 [gaim-migrate @ 1446]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
988 button = picture_button(acctedit, _("Close"), cancel_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
989 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
990 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(acctedit_close), W);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
991
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
992 gtk_widget_show_all(acctedit);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
993 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
994
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
995 struct signon_meter {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
996 struct gaim_connection *gc;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
997 GtkWidget *window;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
998 GtkWidget *progress;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
999 GtkWidget *status;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1000 };
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1001 static GSList *meters = NULL;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1002
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1003 static struct signon_meter *find_signon_meter(struct gaim_connection *gc)
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1004 {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1005 GSList *m = meters;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1006 while (m) {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1007 if (((struct signon_meter *)m->data)->gc == gc)
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1008 return m->data;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1009 m = m->next;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1010 }
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1011 return NULL;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1012 }
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1013
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1014 void account_online(struct gaim_connection *gc)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1015 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1016 int i;
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1017 struct signon_meter *meter = find_signon_meter(gc);
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1018
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1019 /* first we hide the login progress meter */
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1020 if (meter) {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1021 gtk_widget_destroy(meter->window);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1022 meters = g_slist_remove(meters, meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1023 g_free(meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1024 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1025
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1026 /* then we do the buddy list stuff */
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1027 if (mainwindow)
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1028 gtk_widget_hide(mainwindow);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1029
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1030 #ifdef USE_APPLET
2314
64b4c69c1c5e [gaim-migrate @ 2324]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2273
diff changeset
1031 if (blist_options & OPT_BLIST_APP_BUDDY_SHOW) {
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1032 show_buddy_list();
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1033 refresh_buddy_window();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1034 createOnlinePopup();
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1035 applet_buddy_show = TRUE;
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1036 } else if (!blist) {
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1037 show_buddy_list();
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1038 build_edit_tree();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1039 gtk_widget_hide(blist);
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1040 applet_buddy_show = FALSE;
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1041 } else {
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1042 build_edit_tree();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1043 }
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1044 set_user_state(online);
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1045 #else
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1046 show_buddy_list();
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1047 refresh_buddy_window();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1048 #endif
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1049
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1115
diff changeset
1050 update_connection_dependent_prefs();
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
1051 do_away_menu();
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1474
diff changeset
1052 do_proto_menu();
2111
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
1053 redo_convo_menus();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1054 gaim_setup(gc);
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1055
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1056 plugin_event(event_signon, gc, 0, 0, 0);
1575
427e1409917c [gaim-migrate @ 1585]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
1057 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
1058
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1059 /* away option given? */
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1060 if (opt_away) {
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1061 away_on_login(opt_away_arg);
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1062 /* don't do it again */
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1063 opt_away = 0;
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
1064 } else if (awaymessage) {
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
1065 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message);
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1066 }
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1067 if (opt_away_arg != NULL) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
1068 g_free(opt_away_arg);
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1069 opt_away_arg = NULL;
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1070 }
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1071
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1072 /* everything for the account editor */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1073 if (!acctedit)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1074 return;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
1075 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
1076 gtk_clist_set_text(GTK_CLIST(list), i, 1, "Yes");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1077 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
1078
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1079 return;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1080 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1081
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1082 void account_offline(struct gaim_connection *gc)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1083 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1084 int i;
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1085 struct signon_meter *meter = find_signon_meter(gc);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1086 if (meter) {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1087 gtk_widget_destroy(meter->window);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1088 meters = g_slist_remove(meters, meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1089 g_free(meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1090 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1091 gc->user->gc = NULL; /* wasn't that awkward? */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1092 if (!acctedit)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1093 return;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
1094 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
1095 gtk_clist_set_text(GTK_CLIST(list), i, 1, "No");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1096 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1097
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1098 void auto_login()
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1099 {
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
1100 GSList *u = aim_users;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1101 struct aim_user *a = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1102
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1103 while (u) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1104 a = (struct aim_user *)u->data;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1105 if ((a->options & OPT_USR_AUTO) && (a->options & OPT_USR_REM_PASS)) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1106 #ifdef USE_APPLET
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1107 set_user_state(signing_on);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1108 #endif /* USE_APPLET */
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 977
diff changeset
1109 serv_login(a);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1110 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1111 u = u->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1112 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1113 }
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1114
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1115 static void cancel_signon(GtkWidget *button, struct signon_meter *meter)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1116 {
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1117 meter->gc->wants_to_die = TRUE;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1118 signoff(meter->gc);
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1119 }
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1120
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1121 static gint meter_destroy(GtkWidget *window, GdkEvent *evt, struct signon_meter *meter)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1122 {
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1123 return TRUE;
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1124 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1125
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1126 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
1127 {
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1128 struct signon_meter *meter = find_signon_meter(gc);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1129
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1130 if (mainwindow)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1131 gtk_widget_hide(mainwindow);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1132
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1133 if (!meter) {
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1134 GtkWidget *box, *label, *button;
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1135 char buf[256];
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1136
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1137 meter = g_new0(struct signon_meter, 1);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1138 meter->gc = gc;
2403
8555e48c02df [gaim-migrate @ 2416]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2402
diff changeset
1139 meters = g_slist_append(meters, meter);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1140
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1141 meter->window = gtk_window_new(GTK_WINDOW_DIALOG);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1142 gtk_window_set_policy(GTK_WINDOW(meter->window), 0, 0, 1);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1143 gtk_window_set_wmclass(GTK_WINDOW(meter->window), "signon", "Gaim");
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1144 gtk_container_set_border_width(GTK_CONTAINER(meter->window), 5);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1145 g_snprintf(buf, sizeof(buf), "%s Signing On", gc->username);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1146 gtk_window_set_title(GTK_WINDOW(meter->window), buf);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1147 gtk_signal_connect(GTK_OBJECT(meter->window), "delete_event",
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1148 GTK_SIGNAL_FUNC(meter_destroy), meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1149 gtk_widget_realize(meter->window);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1150 aol_icon(meter->window->window);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1151
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1152 box = gtk_vbox_new(FALSE, 5);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1153 gtk_container_add(GTK_CONTAINER(meter->window), box);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1154 gtk_widget_show(box);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1155
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1156 label = gtk_label_new(buf);
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1153
diff changeset
1157 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
1158 gtk_widget_show(label);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1159
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1160 meter->progress = gtk_progress_bar_new();
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1161 gtk_widget_set_usize(meter->progress, 150, 0);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1162 gtk_box_pack_start(GTK_BOX(box), meter->progress, FALSE, FALSE, 0);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1163 gtk_widget_show(meter->progress);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1164
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1165 meter->status = gtk_statusbar_new();
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1166 gtk_widget_set_usize(meter->status, 150, 0);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1167 gtk_box_pack_start(GTK_BOX(box), meter->status, FALSE, FALSE, 0);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1168 gtk_widget_show(meter->status);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1169
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1170 button = gtk_button_new_with_label(_("Cancel"));
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1153
diff changeset
1171 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1172 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_signon), meter);
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1173 gtk_widget_show(button);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1174
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1175 gtk_widget_show(meter->window);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1176 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1177
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1178 gtk_progress_bar_update(GTK_PROGRESS_BAR(meter->progress), howfar / LOGIN_STEPS);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1179 gtk_statusbar_pop(GTK_STATUSBAR(meter->status), 1);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1180 gtk_statusbar_push(GTK_STATUSBAR(meter->status), 1, message);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1181 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1182
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1183 struct kick_dlg {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1184 struct aim_user *user;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1185 GtkWidget *dlg;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1186 };
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1187 static GSList *kicks = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1188
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1189 static struct kick_dlg *find_kick_dlg(struct aim_user *u)
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1190 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1191 GSList *k = kicks;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1192 while (k) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1193 struct kick_dlg *d = k->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1194 if (d->user == u)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1195 return d;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1196 k = k->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1197 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1198 return NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1199 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1200
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1201 static void set_kick_null(GtkObject *obj, struct kick_dlg *k)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1202 {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1203 kicks = g_slist_remove(kicks, k);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1204 g_free(k);
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1205 }
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1206
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1207 void hide_login_progress(struct gaim_connection *gc, char *why)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1208 {
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1209 char buf[2048];
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1210 struct kick_dlg *k = find_kick_dlg(gc->user);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1211 struct signon_meter *meter = find_signon_meter(gc);
1708
eeb0cfe710b1 [gaim-migrate @ 1718]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
1212 sprintf(buf, _("%s\n%s was unable to sign on: %s"), full_date(), gc->username, why);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1213 if (k)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1214 gtk_widget_destroy(k->dlg);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1215 k = g_new0(struct kick_dlg, 1);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1216 k->user = gc->user;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1217 k->dlg = do_error_dialog(buf, _("Signon Error"));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1218 gtk_signal_connect(GTK_OBJECT(k->dlg), "destroy", GTK_SIGNAL_FUNC(set_kick_null), k);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1219 if (meter) {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1220 gtk_widget_destroy(meter->window);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1221 meters = g_slist_remove(meters, meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1222 g_free(meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1223 }
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1224 }
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1225
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1226 void signoff_all(gpointer w, gpointer d)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1227 {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1228 GSList *c = connections;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1229 struct gaim_connection *g = NULL;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1230
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1231 while (c) {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1232 g = (struct gaim_connection *)c->data;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1233 g->wants_to_die = TRUE;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1234 signoff(g);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1235 c = connections;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1236 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1237 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1238
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1239 void signoff(struct gaim_connection *gc)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1240 {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1241 /* core stuff */
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1242 debug_printf("date: %s\n", full_date());
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1243 plugin_event(event_signoff, gc, 0, 0, 0);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1244 system_log(log_signoff, gc, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1245
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1246 /* UI stuff */
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1247 convo_menu_remove(gc);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1248 remove_icon_data(gc);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1249 serv_close(gc);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1250 redo_buddy_list();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1251 build_edit_tree();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1252 do_away_menu();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1253 do_proto_menu();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1254 redo_convo_menus();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1255 #ifdef USE_APPLET
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1256 if (connections)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1257 set_user_state(online);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1258 #endif
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1259 update_connection_dependent_prefs();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1260
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1261 if (connections)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1262 return;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1263
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1264 destroy_all_dialogs();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1265 destroy_buddy();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1266 #ifdef USE_APPLET
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1267 set_user_state(offline);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1268 applet_buddy_show = FALSE;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1269 applet_widget_unregister_callback(APPLET_WIDGET(applet), "signoff");
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1270 remove_applet_away();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1271 #else
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1272 show_login();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1273 #endif /* USE_APPLET */
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1274 if (misc_options & OPT_MISC_BUDDY_TICKER)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1275 BuddyTickerSignoff();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1276 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1277
1942
ba421d552093 [gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1928
diff changeset
1278 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
1279 {
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1280 char *titles[4];
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1281 int i;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1282
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1283 struct aim_user *u = g_new0(struct aim_user, 1);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1284 g_snprintf(u->username, sizeof(u->username), "%s", name);
2273
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2248
diff changeset
1285 g_snprintf(u->user_info, sizeof(u->user_info), "%s", DEFAULT_INFO);
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1286 u->protocol = proto;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1287 u->options = opts;
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
1288 aim_users = g_slist_append(aim_users, u);
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1289
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1290 if (list) {
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1291 titles[0] = u->username;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1292 titles[1] = u->gc ? "Yes" : "No";
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1293 titles[2] = (u->options & OPT_USR_AUTO) ? "True" : "False";
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1294 titles[3] = proto_name(u->protocol);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1295 i = gtk_clist_append(GTK_CLIST(list), titles);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1296 gtk_clist_set_row_data(GTK_CLIST(list), i, u);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1297 }
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1298
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1299 return u;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1300 }