Mercurial > pidgin.yaz
comparison src/connection.c @ 5885:02569519d0cc
[gaim-migrate @ 6317]
The away and protocol menus now update when an account is signed on or off.
The very last of the UI is gone from connection.c, except for a couple
things commented out. I think everything works there again.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 15 Jun 2003 07:31:20 +0000 |
parents | f5b0c6073264 |
children | dbe2a2174be9 |
comparison
equal
deleted
inserted
replaced
5884:d188b000e892 | 5885:02569519d0cc |
---|---|
29 #include "prefs.h" | 29 #include "prefs.h" |
30 #include "request.h" | 30 #include "request.h" |
31 #include "server.h" | 31 #include "server.h" |
32 #include "sound.h" | 32 #include "sound.h" |
33 | 33 |
34 /* XXX UI stuff! */ | |
35 #include "ui.h" | |
36 | |
37 static GList *connections = NULL; | 34 static GList *connections = NULL; |
38 static GList *connections_connecting = NULL; | 35 static GList *connections_connecting = NULL; |
39 static GaimConnectionUiOps *connection_ui_ops = NULL; | 36 static GaimConnectionUiOps *connection_ui_ops = NULL; |
40 | 37 |
41 | 38 |
169 */ | 166 */ |
170 | 167 |
171 void | 168 void |
172 gaim_connection_set_state(GaimConnection *gc, GaimConnectionState state) | 169 gaim_connection_set_state(GaimConnection *gc, GaimConnectionState state) |
173 { | 170 { |
171 GaimConnectionUiOps *ops; | |
172 | |
174 g_return_if_fail(gc != NULL); | 173 g_return_if_fail(gc != NULL); |
175 | 174 |
176 if (gc->state == state) | 175 if (gc->state == state) |
177 return; | 176 return; |
178 | 177 |
179 gc->state = state; | 178 gc->state = state; |
180 | 179 |
180 ops = gaim_get_connection_ui_ops(); | |
181 | |
182 if (gc->state != GAIM_CONNECTED) | |
183 connections_connecting = g_list_remove(connections_connecting, gc); | |
184 | |
181 if (gc->state == GAIM_CONNECTED) { | 185 if (gc->state == GAIM_CONNECTED) { |
182 GaimConnectionUiOps *ops = gaim_get_connection_ui_ops(); | |
183 GaimBlistNode *gnode,*bnode; | 186 GaimBlistNode *gnode,*bnode; |
184 GList *wins; | 187 GList *wins; |
185 GList *add_buds=NULL; | 188 GList *add_buds=NULL; |
186 | 189 |
187 /* Set the time the account came online */ | 190 /* Set the time the account came online */ |
192 if (ops != NULL && ops->connected != NULL) | 195 if (ops != NULL && ops->connected != NULL) |
193 ops->connected(gc); | 196 ops->connected(gc); |
194 | 197 |
195 gaim_blist_show(); | 198 gaim_blist_show(); |
196 gaim_blist_add_account(gc->account); | 199 gaim_blist_add_account(gc->account); |
197 | |
198 /* XXX I hate this. UI code. -- ChipX86 */ | |
199 gaim_setup(gc); | |
200 | 200 |
201 /* | 201 /* |
202 * XXX This is a hack! Remove this and replace it with a better event | 202 * XXX This is a hack! Remove this and replace it with a better event |
203 * notification system. | 203 * notification system. |
204 */ | 204 */ |
246 g_list_free(add_buds); | 246 g_list_free(add_buds); |
247 } | 247 } |
248 | 248 |
249 serv_set_permit_deny(gc); | 249 serv_set_permit_deny(gc); |
250 } | 250 } |
251 else { | 251 else if (gc->state == GAIM_DISCONNECTED) { |
252 connections_connecting = g_list_remove(connections_connecting, gc); | 252 if (ops != NULL && ops->disconnected != NULL) |
253 ops->disconnected(gc, NULL); | |
253 } | 254 } |
254 } | 255 } |
255 | 256 |
256 void | 257 void |
257 gaim_connection_set_account(GaimConnection *gc, GaimAccount *account) | 258 gaim_connection_set_account(GaimConnection *gc, GaimAccount *account) |