Mercurial > pidgin.yaz
annotate src/multi.c @ 5537:3becf79500d2
[gaim-migrate @ 5937]
This is:
-AIM over OSCAR use Christian's new, kick ass
gaim_notify_email stuff for new mail notification. This
should be good, but it's kind of a pain to test. Let me
know if you have any problems
-Minor fix to the translation README
-2 minor changes to the doxygen of 2 major header files
(this means you'll have to recompile a lot of files :-) )
-If your global proxy setting is "No Proxy" and your global
proxy host is empty, but $http_proxy is set to something,
gaim used to switch your global proxy setting to "HTTP." It
no longer does this. This makes more sense to me. If you
disagree, please let me know--this is open to debate, and
what not. Also, the use of environmental proxy settings
will be changed a bit in the next day or two
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 27 May 2003 03:38:52 +0000 |
parents | 2c4c975620f0 |
children | b7319c094153 |
rev | line source |
---|---|
960 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
4634 | 22 #include <stdlib.h> |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
23 #include <string.h> |
3067 | 24 #include <ctype.h> |
960 | 25 #include <gtk/gtk.h> |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
26 #include "prpl.h" |
960 | 27 #include "multi.h" |
28 #include "gaim.h" | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
29 #include "conversation.h" |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
30 #include "notify.h" |
5228
1a53330dfd34
[gaim-migrate @ 5598]
Christian Hammond <chipx86@chipx86.com>
parents:
5211
diff
changeset
|
31 #include "gtkblist.h" |
4962 | 32 #include "gaim-disclosure.h" |
960 | 33 |
4493
61ba567f9c64
[gaim-migrate @ 4768]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4491
diff
changeset
|
34 #ifdef _WIN32 |
61ba567f9c64
[gaim-migrate @ 4768]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4491
diff
changeset
|
35 #include "win32dep.h" |
61ba567f9c64
[gaim-migrate @ 4768]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4491
diff
changeset
|
36 #endif |
61ba567f9c64
[gaim-migrate @ 4768]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4491
diff
changeset
|
37 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
38 #define LOGIN_STEPS 5 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
39 |
960 | 40 GSList *connections; |
3517 | 41 int connecting_count = 0; |
960 | 42 |
43 static GtkWidget *acctedit = NULL; | |
3754 | 44 static GtkWidget *treeview = NULL; /* the treeview of names in the accteditor */ |
45 static GtkListStore *model = NULL; | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
46 |
4491 | 47 static GSList *mod_accounts = NULL; |
960 | 48 |
3754 | 49 enum |
50 { | |
51 COLUMN_SCREENNAME, | |
52 COLUMN_ONLINE, | |
53 COLUMN_AUTOLOGIN, | |
54 COLUMN_PROTOCOL, | |
55 COLUMN_DATA, | |
56 NUM_COLUMNS | |
57 }; | |
58 | |
4491 | 59 struct mod_account { |
60 struct gaim_account *account; | |
61 | |
62 /* these are temporary */ | |
4966 | 63 char username[64]; |
64 char show[400]; | |
65 char password[32]; | |
4491 | 66 int options; |
67 int protocol; | |
68 char proto_opt[7][256]; | |
69 | |
70 /* stuff for modify window */ | |
71 GtkWidget *mod; | |
72 GtkWidget *main; | |
4998 | 73 GtkWidget *disc_box; |
4491 | 74 GtkWidget *name; |
75 GtkWidget *alias; | |
76 GtkWidget *pwdbox; | |
77 GtkWidget *pass; | |
78 GtkWidget *rempass; | |
4966 | 79 GtkWidget *login_frame; |
4491 | 80 GtkWidget *user_frame; |
81 GtkWidget *proto_frame; | |
82 GtkSizeGroup *sg; | |
4966 | 83 GList *user_split_entries; |
4491 | 84 GList *opt_entries; |
85 | |
86 /* stuff for icon selection */ | |
87 char iconfile[256]; | |
88 GtkWidget *iconsel; | |
89 GtkWidget *iconentry; | |
90 GtkWidget *icondlg; | |
91 | |
92 /* stuff for mail check prompt */ | |
93 GtkWidget *checkmail; | |
94 | |
95 /* stuff for register with server */ | |
96 GtkWidget *register_user; | |
4634 | 97 |
98 /* stuff for proxy options */ | |
99 GtkWidget *proxy_frame; | |
100 GtkWidget *proxy_host_box; | |
101 GtkWidget *proxytype_menu; | |
102 GtkWidget *proxyhost_entry; | |
103 GtkWidget *proxyport_entry; | |
104 GtkWidget *proxyuser_entry; | |
105 GtkWidget *proxypass_entry; | |
4491 | 106 }; |
107 | |
108 | |
109 struct mod_account_opt { | |
110 struct mod_account *ma; | |
111 int opt; | |
112 }; | |
113 | |
3754 | 114 static void acct_signin(GtkCellRendererToggle *cell, gchar *path_str, |
115 gpointer d); | |
116 static void acct_autologin(GtkCellRendererToggle *cell, gchar *path_str, | |
117 gpointer d); | |
118 | |
4491 | 119 static struct mod_account *mod_account_find(struct gaim_account *a) |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
120 { |
4491 | 121 GSList *m = mod_accounts; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
122 while (m) { |
4491 | 123 struct mod_account *ma = m->data; |
124 if (ma->account == a) | |
125 return ma; | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
126 m = m->next; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
127 } |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
128 return NULL; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
129 } |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
130 |
960 | 131 |
4491 | 132 struct gaim_connection *new_gaim_conn(struct gaim_account *account) |
960 | 133 { |
134 struct gaim_connection *gc = g_new0(struct gaim_connection, 1); | |
1391
d606da211acb
[gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
135 gc->edittype = EDIT_GC; |
4491 | 136 gc->protocol = account->protocol; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
137 gc->prpl = gaim_find_prpl(account->protocol); |
4491 | 138 g_snprintf(gc->username, sizeof(gc->username), "%s", account->username); |
139 g_snprintf(gc->password, sizeof(gc->password), "%s", account->password); | |
1153
3063e6743913
[gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1124
diff
changeset
|
140 gc->keepalive = 0; |
2382
569ae9f2bb89
[gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2380
diff
changeset
|
141 gc->inpa = 0; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
993
diff
changeset
|
142 gc->buddy_chats = NULL; |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
143 gc->away = NULL; |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
144 gc->away_state = NULL; |
960 | 145 |
146 connections = g_slist_append(connections, gc); | |
147 | |
4491 | 148 account->gc = gc; |
149 gc->account = account; | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
150 |
960 | 151 return gc; |
152 } | |
153 | |
3060 | 154 struct meter_window { |
155 GtkWidget *window; | |
156 GtkTable *table; | |
157 gint rows; | |
158 gint active_count; | |
159 } *meter_win = NULL; | |
160 | |
960 | 161 void destroy_gaim_conn(struct gaim_connection *gc) |
162 { | |
4785 | 163 GaimBlistNode *gnode,*bnode; |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
164 struct group *m; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
165 struct buddy *n; |
4785 | 166 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { |
167 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
168 continue; | |
169 m = (struct group *)gnode; | |
170 for(bnode = gnode->child; bnode; bnode = bnode->next) { | |
5234 | 171 if(GAIM_BLIST_NODE_IS_BUDDY(bnode)) { |
172 n = (struct buddy *)bnode; | |
173 if(n->account == gc->account) { | |
174 n->present = GAIM_BUDDY_OFFLINE; | |
175 } | |
4349 | 176 } |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1058
diff
changeset
|
177 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2568
diff
changeset
|
178 } |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
179 g_free(gc->away); |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
180 g_free(gc->away_state); |
960 | 181 g_free(gc); |
3510 | 182 |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
183 if (!connections && mainwindow) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
184 gtk_widget_show(mainwindow); |
960 | 185 } |
186 | |
4275 | 187 static void quit_acctedit(gpointer d) |
960 | 188 { |
189 if (acctedit) { | |
190 save_prefs(); | |
191 gtk_widget_destroy(acctedit); | |
4275 | 192 acctedit = NULL; |
960 | 193 } |
4695
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
194 |
3754 | 195 treeview = NULL; |
4695
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
196 |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
197 if (!d && !GAIM_GTK_BLIST(gaim_get_blist())->window && |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
198 !mainwindow && !connections) { |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
199 |
4082 | 200 do_quit(); |
4695
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
201 } |
960 | 202 } |
203 | |
4275 | 204 static void on_delete_acctedit(GtkWidget *w, GdkEvent *ev, gpointer d) |
960 | 205 { |
4275 | 206 quit_acctedit(d); |
207 } | |
208 | |
209 static void on_close_acctedit(GtkButton *button, gpointer d) | |
210 { | |
211 quit_acctedit(d); | |
960 | 212 } |
213 | |
214 static char *proto_name(int proto) | |
215 { | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
216 GaimPlugin *p = gaim_find_prpl(proto); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
217 if (p && p->info->name) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
218 return p->info->name; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
219 else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
220 return "Unknown"; |
960 | 221 } |
222 | |
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
223 void regenerate_user_list() |
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
224 { |
4491 | 225 GSList *accounts = gaim_accounts; |
226 struct gaim_account *a; | |
3754 | 227 GtkTreeIter iter; |
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
228 |
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
229 if (!acctedit) |
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
230 return; |
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
231 |
3754 | 232 gtk_list_store_clear(model); |
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
233 |
4491 | 234 while (accounts) { |
235 a = (struct gaim_account *)accounts->data; | |
3754 | 236 |
237 gtk_list_store_append(model, &iter); | |
238 gtk_list_store_set(model, &iter, | |
239 COLUMN_SCREENNAME, a->username, | |
240 COLUMN_ONLINE, (a->gc ? TRUE : FALSE), | |
4491 | 241 COLUMN_AUTOLOGIN, (a->options & OPT_ACCT_AUTO), |
3754 | 242 COLUMN_PROTOCOL, proto_name(a->protocol), |
243 COLUMN_DATA, a, | |
244 -1); | |
4491 | 245 accounts = accounts->next; |
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
246 } |
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
247 } |
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
248 |
3754 | 249 static gboolean get_iter_from_data(GtkTreeView *treeview, |
4491 | 250 struct gaim_account *a, GtkTreeIter *iter) |
3754 | 251 { |
252 return gtk_tree_model_iter_nth_child(gtk_tree_view_get_model(treeview), | |
253 iter, NULL, | |
4491 | 254 g_slist_index(gaim_accounts, a)); |
3754 | 255 } |
256 | |
257 static void add_columns(GtkWidget *treeview) | |
258 { | |
259 GtkCellRenderer *renderer; | |
4635 | 260 /* GtkTreeViewColumn *column; */ |
3754 | 261 |
262 /* Screennames */ | |
263 renderer = gtk_cell_renderer_text_new(); | |
264 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), | |
265 -1, _("Screenname"), | |
266 renderer, | |
267 "text", COLUMN_SCREENNAME, | |
268 NULL); | |
269 | |
270 /* Online? */ | |
271 renderer = gtk_cell_renderer_toggle_new(); | |
272 g_signal_connect(G_OBJECT(renderer), "toggled", | |
273 G_CALLBACK(acct_signin), model); | |
274 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), | |
275 -1, _("Online"), | |
276 renderer, | |
277 "active", COLUMN_ONLINE, | |
278 NULL); | |
279 | |
280 /* Auto-login? */ | |
281 renderer = gtk_cell_renderer_toggle_new(); | |
282 g_signal_connect(G_OBJECT(renderer), "toggled", | |
283 G_CALLBACK(acct_autologin), model); | |
284 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), | |
285 -1, _("Auto-login"), | |
286 renderer, | |
287 "active", COLUMN_AUTOLOGIN, | |
288 NULL); | |
289 | |
290 /* Protocol */ | |
291 renderer = gtk_cell_renderer_text_new(); | |
292 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), | |
293 -1, _("Protocol"), | |
294 renderer, | |
295 "text", COLUMN_PROTOCOL, | |
296 NULL); | |
297 | |
298 /* Data */ | |
4630 | 299 /* |
3754 | 300 column = gtk_tree_view_column_new(); |
4630 | 301 gtk_tree_view_insert_column(GTK_TREE_VIEW(treeview), column, -1); |
3754 | 302 gtk_tree_view_column_set_visible(column, FALSE); |
4630 | 303 */ |
3754 | 304 } |
305 | |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
306 static void |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
307 __rows_reordered_cb(GtkTreeModel *model, GtkTreePath *arg1, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
308 GtkTreeIter *arg2, int *new_order, gpointer user_data) |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
309 { |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
310 GSList *accounts = gaim_accounts; |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
311 GSList *new_accounts = NULL; |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
312 struct gaim_account **account_array; |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
313 int count, i; |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
314 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
315 gaim_debug(GAIM_DEBUG_INFO, "accounts", "Reordering accounts\n"); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
316 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
317 count = g_slist_length(accounts); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
318 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
319 /* Grr. */ |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
320 account_array = g_new(struct gaim_account *, count); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
321 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
322 /* I hate this. */ |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
323 for (i = 0; i < count; i++, accounts = accounts->next) |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
324 account_array[new_order[i]] = accounts->data; |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
325 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
326 /* I hate this too. */ |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
327 for (i = 0; i < count; i++) |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
328 new_accounts = g_slist_append(new_accounts, account_array[i]); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
329 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
330 gaim_accounts = new_accounts; |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
331 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
332 g_slist_free(accounts); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
333 g_free(account_array); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
334 |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
335 save_prefs(); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
336 } |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
337 |
960 | 338 static GtkWidget *generate_list() |
339 { | |
340 GtkWidget *win; | |
341 | |
342 win = gtk_scrolled_window_new(0, 0); | |
3754 | 343 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win), |
344 GTK_POLICY_AUTOMATIC, | |
345 GTK_POLICY_ALWAYS); | |
4550
972af41f277c
[gaim-migrate @ 4830]
Christian Hammond <chipx86@chipx86.com>
parents:
4493
diff
changeset
|
346 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(win), |
972af41f277c
[gaim-migrate @ 4830]
Christian Hammond <chipx86@chipx86.com>
parents:
4493
diff
changeset
|
347 GTK_SHADOW_IN); |
3754 | 348 |
349 /* Create the list model. */ | |
350 model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_STRING, G_TYPE_BOOLEAN, | |
351 G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
960 | 352 |
3754 | 353 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); |
354 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); | |
355 gtk_tree_selection_set_mode( | |
356 gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), | |
357 GTK_SELECTION_MULTIPLE); | |
358 | |
359 add_columns(treeview); | |
360 | |
361 gtk_container_add(GTK_CONTAINER(win), treeview); | |
362 gtk_widget_show(treeview); | |
960 | 363 |
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2203
diff
changeset
|
364 regenerate_user_list(); |
3754 | 365 gtk_tree_view_set_reorderable (GTK_TREE_VIEW(treeview), TRUE); |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
366 g_signal_connect(G_OBJECT(model), "rows-reordered", |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
367 G_CALLBACK(__rows_reordered_cb), NULL); |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
368 |
960 | 369 gtk_widget_show(win); |
370 return win; | |
371 } | |
372 | |
4491 | 373 static void delmod(GtkWidget *w, struct mod_account *ma) |
960 | 374 { |
4491 | 375 mod_accounts = g_slist_remove(mod_accounts, ma); |
376 g_free(ma); | |
960 | 377 } |
378 | |
4491 | 379 static void mod_opt(GtkWidget *b, struct mod_account_opt *mao) |
960 | 380 { |
4491 | 381 mao->ma->options = mao->ma->options ^ mao->opt; |
960 | 382 } |
383 | |
4491 | 384 static void free_mao(GtkWidget *b, struct mod_account_opt *mao) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
385 { |
4491 | 386 g_free(mao); |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
387 } |
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
388 |
4491 | 389 static GtkWidget *acct_button(const char *text, struct mod_account *ma, int option, GtkWidget *box) |
960 | 390 { |
391 GtkWidget *button; | |
4491 | 392 struct mod_account_opt *mao = g_new0(struct mod_account_opt, 1); |
960 | 393 button = gtk_check_button_new_with_label(text); |
4635 | 394 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (ma->options & option)); |
960 | 395 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0); |
4491 | 396 mao->ma = ma; |
397 mao->opt = option; | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
398 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(mod_opt), mao); |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
399 g_signal_connect(G_OBJECT(button), "destroy", G_CALLBACK(free_mao), mao); |
960 | 400 gtk_widget_show(button); |
401 return button; | |
402 } | |
403 | |
4966 | 404 static void process_login_opts(struct mod_account *ma) { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
405 GaimPlugin *p = gaim_find_prpl(ma->protocol); |
4966 | 406 const char *entry_text; |
407 char *username = g_strdup(gtk_entry_get_text(GTK_ENTRY(ma->name))); | |
408 char *tmp; | |
409 GList *entries = ma->user_split_entries; | |
410 GList *user_splits = NULL; | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
411 |
4966 | 412 if(p) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
413 user_splits = GAIM_PLUGIN_PROTOCOL_INFO(p)->user_splits; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
414 |
4966 | 415 while(user_splits) { |
416 GtkWidget *entry = entries->data; | |
417 struct proto_user_split *pus = user_splits->data; | |
418 char tmp_sep[2] = " "; | |
419 entry_text = gtk_entry_get_text(GTK_ENTRY(entry)); | |
420 | |
421 tmp_sep[0] = pus->sep; | |
422 tmp = g_strconcat(username, tmp_sep, *entry_text ? entry_text : pus->def, NULL); | |
423 g_free(username); | |
424 username = tmp; | |
425 | |
426 entries = entries->next; | |
427 user_splits = user_splits->next; | |
428 } | |
429 | |
430 g_snprintf(ma->username, sizeof(ma->username), "%s", username); | |
431 g_free(username); | |
432 | |
433 entry_text = gtk_entry_get_text(GTK_ENTRY(ma->pass)); | |
434 g_snprintf(ma->password, sizeof(ma->password), "%s", entry_text); | |
435 | |
436 entry_text = gtk_entry_get_text(GTK_ENTRY(ma->alias)); | |
437 g_snprintf(ma->show, sizeof(ma->show), "%s", entry_text); | |
438 } | |
439 | |
4491 | 440 static void ok_mod(GtkWidget *w, struct mod_account *ma) |
960 | 441 { |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
442 GList *tmp; |
1954
c15c3a3f6cd4
[gaim-migrate @ 1964]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
443 const char *txt; |
4491 | 444 struct gaim_account *a; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
445 GaimPlugin *p = gaim_find_prpl(ma->protocol); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
446 GaimPluginProtocolInfo *prpl_info = NULL; |
3754 | 447 GtkTreeIter iter; |
4634 | 448 int proxytype; |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
449 |
4491 | 450 if (!ma->account) { |
451 txt = gtk_entry_get_text(GTK_ENTRY(ma->name)); | |
452 ma->account = gaim_account_new(txt, ma->protocol, ma->options); | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
453 } |
4491 | 454 a = ma->account; |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
455 |
4491 | 456 a->options = ma->options; |
457 a->protocol = ma->protocol; | |
4966 | 458 |
459 process_login_opts(ma); | |
460 g_snprintf(a->username, sizeof(a->username), "%s", ma->username); | |
461 g_snprintf(a->alias, sizeof(a->alias), "%s", ma->show); | |
462 | |
4491 | 463 if (a->options & OPT_ACCT_REM_PASS) |
4966 | 464 g_snprintf(a->password, sizeof(a->password), "%s", ma->password); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
465 else |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
466 a->password[0] = '\0'; |
2190
24d947eff811
[gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2165
diff
changeset
|
467 |
3754 | 468 if (get_iter_from_data(GTK_TREE_VIEW(treeview), a, &iter)) { |
469 gtk_list_store_set(model, &iter, | |
470 COLUMN_SCREENNAME, a->username, | |
4491 | 471 COLUMN_AUTOLOGIN, (a->options & OPT_ACCT_AUTO), |
3754 | 472 COLUMN_PROTOCOL, proto_name(a->protocol), |
473 -1); | |
474 } | |
475 | |
476 #if 0 | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
477 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
|
478 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
|
479 gtk_clist_set_text(GTK_CLIST(list), i, 2, |
4491 | 480 (a->options & OPT_ACCT_AUTO) ? "True" : "False"); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
481 gtk_clist_set_text(GTK_CLIST(list), i, 3, proto_name(a->protocol)); |
3754 | 482 #endif |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
483 |
4491 | 484 tmp = ma->opt_entries; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
485 while (tmp) { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
486 GtkEntry *entry = tmp->data; |
4635 | 487 int pos = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(entry), "position")); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
488 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
|
489 gtk_entry_get_text(entry)); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
490 tmp = tmp->next; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
491 } |
4491 | 492 if (ma->opt_entries) |
493 g_list_free(ma->opt_entries); | |
494 ma->opt_entries = NULL; | |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
495 |
4491 | 496 g_snprintf(a->iconfile, sizeof(a->iconfile), "%s", ma->iconfile); |
497 if (ma->icondlg) | |
498 gtk_widget_destroy(ma->icondlg); | |
499 ma->icondlg = NULL; | |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
500 |
4634 | 501 if(ma->account->gpi) |
502 g_free(ma->account->gpi); | |
503 ma->account->gpi = NULL; | |
504 | |
4635 | 505 proxytype = GPOINTER_TO_INT(g_object_get_data( |
506 G_OBJECT(gtk_menu_get_active(GTK_MENU(ma->proxytype_menu))), | |
507 "proxytype")); | |
4634 | 508 |
509 if(proxytype != PROXY_USE_GLOBAL) { | |
510 struct gaim_proxy_info *gpi = g_new0(struct gaim_proxy_info, 1); | |
511 gpi->proxytype = proxytype; | |
512 g_snprintf(gpi->proxyhost, sizeof(gpi->proxyhost), "%s", gtk_entry_get_text(GTK_ENTRY(ma->proxyhost_entry))); | |
513 gpi->proxyport = atoi(gtk_entry_get_text(GTK_ENTRY(ma->proxyport_entry))); | |
514 g_snprintf(gpi->proxyuser, sizeof(gpi->proxyuser), "%s", gtk_entry_get_text(GTK_ENTRY(ma->proxyuser_entry))); | |
515 g_snprintf(gpi->proxypass, sizeof(gpi->proxypass), "%s", gtk_entry_get_text(GTK_ENTRY(ma->proxypass_entry))); | |
516 | |
517 ma->account->gpi = gpi; | |
518 } | |
519 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
520 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(p); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
521 |
2956 | 522 /* |
523 * See if user registration is supported/required | |
524 */ | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
525 if (!p) { |
2956 | 526 /* TBD: error dialog here! (This should never happen, you know...) */ |
4491 | 527 fprintf(stderr, "dbg: couldn't find protocol for protocol number %d!\n", ma->protocol); |
2956 | 528 fflush(stderr); |
529 } else { | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
530 if (prpl_info->register_user != NULL && |
4491 | 531 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ma->register_user)) == TRUE) { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
532 prpl_info->register_user(a); |
2956 | 533 } |
534 } | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
535 |
960 | 536 save_prefs(); |
2956 | 537 |
4491 | 538 gtk_widget_destroy(ma->mod); |
960 | 539 } |
540 | |
4491 | 541 static void cancel_mod(GtkWidget *w, struct mod_account *ma) |
960 | 542 { |
4491 | 543 if (ma->opt_entries) |
544 g_list_free(ma->opt_entries); | |
545 ma->opt_entries = NULL; | |
546 if (ma->icondlg) | |
547 gtk_widget_destroy(ma->icondlg); | |
548 ma->icondlg = NULL; | |
549 gtk_widget_destroy(ma->mod); | |
960 | 550 } |
551 | |
4966 | 552 static void generate_login_options(struct mod_account *ma, GtkWidget *box); |
553 static void generate_user_options(struct mod_account *ma, GtkWidget *box); | |
554 static void generate_protocol_options(struct mod_account *ma, GtkWidget *box); | |
555 | |
960 | 556 static void set_prot(GtkWidget *opt, int proto) |
557 { | |
4635 | 558 struct mod_account *ma = g_object_get_data(G_OBJECT(opt), "mod_account"); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
559 GaimPlugin *p; |
4491 | 560 if (ma->protocol != proto) { |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
561 int i; |
4966 | 562 |
1878
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
563 for (i = 0; i < 7; i++) |
4491 | 564 ma->proto_opt[i][0] = '\0'; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
565 p = gaim_find_prpl(ma->protocol); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
566 |
4966 | 567 process_login_opts(ma); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
568 |
4491 | 569 ma->protocol = proto; |
4966 | 570 |
571 if(!ma->account) | |
572 g_snprintf(ma->username, sizeof(ma->username), "%s", | |
573 gtk_entry_get_text(GTK_ENTRY(ma->name))); | |
574 | |
575 generate_login_options(ma, ma->main); | |
576 generate_user_options(ma, ma->main); | |
4998 | 577 generate_protocol_options(ma, ma->disc_box); |
960 | 578 } |
579 } | |
580 | |
4491 | 581 static GtkWidget *make_protocol_menu(GtkWidget *box, struct mod_account *ma) |
960 | 582 { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
583 GaimPluginProtocolInfo *prpl_info = NULL; |
960 | 584 GtkWidget *optmenu; |
585 GtkWidget *menu; | |
586 GtkWidget *opt; | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
587 GSList *p; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
588 GaimPlugin *e; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
589 int count = 0; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
590 gboolean found = FALSE; |
960 | 591 |
592 optmenu = gtk_option_menu_new(); | |
593 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5); | |
594 gtk_widget_show(optmenu); | |
595 | |
596 menu = gtk_menu_new(); | |
597 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
598 for (p = protocols; p != NULL; p = p->next) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
599 e = (GaimPlugin *)p->data; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
600 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(e); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
601 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
602 if (prpl_info->protocol == ma->protocol) |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
603 found = TRUE; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
604 if (!found) |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
605 count++; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
606 if (e->info->name) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
607 opt = gtk_menu_item_new_with_label(e->info->name); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
608 else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
609 opt = gtk_menu_item_new_with_label("Unknown"); |
4635 | 610 g_object_set_data(G_OBJECT(opt), "mod_account", ma); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
611 g_signal_connect(G_OBJECT(opt), "activate", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
612 G_CALLBACK(set_prot), (void *)prpl_info->protocol); |
4635 | 613 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
614 gtk_widget_show(opt); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
615 } |
960 | 616 |
617 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
618 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), count); |
960 | 619 |
620 return optmenu; | |
621 } | |
622 | |
4491 | 623 static void des_icon_sel(GtkWidget *w, struct mod_account *ma) |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
624 { |
4491 | 625 w = ma->icondlg; |
626 if (ma->icondlg) | |
627 ma->icondlg = NULL; | |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
628 if (w) |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
629 gtk_widget_destroy(w); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
630 } |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
631 |
4491 | 632 static void set_icon(GtkWidget *w, struct mod_account *ma) |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
633 { |
4491 | 634 GtkWidget *sel = ma->icondlg; |
3466 | 635 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
|
636 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
637 if (file_is_dir(file, sel)) |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
638 return; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
639 |
4491 | 640 gtk_entry_set_text(GTK_ENTRY(ma->iconentry), file); |
641 g_snprintf(ma->iconfile, sizeof(ma->iconfile), "%s", file); | |
642 ma->icondlg = NULL; | |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
643 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
644 gtk_widget_destroy(sel); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
645 } |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
646 |
4491 | 647 static void sel_icon_dlg(GtkWidget *w, struct mod_account *ma) |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
648 { |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
649 GtkWidget *dlg; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
650 char buf[256]; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
651 |
4491 | 652 if (ma->icondlg) { |
653 gtk_widget_show(ma->icondlg); | |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
654 return; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
655 } |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
656 |
4703 | 657 dlg = gtk_file_selection_new(_("Load Buddy Icon")); |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
658 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dlg)); |
4491 | 659 if (ma->iconfile) { |
4738 | 660 char *tmp = g_path_get_dirname(ma->iconfile); |
661 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S, tmp); | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
662 g_free(tmp); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
663 } else { |
3630 | 664 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
|
665 } |
4738 | 666 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dlg), buf); |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
667 |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
668 g_signal_connect(G_OBJECT(dlg), "destroy", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
669 G_CALLBACK(des_icon_sel), ma); |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
670 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dlg)->cancel_button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
671 G_CALLBACK(des_icon_sel), ma); |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
672 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dlg)->ok_button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
673 G_CALLBACK(set_icon), ma); |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
674 |
4491 | 675 ma->icondlg = dlg; |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
676 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
677 gtk_widget_show(dlg); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
678 } |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
679 |
4491 | 680 static void reset_icon(GtkWidget *w, struct mod_account *ma) |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
681 { |
4491 | 682 ma->iconfile[0] = 0; |
683 gtk_entry_set_text(GTK_ENTRY(ma->iconentry), ""); | |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
684 } |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
685 |
4491 | 686 static GtkWidget *build_icon_selection(struct mod_account *ma, GtkWidget *box) |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
687 { |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
688 GtkWidget *hbox; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
689 GtkWidget *label; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
690 GtkWidget *name; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
691 GtkWidget *browse; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
692 GtkWidget *reset; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
693 |
4491 | 694 if (ma->account) |
695 g_snprintf(ma->iconfile, sizeof(ma->iconfile), "%s", ma->account->iconfile); | |
2431
5948060f486c
[gaim-migrate @ 2444]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2411
diff
changeset
|
696 |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
697 hbox = gtk_hbox_new(FALSE, 0); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
698 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
699 gtk_widget_show(hbox); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
700 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
701 label = gtk_label_new(_("Buddy Icon File:")); |
4491 | 702 gtk_size_group_add_widget(ma->sg, label); |
3754 | 703 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
704 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
705 gtk_widget_show(label); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
706 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
707 name = gtk_entry_new(); |
4491 | 708 gtk_entry_set_text(GTK_ENTRY(name), ma->iconfile); |
4635 | 709 gtk_editable_set_editable(GTK_EDITABLE(name), FALSE); |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
710 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 5); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
711 gtk_widget_show(name); |
4491 | 712 ma->iconentry = name; |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
713 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
714 browse = gtk_button_new_with_label(_("Browse")); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
715 g_signal_connect(G_OBJECT(browse), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
716 G_CALLBACK(sel_icon_dlg), ma); |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
717 gtk_box_pack_start(GTK_BOX(hbox), browse, FALSE, FALSE, 0); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
718 gtk_widget_show(browse); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
719 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
720 reset = gtk_button_new_with_label(_("Reset")); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
721 g_signal_connect(G_OBJECT(reset), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
722 G_CALLBACK(reset_icon), ma); |
2411
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
723 gtk_box_pack_start(GTK_BOX(hbox), reset, FALSE, FALSE, 0); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
724 gtk_widget_show(reset); |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
725 |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
726 return hbox; |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
727 } |
123aaa84109a
[gaim-migrate @ 2424]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2403
diff
changeset
|
728 |
4491 | 729 static void generate_login_options(struct mod_account *ma, GtkWidget *box) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
730 { |
4966 | 731 GtkWidget *frame; |
960 | 732 GtkWidget *vbox; |
733 GtkWidget *hbox; | |
734 GtkWidget *label; | |
4966 | 735 GList *user_splits = NULL; |
736 GList *split_entries; | |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
737 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
738 GaimPlugin *p; |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
739 |
4966 | 740 char *username = NULL; |
741 char *start; | |
742 | |
743 if(ma->login_frame) | |
744 gtk_widget_destroy(ma->login_frame); | |
745 ma->login_frame = NULL; | |
746 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
747 frame = gaim_gtk_make_frame(box, _("Login Options")); |
4966 | 748 ma->login_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
4998 | 749 gtk_box_reorder_child(GTK_BOX(box), ma->login_frame, 0); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
750 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
751 vbox = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
752 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
753 gtk_container_add(GTK_CONTAINER(frame), vbox); |
960 | 754 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
755 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
756 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
4966 | 757 gtk_widget_show(hbox); |
758 | |
759 label = gtk_label_new(_("Protocol:")); | |
760 gtk_size_group_add_widget(ma->sg, label); | |
761 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
762 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
763 | |
764 make_protocol_menu(hbox, ma); | |
765 | |
766 hbox = gtk_hbox_new(FALSE, 5); | |
767 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
768 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
769 p = gaim_find_prpl(ma->protocol); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
770 |
4966 | 771 if(p) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
772 user_splits = GAIM_PLUGIN_PROTOCOL_INFO(p)->user_splits; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
773 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
774 label = gtk_label_new(_("Screenname:")); |
4491 | 775 gtk_size_group_add_widget(ma->sg, label); |
3754 | 776 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
777 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
960 | 778 |
4491 | 779 ma->name = gtk_entry_new(); |
780 gtk_box_pack_start(GTK_BOX(hbox), ma->name, TRUE, TRUE, 0); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
781 |
4966 | 782 if(ma->user_split_entries) { |
783 g_list_free(ma->user_split_entries); | |
784 ma->user_split_entries = NULL; | |
785 } | |
786 | |
787 while(user_splits) { | |
788 struct proto_user_split *pus = user_splits->data; | |
789 GtkWidget *entry; | |
790 | |
791 hbox = gtk_hbox_new(FALSE, 5); | |
792 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
793 | |
794 label = gtk_label_new(pus->label); | |
795 gtk_size_group_add_widget(ma->sg, label); | |
796 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
797 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
798 user_splits = user_splits->next; | |
799 | |
800 entry = gtk_entry_new(); | |
801 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0); | |
802 | |
803 ma->user_split_entries = g_list_append(ma->user_split_entries, entry); | |
804 } | |
805 | |
4491 | 806 ma->pwdbox = gtk_hbox_new(FALSE, 5); |
807 gtk_box_pack_start(GTK_BOX(vbox), ma->pwdbox, FALSE, FALSE, 0); | |
960 | 808 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
809 label = gtk_label_new(_("Password:")); |
4491 | 810 gtk_size_group_add_widget(ma->sg, label); |
3754 | 811 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
4491 | 812 gtk_box_pack_start(GTK_BOX(ma->pwdbox), label, FALSE, FALSE, 0); |
960 | 813 |
4491 | 814 ma->pass = gtk_entry_new(); |
815 gtk_box_pack_start(GTK_BOX(ma->pwdbox), ma->pass, TRUE, TRUE, 0); | |
816 gtk_entry_set_visibility(GTK_ENTRY(ma->pass), FALSE); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
817 |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
818 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
819 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
3205 | 820 |
821 label = gtk_label_new(_("Alias:")); | |
4491 | 822 gtk_size_group_add_widget(ma->sg, label); |
3754 | 823 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
3205 | 824 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
825 | |
4491 | 826 ma->alias = gtk_entry_new(); |
827 gtk_box_pack_start(GTK_BOX(hbox), ma->alias, TRUE, TRUE, 0); | |
3205 | 828 |
4491 | 829 ma->rempass = acct_button(_("Remember Password"), ma, OPT_ACCT_REM_PASS, vbox); |
830 acct_button(_("Auto-Login"), ma, OPT_ACCT_AUTO, vbox); | |
960 | 831 |
4966 | 832 gtk_widget_show_all(ma->login_frame); |
833 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
834 if (p) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
835 user_splits = g_list_last(GAIM_PLUGIN_PROTOCOL_INFO(p)->user_splits); |
4966 | 836 |
837 username = g_strdup(ma->username); | |
838 split_entries = g_list_last(ma->user_split_entries); | |
2100
a93aeb6f813d
[gaim-migrate @ 2110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
839 |
4966 | 840 while(user_splits) { |
841 struct proto_user_split *pus = user_splits->data; | |
842 GtkWidget *entry = split_entries->data; | |
843 start = strrchr(username, pus->sep); | |
844 if(start) { | |
845 *start = '\0'; | |
846 start++; | |
847 gtk_entry_set_text(GTK_ENTRY(entry), start); | |
848 } else { | |
849 gtk_entry_set_text(GTK_ENTRY(entry), pus->def); | |
850 } | |
851 user_splits = user_splits->prev; | |
852 split_entries = split_entries->prev; | |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
853 } |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
854 |
4966 | 855 gtk_entry_set_text(GTK_ENTRY(ma->name), username); |
856 gtk_entry_set_text(GTK_ENTRY(ma->alias), ma->show); | |
857 gtk_entry_set_text(GTK_ENTRY(ma->pass), ma->password); | |
858 g_free(username); | |
859 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
860 if (p && (GAIM_PLUGIN_PROTOCOL_INFO(p)->options & OPT_PROTO_NO_PASSWORD)) { |
4491 | 861 gtk_widget_hide(ma->pwdbox); |
862 gtk_widget_hide(ma->rempass); | |
2444
13ce96daf30f
[gaim-migrate @ 2457]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2442
diff
changeset
|
863 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
864 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
865 |
4491 | 866 static void generate_user_options(struct mod_account *ma, GtkWidget *box) |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
867 { |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
868 /* This function will add the appropriate (depending on the current |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
869 * protocol) widgets to frame and return TRUE if there anything |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
870 * was added (meaning the frame should be shown) |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
871 * 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
|
872 * 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
|
873 * 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
|
874 * tired and I don't care. */ |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
875 /* 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
|
876 |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
877 GtkWidget *vbox; |
3756
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
878 GtkWidget *frame; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
879 GaimPluginProtocolInfo *prpl_info = NULL; |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
880 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
881 GaimPlugin *p = gaim_find_prpl(ma->protocol); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
882 |
4966 | 883 if(ma->user_frame) |
884 gtk_widget_destroy(ma->user_frame); | |
885 ma->user_frame = NULL; | |
886 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
887 frame = gaim_gtk_make_frame(box, _("User Options")); |
4491 | 888 ma->user_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
4998 | 889 gtk_box_reorder_child(GTK_BOX(box), ma->user_frame, 1); |
4491 | 890 gtk_widget_show_all(ma->user_frame); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
891 |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
892 vbox = gtk_vbox_new(FALSE, 5); |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
893 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
3756
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
894 gtk_container_add(GTK_CONTAINER(frame), vbox); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
895 gtk_widget_show(vbox); |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
896 |
4491 | 897 ma->checkmail = acct_button(_("New Mail Notifications"), ma, OPT_ACCT_MAIL_CHECK, vbox); |
898 ma->iconsel = build_icon_selection(ma, vbox); | |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
899 |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
900 if (!p) { |
4491 | 901 gtk_widget_hide(ma->user_frame); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
902 return; |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
903 } |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
904 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
905 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(p); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
906 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
907 if (!(prpl_info->options & OPT_PROTO_MAIL_CHECK)) |
4491 | 908 gtk_widget_hide(ma->checkmail); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
909 if (!(prpl_info->options & OPT_PROTO_BUDDY_ICON)) |
4491 | 910 gtk_widget_hide(ma->iconsel); |
2525
4fc6aac9da94
[gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2522
diff
changeset
|
911 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
912 if ((prpl_info->options & OPT_PROTO_BUDDY_ICON) || |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
913 (prpl_info->options & OPT_PROTO_MAIL_CHECK)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
914 |
2525
4fc6aac9da94
[gaim-migrate @ 2538]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2522
diff
changeset
|
915 return; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
916 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
917 |
4491 | 918 gtk_widget_hide(ma->user_frame); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
919 } |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
920 |
4491 | 921 static void generate_protocol_options(struct mod_account *ma, GtkWidget *box) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
922 { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
923 GaimPlugin *p = gaim_find_prpl(ma->protocol); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
924 GaimPluginProtocolInfo *prpl_info = NULL; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
925 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
926 GList *op, *tmp; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
927 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
928 GtkWidget *vbox; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
929 GtkWidget *hbox; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
930 GtkWidget *label; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
931 GtkWidget *entry; |
3754 | 932 GtkWidget *frame; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
933 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
934 char buf[256]; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
935 |
4491 | 936 if (ma->proto_frame) |
937 gtk_widget_destroy(ma->proto_frame); | |
938 ma->proto_frame = NULL; | |
2203
14100685c95f
[gaim-migrate @ 2213]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2200
diff
changeset
|
939 |
4491 | 940 if (ma->opt_entries) { |
941 g_list_free(ma->opt_entries); | |
942 ma->opt_entries = NULL; | |
2190
24d947eff811
[gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2165
diff
changeset
|
943 } |
24d947eff811
[gaim-migrate @ 2200]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2165
diff
changeset
|
944 |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
945 if (!p) |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
946 return; |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
947 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
948 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(p); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
949 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
950 if (!prpl_info->user_opts) |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
951 return; |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
952 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
953 tmp = op = prpl_info->user_opts; |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
954 |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
955 if (!op) |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
956 return; |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
957 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
958 g_snprintf(buf, sizeof(buf), _("%s Options"), p->info->name); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
959 frame = gaim_gtk_make_frame(box, buf); |
3754 | 960 |
961 /* BLEH */ | |
4491 | 962 ma->proto_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
4998 | 963 gtk_box_reorder_child(GTK_BOX(box), ma->proto_frame, 0); |
4491 | 964 gtk_widget_show_all(ma->proto_frame); |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
965 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
966 vbox = gtk_vbox_new(FALSE, 5); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
967 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
3754 | 968 gtk_container_add(GTK_CONTAINER(frame), vbox); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
969 gtk_widget_show(vbox); |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
970 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
971 while (op) { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
972 struct proto_user_opt *puo = op->data; |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
973 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
974 hbox = gtk_hbox_new(FALSE, 5); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
975 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
976 gtk_widget_show(hbox); |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
977 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
978 label = gtk_label_new(puo->label); |
4491 | 979 gtk_size_group_add_widget(ma->sg, label); |
3754 | 980 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
981 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
982 gtk_widget_show(label); |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
983 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
984 entry = gtk_entry_new(); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
985 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
4635 | 986 g_object_set_data(G_OBJECT(entry), "position", GINT_TO_POINTER(puo->pos)); |
4491 | 987 if (ma->proto_opt[puo->pos][0]) { |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
988 gaim_debug(GAIM_DEBUG_MISC, "protocol options", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
989 "Setting text %s\n", ma->proto_opt[puo->pos]); |
4491 | 990 gtk_entry_set_text(GTK_ENTRY(entry), ma->proto_opt[puo->pos]); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
991 } else { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
992 gtk_entry_set_text(GTK_ENTRY(entry), puo->def); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
993 } |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
994 gtk_widget_show(entry); |
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
995 |
4491 | 996 ma->opt_entries = g_list_append(ma->opt_entries, entry); |
997 | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
998 op = op->next; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
999 } |
2956 | 1000 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1001 if(prpl_info->register_user != NULL) { |
4491 | 1002 ma->register_user = gtk_check_button_new_with_label(_("Register with server")); |
4635 | 1003 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ma->register_user), FALSE); |
4491 | 1004 gtk_box_pack_start(GTK_BOX(vbox), ma->register_user, FALSE, FALSE, 0); |
1005 gtk_widget_show(ma->register_user); | |
2956 | 1006 } |
1007 | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1008 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1009 |
4635 | 1010 static void proxy_dropdown_set(GObject *w, struct mod_account *ma) { |
1011 int opt = GPOINTER_TO_INT(g_object_get_data(w, "proxytype")); | |
4856 | 1012 if(opt == PROXY_NONE || opt == PROXY_USE_GLOBAL) |
1013 gtk_widget_hide_all(ma->proxy_host_box); | |
1014 else { | |
1015 gtk_widget_show_all(ma->proxy_host_box); | |
1016 } | |
4634 | 1017 } |
1018 | |
1019 static void generate_proxy_options(struct mod_account *ma, GtkWidget *box) { | |
1020 GtkWidget *frame; | |
1021 GtkWidget *hbox; | |
1022 GtkWidget *vbox; | |
1023 GtkWidget *label; | |
1024 GtkWidget *menu; | |
1025 GtkWidget *dropdown; | |
1026 GtkWidget *opt; | |
1027 GtkWidget *entry; | |
1028 GtkWidget *vbox2; | |
1029 | |
1030 struct gaim_proxy_info *gpi = NULL; | |
1031 | |
1032 if(ma->account) | |
1033 gpi = ma->account->gpi; | |
1034 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1035 frame = gaim_gtk_make_frame(box, _("Proxy Options")); |
4634 | 1036 ma->proxy_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
1037 gtk_widget_show_all(ma->proxy_frame); | |
1038 | |
1039 vbox = gtk_vbox_new(FALSE, 5); | |
1040 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
1041 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
1042 gtk_widget_show(vbox); | |
1043 | |
1044 /* make the dropdown w/o the benefit of the easy helper funcs in prefs.c */ | |
1045 hbox = gtk_hbox_new(FALSE, 5); | |
1046 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1047 gtk_widget_show(hbox); | |
1048 | |
1049 label = gtk_label_new_with_mnemonic(_("Proxy _Type")); | |
1050 gtk_size_group_add_widget(ma->sg, label); | |
1051 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
1052 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1053 gtk_widget_show(label); | |
1054 | |
1055 dropdown = gtk_option_menu_new(); | |
1056 menu = gtk_menu_new(); | |
1057 | |
4834 | 1058 opt = gtk_menu_item_new_with_label(_("Use Global Proxy Settings")); |
4635 | 1059 g_object_set_data(G_OBJECT(opt), "proxytype", GINT_TO_POINTER(PROXY_USE_GLOBAL)); |
4634 | 1060 g_signal_connect(G_OBJECT(opt), "activate", |
1061 G_CALLBACK(proxy_dropdown_set), ma); | |
1062 gtk_widget_show(opt); | |
1063 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1064 if(!gpi) | |
1065 gtk_menu_set_active(GTK_MENU(menu), 0); | |
1066 | |
4834 | 1067 opt = gtk_menu_item_new_with_label(_("No Proxy")); |
4635 | 1068 g_object_set_data(G_OBJECT(opt), "proxytype", GINT_TO_POINTER(PROXY_NONE)); |
4634 | 1069 g_signal_connect(G_OBJECT(opt), "activate", |
1070 G_CALLBACK(proxy_dropdown_set), ma); | |
1071 gtk_widget_show(opt); | |
1072 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1073 if(gpi && gpi->proxytype == PROXY_NONE) | |
1074 gtk_menu_set_active(GTK_MENU(menu), 1); | |
1075 | |
1076 opt = gtk_menu_item_new_with_label("SOCKS 4"); | |
4635 | 1077 g_object_set_data(G_OBJECT(opt), "proxytype", GINT_TO_POINTER(PROXY_SOCKS4)); |
4634 | 1078 g_signal_connect(G_OBJECT(opt), "activate", |
1079 G_CALLBACK(proxy_dropdown_set), ma); | |
1080 gtk_widget_show(opt); | |
1081 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1082 if(gpi && gpi->proxytype == PROXY_SOCKS4) | |
1083 gtk_menu_set_active(GTK_MENU(menu), 2); | |
1084 | |
1085 opt = gtk_menu_item_new_with_label("SOCKS 5"); | |
4635 | 1086 g_object_set_data(G_OBJECT(opt), "proxytype", GINT_TO_POINTER(PROXY_SOCKS5)); |
4634 | 1087 g_signal_connect(G_OBJECT(opt), "activate", |
1088 G_CALLBACK(proxy_dropdown_set), ma); | |
1089 gtk_widget_show(opt); | |
1090 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1091 if(gpi && gpi->proxytype == PROXY_SOCKS5) | |
1092 gtk_menu_set_active(GTK_MENU(menu), 3); | |
1093 | |
1094 opt = gtk_menu_item_new_with_label("HTTP"); | |
4635 | 1095 g_object_set_data(G_OBJECT(opt), "proxytype", GINT_TO_POINTER(PROXY_HTTP)); |
4634 | 1096 g_signal_connect(G_OBJECT(opt), "activate", |
1097 G_CALLBACK(proxy_dropdown_set), ma); | |
1098 gtk_widget_show(opt); | |
1099 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1100 if(gpi && gpi->proxytype == PROXY_HTTP) | |
1101 gtk_menu_set_active(GTK_MENU(menu), 4); | |
1102 | |
1103 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); | |
1104 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); | |
1105 gtk_widget_show(dropdown); | |
1106 | |
1107 ma->proxytype_menu = menu; | |
1108 | |
1109 | |
1110 vbox2 = gtk_vbox_new(FALSE, 5); | |
1111 gtk_container_add(GTK_CONTAINER(vbox), vbox2); | |
1112 gtk_widget_show(vbox2); | |
1113 ma->proxy_host_box = vbox2; | |
1114 | |
1115 hbox = gtk_hbox_new(FALSE, 5); | |
1116 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); | |
1117 gtk_widget_show(hbox); | |
1118 | |
1119 label = gtk_label_new_with_mnemonic(_("_Host:")); | |
1120 gtk_size_group_add_widget(ma->sg, label); | |
1121 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
1122 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1123 gtk_widget_show(label); | |
1124 entry = gtk_entry_new(); | |
1125 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1126 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
1127 gtk_entry_set_text(GTK_ENTRY(entry), gpi ? gpi->proxyhost : ""); | |
1128 gtk_widget_show(entry); | |
1129 ma->proxyhost_entry = entry; | |
1130 | |
1131 hbox = gtk_hbox_new(FALSE, 5); | |
1132 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); | |
1133 gtk_widget_show(hbox); | |
1134 | |
1135 label = gtk_label_new_with_mnemonic(_("Port:")); | |
1136 gtk_size_group_add_widget(ma->sg, label); | |
1137 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
1138 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1139 gtk_widget_show(label); | |
1140 entry = gtk_entry_new(); | |
1141 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1142 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
1143 if(gpi && gpi->proxyport) { | |
1144 char buf[128]; | |
1145 g_snprintf(buf, sizeof(buf), "%d", gpi->proxyport); | |
1146 gtk_entry_set_text(GTK_ENTRY(entry), buf); | |
1147 } | |
1148 gtk_widget_show(entry); | |
1149 ma->proxyport_entry = entry; | |
1150 | |
1151 hbox = gtk_hbox_new(FALSE, 5); | |
1152 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); | |
1153 gtk_widget_show(hbox); | |
1154 | |
1155 label = gtk_label_new_with_mnemonic(_("_User:")); | |
1156 gtk_size_group_add_widget(ma->sg, label); | |
1157 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
1158 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1159 gtk_widget_show(label); | |
1160 entry = gtk_entry_new(); | |
1161 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1162 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
1163 gtk_entry_set_text(GTK_ENTRY(entry), gpi ? gpi->proxyuser : ""); | |
1164 gtk_widget_show(entry); | |
1165 ma->proxyuser_entry = entry; | |
1166 | |
1167 hbox = gtk_hbox_new(FALSE, 5); | |
1168 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); | |
1169 gtk_widget_show(hbox); | |
1170 | |
1171 label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); | |
1172 gtk_size_group_add_widget(ma->sg, label); | |
1173 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
1174 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1175 gtk_widget_show(label); | |
1176 entry = gtk_entry_new(); | |
1177 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1178 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
1179 gtk_entry_set_text(GTK_ENTRY(entry), gpi ? gpi->proxypass : ""); | |
5401 | 1180 gtk_entry_set_visibility(GTK_ENTRY(entry),FALSE); /*show *'s for passwd*/ |
4634 | 1181 gtk_widget_show(entry); |
1182 ma->proxypass_entry = entry; | |
1183 | |
4856 | 1184 if(gpi == NULL || gpi->proxytype == PROXY_NONE) |
1185 gtk_widget_hide_all(vbox2); | |
4634 | 1186 } |
1187 | |
4491 | 1188 static void show_acct_mod(struct gaim_account *a) |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1189 { |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
1190 /* 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
|
1191 * three fucking frames: |
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
1192 * a fucking Login Options frame, a fucking User Options frame and a fucking |
4491 | 1193 * Protcol Options frame. This fucking removes the two fucking tabs, which |
1194 * were quite fucking uneccessary. Fuck. */ | |
2522
108b3eab22aa
[gaim-migrate @ 2535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2458
diff
changeset
|
1195 /* -- SeanEgan */ |
3754 | 1196 /* YEAH!! -- ChipX86 */ |
4962 | 1197 GtkWidget *hbox, *vbox, *disc, *dbox; |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1198 GtkWidget *button; |
3754 | 1199 GtkWidget *sep; |
1200 GtkSizeGroup *button_sg; | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1201 |
4491 | 1202 struct mod_account *ma = mod_account_find(a); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1203 |
4491 | 1204 if (!ma) { |
1205 ma = g_new0(struct mod_account, 1); | |
1206 ma->account = a; | |
1207 mod_accounts = g_slist_append(mod_accounts, ma); | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1208 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1209 if (a) { |
2458
8208e2016d9b
[gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2445
diff
changeset
|
1210 int i; |
4491 | 1211 ma->options = a->options; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1212 if (gaim_find_prpl(a->protocol)) |
4491 | 1213 ma->protocol = a->protocol; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1214 else if (protocols) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1215 ma->protocol = GAIM_PLUGIN_PROTOCOL_INFO( |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1216 ((GaimPlugin *)protocols->data))->protocol; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1217 else |
4491 | 1218 ma->protocol = -1; |
1219 g_snprintf(ma->iconfile, sizeof(ma->iconfile), "%s", a->iconfile); | |
4966 | 1220 g_snprintf(ma->username, sizeof(ma->username), "%s", a->username); |
1221 g_snprintf(ma->show, sizeof(ma->show), "%s", a->alias); | |
1222 g_snprintf(ma->password, sizeof(ma->password), "%s", a->password); | |
1223 | |
2458
8208e2016d9b
[gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2445
diff
changeset
|
1224 for (i = 0; i < 7; i++) |
4491 | 1225 g_snprintf(ma->proto_opt[i], sizeof(ma->proto_opt[i]), "%s", |
2458
8208e2016d9b
[gaim-migrate @ 2471]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2445
diff
changeset
|
1226 a->proto_opt[i]); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1227 } else { |
4491 | 1228 ma->options = OPT_ACCT_REM_PASS; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1229 if (gaim_find_prpl(GAIM_PROTO_DEFAULT)) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1230 ma->protocol = GAIM_PROTO_DEFAULT; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1231 else if (protocols) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1232 ma->protocol = GAIM_PLUGIN_PROTOCOL_INFO( |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1233 ((GaimPlugin *)protocols->data))->protocol; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1234 else |
4491 | 1235 ma->protocol = -1; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1236 } |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1237 } else { |
4491 | 1238 gtk_widget_show(ma->mod); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1239 return; |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1240 } |
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1241 |
4491 | 1242 ma->mod = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
1243 gtk_window_set_role(GTK_WINDOW(ma->mod), "account"); | |
1244 gtk_widget_realize(ma->mod); | |
4703 | 1245 gtk_window_set_title(GTK_WINDOW(ma->mod), _("Modify Account")); |
4635 | 1246 gtk_window_set_resizable(GTK_WINDOW(ma->mod), FALSE); /* nothing odd here :) */ |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1247 g_signal_connect(G_OBJECT(ma->mod), "destroy", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1248 G_CALLBACK(delmod), ma); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1249 |
3754 | 1250 vbox = gtk_vbox_new(FALSE, 6); |
4635 | 1251 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); |
4491 | 1252 gtk_container_add(GTK_CONTAINER(ma->mod), vbox); |
3756
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
1253 gtk_widget_show(vbox); |
3754 | 1254 |
4491 | 1255 ma->main = gtk_vbox_new(FALSE, 12); |
4635 | 1256 gtk_container_set_border_width(GTK_CONTAINER(ma->main), 6); |
4491 | 1257 gtk_box_pack_start(GTK_BOX(vbox), ma->main, FALSE, FALSE, 0); |
1258 gtk_widget_show(ma->main); | |
3754 | 1259 |
4491 | 1260 ma->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1261 |
4491 | 1262 generate_login_options(ma, ma->main); |
1263 generate_user_options(ma, ma->main); | |
4962 | 1264 disc = gaim_disclosure_new(_("Show more options"), _("Show fewer options")); |
1265 gtk_box_pack_start(GTK_BOX(ma->main), disc, FALSE, FALSE, 0); | |
1266 gtk_widget_show(disc); | |
4998 | 1267 ma->disc_box = dbox = gtk_vbox_new(FALSE, 12); |
4962 | 1268 gtk_container_set_border_width(GTK_CONTAINER(dbox), 6); |
1269 gtk_box_pack_start(GTK_BOX(ma->main), dbox, FALSE, FALSE, 0); | |
1270 gaim_disclosure_set_container(GAIM_DISCLOSURE(disc), dbox); | |
1271 generate_protocol_options(ma, dbox); | |
1272 generate_proxy_options(ma, dbox); | |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1074
diff
changeset
|
1273 |
3754 | 1274 hbox = gtk_hbox_new(FALSE, 6); |
1275 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1276 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
960 | 1277 |
3754 | 1278 button_sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
1279 | |
1280 button = gtk_button_new_from_stock(GTK_STOCK_OK); | |
1281 gtk_size_group_add_widget(button_sg, button); | |
1282 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1283 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1284 G_CALLBACK(ok_mod), ma); |
3754 | 1285 |
1286 button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | |
1287 gtk_size_group_add_widget(button_sg, button); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1288 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1289 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1290 G_CALLBACK(cancel_mod), ma); |
960 | 1291 |
3756
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
1292 sep = gtk_hseparator_new(); |
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
1293 gtk_box_pack_end (GTK_BOX (vbox), sep, FALSE, FALSE, 0); |
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
1294 gtk_widget_show(sep); |
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
1295 |
08742bf8a7be
[gaim-migrate @ 3895]
Christian Hammond <chipx86@chipx86.com>
parents:
3755
diff
changeset
|
1296 gtk_widget_show_all(hbox); |
4491 | 1297 gtk_widget_show(ma->mod); |
960 | 1298 } |
1299 | |
1300 static void add_acct(GtkWidget *w, gpointer d) | |
1301 { | |
1302 show_acct_mod(NULL); | |
1303 } | |
1304 | |
3754 | 1305 static void mod_acct_func(GtkTreeModel *model, GtkTreePath *path, |
1306 GtkTreeIter *iter, gpointer data) | |
1307 { | |
4491 | 1308 struct gaim_account *a; |
3754 | 1309 |
4491 | 1310 gtk_tree_model_get(model, iter, COLUMN_DATA, &a, -1); |
3754 | 1311 |
4491 | 1312 if (a != NULL) |
1313 show_acct_mod(a); | |
3754 | 1314 } |
1315 | |
960 | 1316 static void mod_acct(GtkWidget *w, gpointer d) |
1317 { | |
3754 | 1318 GtkTreeSelection *selection; |
1319 | |
1320 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); | |
1321 | |
1322 gtk_tree_selection_selected_foreach(selection, mod_acct_func, NULL); | |
960 | 1323 } |
1324 | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1325 struct pass_prompt { |
4491 | 1326 struct gaim_account *account; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1327 GtkWidget *win; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1328 GtkWidget *entry; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1329 }; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1330 static GSList *passes = NULL; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1331 |
4491 | 1332 static struct pass_prompt *find_pass_prompt(struct gaim_account *account) |
960 | 1333 { |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1334 GSList *p = passes; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1335 while (p) { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1336 struct pass_prompt *r = p->data; |
4491 | 1337 if (r->account == account) |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1338 return r; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1339 p = p->next; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1340 } |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1341 return NULL; |
960 | 1342 } |
1343 | |
4483 | 1344 static void pass_callback(GtkDialog *d, gint resp, struct pass_prompt *p) |
960 | 1345 { |
4483 | 1346 if (resp == GTK_RESPONSE_YES) { |
1347 const char *txt = gtk_entry_get_text(GTK_ENTRY(p->entry)); | |
4491 | 1348 g_snprintf(p->account->password, sizeof(p->account->password), "%s", txt); |
1349 serv_login(p->account); | |
4483 | 1350 } |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1351 passes = g_slist_remove(passes, p); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1352 gtk_widget_destroy(p->win); |
4483 | 1353 g_free(p); |
960 | 1354 } |
1355 | |
4491 | 1356 static void do_pass_dlg(struct gaim_account *account) |
960 | 1357 { |
1358 /* we can safely assume that u is not NULL */ | |
4491 | 1359 struct pass_prompt *p = find_pass_prompt(account); |
960 | 1360 GtkWidget *label; |
4483 | 1361 GtkWidget *hbox, *vbox; |
1362 char *labeltext=NULL; | |
5024 | 1363 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_AUTH, GTK_ICON_SIZE_DIALOG); |
960 | 1364 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1365 if (p) { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1366 gtk_widget_show(p->win); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1367 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1368 } |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1369 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1370 p = g_new0(struct pass_prompt, 1); |
4491 | 1371 p->account = account; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1372 passes = g_slist_append(passes, p); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1373 |
4778 | 1374 p->win = gtk_dialog_new_with_buttons("", NULL, 0, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
4483 | 1375 _("_Login"), GTK_RESPONSE_YES, NULL); |
1376 | |
1377 gtk_dialog_set_default_response (GTK_DIALOG(p->win), GTK_RESPONSE_YES); | |
1378 g_signal_connect(G_OBJECT(p->win), "response", G_CALLBACK(pass_callback), p); | |
960 | 1379 |
4483 | 1380 gtk_container_set_border_width (GTK_CONTAINER(p->win), 6); |
1381 gtk_window_set_resizable(GTK_WINDOW(p->win), FALSE); | |
1382 gtk_dialog_set_has_separator(GTK_DIALOG(p->win), FALSE); | |
1383 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(p->win)->vbox), 12); | |
1384 gtk_container_set_border_width (GTK_CONTAINER(GTK_DIALOG(p->win)->vbox), 6); | |
1385 | |
1386 hbox = gtk_hbox_new(FALSE, 12); | |
1387 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(p->win)->vbox), hbox); | |
1388 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | |
960 | 1389 |
4483 | 1390 vbox = gtk_vbox_new(FALSE, 0); |
1391 gtk_container_add(GTK_CONTAINER(hbox), vbox); | |
960 | 1392 |
4491 | 1393 labeltext = g_strdup_printf(_("Please enter your password for %s.\n\n"), |
1394 account->username); | |
4483 | 1395 label = gtk_label_new(labeltext); |
1396 g_free(labeltext); | |
1397 | |
1398 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
1399 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1400 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
4491 | 1401 |
960 | 1402 hbox = gtk_hbox_new(FALSE, 5); |
4483 | 1403 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
1404 label = gtk_label_new_with_mnemonic(_("_Password")); | |
1405 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
960 | 1406 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
1407 | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1408 p->entry = gtk_entry_new(); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1409 gtk_entry_set_visibility(GTK_ENTRY(p->entry), FALSE); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1410 gtk_box_pack_start(GTK_BOX(hbox), p->entry, FALSE, FALSE, 5); |
4483 | 1411 gtk_label_set_mnemonic_widget(GTK_LABEL(label), p->entry); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1412 gtk_widget_grab_focus(p->entry); |
960 | 1413 |
4413 | 1414 gtk_widget_show_all(p->win); |
960 | 1415 } |
1416 | |
3754 | 1417 static void acct_signin(GtkCellRendererToggle *cell, gchar *path_str, |
1418 gpointer d) | |
960 | 1419 { |
3754 | 1420 GtkTreeModel *model = (GtkTreeModel *)d; |
1421 GtkTreeIter iter; | |
1422 | |
4491 | 1423 struct gaim_account *account = NULL; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1424 GaimPlugin *p = NULL; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1425 GaimPluginProtocolInfo *prpl_info = NULL; |
3754 | 1426 |
1427 gtk_tree_model_get_iter_from_string(model, &iter, path_str); | |
4491 | 1428 gtk_tree_model_get(model, &iter, COLUMN_DATA, &account, -1); |
3754 | 1429 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1430 p = gaim_find_prpl(account->protocol); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1431 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1432 if (p != NULL) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1433 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(p); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1434 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1435 if (!account->gc && p && prpl_info->login) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1436 GaimPlugin *p = gaim_find_prpl(account->protocol); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1437 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1438 if (p != NULL) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1439 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(p); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1440 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1441 if (p && !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1442 !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL) && |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1443 !account->password[0]) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1444 |
4491 | 1445 do_pass_dlg(account); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1446 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1447 else { |
4491 | 1448 serv_login(account); |
960 | 1449 } |
4491 | 1450 } else if (account->gc) { |
1451 account->gc->wants_to_die = TRUE; | |
1452 signoff(account->gc); | |
3754 | 1453 } else { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1454 if (account->protocol == GAIM_PROTO_TOC) |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1455 gaim_notify_error(NULL, NULL, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1456 _("TOC not found."), |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1457 _("You have attempted to login an IM account " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1458 "using the TOC protocol. Because this " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1459 "protocol is inferior to OSCAR, it is now " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1460 "compiled as a plugin by default. To login, " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1461 "edit this account to use OSCAR or load the " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1462 "TOC plugin.")); |
3754 | 1463 else |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1464 gaim_notify_error(NULL, NULL, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1465 _("Protocol not found."), |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1466 _("You cannot log this account in; you do " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1467 "not have the protocol it uses loaded, or " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1468 "the protocol does not have a login " |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
1469 "function.")); |
960 | 1470 } |
1471 } | |
3754 | 1472 |
1473 static void acct_autologin(GtkCellRendererToggle *cell, gchar *path_str, | |
1474 gpointer d) | |
2007
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
1475 { |
3867 | 1476 GtkTreeModel *model = (GtkTreeModel *)d; |
1477 GtkTreeIter iter; | |
3754 | 1478 |
4491 | 1479 struct gaim_account *account = NULL; |
3754 | 1480 |
1481 gtk_tree_model_get_iter_from_string(model, &iter, path_str); | |
4491 | 1482 gtk_tree_model_get(model, &iter, COLUMN_DATA, &account, -1); |
3754 | 1483 |
4491 | 1484 account->options ^= OPT_ACCT_AUTO; |
3754 | 1485 |
1486 gtk_list_store_set(GTK_LIST_STORE(model), &iter, | |
4491 | 1487 COLUMN_AUTOLOGIN, (account->options & OPT_ACCT_AUTO), -1); |
3754 | 1488 |
1489 save_prefs(); | |
1490 } | |
1491 | |
4491 | 1492 static void do_del_acct(struct gaim_account *account) |
3754 | 1493 { |
1494 GtkTreeIter iter; | |
4785 | 1495 GaimBlistNode *gnode,*bnode; |
3754 | 1496 |
4491 | 1497 if (account->gc) { |
1498 account->gc->wants_to_die = TRUE; | |
1499 signoff(account->gc); | |
2007
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
1500 } |
3754 | 1501 |
4491 | 1502 if (get_iter_from_data(GTK_TREE_VIEW(treeview), account, &iter)) { |
3754 | 1503 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
1504 } | |
1505 | |
4349 | 1506 |
1507 /* remove the buddies for the account we just destroyed */ | |
4785 | 1508 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { |
1509 struct group *g = (struct group *)gnode; | |
1510 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
1511 continue; | |
1512 for(bnode = gnode->child; bnode; bnode = bnode->next) { | |
5234 | 1513 if(GAIM_BLIST_NODE_IS_BUDDY(bnode)) { |
1514 struct buddy *b = (struct buddy *)bnode; | |
1515 if(b->account == account) | |
1516 gaim_blist_remove_buddy(b); | |
1517 } else if(GAIM_BLIST_NODE_IS_CHAT(bnode)) { | |
1518 struct chat *chat = (struct chat *)bnode; | |
1519 if(chat->account == account) | |
1520 gaim_blist_remove_chat(chat); | |
4349 | 1521 } |
1522 } | |
4785 | 1523 if(!gnode->child) { |
4687 | 1524 gaim_blist_remove_group(g); |
4349 | 1525 } |
1526 } | |
1527 | |
4491 | 1528 gaim_accounts = g_slist_remove(gaim_accounts, account); |
4349 | 1529 |
1530 gaim_blist_save(); | |
1531 | |
2007
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
1532 save_prefs(); |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
1533 } |
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
1534 |
3754 | 1535 static void del_acct_func(GtkTreeModel *model, GtkTreePath *path, |
1536 GtkTreeIter *iter, gpointer data) | |
1537 { | |
4491 | 1538 struct gaim_account *account; |
3754 | 1539 |
4491 | 1540 gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
3754 | 1541 |
4491 | 1542 if (account != NULL) { |
3754 | 1543 char buf[8192]; |
1544 | |
1545 g_snprintf(buf, sizeof(buf), | |
4491 | 1546 _("Are you sure you want to delete %s?"), account->username); |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5469
diff
changeset
|
1547 |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5469
diff
changeset
|
1548 gaim_request_action(NULL, NULL, buf, NULL, 1, account, 2, |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5469
diff
changeset
|
1549 _("Delete"), G_CALLBACK(do_del_acct), |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5469
diff
changeset
|
1550 _("Cancel"), NULL); |
3754 | 1551 } |
1552 } | |
1553 | |
960 | 1554 static void del_acct(GtkWidget *w, gpointer d) |
1555 { | |
3754 | 1556 GtkTreeSelection *selection; |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
1557 |
3754 | 1558 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); |
1559 | |
1560 gtk_tree_selection_selected_foreach(selection, del_acct_func, NULL); | |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
1561 } |
2007
948a67a691a6
[gaim-migrate @ 2017]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1956
diff
changeset
|
1562 |
960 | 1563 void account_editor(GtkWidget *w, GtkWidget *W) |
1564 { | |
1565 /* please kill me */ | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1566 GtkWidget *vbox; |
960 | 1567 GtkWidget *hbox; |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
1568 GtkWidget *sw; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1569 GtkWidget *button; /* used for many things */ |
3754 | 1570 GtkWidget *sep; |
1571 GtkSizeGroup *sg; | |
960 | 1572 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1573 if (acctedit) { |
3472 | 1574 gtk_window_present(GTK_WINDOW(acctedit)); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1575 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1576 } |
3764 | 1577 |
960 | 1578 acctedit = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4703 | 1579 gtk_window_set_title(GTK_WINDOW(acctedit), _("Account Editor")); |
4074 | 1580 gtk_window_set_role(GTK_WINDOW(acctedit), "accounteditor"); |
960 | 1581 gtk_widget_realize(acctedit); |
4635 | 1582 gtk_widget_set_size_request(acctedit, -1, 250); |
3755 | 1583 gtk_window_set_default_size(GTK_WINDOW(acctedit), 550, 250); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1584 g_signal_connect(G_OBJECT(acctedit), "delete_event", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1585 G_CALLBACK(on_delete_acctedit), W); |
960 | 1586 |
3754 | 1587 vbox = gtk_vbox_new(FALSE, 6); |
1588 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1589 gtk_container_add(GTK_CONTAINER(acctedit), vbox); |
960 | 1590 |
2008
6f049002d963
[gaim-migrate @ 2018]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2007
diff
changeset
|
1591 sw = generate_list(); |
3754 | 1592 hbox = gtk_hbox_new(FALSE, 6); |
1593 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 6); | |
1594 | |
4550
972af41f277c
[gaim-migrate @ 4830]
Christian Hammond <chipx86@chipx86.com>
parents:
4493
diff
changeset
|
1595 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0); |
3754 | 1596 |
1597 sep = gtk_hseparator_new(); | |
1598 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0); | |
1599 | |
1600 hbox = gtk_hbox_new(FALSE, 6); | |
1601 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1602 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
960 | 1603 |
3754 | 1604 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
1605 | |
3885 | 1606 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); |
3754 | 1607 gtk_size_group_add_widget(sg, button); |
1608 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1609 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1610 G_CALLBACK(on_close_acctedit), W); |
960 | 1611 |
3754 | 1612 button = gtk_button_new_from_stock(GTK_STOCK_DELETE); |
1613 gtk_size_group_add_widget(sg, button); | |
1614 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1615 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1616 G_CALLBACK(del_acct), NULL); |
3754 | 1617 |
4114 | 1618 button = gaim_pixbuf_button_from_stock(_("_Modify"), GTK_STOCK_PREFERENCES, |
3754 | 1619 GAIM_BUTTON_HORIZONTAL); |
1620 gtk_size_group_add_widget(sg, button); | |
1621 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1622 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1623 G_CALLBACK(mod_acct), NULL); |
960 | 1624 |
3754 | 1625 button = gtk_button_new_from_stock(GTK_STOCK_ADD); |
1626 gtk_size_group_add_widget(sg, button); | |
1627 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1628 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1629 G_CALLBACK(add_acct), NULL); |
960 | 1630 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1631 gtk_widget_show_all(acctedit); |
960 | 1632 } |
1633 | |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1634 struct signon_meter { |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1635 struct gaim_connection *gc; |
3060 | 1636 GtkWidget *button; |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1637 GtkWidget *progress; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1638 GtkWidget *status; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1639 }; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1640 static GSList *meters = NULL; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1641 |
4687 | 1642 GtkWidget* create_meter_pixmap (struct gaim_connection *gc) |
3060 | 1643 { |
4687 | 1644 GdkPixbuf *pb = create_prpl_icon(gc->account); |
1645 GdkPixbuf *scale = gdk_pixbuf_scale_simple(pb, 30,30,GDK_INTERP_BILINEAR); | |
1646 GtkWidget *image = | |
1647 gtk_image_new_from_pixbuf(scale); | |
1648 g_object_unref(G_OBJECT(pb)); | |
1649 g_object_unref(G_OBJECT(scale)); | |
1650 return image; | |
3060 | 1651 } |
1652 | |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1653 static struct signon_meter *find_signon_meter(struct gaim_connection *gc) |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1654 { |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1655 GSList *m = meters; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1656 while (m) { |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1657 if (((struct signon_meter *)m->data)->gc == gc) |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1658 return m->data; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1659 m = m->next; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1660 } |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1661 return NULL; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1662 } |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1663 |
3060 | 1664 void kill_meter(struct signon_meter *meter) { |
1665 gtk_widget_set_sensitive (meter->button, FALSE); | |
4275 | 1666 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(meter->progress), 1); |
3060 | 1667 gtk_statusbar_pop(GTK_STATUSBAR(meter->status), 1); |
4169 | 1668 gtk_statusbar_push(GTK_STATUSBAR(meter->status), 1, _("Done.")); |
3060 | 1669 meter_win->active_count--; |
1670 if (meter_win->active_count == 0) { | |
1671 gtk_widget_destroy(meter_win->window); | |
1672 g_free (meter_win); | |
1673 meter_win = NULL; | |
3554 | 1674 } |
3060 | 1675 } |
1676 | |
4890
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1677 void away_on_login(char *mesg) |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1678 { |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1679 GSList *awy = away_messages; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1680 struct away_message *a, *message = NULL; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1681 struct gaim_gtk_buddy_list *gtkblist; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1682 |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1683 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1684 |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1685 if (!gtkblist->window) { |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1686 return; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1687 } |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1688 |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1689 if (mesg == NULL) { |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1690 /* Use default message */ |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1691 do_away_message(NULL, default_away); |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1692 } else { |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1693 /* Use argument */ |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1694 while (awy) { |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1695 a = (struct away_message *)awy->data; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1696 if (strcmp(a->name, mesg) == 0) { |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1697 message = a; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1698 break; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1699 } |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1700 awy = awy->next; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1701 } |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1702 if (message == NULL) |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1703 message = default_away; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1704 do_away_message(NULL, message); |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1705 } |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1706 return; |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1707 } |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4856
diff
changeset
|
1708 |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
1709 void account_online(struct gaim_connection *gc) |
960 | 1710 { |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1711 struct signon_meter *meter = find_signon_meter(gc); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1712 GList *wins; |
3754 | 1713 GtkTreeIter iter; |
4785 | 1714 GaimBlistNode *gnode,*bnode; |
4349 | 1715 GList *add_buds=NULL; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1716 GList *l; |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1717 |
4333 | 1718 /* Set the time the account came online */ |
1719 time(&gc->login_time); | |
1720 | |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1721 /* first we hide the login progress meter */ |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1722 if (meter) { |
3060 | 1723 kill_meter(meter); |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1724 meters = g_slist_remove(meters, meter); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1725 g_free(meter); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1726 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1727 |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1728 /* then we do the buddy list stuff */ |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1729 if (mainwindow) |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1730 gtk_widget_hide(mainwindow); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1731 |
4687 | 1732 gaim_blist_show(); |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1733 |
3367 | 1734 update_privacy_connections(); |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
1735 do_away_menu(); |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1474
diff
changeset
|
1736 do_proto_menu(); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1737 |
5234 | 1738 gaim_blist_add_account(gc->account); |
1739 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1740 /* |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1741 * 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
|
1742 * notification system. |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1743 */ |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1744 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1745 struct gaim_window *win = (struct gaim_window *)wins->data; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1746 gaim_conversation_update(gaim_window_get_conversation_at(win, 0), |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1747 GAIM_CONV_ACCOUNT_ONLINE); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1748 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1749 |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1750 gaim_setup(gc); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1751 |
4491 | 1752 gc->account->connecting = FALSE; |
3726 | 1753 connecting_count--; |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1754 gaim_debug(GAIM_DEBUG_MISC, "accounts", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1755 "Connecting count: %d\n", connecting_count); |
3570 | 1756 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1757 gaim_event_broadcast(event_signon, gc); |
1575
427e1409917c
[gaim-migrate @ 1585]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1499
diff
changeset
|
1758 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
|
1759 |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1760 /* away option given? */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1761 if (opt_away) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1762 away_on_login(opt_away_arg); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1763 /* don't do it again */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1764 opt_away = 0; |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
1765 } else if (awaymessage) { |
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
1766 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message); |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1767 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1768 if (opt_away_arg != NULL) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2364
diff
changeset
|
1769 g_free(opt_away_arg); |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1770 opt_away_arg = NULL; |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1771 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1772 |
4349 | 1773 /* let the prpl know what buddies we pulled out of the local list */ |
4785 | 1774 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { |
1775 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
1776 continue; | |
1777 for(bnode = gnode->child; bnode; bnode = bnode->next) { | |
5234 | 1778 if(GAIM_BLIST_NODE_IS_BUDDY(bnode)) { |
1779 struct buddy *b = (struct buddy *)bnode; | |
1780 if(b->account == gc->account) { | |
1781 add_buds = g_list_append(add_buds, b->name); | |
1782 } | |
4349 | 1783 } |
1784 } | |
1785 } | |
1786 | |
1787 if(add_buds) { | |
1788 serv_add_buddies(gc, add_buds); | |
1789 g_list_free(add_buds); | |
1790 } | |
1791 | |
1792 serv_set_permit_deny(gc); | |
1793 | |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1794 /* everything for the account editor */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1795 if (!acctedit) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1796 return; |
3754 | 1797 |
4491 | 1798 if (get_iter_from_data(GTK_TREE_VIEW(treeview), gc->account, &iter)) { |
3754 | 1799 gtk_list_store_set(model, &iter, |
1800 COLUMN_ONLINE, TRUE, | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
1801 COLUMN_PROTOCOL, gc->prpl->info->name, |
3754 | 1802 -1); |
1803 } | |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1804 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1805 /* Update the conversation windows that use this account. */ |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1806 for (l = gaim_get_conversations(); l != NULL; l = l->next) { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1807 struct gaim_conversation *conv = (struct gaim_conversation *)l->data; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1808 |
4491 | 1809 if (gaim_conversation_get_account(conv) == gc->account) { |
1810 gaim_conversation_update(conv, GAIM_CONV_UPDATE_ACCOUNT); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1811 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1812 } |
960 | 1813 } |
1814 | |
1815 void account_offline(struct gaim_connection *gc) | |
1816 { | |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1817 struct signon_meter *meter = find_signon_meter(gc); |
3754 | 1818 GtkTreeIter iter; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1819 GList *l; |
3754 | 1820 |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1821 if (meter) { |
3060 | 1822 kill_meter(meter); |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1823 meters = g_slist_remove(meters, meter); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1824 g_free(meter); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1825 } |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1826 |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1827 gaim_debug(GAIM_DEBUG_MISC, "accounts", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1828 "Disconnecting. user = %p, gc = %p (%p)\n", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1829 gc->account, gc->account->gc, gc); |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1830 |
4491 | 1831 gc->account->gc = NULL; /* wasn't that awkward? */ |
4388 | 1832 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1833 if (!acctedit) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1834 return; |
3754 | 1835 |
4491 | 1836 if (get_iter_from_data(GTK_TREE_VIEW(treeview), gc->account, &iter)) { |
3754 | 1837 gtk_list_store_set(model, &iter, COLUMN_ONLINE, FALSE, -1); |
1838 } | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1839 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1840 /* Update the conversation windows that use this account. */ |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1841 for (l = gaim_get_conversations(); l != NULL; l = l->next) { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1842 struct gaim_conversation *conv = (struct gaim_conversation *)l->data; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1843 |
4491 | 1844 if (gaim_conversation_get_account(conv) == gc->account) { |
1845 gaim_conversation_update(conv, GAIM_CONV_UPDATE_ACCOUNT); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1846 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1847 } |
960 | 1848 } |
1849 | |
1850 void auto_login() | |
1851 { | |
4491 | 1852 GSList *accts = gaim_accounts; |
1853 struct gaim_account *a = NULL; | |
960 | 1854 |
4491 | 1855 while (accts) { |
1856 a = (struct gaim_account *)accts->data; | |
1857 if ((a->options & OPT_ACCT_AUTO) && (a->options & OPT_ACCT_REM_PASS)) { | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
977
diff
changeset
|
1858 serv_login(a); |
960 | 1859 } |
4491 | 1860 accts = accts->next; |
960 | 1861 } |
1862 } | |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1863 |
3458 | 1864 /* |
1865 * d:)->-< | |
1866 * | |
1867 * d:O-\-< | |
1868 * | |
1869 * d:D-/-< | |
1870 * | |
1871 * d8D->-< DANCE! | |
1872 */ | |
1873 | |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1874 static void cancel_signon(GtkWidget *button, struct signon_meter *meter) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1875 { |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1876 meter->gc->wants_to_die = TRUE; |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1877 signoff(meter->gc); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
1878 } |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
1879 |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1880 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
|
1881 { |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
1882 return TRUE; |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1883 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1884 |
3060 | 1885 static struct signon_meter *register_meter(struct gaim_connection *gc, GtkWidget *widget, GtkTable *table, gint *rows) |
1886 { | |
1887 GtkWidget *graphic; | |
3378 | 1888 GtkWidget *label; |
3060 | 1889 GtkWidget *nest_vbox; |
1890 GString *name_to_print; | |
1891 struct signon_meter *meter; | |
4491 | 1892 |
3060 | 1893 name_to_print = g_string_new(gc->username); |
4491 | 1894 |
3060 | 1895 meter = g_new0(struct signon_meter, 1); |
4491 | 1896 |
3060 | 1897 (*rows)++; |
1898 gtk_table_resize (table, *rows, 4); | |
4491 | 1899 |
4687 | 1900 graphic = create_meter_pixmap(gc); |
4491 | 1901 |
3060 | 1902 nest_vbox = gtk_vbox_new (FALSE, 0); |
4491 | 1903 |
4225 | 1904 g_string_prepend(name_to_print, _("Signon: ")); |
3378 | 1905 label = gtk_label_new (name_to_print->str); |
4225 | 1906 g_string_free(name_to_print, TRUE); |
3378 | 1907 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); |
4491 | 1908 |
3060 | 1909 meter->status = gtk_statusbar_new(); |
4639 | 1910 gtk_widget_set_size_request(meter->status, 250, -1); |
4491 | 1911 |
3060 | 1912 meter->progress = gtk_progress_bar_new (); |
4491 | 1913 |
5024 | 1914 meter->button = gaim_pixbuf_button_from_stock (_("Cancel"), GTK_STOCK_CANCEL, GAIM_BUTTON_HORIZONTAL); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1915 g_signal_connect(G_OBJECT (meter->button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1916 G_CALLBACK (cancel_signon), meter); |
4491 | 1917 |
3060 | 1918 gtk_table_attach (GTK_TABLE (table), graphic, 0, 1, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); |
1919 gtk_table_attach (GTK_TABLE (table), nest_vbox, 1, 2, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); | |
3378 | 1920 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (label), FALSE, FALSE, 0); |
3060 | 1921 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (meter->status), FALSE, FALSE, 0); |
1922 gtk_table_attach (GTK_TABLE (table), meter->progress, 2, 3, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); | |
1923 gtk_table_attach (GTK_TABLE (table), meter->button, 3, 4, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); | |
1924 | |
1925 gtk_widget_show_all (GTK_WIDGET (meter_win->window)); | |
4491 | 1926 |
3060 | 1927 meter_win->active_count++; |
4491 | 1928 |
3060 | 1929 return meter; |
1930 } | |
1931 | |
1932 static void loop_cancel () { | |
1933 GSList *m = meters; | |
1934 struct signon_meter *meter = NULL; | |
1935 | |
1936 while (m) { | |
1937 meter = (struct signon_meter *) (m->data); | |
1938 meter->gc->wants_to_die = TRUE; | |
1939 signoff((struct gaim_connection *) meter->gc); | |
1940 m = meters; | |
1941 } | |
1942 } | |
1943 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1172
diff
changeset
|
1944 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
|
1945 { |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1946 struct signon_meter *meter = find_signon_meter(gc); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1947 |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1948 if (mainwindow) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1949 gtk_widget_hide(mainwindow); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1950 |
3060 | 1951 if (!meter_win) { |
1952 GtkWidget *cancel_button; | |
1953 GtkWidget *vbox; | |
4635 | 1954 |
3060 | 1955 meter_win = g_new0(struct meter_window, 1); |
1956 meter_win->rows=0; | |
4635 | 1957 |
3060 | 1958 meter_win->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); |
1959 GAIM_DIALOG(meter_win->window); | |
4635 | 1960 gtk_window_set_resizable(GTK_WINDOW(meter_win->window), FALSE); |
4074 | 1961 gtk_window_set_role(GTK_WINDOW(meter_win->window), "signon"); |
3060 | 1962 gtk_container_set_border_width(GTK_CONTAINER(meter_win->window), 5); |
4703 | 1963 gtk_window_set_title (GTK_WINDOW (meter_win->window), _("Signon")); |
3060 | 1964 gtk_widget_realize(meter_win->window); |
4635 | 1965 |
3060 | 1966 vbox = gtk_vbox_new (FALSE, 0); |
1967 gtk_container_add (GTK_CONTAINER (meter_win->window), GTK_WIDGET (vbox)); | |
1968 | |
1969 meter_win->table = (GtkTable *) gtk_table_new (1 , 4, FALSE); | |
1970 gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (meter_win->table), FALSE, FALSE, 0); | |
1971 gtk_container_set_border_width (GTK_CONTAINER (meter_win->table), 5); | |
1972 gtk_table_set_row_spacings (GTK_TABLE (meter_win->table), 5); | |
1973 gtk_table_set_col_spacings (GTK_TABLE (meter_win->table), 10); | |
1974 | |
5024 | 1975 cancel_button = gaim_pixbuf_button_from_stock (_("Cancel All"), GTK_STOCK_QUIT, GAIM_BUTTON_HORIZONTAL); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1976 g_signal_connect_swapped(G_OBJECT(cancel_button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1977 G_CALLBACK (loop_cancel), NULL); |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1978 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(cancel_button), FALSE, FALSE, 0); |
3060 | 1979 |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1980 g_signal_connect(G_OBJECT(meter_win->window), "delete_event", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
1981 G_CALLBACK(meter_destroy), NULL); |
4987 | 1982 } |
3060 | 1983 |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1984 if (!meter) { |
3060 | 1985 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
|
1986 meter->gc = gc; |
2403
8555e48c02df
[gaim-migrate @ 2416]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2402
diff
changeset
|
1987 meters = g_slist_append(meters, meter); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1988 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1989 |
4275 | 1990 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
|
1991 gtk_statusbar_pop(GTK_STATUSBAR(meter->status), 1); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
1992 gtk_statusbar_push(GTK_STATUSBAR(meter->status), 1, message); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1993 } |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
1994 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1995 struct kick_dlg { |
4491 | 1996 struct gaim_account *account; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1997 GtkWidget *dlg; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1998 }; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
1999 static GSList *kicks = NULL; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2000 |
4491 | 2001 static struct kick_dlg *find_kick_dlg(struct gaim_account *account) |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
2002 { |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2003 GSList *k = kicks; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2004 while (k) { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2005 struct kick_dlg *d = k->data; |
4491 | 2006 if (d->account == account) |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2007 return d; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2008 k = k->next; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2009 } |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2010 return NULL; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2011 } |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2012 |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
2013 static void set_kick_null(struct kick_dlg *k) |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2014 { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2015 kicks = g_slist_remove(kicks, k); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2016 g_free(k); |
1817
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
2017 } |
b367beee6448
[gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
2018 |
2956 | 2019 /* |
2020 * Common code for hide_login_progress(), and hide_login_progress_info() | |
2021 */ | |
2022 static void hide_login_progress_common(struct gaim_connection *gc, | |
2023 char *details, | |
2024 char *title, | |
2025 char *prologue) | |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
2026 { |
4617 | 2027 gchar *buf; |
4491 | 2028 struct kick_dlg *k = find_kick_dlg(gc->account); |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
2029 struct signon_meter *meter = find_signon_meter(gc); |
4617 | 2030 buf = g_strdup_printf(_("%s\n%s: %s"), full_date(), prologue, details); |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2031 if (k) |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2032 gtk_widget_destroy(k->dlg); |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
2033 k = g_new0(struct kick_dlg, 1); |
4491 | 2034 k->account = gc->account; |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
2035 k->dlg = gaim_notify_message(NULL, GAIM_NOTIFY_MSG_ERROR, NULL, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5413
diff
changeset
|
2036 title, buf, G_CALLBACK(set_kick_null), k); |
2709
df0832a9ccec
[gaim-migrate @ 2722]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2707
diff
changeset
|
2037 kicks = g_slist_append(kicks, k); |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
2038 if (meter) { |
3060 | 2039 kill_meter(meter); |
2402
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
2040 meters = g_slist_remove(meters, meter); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
2041 g_free(meter); |
6e3dc0b3b9b1
[gaim-migrate @ 2415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2397
diff
changeset
|
2042 } |
4617 | 2043 g_free(buf); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
984
diff
changeset
|
2044 } |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
2045 |
2956 | 2046 void hide_login_progress(struct gaim_connection *gc, char *why) |
2047 { | |
4617 | 2048 gchar *buf; |
2956 | 2049 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
2050 gaim_event_broadcast(event_error, gc, why); |
4617 | 2051 buf = g_strdup_printf(_("%s was unable to sign on"), gc->username); |
2956 | 2052 hide_login_progress_common(gc, why, _("Signon Error"), buf); |
4617 | 2053 g_free(buf); |
2956 | 2054 } |
2055 | |
2056 /* | |
2057 * Like hide_login_progress(), but for informational, not error/warning, | |
2058 * messages. | |
2059 * | |
2060 */ | |
2061 void hide_login_progress_notice(struct gaim_connection *gc, char *why) | |
2062 { | |
2063 hide_login_progress_common(gc, why, _("Notice"), gc->username); | |
2064 } | |
2065 | |
3074 | 2066 /* |
2067 * Like hide_login_progress(), but for non-signon error messages. | |
2068 * | |
2069 */ | |
2070 void hide_login_progress_error(struct gaim_connection *gc, char *why) | |
2071 { | |
2072 char buf[2048]; | |
4617 | 2073 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
2074 gaim_event_broadcast(event_error, gc, why); |
3074 | 2075 g_snprintf(buf, sizeof(buf), _("%s has been signed off"), gc->username); |
2076 hide_login_progress_common(gc, why, _("Connection Error"), buf); | |
2077 } | |
2078 | |
2559
e49ab50736bf
[gaim-migrate @ 2572]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2525
diff
changeset
|
2079 void signoff_all() |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2080 { |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2081 GSList *c = connections; |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2082 struct gaim_connection *g = NULL; |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2083 |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2084 while (c) { |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2085 g = (struct gaim_connection *)c->data; |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2086 g->wants_to_die = TRUE; |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2087 signoff(g); |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2088 c = connections; |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2089 } |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2090 } |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2091 |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2092 void signoff(struct gaim_connection *gc) |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2093 { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2094 GList *wins; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2095 |
5413 | 2096 /* we only remove the account if we ever added it */ |
2097 if(!gc->account->connecting) | |
2098 gaim_blist_remove_account(gc->account); | |
3510 | 2099 |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2100 /* core stuff */ |
3510 | 2101 /* remove this here so plugins get a sensible count of connections */ |
2102 connections = g_slist_remove(connections, gc); | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2103 gaim_debug(GAIM_DEBUG_MISC, "accounts", "date: %s\n", full_date()); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5068
diff
changeset
|
2104 gaim_event_broadcast(event_signoff, gc); |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2105 system_log(log_signoff, gc, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); |
3510 | 2106 /* set this in case the plugin died before really connecting. |
2107 do it after calling the plugins so they can determine if | |
2108 this user was ever on-line or not */ | |
4491 | 2109 if (gc->account->connecting) { |
2110 gc->account->connecting = FALSE; | |
3726 | 2111 connecting_count--; |
3517 | 2112 } |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2113 gaim_debug(GAIM_DEBUG_MISC, "accounts", "connecting_count: %d\n", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2114 connecting_count); |
3510 | 2115 serv_close(gc); |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2116 |
3510 | 2117 /* more UI stuff */ |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2118 do_away_menu(); |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2119 do_proto_menu(); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2120 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2121 /* |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2122 * 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
|
2123 * notification system. |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2124 */ |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2125 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2126 struct gaim_window *win = (struct gaim_window *)wins->data; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2127 gaim_conversation_update(gaim_window_get_conversation_at(win, 0), |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2128 GAIM_CONV_ACCOUNT_OFFLINE); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2129 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2130 |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5469
diff
changeset
|
2131 gaim_request_close_with_handle(gc); |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5469
diff
changeset
|
2132 gaim_notify_close_with_handle(gc); |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5469
diff
changeset
|
2133 |
3367 | 2134 update_privacy_connections(); |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2135 |
3510 | 2136 /* in, out, shake it all about */ |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2137 if (connections) |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2138 return; |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2139 |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2140 destroy_all_dialogs(); |
4687 | 2141 gaim_blist_destroy(); |
3472 | 2142 |
2380
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2143 show_login(); |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2144 } |
6f83c22d9e70
[gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
2145 |
4491 | 2146 struct gaim_account *gaim_account_new(const char *name, int proto, int opts) |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
2147 { |
4491 | 2148 struct gaim_account *account = g_new0(struct gaim_account, 1); |
2149 g_snprintf(account->username, sizeof(account->username), "%s", name); | |
2150 g_snprintf(account->user_info, sizeof(account->user_info), "%s", DEFAULT_INFO); | |
2151 account->protocol = proto; | |
2152 account->options = opts; | |
2153 account->permit = NULL; | |
2154 account->deny = NULL; | |
2155 gaim_accounts = g_slist_append(gaim_accounts, account); | |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
2156 |
3754 | 2157 if (treeview) { |
2158 GtkTreeIter iter; | |
2159 | |
2160 gtk_list_store_append(model, &iter); | |
2161 gtk_list_store_set(model, &iter, | |
4491 | 2162 COLUMN_SCREENNAME, account->username, |
2163 COLUMN_ONLINE, (account->gc ? TRUE : FALSE), | |
2164 COLUMN_AUTOLOGIN, (account->options & OPT_ACCT_AUTO), | |
2165 COLUMN_PROTOCOL, proto_name(account->protocol), | |
2166 COLUMN_DATA, account, | |
3754 | 2167 -1); |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
2168 } |
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
2169 |
4491 | 2170 return account; |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
2171 } |
5469
df653f6f2978
[gaim-migrate @ 5861]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5436
diff
changeset
|
2172 |
df653f6f2978
[gaim-migrate @ 5861]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5436
diff
changeset
|
2173 GSList *gaim_get_connections() |
df653f6f2978
[gaim-migrate @ 5861]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5436
diff
changeset
|
2174 { |
df653f6f2978
[gaim-migrate @ 5861]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5436
diff
changeset
|
2175 return connections; |
df653f6f2978
[gaim-migrate @ 5861]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5436
diff
changeset
|
2176 } |