Mercurial > pidgin
comparison src/account.c @ 12070:e4666705944b
[gaim-migrate @ 14365]
patches [ 1353462 ] account-disabled/enabled signals, use them in account dialog
and [ 1355690 ] Add/remove statusbox when accounts are enabled/disabled
some parts of the first one didn't apply, but they were doc changes, so
i figured charkins could diff them.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Sun, 13 Nov 2005 03:45:16 +0000 |
parents | 41d84ac57cb6 |
children | 980c877bd238 |
comparison
equal
deleted
inserted
replaced
12069:1019f1d510d6 | 12070:e4666705944b |
---|---|
1290 void | 1290 void |
1291 gaim_account_set_enabled(GaimAccount *account, const char *ui, | 1291 gaim_account_set_enabled(GaimAccount *account, const char *ui, |
1292 gboolean value) | 1292 gboolean value) |
1293 { | 1293 { |
1294 GaimConnection *gc; | 1294 GaimConnection *gc; |
1295 gboolean was_enabled = FALSE; | |
1295 | 1296 |
1296 g_return_if_fail(account != NULL); | 1297 g_return_if_fail(account != NULL); |
1297 g_return_if_fail(ui != NULL); | 1298 g_return_if_fail(ui != NULL); |
1299 | |
1300 was_enabled = gaim_account_get_enabled(account, ui); | |
1298 | 1301 |
1299 gaim_account_set_ui_bool(account, ui, "auto-login", value); | 1302 gaim_account_set_ui_bool(account, ui, "auto-login", value); |
1300 gc = gaim_account_get_connection(account); | 1303 gc = gaim_account_get_connection(account); |
1304 | |
1305 if(was_enabled && !value) | |
1306 gaim_signal_emit(gaim_accounts_get_handle(), "account-disabled", account); | |
1307 else if(!was_enabled && value) | |
1308 gaim_signal_emit(gaim_accounts_get_handle(), "account-enabled", account); | |
1301 | 1309 |
1302 if ((gc != NULL) && (gc->wants_to_die == TRUE)) | 1310 if ((gc != NULL) && (gc->wants_to_die == TRUE)) |
1303 return; | 1311 return; |
1304 | 1312 |
1305 if (value && gaim_presence_is_online(account->presence)) | 1313 if (value && gaim_presence_is_online(account->presence)) |
2250 gaim_signal_register(handle, "account-connecting", | 2258 gaim_signal_register(handle, "account-connecting", |
2251 gaim_marshal_VOID__POINTER, NULL, 1, | 2259 gaim_marshal_VOID__POINTER, NULL, 1, |
2252 gaim_value_new(GAIM_TYPE_SUBTYPE, | 2260 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2253 GAIM_SUBTYPE_ACCOUNT)); | 2261 GAIM_SUBTYPE_ACCOUNT)); |
2254 | 2262 |
2263 gaim_signal_register(handle, "account-disabled", | |
2264 gaim_marshal_VOID__POINTER, NULL, 1, | |
2265 gaim_value_new(GAIM_TYPE_SUBTYPE, | |
2266 GAIM_SUBTYPE_ACCOUNT)); | |
2267 | |
2268 gaim_signal_register(handle, "account-enabled", | |
2269 gaim_marshal_VOID__POINTER, NULL, 1, | |
2270 gaim_value_new(GAIM_TYPE_SUBTYPE, | |
2271 GAIM_SUBTYPE_ACCOUNT)); | |
2272 | |
2255 gaim_signal_register(handle, "account-setting-info", | 2273 gaim_signal_register(handle, "account-setting-info", |
2256 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, | 2274 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, |
2257 gaim_value_new(GAIM_TYPE_SUBTYPE, | 2275 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2258 GAIM_SUBTYPE_ACCOUNT), | 2276 GAIM_SUBTYPE_ACCOUNT), |
2259 gaim_value_new(GAIM_TYPE_STRING)); | 2277 gaim_value_new(GAIM_TYPE_STRING)); |