* invent the MODEST_CONF_CONNECT_AT_STARTUP property, and make
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 5 Mar 2007 08:27:48 +0000 (08:27 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 5 Mar 2007 08:27:48 +0000 (08:27 +0000)
it the default.
  now, modest will try to make a connection by default when it starts

pmo-trunk-r882

src/maemo/modest-main-window.c
src/modest-defs.h
src/modest-main.c
src/modest-runtime.c

index a57c267..cdebd41 100644 (file)
@@ -468,8 +468,11 @@ modest_main_window_new (void)
        tny_account_store_view_set_account_store (TNY_ACCOUNT_STORE_VIEW (priv->folder_view),
                                                  TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
        g_idle_add ((GSourceFunc)sync_accounts_cb, self);
-       /* do send & receive when we are idle */
-       
+       /* do send & receive when we are idle */        
+
+       g_message ("online? %s",
+                  tny_device_is_online (modest_runtime_get_device()) ? "yes" : "no");
+
        return MODEST_WINDOW(self);
 }
 
index 7dedda9..99a8e74 100644 (file)
@@ -58,6 +58,8 @@
 #define MODEST_CONF_REPLY_TYPE           MODEST_CONF_NAMESPACE "/reply_type"        /*  int  */
 #define MODEST_CONF_FORWARD_TYPE         MODEST_CONF_NAMESPACE "/forward_type"      /*  int  */
 
+#define MODEST_CONF_CONNECT_AT_STARTUP   MODEST_CONF_NAMESPACE "/connect_at_startup"      
+
 #define MODEST_CONF_SHOW_TOOLBAR         MODEST_CONF_NAMESPACE "/show_toolbar"      
 #define MODEST_CONF_SHOW_CC              MODEST_CONF_NAMESPACE "/show_cc"           
 #define MODEST_CONF_SHOW_BCC             MODEST_CONF_NAMESPACE "/show_bcc"           
index 9e6e63e..8127e9c 100644 (file)
@@ -124,7 +124,10 @@ main (int argc, char *argv[])
 
        account_or_default = check_account (account);
        g_free (account);
-       
+
+       if (modest_conf_get_bool (modest_runtime_get_conf(), MODEST_CONF_CONNECT_AT_STARTUP, NULL))
+               tny_device_force_online (modest_runtime_get_device());
+                       
        if (!batch) {
                if (!modest_runtime_init_ui (argc, argv)) {
                        g_printerr ("modest: cannot start ui\n");
index 3803074..ef15710 100644 (file)
@@ -654,4 +654,8 @@ init_default_settings (ModestConf *conf)
 
        if (!modest_conf_key_exists (conf, MODEST_CONF_SHOW_BCC, NULL))
                modest_conf_set_bool (conf, MODEST_CONF_SHOW_BCC, FALSE, NULL);
+
+       if (!modest_conf_key_exists (conf, MODEST_CONF_CONNECT_AT_STARTUP, NULL))
+               modest_conf_set_bool (conf, MODEST_CONF_CONNECT_AT_STARTUP, TRUE, NULL);
+
 }