annotate src/multi.c @ 4398:a8249a5250b6

[gaim-migrate @ 4667] Made use of the new GAIM_IS_GTK_WINDOW() and GAIM_IS_GTK_CONVERSATION() macros. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 22 Jan 2003 23:46:59 +0000
parents bf6ac19d0d63
children a00bfe984e7e
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>
3067
b695cbbeee2d [gaim-migrate @ 3081]
Sean Egan <seanegan@gmail.com>
parents: 3066
diff changeset
23 #include <ctype.h>
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 #include <gtk/gtk.h>
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
25 #include "prpl.h"
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 #include "multi.h"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 #include "gaim.h"
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
28 #include "conversation.h"
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 #include "pixmaps/cancel.xpm"
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 #include "pixmaps/ok.xpm"
3717
988485669631 [gaim-migrate @ 3850]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
32 /*#include "pixmaps/no_icon.xpm"*/
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
34 #define LOGIN_STEPS 5
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
35
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 GSList *connections;
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3510
diff changeset
37 int connecting_count = 0;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 static GtkWidget *acctedit = NULL;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
40 static GtkWidget *treeview = NULL; /* the treeview of names in the accteditor */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
41 static GtkListStore *model = NULL;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
42
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
43 static GSList *mod_users = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
45 enum
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
46 {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
47 COLUMN_SCREENNAME,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
48 COLUMN_ONLINE,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
49 COLUMN_AUTOLOGIN,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
50 COLUMN_PROTOCOL,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
51 COLUMN_DATA,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
52 NUM_COLUMNS
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
53 };
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
54
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
55 static void acct_signin(GtkCellRendererToggle *cell, gchar *path_str,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
56 gpointer d);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
57 static void acct_autologin(GtkCellRendererToggle *cell, gchar *path_str,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
58 gpointer d);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
59
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
60 static struct mod_user *find_mod_user(struct aim_user *a)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
61 {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
62 GSList *m = mod_users;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
63 while (m) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
64 struct mod_user *u = m->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
65 if (u->user == a)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
66 return u;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
67 m = m->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
68 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
69 return NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
70 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
71
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
72 static void generate_protocol_options(struct mod_user *, GtkWidget *);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
73
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 struct mod_usr_opt {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
75 struct mod_user *user;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 int opt;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 };
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 struct gaim_connection *new_gaim_conn(struct aim_user *user)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 struct gaim_connection *gc = g_new0(struct gaim_connection, 1);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1355
diff changeset
82 gc->edittype = EDIT_GC;
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
83 gc->protocol = user->protocol;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
84 gc->prpl = find_prpl(user->protocol);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
85 g_snprintf(gc->username, sizeof(gc->username), "%s", user->username);
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
86 g_snprintf(gc->password, sizeof(gc->password), "%s", user->password);
1153
3063e6743913 [gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1124
diff changeset
87 gc->keepalive = 0;
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
88 gc->inpa = 0;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 993
diff changeset
89 gc->buddy_chats = NULL;
4111
ee884f1d7ae3 [gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents: 4082
diff changeset
90 gc->away = NULL;
ee884f1d7ae3 [gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents: 4082
diff changeset
91 gc->away_state = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 connections = g_slist_append(connections, gc);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
95 user->gc = gc;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
96 gc->user = user;
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
97
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 return gc;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
101 struct meter_window {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
102 GtkWidget *window;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
103 GtkTable *table;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
104 gint rows;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
105 gint active_count;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
106 } *meter_win = NULL;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
107
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 void destroy_gaim_conn(struct gaim_connection *gc)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109 {
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
110 GSList *g = groups;
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
111 GSList *h;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
112 struct group *m;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
113 struct buddy *n;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
114 while (g) {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
115 m = (struct group *)g->data;
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
116 g = g_slist_next(g);
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
117 h = m->members;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
118 while (h) {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
119 n = (struct buddy *)h->data;
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
120 h = g_slist_next(h);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
121 if(n->user == gc->user) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
122 n->present = 0;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
123 }
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1058
diff changeset
124 }
2597
2ced57c58653 [gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2568
diff changeset
125 }
4111
ee884f1d7ae3 [gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents: 4082
diff changeset
126 g_free(gc->away);
ee884f1d7ae3 [gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents: 4082
diff changeset
127 g_free(gc->away_state);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128 g_free(gc);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
129
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
130 if (!connections && mainwindow)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
131 gtk_widget_show(mainwindow);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
134 static void quit_acctedit(gpointer d)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136 if (acctedit) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 save_prefs();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 gtk_widget_destroy(acctedit);
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
139 acctedit = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
140 }
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
141 treeview = NULL;
1474
4e891576c226 [gaim-migrate @ 1484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1473
diff changeset
142 if (!d && !blist && !mainwindow && !connections)
4082
4b04ecb3eb97 [gaim-migrate @ 4297]
Luke Schierer <lschiere@pidgin.im>
parents: 4074
diff changeset
143 do_quit();
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
146 static void on_delete_acctedit(GtkWidget *w, GdkEvent *ev, gpointer d)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147 {
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
148 quit_acctedit(d);
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
149 }
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
150
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
151 static void on_close_acctedit(GtkButton *button, gpointer d)
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
152 {
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
153 quit_acctedit(d);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 static char *proto_name(int proto)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157 {
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
158 struct prpl *p = find_prpl(proto);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
159 if (p && p->name)
3572
bdd0bebd2d04 [gaim-migrate @ 3670]
Sean Egan <seanegan@gmail.com>
parents: 3570
diff changeset
160 return p->name;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
161 else
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
162 return "Unknown";
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
165 void regenerate_user_list()
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
166 {
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
167 GSList *u = aim_users;
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
168 struct aim_user *a;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
169 GtkTreeIter iter;
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
170
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
171 if (!acctedit)
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
172 return;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
173
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
174 gtk_list_store_clear(model);
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
175
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
176 while (u) {
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
177 a = (struct aim_user *)u->data;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
178
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
179 gtk_list_store_append(model, &iter);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
180 gtk_list_store_set(model, &iter,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
181 COLUMN_SCREENNAME, a->username,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
182 COLUMN_ONLINE, (a->gc ? TRUE : FALSE),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
183 COLUMN_AUTOLOGIN, (a->options & OPT_USR_AUTO),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
184 COLUMN_PROTOCOL, proto_name(a->protocol),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
185 COLUMN_DATA, a,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
186 -1);
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
187 u = u->next;
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
188 }
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
189 }
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
190
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
191 static gboolean get_iter_from_data(GtkTreeView *treeview,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
192 struct aim_user *a, GtkTreeIter *iter)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
193 {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
194 return gtk_tree_model_iter_nth_child(gtk_tree_view_get_model(treeview),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
195 iter, NULL,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
196 g_slist_index(aim_users, a));
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
197 #if 0
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
198 GtkListModel *model = gtk_tree_view_get_model(treeview);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
199 struct aim_user *user;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
200 int i;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
201
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
202 rows = gtk_tree_model_iter_n_children(model, NULL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
203
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
204 for (i = 0; i < rows; i++)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
205 {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
206 gtk_tree_model_get(model, iter, COLUMN_DATA, &user, -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
207
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
208 if (user == a)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
209 return TRUE;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
210 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
211
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
212 return FALSE;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
213 #endif
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
214 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
215
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
216 static void add_columns(GtkWidget *treeview)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
217 {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
218 GtkCellRenderer *renderer;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
219 GtkTreeViewColumn *column;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
220
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
221 /* Screennames */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
222 renderer = gtk_cell_renderer_text_new();
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
223 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
224 -1, _("Screenname"),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
225 renderer,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
226 "text", COLUMN_SCREENNAME,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
227 NULL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
228
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
229 /* Online? */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
230 renderer = gtk_cell_renderer_toggle_new();
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
231 g_signal_connect(G_OBJECT(renderer), "toggled",
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
232 G_CALLBACK(acct_signin), model);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
233 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
234 -1, _("Online"),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
235 renderer,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
236 "active", COLUMN_ONLINE,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
237 NULL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
238
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
239 /* Auto-login? */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
240 renderer = gtk_cell_renderer_toggle_new();
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
241 g_signal_connect(G_OBJECT(renderer), "toggled",
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
242 G_CALLBACK(acct_autologin), model);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
243 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
244 -1, _("Auto-login"),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
245 renderer,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
246 "active", COLUMN_AUTOLOGIN,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
247 NULL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
248
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
249 /* Protocol */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
250 renderer = gtk_cell_renderer_text_new();
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
251 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
252 -1, _("Protocol"),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
253 renderer,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
254 "text", COLUMN_PROTOCOL,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
255 NULL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
256
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
257 /* Data */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
258 column = gtk_tree_view_column_new();
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
259 // gtk_tree_view_insert_column(GTK_TREE_VIEW(treeview), column, -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
260 gtk_tree_view_column_set_visible(column, FALSE);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
261 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
262
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
263 static GtkWidget *generate_list()
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
264 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
265 GtkWidget *win;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
266
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
267 win = gtk_scrolled_window_new(0, 0);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
268 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
269 GTK_POLICY_AUTOMATIC,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
270 GTK_POLICY_ALWAYS);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
271
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
272 /* Create the list model. */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
273 model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_STRING, G_TYPE_BOOLEAN,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
274 G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
275
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
276 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
277 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
278 gtk_tree_selection_set_mode(
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
279 gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
280 GTK_SELECTION_MULTIPLE);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
281
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
282 add_columns(treeview);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
283
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
284 gtk_container_add(GTK_CONTAINER(win), treeview);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
285 gtk_widget_show(treeview);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
286
2204
5014b802eb41 [gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2203
diff changeset
287 regenerate_user_list();
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
288 gtk_tree_view_set_reorderable (GTK_TREE_VIEW(treeview), TRUE);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
289 gtk_widget_show(win);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
290 return win;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
291 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
292
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
293 static void delmod(GtkWidget *w, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
294 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
295 mod_users = g_slist_remove(mod_users, u);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
296 g_free(u);
960
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 mod_opt(GtkWidget *b, struct mod_usr_opt *m)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
300 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
301 m->user->options = m->user->options ^ m->opt;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
302 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
303
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
304 static void free_muo(GtkWidget *b, struct mod_usr_opt *m)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
305 {
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
306 g_free(m);
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
307 }
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
308
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
309 static GtkWidget *acct_button(const char *text, struct mod_user *u, int option, GtkWidget *box)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
310 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
311 GtkWidget *button;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
312 struct mod_usr_opt *muo = g_new0(struct mod_usr_opt, 1);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
313 button = gtk_check_button_new_with_label(text);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
314 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (u->options & option));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
315 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
316 muo->user = u;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
317 muo->opt = option;
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
318 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(mod_opt), muo);
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
319 g_signal_connect(GTK_OBJECT(button), "destroy", G_CALLBACK(free_muo), muo);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
320 gtk_widget_show(button);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
321 return button;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
322 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
323
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
324 static void ok_mod(GtkWidget *w, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
325 {
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
326 GList *tmp;
1954
c15c3a3f6cd4 [gaim-migrate @ 1964]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1942
diff changeset
327 const char *txt;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
328 struct aim_user *a;
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
329 struct prpl *p;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
330 GtkTreeIter iter;
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
331
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
332 if (!u->user) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
333 txt = gtk_entry_get_text(GTK_ENTRY(u->name));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
334 u->user = new_user(txt, u->protocol, u->options);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
335 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
336 a = u->user;
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
337
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
338 a->options = u->options;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
339 a->protocol = u->protocol;
2628
4054a0849461 [gaim-migrate @ 2641]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2627
diff changeset
340 txt = gtk_entry_get_text(GTK_ENTRY(u->name));
4054a0849461 [gaim-migrate @ 2641]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2627
diff changeset
341 g_snprintf(a->username, sizeof(a->username), "%s", txt);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
342 txt = gtk_entry_get_text(GTK_ENTRY(u->alias));
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
343 g_snprintf(a->alias, sizeof(a->alias), "%s", txt);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
344 txt = gtk_entry_get_text(GTK_ENTRY(u->pass));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
345 if (a->options & OPT_USR_REM_PASS)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
346 g_snprintf(a->password, sizeof(a->password), "%s", txt);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
347 else
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
348 a->password[0] = '\0';
2190
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
349
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
350 if (get_iter_from_data(GTK_TREE_VIEW(treeview), a, &iter)) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
351 gtk_list_store_set(model, &iter,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
352 COLUMN_SCREENNAME, a->username,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
353 COLUMN_AUTOLOGIN, (a->options & OPT_USR_AUTO),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
354 COLUMN_PROTOCOL, proto_name(a->protocol),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
355 -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
356 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
357
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
358 #if 0
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
359 i = gtk_clist_find_row_from_data(GTK_CLIST(list), a);
2628
4054a0849461 [gaim-migrate @ 2641]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2627
diff changeset
360 gtk_clist_set_text(GTK_CLIST(list), i, 0, a->username);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
361 gtk_clist_set_text(GTK_CLIST(list), i, 2,
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
362 (a->options & OPT_USR_AUTO) ? "True" : "False");
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
363 gtk_clist_set_text(GTK_CLIST(list), i, 3, proto_name(a->protocol));
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
364 #endif
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
365
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
366 tmp = u->opt_entries;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
367 while (tmp) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
368 GtkEntry *entry = tmp->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
369 int pos = (int)gtk_object_get_user_data(GTK_OBJECT(entry));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
370 g_snprintf(a->proto_opt[pos], sizeof(a->proto_opt[pos]), "%s",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
371 gtk_entry_get_text(entry));
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
372 tmp = tmp->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
373 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
374 if (u->opt_entries)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
375 g_list_free(u->opt_entries);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
376 u->opt_entries = NULL;
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
377
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
378 g_snprintf(a->iconfile, sizeof(a->iconfile), "%s", u->iconfile);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
379 if (u->icondlg)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
380 gtk_widget_destroy(u->icondlg);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
381 u->icondlg = NULL;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
382
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
383 /*
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
384 * See if user registration is supported/required
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
385 */
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
386 if((p = find_prpl(u->protocol)) == NULL) {
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
387 /* TBD: error dialog here! (This should never happen, you know...) */
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
388 fprintf(stderr, "dbg: couldn't find protocol for protocol number %d!\n", u->protocol);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
389 fflush(stderr);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
390 } else {
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
391 if(p->register_user != NULL &&
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
392 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(u->register_user)) == TRUE) {
4040
89b56ab2b692 [gaim-migrate @ 4248]
Luke Schierer <lschiere@pidgin.im>
parents: 3885
diff changeset
393 ref_protocol(p);
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
394 p->register_user(a);
4040
89b56ab2b692 [gaim-migrate @ 4248]
Luke Schierer <lschiere@pidgin.im>
parents: 3885
diff changeset
395 /* we don't unref the protocol because register user has callbacks
89b56ab2b692 [gaim-migrate @ 4248]
Luke Schierer <lschiere@pidgin.im>
parents: 3885
diff changeset
396 * that need to get called first, then they will unref the protocol
89b56ab2b692 [gaim-migrate @ 4248]
Luke Schierer <lschiere@pidgin.im>
parents: 3885
diff changeset
397 * appropriately */
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
398 }
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
399 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
400
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
401 save_prefs();
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
402
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
403 gtk_widget_destroy(u->mod);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
404 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
405
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
406 static void cancel_mod(GtkWidget *w, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
407 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
408 if (u->opt_entries)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
409 g_list_free(u->opt_entries);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
410 u->opt_entries = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
411 if (u->icondlg)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
412 gtk_widget_destroy(u->icondlg);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
413 u->icondlg = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
414 gtk_widget_destroy(u->mod);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
415 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
416
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
417 static void set_prot(GtkWidget *opt, int proto)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
418 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
419 struct mod_user *u = gtk_object_get_user_data(GTK_OBJECT(opt));
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
420 struct prpl *p, *q;
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
421 q = find_prpl(proto);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
422 if (u->protocol != proto) {
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
423 int i;
1878
75643b9f4261 [gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
424 for (i = 0; i < 7; i++)
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1075
diff changeset
425 u->proto_opt[i][0] = '\0';
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
426 p = find_prpl(u->protocol);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
427
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
428 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
429 gtk_widget_hide(u->pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
430 gtk_widget_hide(u->rempass);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
431 } 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
432 gtk_widget_show(u->pwdbox);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
433 gtk_widget_show(u->rempass);
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
434 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
435 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
436 gtk_widget_show(u->checkmail);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
437 } 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
438 gtk_widget_hide(u->checkmail);
0befa2d2e540 [gaim-migrate @ 2163]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2118
diff changeset
439 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
440
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
441 if (!(p->options & OPT_PROTO_BUDDY_ICON) && (q->options & OPT_PROTO_BUDDY_ICON)) {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
442 gtk_widget_show(u->iconsel);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
443 } else if ((p->options & OPT_PROTO_BUDDY_ICON) && !(q->options & OPT_PROTO_BUDDY_ICON)) {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
444 gtk_widget_hide(u->iconsel);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
445 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
446
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
447 if ((q->options & OPT_PROTO_BUDDY_ICON) || (q->options & OPT_PROTO_MAIL_CHECK))
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
448 gtk_widget_show(u->user_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
449 else
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
450 gtk_widget_hide(u->user_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
451
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
452 u->protocol = proto;
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
453 generate_protocol_options(u, u->main);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
454 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
455 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
456
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
457 static GtkWidget *make_protocol_menu(GtkWidget *box, struct mod_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
458 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
459 GtkWidget *optmenu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
460 GtkWidget *menu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
461 GtkWidget *opt;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
462 GSList *p = protocols;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
463 struct prpl *e;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
464 int count = 0;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
465 gboolean found = FALSE;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
466
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
467 optmenu = gtk_option_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
468 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
469 gtk_widget_show(optmenu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
470
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
471 menu = gtk_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
472
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
473 while (p) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
474 e = (struct prpl *)p->data;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
475 if (e->protocol == u->protocol)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
476 found = TRUE;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
477 if (!found)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
478 count++;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
479 if (e->name)
3572
bdd0bebd2d04 [gaim-migrate @ 3670]
Sean Egan <seanegan@gmail.com>
parents: 3570
diff changeset
480 opt = gtk_menu_item_new_with_label(e->name);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
481 else
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
482 opt = gtk_menu_item_new_with_label("Unknown");
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
483 gtk_object_set_user_data(GTK_OBJECT(opt), u);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
484 g_signal_connect(GTK_OBJECT(opt), "activate",
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
485 G_CALLBACK(set_prot), (void *)e->protocol);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
486 gtk_menu_append(GTK_MENU(menu), opt);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
487 gtk_widget_show(opt);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
488 p = p->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
489 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
490
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
491 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
492 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), count);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
493
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
494 return optmenu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
495 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
496
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
497 static void des_icon_sel(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
498 {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
499 w = u->icondlg;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
500 if (u->icondlg)
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
501 u->icondlg = NULL;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
502 if (w)
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
503 gtk_widget_destroy(w);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
504 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
505
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
506 static void set_icon(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
507 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
508 GtkWidget *sel = u->icondlg;
3466
7a3f16a375a5 [gaim-migrate @ 3516]
Sean Egan <seanegan@gmail.com>
parents: 3458
diff changeset
509 const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sel));
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
510
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
511 if (file_is_dir(file, sel))
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
512 return;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
513
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
514 gtk_entry_set_text(GTK_ENTRY(u->iconentry), file);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
515 g_snprintf(u->iconfile, sizeof(u->iconfile), "%s", file);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
516 u->icondlg = NULL;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
517
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
518 gtk_widget_destroy(sel);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
519 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
520
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
521 static void sel_icon_dlg(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
522 {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
523 GtkWidget *dlg;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
524 char buf[256];
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
525
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
526 if (u->icondlg) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
527 gtk_widget_show(u->icondlg);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
528 return;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
529 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
530
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
531 dlg = gtk_file_selection_new(_("Gaim - Load Buddy Icon"));
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
532 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dlg));
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
533 if (u->iconfile) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
534 char *tmp = g_dirname(u->iconfile);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
535 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dlg), tmp);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
536 g_free(tmp);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
537 } else {
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3572
diff changeset
538 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S, gaim_home_dir());
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
539 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dlg), buf);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
540 }
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
541
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
542 g_signal_connect(GTK_OBJECT(dlg), "destroy", G_CALLBACK(des_icon_sel), u);
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
543 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(dlg)->cancel_button), "clicked",
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
544 G_CALLBACK(des_icon_sel), u);
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
545 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(dlg)->ok_button), "clicked",
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
546 G_CALLBACK(set_icon), u);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
547
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
548 u->icondlg = dlg;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
549
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
550 gtk_widget_show(dlg);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
551 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
552
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
553 static void reset_icon(GtkWidget *w, struct mod_user *u)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
554 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
555 u->iconfile[0] = 0;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
556 gtk_entry_set_text(GTK_ENTRY(u->iconentry), "");
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
557 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
558
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
559 static GtkWidget *build_icon_selection(struct mod_user *u, GtkWidget *box)
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
560 {
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
561 GtkWidget *hbox;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
562 GtkWidget *label;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
563 GtkWidget *name;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
564 GtkWidget *browse;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
565 GtkWidget *reset;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
566
2444
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
567 if (u->user)
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
568 g_snprintf(u->iconfile, sizeof(u->iconfile), "%s", u->user->iconfile);
2431
5948060f486c [gaim-migrate @ 2444]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2411
diff changeset
569
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
570 hbox = gtk_hbox_new(FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
571 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
572 gtk_widget_show(hbox);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
573
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
574 label = gtk_label_new(_("Buddy Icon File:"));
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
575 gtk_size_group_add_widget(u->sg, label);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
576 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
577 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
578 gtk_widget_show(label);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
579
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
580 name = gtk_entry_new();
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
581 gtk_entry_set_text(GTK_ENTRY(name), u->iconfile);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
582 gtk_entry_set_editable(GTK_ENTRY(name), FALSE);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
583 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 5);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
584 gtk_widget_show(name);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
585 u->iconentry = name;
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
586
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
587 browse = gtk_button_new_with_label(_("Browse"));
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
588 g_signal_connect(GTK_OBJECT(browse), "clicked", G_CALLBACK(sel_icon_dlg), u);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
589 gtk_box_pack_start(GTK_BOX(hbox), browse, FALSE, FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
590 gtk_widget_show(browse);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
591
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
592 reset = gtk_button_new_with_label(_("Reset"));
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
593 g_signal_connect(GTK_OBJECT(reset), "clicked", G_CALLBACK(reset_icon), u);
2411
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
594 gtk_box_pack_start(GTK_BOX(hbox), reset, FALSE, FALSE, 0);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
595 gtk_widget_show(reset);
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
596
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
597 return hbox;
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
598 }
123aaa84109a [gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2403
diff changeset
599
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
600 static void generate_login_options(struct mod_user *u, GtkWidget *box)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
601 {
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
602 GtkWidget *frame, *frame_parent;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
603 GtkWidget *vbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
604 GtkWidget *hbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
605 GtkWidget *label;
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
606
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
607 struct prpl *p;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
608
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
609 frame = make_frame(box, _("Login Options"));
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
610 frame_parent = gtk_widget_get_parent(gtk_widget_get_parent(frame));
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
611
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
612 vbox = gtk_vbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
613 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
614 gtk_container_add(GTK_CONTAINER(frame), vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
615
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
616 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
617 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
618
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
619 label = gtk_label_new(_("Screenname:"));
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
620 gtk_size_group_add_widget(u->sg, label);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
621 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
622 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
623
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
624 u->name = gtk_entry_new();
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
625 gtk_box_pack_start(GTK_BOX(hbox), u->name, TRUE, TRUE, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
626
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
627 u->pwdbox = gtk_hbox_new(FALSE, 5);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
628 gtk_box_pack_start(GTK_BOX(vbox), u->pwdbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
629
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
630 label = gtk_label_new(_("Password:"));
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
631 gtk_size_group_add_widget(u->sg, label);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
632 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
633 gtk_box_pack_start(GTK_BOX(u->pwdbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
634
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
635 u->pass = gtk_entry_new();
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
636 gtk_box_pack_start(GTK_BOX(u->pwdbox), u->pass, TRUE, TRUE, 0);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
637 gtk_entry_set_visibility(GTK_ENTRY(u->pass), FALSE);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
638
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
639 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
640 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
641
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
642 label = gtk_label_new(_("Alias:"));
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
643 gtk_size_group_add_widget(u->sg, label);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
644 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
645 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
646
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
647 u->alias = gtk_entry_new();
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
648 gtk_box_pack_start(GTK_BOX(hbox), u->alias, TRUE, TRUE, 0);
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
649
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
650 hbox = gtk_hbox_new(FALSE, 5);
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
651 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
652 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
653
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
654 label = gtk_label_new(_("Protocol:"));
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
655 gtk_size_group_add_widget(u->sg, label);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
656 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
657 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
658
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
659 make_protocol_menu(hbox, u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
660
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
661 u->rempass = acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
662 acct_button(_("Auto-Login"), u, OPT_USR_AUTO, vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
663
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
664 gtk_widget_show_all(frame_parent);
2100
a93aeb6f813d [gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
665
2444
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
666 if (u->user) {
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
667 gtk_entry_set_text(GTK_ENTRY(u->name), u->user->username);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3111
diff changeset
668 gtk_entry_set_text(GTK_ENTRY(u->alias), u->user->alias);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
669 gtk_entry_set_text(GTK_ENTRY(u->pass), u->user->password);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
670 }
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
671
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
672 p = find_prpl(u->protocol);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
673 if (p && (p->options & OPT_PROTO_NO_PASSWORD)) {
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
674 gtk_widget_hide(u->pwdbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
675 gtk_widget_hide(u->rempass);
2444
13ce96daf30f [gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2442
diff changeset
676 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
677 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
678
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
679 static void generate_user_options(struct mod_user *u, GtkWidget *box)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
680 {
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
681 /* This function will add the appropriate (depending on the current
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
682 * protocol) widgets to frame and return TRUE if there anything
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
683 * was added (meaning the frame should be shown)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
684 * Eric will most likely change this (as he does all other submitted code)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
685 * so that it will accept the vbox as an argument and create, add, and show
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
686 * the frame itself (like generate_protocol_options). I'd do it myself, but I'm
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
687 * tired and I don't care. */
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
688 /* Sean was right. I did do that. I told him I would. */
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
689
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
690 GtkWidget *vbox;
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
691 GtkWidget *frame;
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
692
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
693 struct prpl *p = find_prpl(u->protocol);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
694
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
695 frame = make_frame(box, _("User Options"));
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
696 u->user_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame));
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
697 gtk_widget_show_all(u->user_frame);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
698
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
699 vbox = gtk_vbox_new(FALSE, 5);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
700 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
701 gtk_container_add(GTK_CONTAINER(frame), vbox);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
702 gtk_widget_show(vbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
703
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
704 u->checkmail = acct_button(_("New Mail Notifications"), u, OPT_USR_MAIL_CHECK, vbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
705 u->iconsel = build_icon_selection(u, vbox);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
706
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
707 if (!p) {
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
708 gtk_widget_hide(u->user_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
709 return;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
710 }
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
711
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
712 if (!(p->options & OPT_PROTO_MAIL_CHECK))
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
713 gtk_widget_hide(u->checkmail);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
714 if (!(p->options & OPT_PROTO_BUDDY_ICON))
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
715 gtk_widget_hide(u->iconsel);
2525
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
716
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
717 if ((p->options & OPT_PROTO_BUDDY_ICON) || (p->options & OPT_PROTO_MAIL_CHECK))
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
718 return;
4fc6aac9da94 [gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2522
diff changeset
719 gtk_widget_hide(u->user_frame);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
720 }
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
721
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
722 static void generate_protocol_options(struct mod_user *u, GtkWidget *box)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
723 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
724 struct prpl *p = find_prpl(u->protocol);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
725
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
726 GList *op, *tmp;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
727
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
728 GtkWidget *vbox;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
729 GtkWidget *hbox;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
730 GtkWidget *label;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
731 GtkWidget *entry;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
732 GtkWidget *frame;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
733
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
734 char buf[256];
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
735
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
736 if (u->proto_frame)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
737 gtk_widget_destroy(u->proto_frame);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
738 u->proto_frame = NULL;
2203
14100685c95f [gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2200
diff changeset
739
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
740 if (u->opt_entries) {
2190
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
741 g_list_free(u->opt_entries);
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
742 u->opt_entries = NULL;
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
743 }
24d947eff811 [gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2165
diff changeset
744
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
745 if (!p)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
746 return;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
747
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
748 if (!p->user_opts)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
749 return;
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
750
3572
bdd0bebd2d04 [gaim-migrate @ 3670]
Sean Egan <seanegan@gmail.com>
parents: 3570
diff changeset
751 tmp = op = p->user_opts;
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
752
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
753 if (!op)
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
754 return;
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
755
4169
40d35a98f481 [gaim-migrate @ 4398]
Luke Schierer <lschiere@pidgin.im>
parents: 4162
diff changeset
756 g_snprintf(buf, sizeof(buf), _("%s Options"), p->name);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
757 frame = make_frame(box, buf);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
758
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
759 /* BLEH */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
760 u->proto_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame));
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
761 gtk_widget_show_all(u->proto_frame);
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
762
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
763 vbox = gtk_vbox_new(FALSE, 5);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
764 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
765 gtk_container_add(GTK_CONTAINER(frame), vbox);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
766 gtk_widget_show(vbox);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
767
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
768 while (op) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
769 struct proto_user_opt *puo = op->data;
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
770
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
771 hbox = gtk_hbox_new(FALSE, 5);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
772 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
773 gtk_widget_show(hbox);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
774
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
775 label = gtk_label_new(puo->label);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
776 gtk_size_group_add_widget(u->sg, label);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
777 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
778 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
779 gtk_widget_show(label);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
780
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
781 entry = gtk_entry_new();
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
782 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
783 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)puo->pos);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
784 if (u->proto_opt[puo->pos][0]) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
785 debug_printf("setting text %s\n", u->proto_opt[puo->pos]);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
786 gtk_entry_set_text(GTK_ENTRY(entry), u->proto_opt[puo->pos]);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
787 } else {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
788 gtk_entry_set_text(GTK_ENTRY(entry), puo->def);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
789 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
790 gtk_widget_show(entry);
2154
cff133e0ec0c [gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2153
diff changeset
791
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
792 u->opt_entries = g_list_append(u->opt_entries, entry);
3572
bdd0bebd2d04 [gaim-migrate @ 3670]
Sean Egan <seanegan@gmail.com>
parents: 3570
diff changeset
793
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
794 op = op->next;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
795 }
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
796
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
797 if(p->register_user != NULL) {
2975
626729653436 [gaim-migrate @ 2988]
Rob Flynn <gaim@robflynn.com>
parents: 2956
diff changeset
798 u->register_user = gtk_check_button_new_with_label(_("Register with server"));
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
799 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(u->register_user), FALSE);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
800 gtk_box_pack_start(GTK_BOX(vbox), u->register_user, FALSE, FALSE, 0);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
801 gtk_widget_show(u->register_user);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
802 }
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
803
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
804 }
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
805
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
806 static void show_acct_mod(struct aim_user *a)
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
807 {
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
808 /* This is the fucking modify account dialog. I've fucking seperated it into
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
809 * three fucking frames:
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
810 * a fucking Login Options frame, a fucking User Options frame and a fucking
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
811 * Protcol Options frame. This fucking removes the two fucking tabs, which were
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
812 * quite fucking uneccessary. Fuck. */
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
813 /* -- SeanEgan */
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
814 /* YEAH!! -- ChipX86 */
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
815 GtkWidget *hbox, *vbox;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
816 GtkWidget *button;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
817 GtkWidget *sep;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
818 GtkSizeGroup *button_sg;
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
819
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
820 struct mod_user *u = find_mod_user(a);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
821
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
822 if (!u) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
823 u = g_new0(struct mod_user, 1);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
824 u->user = a;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
825 mod_users = g_slist_append(mod_users, u);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
826
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
827 if (a) {
2458
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
828 int i;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
829 u->options = a->options;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
830 if (find_prpl(a->protocol))
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
831 u->protocol = a->protocol;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
832 else if (protocols)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
833 u->protocol = ((struct prpl *)protocols->data)->protocol;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
834 else
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
835 u->protocol = -1;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
836 g_snprintf(u->iconfile, sizeof(u->iconfile), "%s", a->iconfile);
2458
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
837 for (i = 0; i < 7; i++)
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
838 g_snprintf(u->proto_opt[i], sizeof(u->proto_opt[i]), "%s",
8208e2016d9b [gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2445
diff changeset
839 a->proto_opt[i]);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
840 } else {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
841 u->options = OPT_USR_REM_PASS;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
842 if (find_prpl(DEFAULT_PROTO))
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
843 u->protocol = DEFAULT_PROTO;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
844 else if (protocols)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
845 u->protocol = ((struct prpl *)protocols->data)->protocol;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
846 else
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
847 u->protocol = -1;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
848 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
849 } else {
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
850 gtk_widget_show(u->mod);
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
851 return;
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
852 }
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
853
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
854 u->mod = gtk_window_new(GTK_WINDOW_TOPLEVEL);
4074
3ccbdf8e7f8d [gaim-migrate @ 4289]
Sean Egan <seanegan@gmail.com>
parents: 4040
diff changeset
855 gtk_window_set_role(GTK_WINDOW(u->mod), "account");
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
856 gtk_widget_realize(u->mod);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
857 gtk_window_set_title(GTK_WINDOW(u->mod), _("Gaim - Modify Account"));
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
858 gtk_window_set_policy(GTK_WINDOW(u->mod), FALSE, FALSE, TRUE); /* nothing odd here :) */
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
859 g_signal_connect(GTK_OBJECT(u->mod), "destroy", G_CALLBACK(delmod), u);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
860
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
861 vbox = gtk_vbox_new(FALSE, 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
862 gtk_container_border_width(GTK_CONTAINER(vbox), 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
863 gtk_container_add(GTK_CONTAINER(u->mod), vbox);
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
864 gtk_widget_show(vbox);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
865
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
866 u->main = gtk_vbox_new(FALSE, 12);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
867 gtk_container_border_width(GTK_CONTAINER(u->main), 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
868 gtk_box_pack_start(GTK_BOX(vbox), u->main, FALSE, FALSE, 0);
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
869 gtk_widget_show(u->main);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
870
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
871 u->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
872
2522
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
873 generate_login_options(u, u->main);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
874 generate_user_options(u, u->main);
108b3eab22aa [gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2458
diff changeset
875 generate_protocol_options(u, u->main);
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1074
diff changeset
876
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
877 hbox = gtk_hbox_new(FALSE, 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
878 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
879 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
880
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
881 button_sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
882
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
883 button = gtk_button_new_from_stock(GTK_STOCK_OK);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
884 gtk_size_group_add_widget(button_sg, button);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
885 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
886 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(ok_mod), u);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
887
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
888 button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
889 gtk_size_group_add_widget(button_sg, button);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
890 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
891 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(cancel_mod), u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
892
3756
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
893 sep = gtk_hseparator_new();
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
894 gtk_box_pack_end (GTK_BOX (vbox), sep, FALSE, FALSE, 0);
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
895 gtk_widget_show(sep);
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
896
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
897 gtk_widget_show_all(hbox);
08742bf8a7be [gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents: 3755
diff changeset
898 gtk_widget_show(u->mod);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
899 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
900
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
901 static void add_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
902 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
903 show_acct_mod(NULL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
904 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
905
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
906 static void mod_acct_func(GtkTreeModel *model, GtkTreePath *path,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
907 GtkTreeIter *iter, gpointer data)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
908 {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
909 struct aim_user *u;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
910
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
911 gtk_tree_model_get(model, iter, COLUMN_DATA, &u, -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
912
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
913 if (u != NULL)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
914 show_acct_mod(u);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
915 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
916
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
917 static void mod_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
918 {
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
919 GtkTreeSelection *selection;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
920
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
921 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
922
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
923 gtk_tree_selection_selected_foreach(selection, mod_acct_func, NULL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
924
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
925 #if 0
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
926 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
927 row = (int)l->data;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
928 if (row != -1) {
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
929 u = g_slist_nth_data(aim_users, row);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
930 if (u)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
931 show_acct_mod(u);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
932 }
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
933 l = l->next;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
934 }
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
935 #endif
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
936 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
937
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
938 struct pass_prompt {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
939 struct aim_user *u;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
940 GtkWidget *win;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
941 GtkWidget *entry;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
942 };
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
943 static GSList *passes = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
944
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
945 static struct pass_prompt *find_pass_prompt(struct aim_user *u)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
946 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
947 GSList *p = passes;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
948 while (p) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
949 struct pass_prompt *r = p->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
950 if (r->u == u)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
951 return r;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
952 p = p->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
953 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
954 return NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
955 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
956
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
957 static void pass_des(GtkWidget *w, struct pass_prompt *p)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
958 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
959 passes = g_slist_remove(passes, p);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
960 g_free(p);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
961 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
962
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
963 static void pass_cancel(GtkWidget *w, struct pass_prompt *p)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
964 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
965 gtk_widget_destroy(p->win);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
966 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
967
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
968 static void pass_signon(GtkWidget *w, struct pass_prompt *p)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
969 {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
970 const char *txt = gtk_entry_get_text(GTK_ENTRY(p->entry));
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
971 g_snprintf(p->u->password, sizeof(p->u->password), "%s", txt);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
972 serv_login(p->u);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
973 gtk_widget_destroy(p->win);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
974 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
975
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
976 static void do_pass_dlg(struct aim_user *u)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
977 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
978 /* we can safely assume that u is not NULL */
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
979 GtkWidget *frame;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
980 GtkWidget *vbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
981 GtkWidget *hbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
982 char buf[96];
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
983 GtkWidget *label;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
984 GtkWidget *button;
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
985 struct pass_prompt *p = find_pass_prompt(u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
986
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
987 if (p) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
988 gtk_widget_show(p->win);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
989 return;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
990 }
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
991
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
992 p = g_new0(struct pass_prompt, 1);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
993 p->u = u;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
994 passes = g_slist_append(passes, p);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
995
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2709
diff changeset
996 GAIM_DIALOG(p->win);
4074
3ccbdf8e7f8d [gaim-migrate @ 4289]
Sean Egan <seanegan@gmail.com>
parents: 4040
diff changeset
997 gtk_window_set_role(GTK_WINDOW(p->win), "password");
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
998 gtk_container_border_width(GTK_CONTAINER(p->win), 5);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
999 g_signal_connect(GTK_OBJECT(p->win), "destroy", G_CALLBACK(pass_des), p);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1000 gtk_widget_realize(p->win);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1001
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1002 frame = make_frame(p->win, _("Enter Password"));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1003 gtk_widget_show(frame);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1004
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1005 vbox = gtk_vbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1006 gtk_container_add(GTK_CONTAINER(frame), vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1007 gtk_widget_show(vbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1008
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1009 hbox = gtk_hbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1010 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1011 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1012
4169
40d35a98f481 [gaim-migrate @ 4398]
Luke Schierer <lschiere@pidgin.im>
parents: 4162
diff changeset
1013 g_snprintf(buf, sizeof(buf), _("Password for %s:"), u->username);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1014 label = gtk_label_new(buf);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1015 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1016 gtk_widget_show(label);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1017
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1018 p->entry = gtk_entry_new();
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1019 gtk_entry_set_visibility(GTK_ENTRY(p->entry), FALSE);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1020 gtk_box_pack_start(GTK_BOX(hbox), p->entry, FALSE, FALSE, 5);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1021 g_signal_connect(GTK_OBJECT(p->entry), "activate", G_CALLBACK(pass_signon), p);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1022 gtk_widget_grab_focus(p->entry);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1023 gtk_widget_show(p->entry);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1024
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1025 hbox = gtk_hbox_new(FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1026 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1027 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1028
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1029 button = picture_button(p->win, _("Cancel"), cancel_xpm);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1030 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(pass_cancel), p);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1031 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1032
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1033 button = picture_button(p->win, _("Signon"), ok_xpm);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1034 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(pass_signon), p);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1035 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1036
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1037 gtk_widget_show(p->win);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1038 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1039
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1040 static void acct_signin(GtkCellRendererToggle *cell, gchar *path_str,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1041 gpointer d)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1042 {
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1043 GtkTreeModel *model = (GtkTreeModel *)d;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1044 GtkTreeIter iter;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1045
3067
b695cbbeee2d [gaim-migrate @ 3081]
Sean Egan <seanegan@gmail.com>
parents: 3066
diff changeset
1046 struct aim_user *u = NULL;
3069
cbb8b9b4ca4a [gaim-migrate @ 3083]
Sean Egan <seanegan@gmail.com>
parents: 3067
diff changeset
1047 struct prpl *p = NULL;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1048
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1049 gtk_tree_model_get_iter_from_string(model, &iter, path_str);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1050 gtk_tree_model_get(model, &iter, COLUMN_DATA, &u, -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1051
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1052 p = find_prpl(u->protocol);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1053 if (!u->gc && p && p->login) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1054 struct prpl *p = find_prpl(u->protocol);
3789
fb519383a058 [gaim-migrate @ 3929]
Rob Flynn <gaim@robflynn.com>
parents: 3764
diff changeset
1055 if (p && !(p->options & OPT_PROTO_NO_PASSWORD) &&
fb519383a058 [gaim-migrate @ 3929]
Rob Flynn <gaim@robflynn.com>
parents: 3764
diff changeset
1056 !(p->options & OPT_PROTO_PASSWORD_OPTIONAL) && !u->password[0]) {
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1057 do_pass_dlg(u);
3069
cbb8b9b4ca4a [gaim-migrate @ 3083]
Sean Egan <seanegan@gmail.com>
parents: 3067
diff changeset
1058 } else {
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1059 serv_login(u);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1060 }
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1061 } else if (u->gc) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1062 u->gc->wants_to_die = TRUE;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1063 signoff(u->gc);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1064 } else {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1065 if (u->protocol == PROTO_TOC)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1066 do_error_dialog(_("TOC not found."),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1067 _("You have attempted to login an IM account using the "
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1068 "TOC protocol. Because this protocol is inferior to "
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1069 "OSCAR, it is now compiled as a plugin by default. "
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1070 "To login, edit this account to use OSCAR or load the "
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1071 "TOC plugin."), GAIM_ERROR);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1072 else
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1073 do_error_dialog(_("Protocol not found."),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1074 _("You cannot log this account in; you do not have "
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1075 "the protocol it uses loaded, or the protocol does "
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1076 "not have a login function."), GAIM_ERROR);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1077 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1078 }
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1079
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1080 static void acct_autologin(GtkCellRendererToggle *cell, gchar *path_str,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1081 gpointer d)
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1082 {
3867
43e396e94095 [gaim-migrate @ 4019]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
1083 GtkTreeModel *model = (GtkTreeModel *)d;
43e396e94095 [gaim-migrate @ 4019]
Rob Flynn <gaim@robflynn.com>
parents: 3789
diff changeset
1084 GtkTreeIter iter;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1085
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1086 struct aim_user *u = NULL;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1087
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1088 gtk_tree_model_get_iter_from_string(model, &iter, path_str);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1089 gtk_tree_model_get(model, &iter, COLUMN_DATA, &u, -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1090
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1091 u->options ^= OPT_USR_AUTO;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1092
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1093 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1094 COLUMN_AUTOLOGIN, (u->options & OPT_USR_AUTO), -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1095
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1096 save_prefs();
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1097 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1098
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1099 static void do_del_acct(struct aim_user *u)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1100 {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1101 GtkTreeIter iter;
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1102 GSList *grps = groups, *buds;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1103
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1104 if (u->gc) {
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1105 u->gc->wants_to_die = TRUE;
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1106 signoff(u->gc);
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1107 }
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1108
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1109 if (get_iter_from_data(GTK_TREE_VIEW(treeview), u, &iter)) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1110 gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1111 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1112
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1113
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1114 /* remove the buddies for the account we just destroyed */
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1115 while(grps) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1116 struct group *g = grps->data;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1117 grps = grps->next;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1118 buds = g->members;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1119 while(buds) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1120 struct buddy *b = buds->data;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1121 buds = buds->next;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1122 if(b->user == u) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1123 /* sigh, someday we'll get a central gaim_buddy_free() */
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1124 g->members = g_slist_remove(g->members, b);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1125 g_hash_table_destroy(b->settings);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1126 g_free(b);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1127 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1128 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1129 if(!g->members) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1130 ui_remove_group(g);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1131 groups = g_slist_remove(groups, g);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1132 g_free(g);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1133 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1134 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1135
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
1136 aim_users = g_slist_remove(aim_users, u);
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1137
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1138 gaim_blist_save();
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1139
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1140 save_prefs();
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1141 }
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1142
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1143 static void del_acct_func(GtkTreeModel *model, GtkTreePath *path,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1144 GtkTreeIter *iter, gpointer data)
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1145 {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1146 struct aim_user *u;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1147
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1148 gtk_tree_model_get(model, iter, COLUMN_DATA, &u, -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1149
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1150 if (u != NULL) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1151 char buf[8192];
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1152
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1153 g_snprintf(buf, sizeof(buf),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1154 _("Are you sure you want to delete %s?"), u->username);
4249
9c7fcb211886 [gaim-migrate @ 4499]
Mark Doliner <mark@kingant.net>
parents: 4245
diff changeset
1155 do_ask_dialog(buf, NULL, u, _("Delete"), do_del_acct, _("Cancel"), NULL, NULL, FALSE);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1156 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1157 }
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1158
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1159 static void del_acct(GtkWidget *w, gpointer d)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1160 {
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1161 GtkTreeSelection *selection;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1162
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1163 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1164
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1165 gtk_tree_selection_selected_foreach(selection, del_acct_func, NULL);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1166 }
2007
948a67a691a6 [gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1956
diff changeset
1167
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1168 #if 0
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1169 static void sel_auto(gpointer w, gpointer d)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1170 {
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
1171 GSList *l = aim_users;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1172 struct aim_user *u;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
1173 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
1174 while (l) {
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1175 u = l->data;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1176 l = l->next;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1177 if (u->options & OPT_USR_AUTO)
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1178 gtk_clist_select_row(GTK_CLIST(list), i, -1);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1179 else
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1180 gtk_clist_unselect_row(GTK_CLIST(list), i, -1);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1181 i++;
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1182 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1183 }
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1184 #endif
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1185
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1186 void account_editor(GtkWidget *w, GtkWidget *W)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1187 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1188 /* please kill me */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1189 GtkWidget *vbox;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1190 GtkWidget *hbox;
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1191 GtkWidget *sw;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1192 GtkWidget *button; /* used for many things */
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1193 GtkWidget *sep;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1194 GtkSizeGroup *sg;
3764
6400b37e0c35 [gaim-migrate @ 3903]
Rob Flynn <gaim@robflynn.com>
parents: 3760
diff changeset
1195 GtkWidget *frame;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1196
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1197 if (acctedit) {
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1198 gtk_window_present(GTK_WINDOW(acctedit));
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1199 return;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1200 }
3764
6400b37e0c35 [gaim-migrate @ 3903]
Rob Flynn <gaim@robflynn.com>
parents: 3760
diff changeset
1201
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1202 acctedit = gtk_window_new(GTK_WINDOW_TOPLEVEL);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1203 gtk_window_set_title(GTK_WINDOW(acctedit), _("Gaim - Account Editor"));
4074
3ccbdf8e7f8d [gaim-migrate @ 4289]
Sean Egan <seanegan@gmail.com>
parents: 4040
diff changeset
1204 gtk_window_set_role(GTK_WINDOW(acctedit), "accounteditor");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1205 gtk_widget_realize(acctedit);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1206 gtk_widget_set_usize(acctedit, -1, 250);
3755
a868e1181321 [gaim-migrate @ 3894]
Sean Egan <seanegan@gmail.com>
parents: 3754
diff changeset
1207 gtk_window_set_default_size(GTK_WINDOW(acctedit), 550, 250);
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
1208 g_signal_connect(GTK_OBJECT(acctedit), "delete_event", G_CALLBACK(on_delete_acctedit), W);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1209
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1210 vbox = gtk_vbox_new(FALSE, 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1211 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1212 gtk_container_add(GTK_CONTAINER(acctedit), vbox);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1213
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1214 sw = generate_list();
3764
6400b37e0c35 [gaim-migrate @ 3903]
Rob Flynn <gaim@robflynn.com>
parents: 3760
diff changeset
1215 frame = gtk_frame_new(NULL);
6400b37e0c35 [gaim-migrate @ 3903]
Rob Flynn <gaim@robflynn.com>
parents: 3760
diff changeset
1216 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
6400b37e0c35 [gaim-migrate @ 3903]
Rob Flynn <gaim@robflynn.com>
parents: 3760
diff changeset
1217 gtk_container_add(GTK_CONTAINER(frame), sw);
6400b37e0c35 [gaim-migrate @ 3903]
Rob Flynn <gaim@robflynn.com>
parents: 3760
diff changeset
1218 gtk_widget_show(frame);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1219
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1220 hbox = gtk_hbox_new(FALSE, 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1221 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1222
3764
6400b37e0c35 [gaim-migrate @ 3903]
Rob Flynn <gaim@robflynn.com>
parents: 3760
diff changeset
1223 gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1224
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1225 #if 0
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1226 vbox2 = gtk_vbox_new(TRUE, 5);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1227 gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, 0);
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1228
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1229 button = gtk_button_new_from_stock(GTK_STOCK_REFRESH);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1230 gtk_button_set_use_stock(GTK_BUTTON(button), FALSE);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1231 gtk_button_set_label(GTK_BUTTON(button), "Select All");
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1232 // button = picture_button2(acctedit, _("Select All"), tb_refresh_xpm, 2);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1233 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1234 g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1235 G_CALLBACK(gtk_clist_select_all), GTK_OBJECT(list));
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1236
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1237 button = gtk_button_new_from_stock(GTK_STOCK_REDO);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1238 gtk_button_set_use_stock(GTK_BUTTON(button), FALSE);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1239 // gtk_button_set_label(button, "Select Autos");
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1240 // button = picture_button2(acctedit, _("Select Autos"), tb_redo_xpm, 2);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1241 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1242 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_auto), NULL);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1243
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1244 button = gtk_button_new_from_stock(GTK_STOCK_UNDO);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1245 gtk_button_set_use_stock(GTK_BUTTON(button), FALSE);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1246 gtk_button_set_label(GTK_BUTTON(button), "Select None");
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1247 // button = picture_button2(acctedit, _("Select None"), tb_undo_xpm, 2);
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1248 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1249 g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1250 G_CALLBACK(gtk_clist_unselect_all), GTK_OBJECT(list));
2008
6f049002d963 [gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2007
diff changeset
1251
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1252 #endif
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1253
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1254 sep = gtk_hseparator_new();
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1255 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1256
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1257 hbox = gtk_hbox_new(FALSE, 6);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1258 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1259 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1260
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1261 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1262
3885
94852b7cc81f [gaim-migrate @ 4037]
Rob Flynn <gaim@robflynn.com>
parents: 3867
diff changeset
1263 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1264 gtk_size_group_add_widget(sg, button);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1265 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
1266 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(on_close_acctedit), W);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1267
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1268 button = gtk_button_new_from_stock(GTK_STOCK_DELETE);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1269 gtk_size_group_add_widget(sg, button);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1270 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1271 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(del_acct), NULL);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1272
4114
fa5075168c23 [gaim-migrate @ 4330]
Luke Schierer <lschiere@pidgin.im>
parents: 4111
diff changeset
1273 button = gaim_pixbuf_button_from_stock(_("_Modify"), GTK_STOCK_PREFERENCES,
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1274 GAIM_BUTTON_HORIZONTAL);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1275 gtk_size_group_add_widget(sg, button);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1276 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1277 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(mod_acct), NULL);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1278
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1279 button = gtk_button_new_from_stock(GTK_STOCK_ADD);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1280 gtk_size_group_add_widget(sg, button);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1281 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1282 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(add_acct), NULL);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1283
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1284 gtk_widget_show_all(acctedit);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1285 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1286
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1287 struct signon_meter {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1288 struct gaim_connection *gc;
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1289 GtkWidget *button;
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1290 GtkWidget *progress;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1291 GtkWidget *status;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1292 };
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1293 static GSList *meters = NULL;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1294
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1295 GtkWidget* create_meter_pixmap (GtkWidget *widget, struct gaim_connection *gc)
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1296 {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1297 GdkPixmap *gdkpixmap;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1298 GdkBitmap *mask;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1299 GtkWidget *pixmap;
3111
319a66fc131f [gaim-migrate @ 3125]
Sean Egan <seanegan@gmail.com>
parents: 3075
diff changeset
1300
319a66fc131f [gaim-migrate @ 3125]
Sean Egan <seanegan@gmail.com>
parents: 3075
diff changeset
1301 create_prpl_icon (widget, gc, &gdkpixmap, &mask);
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1302
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1303 pixmap = gtk_pixmap_new (gdkpixmap, mask);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1304 gdk_pixmap_unref (gdkpixmap);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1305 gdk_bitmap_unref (mask);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1306 return pixmap;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1307 }
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1308
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1309 static struct signon_meter *find_signon_meter(struct gaim_connection *gc)
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1310 {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1311 GSList *m = meters;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1312 while (m) {
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1313 if (((struct signon_meter *)m->data)->gc == gc)
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1314 return m->data;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1315 m = m->next;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1316 }
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1317 return NULL;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1318 }
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1319
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1320 void kill_meter(struct signon_meter *meter) {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1321 gtk_widget_set_sensitive (meter->button, FALSE);
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
1322 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(meter->progress), 1);
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1323 gtk_statusbar_pop(GTK_STATUSBAR(meter->status), 1);
4169
40d35a98f481 [gaim-migrate @ 4398]
Luke Schierer <lschiere@pidgin.im>
parents: 4162
diff changeset
1324 gtk_statusbar_push(GTK_STATUSBAR(meter->status), 1, _("Done."));
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1325 meter_win->active_count--;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1326 if (meter_win->active_count == 0) {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1327 gtk_widget_destroy(meter_win->window);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1328 g_free (meter_win);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1329 meter_win = NULL;
3554
cf00549c53d7 [gaim-migrate @ 3644]
Sean Egan <seanegan@gmail.com>
parents: 3517
diff changeset
1330 }
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1331 }
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1332
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1333 void account_online(struct gaim_connection *gc)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1334 {
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1335 struct signon_meter *meter = find_signon_meter(gc);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1336 GList *wins;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1337 GtkTreeIter iter;
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1338 GSList *grps, *buds;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1339 GList *add_buds=NULL;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1340 GList *l;
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1341
4333
cc2f780c0505 [gaim-migrate @ 4597]
Mark Doliner <mark@kingant.net>
parents: 4275
diff changeset
1342 /* Set the time the account came online */
cc2f780c0505 [gaim-migrate @ 4597]
Mark Doliner <mark@kingant.net>
parents: 4275
diff changeset
1343 time(&gc->login_time);
cc2f780c0505 [gaim-migrate @ 4597]
Mark Doliner <mark@kingant.net>
parents: 4275
diff changeset
1344
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1345 /* first we hide the login progress meter */
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1346 if (meter) {
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1347 kill_meter(meter);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1348 meters = g_slist_remove(meters, meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1349 g_free(meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1350 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1351
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1352 /* then we do the buddy list stuff */
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1353 if (mainwindow)
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1354 gtk_widget_hide(mainwindow);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1355
2118
fa3dfde4727e [gaim-migrate @ 2128]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2117
diff changeset
1356 show_buddy_list();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1357
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3285
diff changeset
1358 update_privacy_connections();
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
1359 do_away_menu();
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1474
diff changeset
1360 do_proto_menu();
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1361
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1362 /*
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1363 * XXX This is a hack! Remove this and replace it with a better event
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1364 * notification system.
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1365 */
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1366 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1367 struct gaim_window *win = (struct gaim_window *)wins->data;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1368 gaim_conversation_update(gaim_window_get_conversation_at(win, 0),
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1369 GAIM_CONV_ACCOUNT_ONLINE);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1370 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1371
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1372 redo_buddy_list();
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1373 gaim_setup(gc);
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1374
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1375 gc->user->connecting = FALSE;
3726
d85208a99af2 [gaim-migrate @ 3862]
Luke Schierer <lschiere@pidgin.im>
parents: 3717
diff changeset
1376 connecting_count--;
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
1377 debug_printf("connecting_count: %d\n", connecting_count);
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
1378
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3510
diff changeset
1379 plugin_event(event_signon, gc);
1575
427e1409917c [gaim-migrate @ 1585]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
1380 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
1381
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1382 /* away option given? */
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1383 if (opt_away) {
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1384 away_on_login(opt_away_arg);
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1385 /* don't do it again */
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1386 opt_away = 0;
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
1387 } else if (awaymessage) {
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
1388 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message);
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1389 }
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1390 if (opt_away_arg != NULL) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2364
diff changeset
1391 g_free(opt_away_arg);
1254
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1392 opt_away_arg = NULL;
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1393 }
9da444224f0e [gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1394
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1395 /* let the prpl know what buddies we pulled out of the local list */
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1396
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1397 for(grps = groups; grps; grps = grps->next) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1398 struct group *g = grps->data;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1399 for(buds = g->members; buds; buds = buds->next) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1400 struct buddy *b = buds->data;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1401 if(b->user->gc == gc) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1402 add_buds = g_list_append(add_buds, b->name);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1403 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1404 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1405 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1406
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1407 if(add_buds) {
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1408 serv_add_buddies(gc, add_buds);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1409 g_list_free(add_buds);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1410 }
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1411
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1412 serv_set_permit_deny(gc);
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1413
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1414 /* everything for the account editor */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1415 if (!acctedit)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1416 return;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1417
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1418 if (get_iter_from_data(GTK_TREE_VIEW(treeview), gc->user, &iter)) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1419 gtk_list_store_set(model, &iter,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1420 COLUMN_ONLINE, TRUE,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1421 COLUMN_PROTOCOL, gc->prpl->name,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1422 -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1423 }
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1424
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1425 /* Update the conversation windows that use this account. */
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1426 for (l = gaim_get_conversations(); l != NULL; l = l->next) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1427 struct gaim_conversation *conv = (struct gaim_conversation *)l->data;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1428
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1429 if (gaim_conversation_get_user(conv) == gc->user) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1430 gaim_conversation_update(conv, GAIM_CONV_UPDATE_USER);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1431 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1432 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1433 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1434
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1435 void account_offline(struct gaim_connection *gc)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1436 {
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1437 struct signon_meter *meter = find_signon_meter(gc);
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1438 GtkTreeIter iter;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1439 GList *l;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1440
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1441 if (meter) {
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1442 kill_meter(meter);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1443 meters = g_slist_remove(meters, meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1444 g_free(meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1445 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1446 debug_printf("Disconnecting. user = %p, gc = %p (%p)\n",
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1447 gc->user, gc->user->gc, gc);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1448 gc->user->gc = NULL; /* wasn't that awkward? */
4388
bf6ac19d0d63 [gaim-migrate @ 4654]
Nathan Walp <nwalp@pidgin.im>
parents: 4359
diff changeset
1449
bf6ac19d0d63 [gaim-migrate @ 4654]
Nathan Walp <nwalp@pidgin.im>
parents: 4359
diff changeset
1450 /* take these buddies out of the edit tree */
bf6ac19d0d63 [gaim-migrate @ 4654]
Nathan Walp <nwalp@pidgin.im>
parents: 4359
diff changeset
1451 build_edit_tree();
bf6ac19d0d63 [gaim-migrate @ 4654]
Nathan Walp <nwalp@pidgin.im>
parents: 4359
diff changeset
1452
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1453 if (!acctedit)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1454 return;
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1455
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1456 if (get_iter_from_data(GTK_TREE_VIEW(treeview), gc->user, &iter)) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1457 gtk_list_store_set(model, &iter, COLUMN_ONLINE, FALSE, -1);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1458 }
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1459
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1460 /* Update the conversation windows that use this account. */
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1461 for (l = gaim_get_conversations(); l != NULL; l = l->next) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1462 struct gaim_conversation *conv = (struct gaim_conversation *)l->data;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1463
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1464 if (gaim_conversation_get_user(conv) == gc->user) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1465 gaim_conversation_update(conv, GAIM_CONV_UPDATE_USER);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1466 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1467 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1468 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1469
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1470 void auto_login()
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1471 {
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
1472 GSList *u = aim_users;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1473 struct aim_user *a = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1474
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1475 while (u) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1476 a = (struct aim_user *)u->data;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1477 if ((a->options & OPT_USR_AUTO) && (a->options & OPT_USR_REM_PASS)) {
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 977
diff changeset
1478 serv_login(a);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1479 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1480 u = u->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1481 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1482 }
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1483
3458
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1484 /*
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1485 * d:)->-<
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1486 *
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1487 * d:O-\-<
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1488 *
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1489 * d:D-/-<
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1490 *
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1491 * d8D->-< DANCE!
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1492 */
66b1ad9782a9 [gaim-migrate @ 3506]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1493
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1494 static void cancel_signon(GtkWidget *button, struct signon_meter *meter)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1495 {
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1496 meter->gc->wants_to_die = TRUE;
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1497 signoff(meter->gc);
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1498 }
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1499
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1500 static gint meter_destroy(GtkWidget *window, GdkEvent *evt, struct signon_meter *meter)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1501 {
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1502 return TRUE;
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1503 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1504
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1505 static struct signon_meter *register_meter(struct gaim_connection *gc, GtkWidget *widget, GtkTable *table, gint *rows)
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1506 {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1507 GtkWidget *graphic;
3378
8c394e9f0dfb [gaim-migrate @ 3397]
Sean Egan <seanegan@gmail.com>
parents: 3375
diff changeset
1508 GtkWidget *label;
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1509 GtkWidget *nest_vbox;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1510 GString *name_to_print;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1511 struct signon_meter *meter;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1512
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1513 name_to_print = g_string_new(gc->username);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1514
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1515 meter = g_new0(struct signon_meter, 1);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1516
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1517 (*rows)++;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1518 gtk_table_resize (table, *rows, 4);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1519
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1520 graphic = create_meter_pixmap( widget , gc);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1521
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1522 nest_vbox = gtk_vbox_new (FALSE, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1523
4225
76ea459c8b5b [gaim-migrate @ 4469]
Luke Schierer <lschiere@pidgin.im>
parents: 4169
diff changeset
1524 g_string_prepend(name_to_print, _("Signon: "));
3378
8c394e9f0dfb [gaim-migrate @ 3397]
Sean Egan <seanegan@gmail.com>
parents: 3375
diff changeset
1525 label = gtk_label_new (name_to_print->str);
4225
76ea459c8b5b [gaim-migrate @ 4469]
Luke Schierer <lschiere@pidgin.im>
parents: 4169
diff changeset
1526 g_string_free(name_to_print, TRUE);
3378
8c394e9f0dfb [gaim-migrate @ 3397]
Sean Egan <seanegan@gmail.com>
parents: 3375
diff changeset
1527 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1528
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1529 meter->status = gtk_statusbar_new();
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1530 gtk_widget_set_usize(meter->status, 250, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1531
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1532 meter->progress = gtk_progress_bar_new ();
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1533
4114
fa5075168c23 [gaim-migrate @ 4330]
Luke Schierer <lschiere@pidgin.im>
parents: 4111
diff changeset
1534 meter->button = gtk_button_new_with_label (_("Cancel"));
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1535 g_signal_connect (GTK_OBJECT (meter->button), "clicked", G_CALLBACK (cancel_signon), meter);
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1536
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1537 gtk_table_attach (GTK_TABLE (table), graphic, 0, 1, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1538 gtk_table_attach (GTK_TABLE (table), nest_vbox, 1, 2, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
3378
8c394e9f0dfb [gaim-migrate @ 3397]
Sean Egan <seanegan@gmail.com>
parents: 3375
diff changeset
1539 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (label), FALSE, FALSE, 0);
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1540 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (meter->status), FALSE, FALSE, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1541 gtk_table_attach (GTK_TABLE (table), meter->progress, 2, 3, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1542 gtk_table_attach (GTK_TABLE (table), meter->button, 3, 4, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1543
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1544 gtk_widget_show_all (GTK_WIDGET (meter_win->window));
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1545
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1546 meter_win->active_count++;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1547
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1548 return meter;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1549 }
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1550
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1551 static void loop_cancel () {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1552 GSList *m = meters;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1553 struct signon_meter *meter = NULL;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1554
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1555 while (m) {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1556 meter = (struct signon_meter *) (m->data);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1557 meter->gc->wants_to_die = TRUE;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1558 signoff((struct gaim_connection *) meter->gc);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1559 m = meters;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1560 }
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1561 }
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1562
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1172
diff changeset
1563 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
1564 {
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1565 struct signon_meter *meter = find_signon_meter(gc);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1566
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1567 if (mainwindow)
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1568 gtk_widget_hide(mainwindow);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1569
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1570 if (!meter_win) {
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1571 GtkWidget *cancel_button;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1572 GtkWidget *vbox;
3067
b695cbbeee2d [gaim-migrate @ 3081]
Sean Egan <seanegan@gmail.com>
parents: 3066
diff changeset
1573
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1574 meter_win = g_new0(struct meter_window, 1);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1575 meter_win->rows=0;
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1576
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1577 meter_win->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1578 GAIM_DIALOG(meter_win->window);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1579 gtk_window_set_policy(GTK_WINDOW(meter_win->window), 0, 0, 1);
4074
3ccbdf8e7f8d [gaim-migrate @ 4289]
Sean Egan <seanegan@gmail.com>
parents: 4040
diff changeset
1580 gtk_window_set_role(GTK_WINDOW(meter_win->window), "signon");
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1581 gtk_container_set_border_width(GTK_CONTAINER(meter_win->window), 5);
4169
40d35a98f481 [gaim-migrate @ 4398]
Luke Schierer <lschiere@pidgin.im>
parents: 4162
diff changeset
1582 gtk_window_set_title (GTK_WINDOW (meter_win->window), _("Gaim Account Signon"));
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1583 gtk_widget_realize(meter_win->window);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1584
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1585 vbox = gtk_vbox_new (FALSE, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1586 gtk_container_add (GTK_CONTAINER (meter_win->window), GTK_WIDGET (vbox));
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1587
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1588 meter_win->table = (GtkTable *) gtk_table_new (1 , 4, FALSE);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1589 gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (meter_win->table), FALSE, FALSE, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1590 gtk_container_set_border_width (GTK_CONTAINER (meter_win->table), 5);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1591 gtk_table_set_row_spacings (GTK_TABLE (meter_win->table), 5);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1592 gtk_table_set_col_spacings (GTK_TABLE (meter_win->table), 10);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1593
4114
fa5075168c23 [gaim-migrate @ 4330]
Luke Schierer <lschiere@pidgin.im>
parents: 4111
diff changeset
1594 cancel_button = gtk_button_new_with_label (_("Cancel All"));
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1595 g_signal_connect_swapped (GTK_OBJECT (cancel_button), "clicked", G_CALLBACK (loop_cancel), NULL);
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1596 gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (cancel_button), FALSE, FALSE, 0);
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1597
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1598 g_signal_connect (GTK_OBJECT (meter_win->window), "delete_event", G_CALLBACK (meter_destroy), NULL);
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1599 }
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1600
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1601 if (!meter) {
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1602 char buf[256];
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1603
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1604 meter = register_meter(gc, GTK_WIDGET (meter_win->window), GTK_TABLE (meter_win->table), (gint *) &meter_win->rows);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1605 meter->gc = gc;
2403
8555e48c02df [gaim-migrate @ 2416]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2402
diff changeset
1606 meters = g_slist_append(meters, meter);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1607
3572
bdd0bebd2d04 [gaim-migrate @ 3670]
Sean Egan <seanegan@gmail.com>
parents: 3570
diff changeset
1608 g_snprintf(buf, sizeof(buf), "%s Signing On (using %s)", gc->username, gc->prpl->name);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1609 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1610
4275
5ce5b252cdb1 [gaim-migrate @ 4526]
Luke Schierer <lschiere@pidgin.im>
parents: 4249
diff changeset
1611 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(meter->progress), howfar / LOGIN_STEPS);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1612 gtk_statusbar_pop(GTK_STATUSBAR(meter->status), 1);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1613 gtk_statusbar_push(GTK_STATUSBAR(meter->status), 1, message);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1614 }
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1615
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1616 struct kick_dlg {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1617 struct aim_user *user;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1618 GtkWidget *dlg;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1619 };
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1620 static GSList *kicks = NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1621
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1622 static struct kick_dlg *find_kick_dlg(struct aim_user *u)
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1623 {
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1624 GSList *k = kicks;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1625 while (k) {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1626 struct kick_dlg *d = k->data;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1627 if (d->user == u)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1628 return d;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1629 k = k->next;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1630 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1631 return NULL;
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1632 }
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1633
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1634 static void set_kick_null(GtkObject *obj, struct kick_dlg *k)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1635 {
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1636 kicks = g_slist_remove(kicks, k);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1637 g_free(k);
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1638 }
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
1639
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1640 /*
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1641 * Common code for hide_login_progress(), and hide_login_progress_info()
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1642 */
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1643 static void hide_login_progress_common(struct gaim_connection *gc,
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1644 char *details,
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1645 char *title,
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1646 char *prologue)
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1647 {
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1648 char buf[2048];
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1649 struct kick_dlg *k = find_kick_dlg(gc->user);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1650 struct signon_meter *meter = find_signon_meter(gc);
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1651 sprintf(buf, _("%s\n%s: %s"), full_date(), prologue, details);
2442
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1652 if (k)
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1653 gtk_widget_destroy(k->dlg);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1654 k = g_new0(struct kick_dlg, 1);
895e2469cb3a [gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2438
diff changeset
1655 k->user = gc->user;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3391
diff changeset
1656 k->dlg = do_error_dialog(title, buf, GAIM_ERROR);
2709
df0832a9ccec [gaim-migrate @ 2722]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2707
diff changeset
1657 kicks = g_slist_append(kicks, k);
4162
d3c8d2b40494 [gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents: 4114
diff changeset
1658 g_signal_connect(GTK_OBJECT(k->dlg), "destroy", G_CALLBACK(set_kick_null), k);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1659 if (meter) {
3060
4f2f12bf4408 [gaim-migrate @ 3074]
Sean Egan <seanegan@gmail.com>
parents: 2975
diff changeset
1660 kill_meter(meter);
2402
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1661 meters = g_slist_remove(meters, meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1662 g_free(meter);
6e3dc0b3b9b1 [gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1663 }
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 984
diff changeset
1664 }
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1665
2956
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1666 void hide_login_progress(struct gaim_connection *gc, char *why)
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1667 {
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1668 char buf[2048];
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1669
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1670 sprintf(buf, _("%s was unable to sign on"), gc->username);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1671 hide_login_progress_common(gc, why, _("Signon Error"), buf);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1672 }
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1673
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1674 /*
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1675 * Like hide_login_progress(), but for informational, not error/warning,
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1676 * messages.
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1677 *
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1678 */
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1679 void hide_login_progress_notice(struct gaim_connection *gc, char *why)
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1680 {
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1681 hide_login_progress_common(gc, why, _("Notice"), gc->username);
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1682 }
b68c648618a3 [gaim-migrate @ 2969]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
1683
3074
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1684 /*
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1685 * Like hide_login_progress(), but for non-signon error messages.
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1686 *
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1687 */
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1688 void hide_login_progress_error(struct gaim_connection *gc, char *why)
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1689 {
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1690 char buf[2048];
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1691 g_snprintf(buf, sizeof(buf), _("%s has been signed off"), gc->username);
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1692 hide_login_progress_common(gc, why, _("Connection Error"), buf);
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1693 }
793fb2e9d53b [gaim-migrate @ 3088]
Sean Egan <seanegan@gmail.com>
parents: 3069
diff changeset
1694
2559
e49ab50736bf [gaim-migrate @ 2572]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2525
diff changeset
1695 void signoff_all()
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1696 {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1697 GSList *c = connections;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1698 struct gaim_connection *g = NULL;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1699
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1700 while (c) {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1701 g = (struct gaim_connection *)c->data;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1702 g->wants_to_die = TRUE;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1703 signoff(g);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1704 c = connections;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1705 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1706 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1707
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1708 void signoff(struct gaim_connection *gc)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1709 {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1710 GList *wins;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1711
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1712 /* UI stuff */
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1713 /* CONV XXX
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1714 convo_menu_remove(gc);
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1715 remove_icon_data(gc);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1716 */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1717
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1718 /* core stuff */
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1719 /* remove this here so plugins get a sensible count of connections */
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1720 connections = g_slist_remove(connections, gc);
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1721 debug_printf("date: %s\n", full_date());
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3510
diff changeset
1722 plugin_event(event_signoff, gc);
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1723 system_log(log_signoff, gc, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1724 /* set this in case the plugin died before really connecting.
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1725 do it after calling the plugins so they can determine if
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1726 this user was ever on-line or not */
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3510
diff changeset
1727 if (gc->user->connecting) {
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3510
diff changeset
1728 gc->user->connecting = FALSE;
3726
d85208a99af2 [gaim-migrate @ 3862]
Luke Schierer <lschiere@pidgin.im>
parents: 3717
diff changeset
1729 connecting_count--;
3517
6b0cb60162f4 [gaim-migrate @ 3590]
Sean Egan <seanegan@gmail.com>
parents: 3510
diff changeset
1730 }
3570
b791019b2492 [gaim-migrate @ 3666]
Sean Egan <seanegan@gmail.com>
parents: 3554
diff changeset
1731 debug_printf("connecting_count: %d\n", connecting_count);
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1732 serv_close(gc);
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1733
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1734 /* more UI stuff */
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1735 redo_buddy_list();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1736 do_away_menu();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1737 do_proto_menu();
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1738
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1739 /*
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1740 * XXX This is a hack! Remove this and replace it with a better event
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1741 * notification system.
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1742 */
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1743 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1744 struct gaim_window *win = (struct gaim_window *)wins->data;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1745 gaim_conversation_update(gaim_window_get_conversation_at(win, 0),
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1746 GAIM_CONV_ACCOUNT_OFFLINE);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1747 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
1748
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3285
diff changeset
1749 update_privacy_connections();
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1750
3510
e23909729192 [gaim-migrate @ 3576]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1751 /* in, out, shake it all about */
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1752 if (connections)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1753 return;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1754
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1755 destroy_all_dialogs();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1756 destroy_buddy();
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1757
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1758 show_login();
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1759 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1760
1942
ba421d552093 [gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1928
diff changeset
1761 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
1762 {
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1763 struct aim_user *u = g_new0(struct aim_user, 1);
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1764 g_snprintf(u->username, sizeof(u->username), "%s", name);
2273
0b5c3338fa3d [gaim-migrate @ 2283]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2248
diff changeset
1765 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
1766 u->protocol = proto;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1767 u->options = opts;
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1768 u->permit = NULL;
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
1769 u->deny = NULL;
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2396
diff changeset
1770 aim_users = g_slist_append(aim_users, u);
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1771
3754
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1772 if (treeview) {
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1773 GtkTreeIter iter;
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1774
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1775 gtk_list_store_append(model, &iter);
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1776 gtk_list_store_set(model, &iter,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1777 COLUMN_SCREENNAME, u->username,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1778 COLUMN_ONLINE, (u->gc ? TRUE : FALSE),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1779 COLUMN_AUTOLOGIN, (u->options & OPT_USR_AUTO),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1780 COLUMN_PROTOCOL, proto_name(u->protocol),
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1781 COLUMN_DATA, u,
599194293ee5 [gaim-migrate @ 3893]
Sean Egan <seanegan@gmail.com>
parents: 3730
diff changeset
1782 -1);
1355
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1783 }
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1784
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1785 return u;
04874e92af24 [gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1786 }