comparison gtk/gtkconn.c @ 14696:34083fe39891

[gaim-migrate @ 17448] From Paul Betts, NetworkManager integration. This will smartly disconnect and reconnect accounts according to network availability. Probably needs some more tweaking. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 08 Oct 2006 08:40:09 +0000
parents 009db0b357b5
children 05c34aabdcc3
comparison
equal deleted inserted replaced
14695:fa0c8fa2b5a7 14696:34083fe39891
97 if (gaim_connections_get_all() != NULL) 97 if (gaim_connections_get_all() != NULL)
98 return; 98 return;
99 99
100 gaim_gtkdialogs_destroy_all(); 100 gaim_gtkdialogs_destroy_all();
101 } 101 }
102
103 static void
104 gaim_gtk_connection_notice(GaimConnection *gc,
105 const char *text)
106 {
107 }
108
109 102
110 static void 103 static void
111 free_auto_recon(gpointer data) 104 free_auto_recon(gpointer data)
112 { 105 {
113 GaimAutoRecon *info = data; 106 GaimAutoRecon *info = data;
199 */ 192 */
200 gaim_account_set_enabled(account, GAIM_GTK_UI, FALSE); 193 gaim_account_set_enabled(account, GAIM_GTK_UI, FALSE);
201 } 194 }
202 } 195 }
203 196
197 static void gaim_gtk_connection_network_connected ()
198 {
199 GList *list = gaim_accounts_get_all_active();
200 while (list) {
201 GaimAccount *account = (GaimAccount*)list->data;
202 GaimAutoRecon *info = g_hash_table_lookup(hash, account);
203 if (info)
204 free_auto_recon(info);
205 do_signon(account);
206 list = list->next;
207 }
208 }
209
210 static void gaim_gtk_connection_network_disconnected ()
211 {
212 GList *l = gaim_accounts_get_all_active();
213 while (l) {
214 GaimAccount *a = (GaimAccount*)l->data;
215 gaim_account_disconnect(a);
216 l = l->next;
217 }
218 }
219
220 static void gaim_gtk_connection_notice(GaimConnection *gc, const char *text)
221 { }
222
204 static GaimConnectionUiOps conn_ui_ops = 223 static GaimConnectionUiOps conn_ui_ops =
205 { 224 {
206 gaim_gtk_connection_connect_progress, 225 gaim_gtk_connection_connect_progress,
207 gaim_gtk_connection_connected, 226 gaim_gtk_connection_connected,
208 gaim_gtk_connection_disconnected, 227 gaim_gtk_connection_disconnected,
209 gaim_gtk_connection_notice, 228 gaim_gtk_connection_notice,
210 gaim_gtk_connection_report_disconnect, 229 gaim_gtk_connection_report_disconnect,
230 gaim_gtk_connection_network_connected,
231 gaim_gtk_connection_network_disconnected
211 }; 232 };
212 233
213 GaimConnectionUiOps * 234 GaimConnectionUiOps *
214 gaim_gtk_connections_get_ui_ops(void) 235 gaim_gtk_connections_get_ui_ops(void)
215 { 236 {