X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-main-window.c;h=34fb4e8fbbbfa9db1ffedc31b26cba308976e30d;hp=40204ea5227c13a5d1c0344ea9dcc08e68649015;hb=95450fa69acf453d0ffdeabae6d6a67aeabac235;hpb=0789247d553240d477f7122a5d0e6a4d78c54ebb diff --git a/src/maemo/modest-main-window.c b/src/maemo/modest-main-window.c index 40204ea..34fb4e8 100644 --- a/src/maemo/modest-main-window.c +++ b/src/maemo/modest-main-window.c @@ -317,6 +317,19 @@ on_delete_event (GtkWidget *widget, GdkEvent *event, ModestMainWindow *self) return FALSE; } + +static void +on_connection_changed (TnyDevice *device, gboolean online, ModestMainWindow *self) +{ + /* When going online, do the equivalent of pressing the send/receive button, + * as per the specification: */ + if (online) { + modest_ui_actions_on_send_receive (NULL /* action */, MODEST_WINDOW (self)); + } +} + + + static void connect_signals (ModestMainWindow *self) { @@ -374,12 +387,17 @@ connect_signals (ModestMainWindow *self) "account_update", G_CALLBACK (on_account_update), self); + + /* Device */ + g_signal_connect (G_OBJECT(modest_runtime_get_device()), "connection_changed", + G_CALLBACK(on_connection_changed), self); } gboolean sync_accounts_cb (ModestMainWindow *win) { + /* TODO: Only for auto-update accounts. */ modest_ui_actions_on_send_receive (NULL, MODEST_WINDOW(win)); return FALSE; } @@ -703,7 +721,7 @@ modest_main_window_show_toolbar (ModestWindow *self, } /* - * TODO: modify the menu dinamically. Add handlers to each item of the + * TODO: modify the menu dynamically. Add handlers to each item of the * menu when created */ static void