annotate src/multi.c @ 2396:78fab38249a2

[gaim-migrate @ 2409] this was evil committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 30 Sep 2001 19:48:44 +0000
parents 569ae9f2bb89
children 520257562955
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 */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
47 static GtkWidget *newmod = NULL; /* the dialog for creating a new account */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
48 static GtkWidget *newmain = NULL; /* the notebook that holds options */
1878
75643b9f4261 [gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
49 static struct aim_user tmpusr = { "", "", "", OPT_USR_REM_PASS, DEFAULT_PROTO,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
50 {"", "", "", "", "", "", ""}, "", NULL, NULL, NULL, NULL, NULL,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
51 NULL, NULL, OPT_USR_REM_PASS, DEFAULT_PROTO, NULL, NULL, NULL
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
52 };
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
54 static void generate_prpl_options(struct aim_user *, GtkWidget *);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
55
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 struct mod_usr_opt {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 struct aim_user *user;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 int opt;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 };
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
61 struct gaim_connection *new_gaim_conn(struct aim_user *user)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 struct gaim_connection *gc = g_new0(struct gaim_connection, 1);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1355
diff changeset
64 gc->edittype = EDIT_GC;
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
65 gc->protocol = user->protocol;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
66 gc->prpl = find_prpl(user->protocol);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
67 g_snprintf(gc->username, sizeof(gc->username), "%s", user->username);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
68 g_snprintf(gc->password, sizeof(gc->password), "%s", user->password);
1153
3063e6743913 [gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1124
diff changeset
69 gc->options = user->options;
3063e6743913 [gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1124
diff changeset
70 gc->keepalive = 0;
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
71 gc->inpa = 0;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 993
diff changeset
72 gc->buddy_chats = NULL;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
73 gc->groups = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
74 gc->permit = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
75 gc->deny = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 connections = g_slist_append(connections, gc);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
79 user->gc = gc;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
80 gc->user = user;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
81
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 return gc;
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
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 void destroy_gaim_conn(struct gaim_connection *gc)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 {
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
87 GSList *g = gc->groups;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
88 GSList *h;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
89 struct group *m;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
90 struct buddy *n;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 connections = g_slist_remove(connections, gc);
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
92 while (g) {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
93 m = (struct group *)g->data;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
94 g = g_slist_remove(g, m);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
95 h = m->members;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
96 while (h) {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
97 n = (struct buddy *)h->data;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
98 h = g_slist_remove(h, n);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
99 g_free(n);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
100 }
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
101 g_free(m);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
102 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103 g_free(gc);
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
104 #ifndef USE_APPLET
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
105 if (!connections && mainwindow)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
106 gtk_widget_show(mainwindow);
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
107 #endif
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 static void delete_acctedit(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112 if (acctedit) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113 save_prefs();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114 gtk_widget_destroy(acctedit);
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 acctedit = NULL;
1666
8b0c165a33f4 [gaim-migrate @ 1676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1575
diff changeset
117 list = NULL;
1474
4e891576c226 [gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1473
diff changeset
118 if (!d && !blist && !mainwindow && !connections)
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1115
diff changeset
119 gtk_main_quit();
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 static gint acctedit_close(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124 gtk_widget_destroy(acctedit);
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 return FALSE;
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
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130 static char *proto_name(int proto)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 {
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
132 struct prpl *p = find_prpl(proto);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
133 if (p && p->name)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
134 return (*p->name)();
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
135 else
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
136 return "Unknown";
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
139 void regenerate_user_list()
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
140 {
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
141 char *titles[4];
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
142 GList *u = aim_users;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
143 struct aim_user *a;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
144 int i;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
145
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
146 if (!acctedit)
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
147 return;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
148
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
149 gtk_clist_clear(GTK_CLIST(list));
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
150
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
151 while (u) {
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
152 a = (struct aim_user *)u->data;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
153 titles[0] = a->username;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
154 titles[1] = a->gc ? "Yes" : "No";
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
155 titles[2] = (a->options & OPT_USR_AUTO) ? "True" : "False";
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
156 titles[3] = proto_name(a->protocol);
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
157 i = gtk_clist_append(GTK_CLIST(list), titles);
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
158 gtk_clist_set_row_data(GTK_CLIST(list), i, a);
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
159 u = u->next;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
160 }
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
161 }
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
162
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 static GtkWidget *generate_list()
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165 GtkWidget *win;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
166 char *titles[4] = { "Screenname", "Currently Online", "Auto-login", "Protocol" };
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168 win = gtk_scrolled_window_new(0, 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
169 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
170 GTK_POLICY_ALWAYS);
960
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 list = gtk_clist_new_with_titles(4, titles);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
173 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90);
2364
94314b9dbda4 [gaim-migrate @ 2377]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
174 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_EXTENDED);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
175 gtk_clist_column_titles_passive(GTK_CLIST(list));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176 gtk_container_add(GTK_CONTAINER(win), list);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
177 gtk_widget_show(list);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
179 regenerate_user_list();
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
180
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
181 gtk_widget_show(win);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 return win;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185 static void delmod(GtkWidget *w, struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
186 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
187 gtk_widget_destroy(w);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
188 if (u) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
189 u->mod = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
190 } else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
191 newmod = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
192 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
193 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
194
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
195 static void mod_opt(GtkWidget *b, struct mod_usr_opt *m)
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 if (m->user) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198 m->user->tmp_options = m->user->tmp_options ^ m->opt;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
199 } else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
200 tmpusr.options = tmpusr.options ^ m->opt;
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 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
203
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
204 static void free_muo(GtkWidget *b, struct mod_usr_opt *m)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
205 {
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
206 g_free(m);
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
207 }
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
208
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
209 static GtkWidget *acct_button(const char *text, struct aim_user *u, int option, GtkWidget *box)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
211 GtkWidget *button;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
212 struct mod_usr_opt *muo = g_new0(struct mod_usr_opt, 1);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
213 button = gtk_check_button_new_with_label(text);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
214 if (u) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
215 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (u->options & option));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
216 } else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
217 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (tmpusr.options & option));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
218 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
219 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
220 muo->user = u;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
221 muo->opt = option;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222 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
223 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
224 gtk_widget_show(button);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
225 return button;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
226 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
227
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
228 static void ok_mod(GtkWidget *w, struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
229 {
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
230 GList *tmp;
1954
c15c3a3f6cd4 [gaim-migrate @ 1964]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1942
diff changeset
231 const char *txt;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
232 int i;
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
233
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
234 if (u) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
235 u->options = u->tmp_options;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
236 u->protocol = u->tmp_protocol;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
237 txt = gtk_entry_get_text(GTK_ENTRY(u->pass));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
238 if (u->options & OPT_USR_REM_PASS)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
239 g_snprintf(u->password, sizeof(u->password), "%s", txt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
240 else
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
241 u->password[0] = '\0';
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
242 i = gtk_clist_find_row_from_data(GTK_CLIST(list), u);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
243 gtk_clist_set_text(GTK_CLIST(list), i, 2,
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
244 (u->options & OPT_USR_AUTO) ? "True" : "False");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
245 gtk_clist_set_text(GTK_CLIST(list), i, 3, proto_name(u->protocol));
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
246
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
247 tmp = u->opt_entries;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
248 while (tmp) {
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
249 GtkEntry *entry = tmp->data;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
250 int pos = (int)gtk_object_get_user_data(GTK_OBJECT(entry));
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
251 g_snprintf(u->proto_opt[pos], sizeof(u->proto_opt[pos]), "%s",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
252 gtk_entry_get_text(entry));
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
253 tmp = tmp->next;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
254 }
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
255 if (u->opt_entries)
2165
34ce165132de [gaim-migrate @ 2175]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2164
diff changeset
256 g_list_free(u->opt_entries);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
257 u->opt_entries = NULL;
2190
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
258
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
259 gtk_widget_destroy(u->mod);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
260 } else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
261 txt = gtk_entry_get_text(GTK_ENTRY(tmpusr.name));
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
262 u = new_user(txt, tmpusr.protocol, tmpusr.options);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
263
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
264 txt = gtk_entry_get_text(GTK_ENTRY(tmpusr.pass));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
265 g_snprintf(u->password, sizeof(u->password), "%s", txt);
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
266
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
267 tmp = tmpusr.opt_entries;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
268 while (tmp) {
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
269 GtkEntry *entry = tmp->data;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
270 int pos = (int)gtk_object_get_user_data(GTK_OBJECT(entry));
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
271 g_snprintf(u->proto_opt[pos], sizeof(u->proto_opt[pos]), "%s",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
272 gtk_entry_get_text(entry));
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
273 tmp = tmp->next;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
274 }
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
275 if (tmpusr.opt_entries)
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
276 g_list_free(tmpusr.opt_entries);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
277 tmpusr.opt_entries = NULL;
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
278
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
279 gtk_widget_destroy(newmod);
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 save_prefs();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
282 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
283
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
284 static void cancel_mod(GtkWidget *w, struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
285 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
286 if (u) {
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
287 if (u->opt_entries)
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
288 g_list_free(u->opt_entries);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
289 u->opt_entries = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
290 gtk_widget_destroy(u->mod);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
291 } else {
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
292 if (tmpusr.opt_entries)
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
293 g_list_free(tmpusr.opt_entries);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
294 tmpusr.opt_entries = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
295 gtk_widget_destroy(newmod);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
296 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
297 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
298
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
299 static void set_prot(GtkWidget *opt, int proto)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
300 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
301 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt));
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
302 struct prpl *p, *q;
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
303 q = find_prpl(proto);
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
304 if (u && (u->tmp_protocol != proto)) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
305 int i;
1878
75643b9f4261 [gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
306 for (i = 0; i < 7; i++)
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
307 u->proto_opt[i][0] = '\0';
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
308 p = find_prpl(u->tmp_protocol);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
309 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
310 gtk_widget_hide(u->pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
311 gtk_widget_hide(u->rempass);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
312 } 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
313 gtk_widget_show(u->pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
314 gtk_widget_show(u->rempass);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
315 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
316 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
317 gtk_widget_show(u->checkmail);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
318 } 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
319 gtk_widget_hide(u->checkmail);
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
320 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
321 u->tmp_protocol = proto;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
322 generate_prpl_options(u, u->main);
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
323 } else if (!u && (tmpusr.tmp_protocol != proto)) {
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
324 int i;
1878
75643b9f4261 [gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
325 for (i = 0; i < 7; i++)
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
326 tmpusr.proto_opt[i][0] = '\0';
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
327 p = find_prpl(tmpusr.tmp_protocol);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
328 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
329 gtk_widget_hide(tmpusr.pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
330 gtk_widget_hide(tmpusr.rempass);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
331 } 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
332 gtk_widget_show(tmpusr.pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
333 gtk_widget_show(tmpusr.rempass);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
334 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
335 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
336 gtk_widget_show(tmpusr.checkmail);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
337 } 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
338 gtk_widget_hide(tmpusr.checkmail);
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
339 }
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
340 tmpusr.tmp_protocol = tmpusr.protocol = proto;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
341 generate_prpl_options(NULL, newmain);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
342 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
343 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
344
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
345 static GtkWidget *make_protocol_menu(GtkWidget *box, struct aim_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
346 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
347 GtkWidget *optmenu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
348 GtkWidget *menu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
349 GtkWidget *opt;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
350 GSList *p = protocols;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
351 struct prpl *e;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
352 int count = 0;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
353 gboolean found = FALSE;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
354
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
355 optmenu = gtk_option_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
356 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
357 gtk_widget_show(optmenu);
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 menu = gtk_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
360
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
361 while (p) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
362 e = (struct prpl *)p->data;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
363 if (u) {
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
364 if (e->protocol == u->tmp_protocol)
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
365 found = TRUE;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
366 if (!found)
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
367 count++;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
368 } else {
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
369 if (e->protocol == tmpusr.tmp_protocol)
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
370 found = TRUE;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
371 if (!found)
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
372 count++;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
373 }
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
374 if (e->name)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
375 opt = gtk_menu_item_new_with_label((*e->name)());
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
376 else
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
377 opt = gtk_menu_item_new_with_label("Unknown");
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
378 gtk_object_set_user_data(GTK_OBJECT(opt), u);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
379 gtk_signal_connect(GTK_OBJECT(opt), "activate",
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
380 GTK_SIGNAL_FUNC(set_prot), (void *)e->protocol);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
381 gtk_menu_append(GTK_MENU(menu), opt);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
382 gtk_widget_show(opt);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
383 p = p->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
384 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
385
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
386 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
387 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), count);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
388
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
389 return optmenu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
390 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
391
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
392 static void generate_general_options(struct aim_user *u, GtkWidget *book)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
393 {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
394 GtkWidget *vbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
395 GtkWidget *hbox;
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
396 GtkWidget *pwdbox;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
397 GtkWidget *label;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
398 GtkWidget *name;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
399 GtkWidget *pass;
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
400 GtkWidget *rempass;
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
401 GtkWidget *checkmail;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
402
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
403 vbox = gtk_vbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
404 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
405 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new(_("General Options")));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
406
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
407 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
408 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
409
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
410 label = gtk_label_new(_("Screenname:"));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
411 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
412
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
413 name = gtk_entry_new();
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
414 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 0);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
415
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
416 pwdbox = gtk_hbox_new(FALSE, 5);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
417 gtk_box_pack_start(GTK_BOX(vbox), pwdbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
418
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
419 label = gtk_label_new(_("Password:"));
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
420 gtk_box_pack_start(GTK_BOX(pwdbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
421
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
422 pass = gtk_entry_new();
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
423 gtk_box_pack_start(GTK_BOX(pwdbox), pass, TRUE, TRUE, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
424 gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
425
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
426 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
427 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
428 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
429
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
430 label = gtk_label_new(_("Protocol:"));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
431 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
432
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
433 make_protocol_menu(hbox, u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
434
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
435 rempass = acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
436 acct_button(_("Auto-Login"), u, OPT_USR_AUTO, vbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
437 /*acct_button(_("Send KeepAlive packet (6 bytes/second)"), u, OPT_USR_KEEPALV, vbox); */
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
438 checkmail = acct_button(_("New Mail Notifications"), u, OPT_USR_MAIL_CHECK, vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
439
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
440 gtk_widget_show_all(vbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
441
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
442 if (u) {
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
443 u->name = name;
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
444 u->pwdbox = pwdbox;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
445 u->pass = pass;
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
446 u->rempass = rempass;
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
447 u->checkmail = checkmail;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
448 gtk_entry_set_text(GTK_ENTRY(name), u->username);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
449 gtk_entry_set_text(GTK_ENTRY(pass), u->password);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
450 gtk_entry_set_editable(GTK_ENTRY(name), FALSE);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
451 } else {
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
452 tmpusr.name = name;
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
453 tmpusr.pwdbox = pwdbox;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
454 tmpusr.pass = pass;
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
455 tmpusr.rempass = rempass;
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
456 tmpusr.checkmail = checkmail;
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
457 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
458 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
459
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
460 static void generate_prpl_options(struct aim_user *u, GtkWidget *book)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
461 {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
462 struct prpl *p;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
463
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
464 if (u)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
465 p = find_prpl(u->tmp_protocol);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
466 else
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
467 p = find_prpl(tmpusr.protocol);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
468
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
469 /* page 0 is general, keep it. page 1 is options for our
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
470 * particular protocol, so clear it out and make a new one. */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
471
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
472 gtk_notebook_remove_page(GTK_NOTEBOOK(book), 1);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
473
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
474 if (!p)
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
475 return;
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
476
2190
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
477 if (u && u->opt_entries) {
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
478 g_list_free(u->opt_entries);
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
479 u->opt_entries = NULL;
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
480 } else if (!u && tmpusr.opt_entries) {
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
481 g_list_free(tmpusr.opt_entries);
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
482 tmpusr.opt_entries = NULL;
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
483 }
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
484
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
485 if (p->user_opts) {
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
486 GList *op = (*p->user_opts)();
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
487 GList *tmp = op;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
488
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
489 GtkWidget *vbox;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
490 GtkWidget *hbox;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
491 GtkWidget *label;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
492 GtkWidget *entry;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
493
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
494 char buf[256];
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
495
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
496 vbox = gtk_vbox_new(FALSE, 5);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
497 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
498 g_snprintf(buf, sizeof(buf), "%s Options", (*p->name)());
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
499 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new(buf));
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
500 gtk_widget_show(vbox);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
501
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
502 while (op) {
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
503 struct proto_user_opt *puo = op->data;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
504
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
505 hbox = gtk_hbox_new(FALSE, 5);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
506 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
507 gtk_widget_show(hbox);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
508
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
509 label = gtk_label_new(puo->label);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
510 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
511 gtk_widget_show(label);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
512
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
513 entry = gtk_entry_new();
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
514 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
515 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)puo->pos);
2164
1eaf7f02f77e [gaim-migrate @ 2174]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2159
diff changeset
516 if (u && u->proto_opt[puo->pos][0]) {
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
517 debug_printf("setting text %s\n", u->proto_opt[puo->pos]);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
518 gtk_entry_set_text(GTK_ENTRY(entry), u->proto_opt[puo->pos]);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
519 } else {
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
520 gtk_entry_set_text(GTK_ENTRY(entry), puo->def);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
521 }
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
522 gtk_widget_show(entry);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
523
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
524 if (u)
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
525 u->opt_entries = g_list_append(u->opt_entries, entry);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
526 else
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
527 tmpusr.opt_entries = g_list_append(tmpusr.opt_entries, entry);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
528
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
529 g_free(puo);
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
530 op = op->next;
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
531 }
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
532 g_list_free(tmp);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
533 }
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
534 }
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
535
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
536 static void show_acct_mod(struct aim_user *u)
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
537 {
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
538 /* here we can have all the aim_user options, including ones not shown in the main acctedit
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
539 * window. this can keep the size of the acctedit window small and readable, and make this
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
540 * one the powerful editor. this is where things like name/password are edited, but can
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
541 * also have toggles (and even more complex options) like whether to autologin or whether
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
542 * to send keepalives or whatever. this would be the perfect place to specify which protocol
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
543 * to use. make sure to account for the possibility of protocol plugins. */
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
544 GtkWidget *mod;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
545 GtkWidget *box;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
546 GtkWidget *book;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
547 GtkWidget *hbox;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
548 GtkWidget *button;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
549
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
550 struct prpl *p;
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
551
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
552 if (!u && newmod) {
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
553 gtk_widget_show(newmod);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
554 return;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
555 }
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
556 if (u && u->mod) {
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
557 gtk_widget_show(u->mod);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
558 return;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
559 }
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
560
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
561 mod = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
562 gtk_window_set_wmclass(GTK_WINDOW(mod), "account", "Gaim");
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
563 gtk_widget_realize(mod);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
564 aol_icon(mod->window);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
565 gtk_window_set_title(GTK_WINDOW(mod), _("Gaim - Modify Account"));
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
566 gtk_window_set_policy(GTK_WINDOW(mod), FALSE, TRUE, TRUE); /* nothing odd here :) */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
567 gtk_signal_connect(GTK_OBJECT(mod), "destroy", GTK_SIGNAL_FUNC(delmod), u);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
568
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
569 box = gtk_vbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
570 gtk_container_border_width(GTK_CONTAINER(mod), 5);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
571 gtk_container_add(GTK_CONTAINER(mod), box);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
572
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
573 book = gtk_notebook_new();
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
574 gtk_box_pack_start(GTK_BOX(box), book, FALSE, FALSE, 0);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
575
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
576 if (u) {
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
577 if (find_prpl(u->protocol))
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
578 u->tmp_protocol = u->protocol;
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
579 else if (protocols)
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
580 u->tmp_protocol = ((struct prpl *)protocols->data)->protocol;
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
581 else
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
582 u->tmp_protocol = -1;
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
583 } else {
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
584 if (find_prpl(tmpusr.protocol))
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
585 tmpusr.tmp_protocol = tmpusr.protocol;
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
586 else if (protocols)
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
587 tmpusr.tmp_protocol = ((struct prpl *)protocols->data)->protocol;
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
588 else
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
589 tmpusr.tmp_protocol = -1;
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
590 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
591 generate_general_options(u, book);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
592 generate_prpl_options(u, book);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
593
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
594 hbox = gtk_hbox_new(FALSE, 5);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
595 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
596
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
597 button = picture_button(mod, _("Cancel"), cancel_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
598 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
599 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_mod), u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
600
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
601 button = picture_button(mod, _("OK"), ok_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
602 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
603 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_mod), u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
604
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
605 if (u) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
606 u->mod = mod;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
607 u->main = book; /* sorry, i think i broke the joke :) */
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
608 u->tmp_options = u->options;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
609 } else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
610 newmod = mod;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
611 newmain = book;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
612 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
613
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
614 gtk_widget_show_all(mod);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
615
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
616 if (u) {
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
617 p = find_prpl(u->tmp_protocol);
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
618 if (p && (p->options & OPT_PROTO_NO_PASSWORD)) {
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
619 gtk_widget_hide(u->pwdbox);
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
620 gtk_widget_hide(u->rempass);
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
621 }
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
622 if (p && (!(p->options & OPT_PROTO_MAIL_CHECK)))
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
623 gtk_widget_hide(u->checkmail);
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
624 } else {
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
625 p = find_prpl(tmpusr.tmp_protocol);
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
626 if (p && (p->options & OPT_PROTO_NO_PASSWORD)) {
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
627 gtk_widget_hide(tmpusr.pwdbox);
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
628 gtk_widget_hide(tmpusr.rempass);
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
629 }
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
630 if (p && (!(p->options & OPT_PROTO_MAIL_CHECK)))
2153
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
631 gtk_widget_hide(tmpusr.checkmail);
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
632 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
633 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
634
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
635 static void add_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
636 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
637 show_acct_mod(NULL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
638 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
639
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
640 static void mod_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
641 {
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
642 GList *l = GTK_CLIST(list)->selection;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
643 int row = -1;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
644 struct aim_user *u;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
645 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
646 row = (int)l->data;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
647 if (row != -1) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
648 u = g_list_nth_data(aim_users, row);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
649 if (u)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
650 show_acct_mod(u);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
651 }
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
652 l = l->next;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
653 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
654 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
655
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
656 static void pass_des(GtkWidget *w, struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
657 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
658 gtk_widget_destroy(w);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
659 u->passprmt = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
660 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
661
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
662 static void pass_cancel(GtkWidget *w, struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
663 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
664 gtk_widget_destroy(u->passprmt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
665 u->passprmt = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
666 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
667
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
668 static void pass_signon(GtkWidget *w, struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
669 {
1954
c15c3a3f6cd4 [gaim-migrate @ 1964]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1942
diff changeset
670 const char *txt = gtk_entry_get_text(GTK_ENTRY(u->passentry));
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 977
diff changeset
671 g_snprintf(u->password, sizeof(u->password), "%s", txt);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
672 #ifdef USE_APPLET
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
673 set_user_state(signing_on);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
674 #endif
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
675 gtk_widget_destroy(u->passprmt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
676 u->passprmt = NULL;
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 977
diff changeset
677 serv_login(u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
678 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
679
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
680 static void do_pass_dlg(struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
681 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
682 /* we can safely assume that u is not NULL */
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
683 GtkWidget *frame;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
684 GtkWidget *vbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
685 GtkWidget *hbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
686 char buf[96];
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
687 GtkWidget *label;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
688 GtkWidget *button;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
689
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
690 if (u->passprmt) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
691 gtk_widget_show(u->passprmt);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
692 return;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
693 }
1956
c9c20663e05b [gaim-migrate @ 1966]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1954
diff changeset
694 u->passprmt = gtk_window_new(GTK_WINDOW_DIALOG);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
695 gtk_window_set_wmclass(GTK_WINDOW(u->passprmt), "password", "Gaim");
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
696 gtk_container_border_width(GTK_CONTAINER(u->passprmt), 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
697 gtk_signal_connect(GTK_OBJECT(u->passprmt), "destroy", GTK_SIGNAL_FUNC(pass_des), u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
698 gtk_widget_realize(u->passprmt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
699 aol_icon(u->passprmt->window);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
700
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
701 frame = gtk_frame_new(_("Enter Password"));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
702 gtk_container_add(GTK_CONTAINER(u->passprmt), frame);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
703 gtk_widget_show(frame);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
704
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
705 vbox = gtk_vbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
706 gtk_container_add(GTK_CONTAINER(frame), vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
707 gtk_widget_show(vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
708
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
709 hbox = gtk_hbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
710 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
711 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
712
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
713 g_snprintf(buf, sizeof(buf), "Password for %s:", u->username);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
714 label = gtk_label_new(buf);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
715 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
716 gtk_widget_show(label);
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 u->passentry = gtk_entry_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
719 gtk_entry_set_visibility(GTK_ENTRY(u->passentry), FALSE);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
720 gtk_box_pack_start(GTK_BOX(hbox), u->passentry, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
721 gtk_signal_connect(GTK_OBJECT(u->passentry), "activate", GTK_SIGNAL_FUNC(pass_signon), u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
722 gtk_widget_grab_focus(u->passentry);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
723 gtk_widget_show(u->passentry);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
724
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
725 hbox = gtk_hbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
726 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
727 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
728
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
729 button = picture_button(u->passprmt, _("Cancel"), cancel_xpm);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
730 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_cancel), u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
731 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
732
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
733 button = picture_button(u->passprmt, _("Signon"), ok_xpm);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
734 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pass_signon), u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
735 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
736
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
737 gtk_widget_show(u->passprmt);
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
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
740 static void acct_signin(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
741 {
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
742 GList *l = GTK_CLIST(list)->selection;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
743 int row = -1;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
744 struct aim_user *u;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
745 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
746 row = (int)l->data;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
747 u = g_list_nth_data(aim_users, row);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
748 if (!u->gc) {
2101
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
749 struct prpl *p = find_prpl(u->protocol);
dd3aa315519d [gaim-migrate @ 2111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2100
diff changeset
750 if (p && !(p->options & OPT_PROTO_NO_PASSWORD) && !u->password[0]) {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
751 do_pass_dlg(u);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
752 } else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
753 #ifdef USE_APPLET
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
754 set_user_state(signing_on);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
755 #endif /* USE_APPLET */
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
756 gtk_clist_set_text(GTK_CLIST(list), row, 1, "Attempting");
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 977
diff changeset
757 serv_login(u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
758 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
759 } else {
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
760 u->gc->wants_to_die = TRUE;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
761 signoff(u->gc);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
762 }
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
763 l = l->next;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
764 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
765 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
766
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
767 static void do_del_acct(gpointer w, struct aim_user *u)
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
768 {
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
769 if (u->gc) {
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
770 u->gc->wants_to_die = TRUE;
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
771 signoff(u->gc);
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
772 }
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
773 gtk_clist_remove(GTK_CLIST(list), g_list_index(aim_users, u));
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
774 aim_users = g_list_remove(aim_users, u);
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
775 save_prefs();
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
776 }
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
777
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
778 static void del_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
779 {
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
780 GList *l = GTK_CLIST(list)->selection;
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
781 char buf[8192];
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
782 int row = -1;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
783 struct aim_user *u;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
784 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
785 row = (int)l->data;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
786 u = g_list_nth_data(aim_users, row);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
787 if (!u)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
788 return;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
789
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
790 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
791 do_ask_dialog(buf, u, do_del_acct, NULL);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
792 l = l->next;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
793 }
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
794 }
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
795
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
796 static void sel_auto(gpointer w, gpointer d)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
797 {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
798 GList *l = aim_users;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
799 struct aim_user *u;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
800 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
801 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
802 u = l->data;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
803 l = l->next;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
804 if (u->options & OPT_USR_AUTO)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
805 gtk_clist_select_row(GTK_CLIST(list), i, -1);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
806 else
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
807 gtk_clist_unselect_row(GTK_CLIST(list), i, -1);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
808 i++;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
809 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
810 }
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 void account_editor(GtkWidget *w, GtkWidget *W)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
813 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
814 /* please kill me */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
815 GtkWidget *vbox;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
816 GtkWidget *hbox;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
817 GtkWidget *vbox2;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
818 GtkWidget *sw;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
819 GtkWidget *button; /* used for many things */
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
820
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
821 if (acctedit) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
822 gtk_widget_show(acctedit);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
823 return;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
824 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
825
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
826 acctedit = gtk_window_new(GTK_WINDOW_TOPLEVEL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
827 gtk_window_set_title(GTK_WINDOW(acctedit), _("Gaim - Account Editor"));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
828 gtk_window_set_wmclass(GTK_WINDOW(acctedit), "accounteditor", "Gaim");
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
829 gtk_widget_realize(acctedit);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
830 aol_icon(acctedit->window);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
831 gtk_widget_set_usize(acctedit, -1, 200);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
832 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
833
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
834 vbox = gtk_vbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
835 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
836 gtk_container_add(GTK_CONTAINER(acctedit), vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
837
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
838 hbox = gtk_hbox_new(FALSE, 5);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
839 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
840
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
841 sw = generate_list();
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
842
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
843 vbox2 = gtk_vbox_new(TRUE, 5);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
844 gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
845
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
846 button = picture_button2(acctedit, _("Select All"), tb_refresh_xpm, 2);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
847 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
848 gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
849 GTK_SIGNAL_FUNC(gtk_clist_select_all), GTK_OBJECT(list));
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
850
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
851 button = picture_button2(acctedit, _("Select Autos"), tb_redo_xpm, 2);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
852 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
853 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
854
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
855 button = picture_button2(acctedit, _("Select None"), tb_undo_xpm, 2);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
856 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
857 gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
858 GTK_SIGNAL_FUNC(gtk_clist_unselect_all), GTK_OBJECT(list));
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
859
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
860 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
861
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
862 hbox = gtk_hbox_new(TRUE, 5);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
863 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
864
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
865 button = picture_button(acctedit, _("Add"), gnome_add_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
866 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
867 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
868
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
869 button = picture_button(acctedit, _("Modify"), gnome_preferences_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
870 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
871 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
872
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
873 button = picture_button(acctedit, _("Sign On/Off"), join_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
874 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
875 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
876
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
877 button = picture_button(acctedit, _("Delete"), gnome_remove_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
878 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
879 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
880
1436
f6a9bd50fd19 [gaim-migrate @ 1446]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
881 button = picture_button(acctedit, _("Close"), cancel_xpm);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
882 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
883 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
884
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
885 gtk_widget_show_all(acctedit);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
886 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
887
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
888 void account_online(struct gaim_connection *gc)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
889 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
890 int i;
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
891
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
892 /* first we hide the login progress meter */
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
893 if (gc->meter)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
894 gtk_widget_destroy(gc->meter);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
895 gc->meter = NULL;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
896
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
897 /* then we do the buddy list stuff */
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
898 if (mainwindow)
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
899 gtk_widget_hide(mainwindow);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
900
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
901 #ifdef USE_APPLET
2314
64b4c69c1c5e [gaim-migrate @ 2324]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2273
diff changeset
902 if (blist_options & OPT_BLIST_APP_BUDDY_SHOW) {
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
903 show_buddy_list();
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
904 refresh_buddy_window();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
905 createOnlinePopup();
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
906 applet_buddy_show = TRUE;
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
907 } else if (!blist) {
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
908 show_buddy_list();
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
909 build_edit_tree();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
910 gtk_widget_hide(blist);
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
911 applet_buddy_show = FALSE;
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
912 } else {
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
913 build_edit_tree();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
914 }
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
915 set_user_state(online);
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
916 #else
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
917 show_buddy_list();
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
918 refresh_buddy_window();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
919 #endif
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
920
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1115
diff changeset
921 update_connection_dependent_prefs();
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
922 do_away_menu();
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1474
diff changeset
923 do_proto_menu();
2111
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
924 redo_convo_menus();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
925 gaim_setup(gc);
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
926
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
927 plugin_event(event_signon, gc, 0, 0, 0);
1575
427e1409917c [gaim-migrate @ 1585]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
928 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
929
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
930 /* away option given? */
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
931 if (opt_away) {
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
932 away_on_login(opt_away_arg);
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
933 /* don't do it again */
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
934 opt_away = 0;
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
935 } else if (awaymessage) {
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
936 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message);
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
937 }
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
938 if (opt_away_arg != NULL) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
939 g_free(opt_away_arg);
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
940 opt_away_arg = NULL;
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
941 }
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
942
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
943 /* everything for the account editor */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
944 if (!acctedit)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
945 return;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
946 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
947 gtk_clist_set_text(GTK_CLIST(list), i, 1, "Yes");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
948 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
949
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
950 return;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
951 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
952
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
953 void account_offline(struct gaim_connection *gc)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
954 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
955 int i;
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
956 if (gc->meter)
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
957 gtk_widget_destroy(gc->meter);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
958 gc->meter = NULL;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
959 gc->user->gc = NULL; /* wasn't that awkward? */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
960 if (!acctedit)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
961 return;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1009
diff changeset
962 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
963 gtk_clist_set_text(GTK_CLIST(list), i, 1, "No");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
964 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
965
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
966 void auto_login()
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
967 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
968 GList *u = aim_users;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
969 struct aim_user *a = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
970
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
971 while (u) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
972 a = (struct aim_user *)u->data;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
973 if ((a->options & OPT_USR_AUTO) && (a->options & OPT_USR_REM_PASS)) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
974 #ifdef USE_APPLET
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
975 set_user_state(signing_on);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
976 #endif /* USE_APPLET */
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 977
diff changeset
977 serv_login(a);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
978 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
979 u = u->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
980 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
981 }
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
982
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
983 static void cancel_signon(GtkWidget *button, struct gaim_connection *gc)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
984 {
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
985 gc->wants_to_die = TRUE;
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
986 signoff(gc);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
987 }
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
988
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
989 static gint meter_destroy(GtkWidget *meter, GdkEvent *evt, struct gaim_connection *gc)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
990 {
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
991 return TRUE;
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
992 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
993
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
994 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
995 {
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
996 if (mainwindow)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
997 gtk_widget_hide(mainwindow);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
998
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
999 if (!gc->meter) {
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1000 GtkWidget *box, *label, *button;
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1001 char buf[256];
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1002
1956
c9c20663e05b [gaim-migrate @ 1966]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1954
diff changeset
1003 gc->meter = gtk_window_new(GTK_WINDOW_DIALOG);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1004 gtk_window_set_policy(GTK_WINDOW(gc->meter), 0, 0, 1);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1005 gtk_window_set_wmclass(GTK_WINDOW(gc->meter), "signon", "Gaim");
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1006 gtk_container_set_border_width(GTK_CONTAINER(gc->meter), 5);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1007 g_snprintf(buf, sizeof(buf), "%s Signing On", gc->username);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1008 gtk_window_set_title(GTK_WINDOW(gc->meter), buf);
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1009 gtk_signal_connect(GTK_OBJECT(gc->meter), "delete_event",
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1010 GTK_SIGNAL_FUNC(meter_destroy), gc);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1011 gtk_widget_realize(gc->meter);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1012 aol_icon(gc->meter->window);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1013
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1014 box = gtk_vbox_new(FALSE, 5);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1015 gtk_container_add(GTK_CONTAINER(gc->meter), box);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1016 gtk_widget_show(box);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1017
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1018 label = gtk_label_new(buf);
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1153
diff changeset
1019 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
1020 gtk_widget_show(label);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1021
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1022 gc->progress = gtk_progress_bar_new();
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1023 gtk_widget_set_usize(gc->progress, 150, 0);
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1153
diff changeset
1024 gtk_box_pack_start(GTK_BOX(box), gc->progress, FALSE, FALSE, 0);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1025 gtk_widget_show(gc->progress);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1026
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1027 gc->status = gtk_statusbar_new();
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1028 gtk_widget_set_usize(gc->status, 150, 0);
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1153
diff changeset
1029 gtk_box_pack_start(GTK_BOX(box), gc->status, FALSE, FALSE, 0);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1030 gtk_widget_show(gc->status);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1031
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1032 button = gtk_button_new_with_label(_("Cancel"));
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1153
diff changeset
1033 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1034 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_signon), gc);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1035 gtk_widget_show(button);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1036
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1037 gtk_widget_show(gc->meter);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1038 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1039
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
1040 gtk_progress_bar_update(GTK_PROGRESS_BAR(gc->progress), howfar / LOGIN_STEPS);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1041 gtk_statusbar_pop(GTK_STATUSBAR(gc->status), 1);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1042 gtk_statusbar_push(GTK_STATUSBAR(gc->status), 1, message);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1043 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1044
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1045 static void set_kick_null(GtkObject *obj, struct aim_user *u)
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1046 {
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1047 u->kick_dlg = NULL;
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1048 }
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1049
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1050 void hide_login_progress(struct gaim_connection *gc, char *why)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1051 {
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1052 char buf[2048];
1708
eeb0cfe710b1 [gaim-migrate @ 1718]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
1053 sprintf(buf, _("%s\n%s was unable to sign on: %s"), full_date(), gc->username, why);
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1054 if (gc->user->kick_dlg)
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1055 gtk_widget_destroy(gc->user->kick_dlg);
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1056 gc->user->kick_dlg = do_error_dialog(buf, _("Signon Error"));
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1057 gtk_signal_connect(GTK_OBJECT(gc->user->kick_dlg), "destroy",
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1058 GTK_SIGNAL_FUNC(set_kick_null), gc->user);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1059 if (gc->meter)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1060 gtk_widget_destroy(gc->meter);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1061 gc->meter = NULL;
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1062 }
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1063
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1064 void signoff_all(gpointer w, gpointer d)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1065 {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1066 GSList *c = connections;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1067 struct gaim_connection *g = NULL;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1068
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1069 while (c) {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1070 g = (struct gaim_connection *)c->data;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1071 g->wants_to_die = TRUE;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1072 signoff(g);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1073 c = connections;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1074 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1075 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1076
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1077 void signoff(struct gaim_connection *gc)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1078 {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1079 /* core stuff */
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1080 debug_printf("date: %s\n", full_date());
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1081 plugin_event(event_signoff, gc, 0, 0, 0);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1082 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
1083
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1084 /* UI stuff */
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1085 convo_menu_remove(gc);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1086 remove_icon_data(gc);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1087 serv_close(gc);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1088 redo_buddy_list();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1089 build_edit_tree();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1090 do_away_menu();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1091 do_proto_menu();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1092 redo_convo_menus();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1093 #ifdef USE_APPLET
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1094 if (connections)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1095 set_user_state(online);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1096 #endif
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1097 update_connection_dependent_prefs();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1098
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1099 if (connections)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1100 return;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1101
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1102 destroy_all_dialogs();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1103 destroy_buddy();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1104 #ifdef USE_APPLET
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1105 set_user_state(offline);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1106 applet_buddy_show = FALSE;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1107 applet_widget_unregister_callback(APPLET_WIDGET(applet), "signoff");
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1108 remove_applet_away();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1109 #else
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1110 show_login();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1111 #endif /* USE_APPLET */
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1112 if (misc_options & OPT_MISC_BUDDY_TICKER)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1113 BuddyTickerSignoff();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1114 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1115
1942
ba421d552093 [gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1928
diff changeset
1116 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
1117 {
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1118 char *titles[4];
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1119 int i;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1120
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1121 struct aim_user *u = g_new0(struct aim_user, 1);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1122 g_snprintf(u->username, sizeof(u->username), "%s", name);
2273
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2248
diff changeset
1123 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
1124 u->protocol = proto;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1125 u->options = opts;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1126 aim_users = g_list_append(aim_users, u);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1127
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1128 if (list) {
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1129 titles[0] = u->username;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1130 titles[1] = u->gc ? "Yes" : "No";
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1131 titles[2] = (u->options & OPT_USR_AUTO) ? "True" : "False";
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1132 titles[3] = proto_name(u->protocol);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1133 i = gtk_clist_append(GTK_CLIST(list), titles);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1134 gtk_clist_set_row_data(GTK_CLIST(list), i, u);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1135 }
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1136
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1137 return u;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1138 }