2007-04-20 2007-04-20 Murray Cumming <murrayc@murrayc.com>
[modest] / src / modest-main.c
index 925b84c..87dbf0d 100644 (file)
@@ -119,23 +119,25 @@ main (int argc, char *argv[])
        if (!modest_runtime_init ()) {
                g_printerr ("modest: cannot init runtime\n");
                return MODEST_ERR_INIT;
+               
        }
        
-
        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");
                        retval = MODEST_ERR_UI;
                        goto cleanup;
-               } else
+               } else {
+                       if (modest_conf_get_bool (modest_runtime_get_conf(),
+                                                 MODEST_CONF_CONNECT_AT_STARTUP, NULL))
+                               tny_device_force_online (modest_runtime_get_device());
+                       
                        retval = start_ui (account_or_default,
                                           mailto, cc, bcc, subject, body);
+               }
        } else {
                if (!account_or_default) {
                        g_printerr ("modest: no account has been defined yet\n");
@@ -225,7 +227,7 @@ start_ui (const gchar *account_name, const gchar* mailto, const gchar *cc, const
                modest_window_mgr_register_window (mgr, win);
        }
        
-       gtk_widget_show (GTK_WIDGET (win));
+       gtk_widget_show_all (GTK_WIDGET (win));
        gtk_main();
        
        return MODEST_ERR_NONE;
@@ -284,7 +286,7 @@ send_mail (const gchar* account_name,
        modest_mail_operation_send_new_mail (mail_operation, account,
                                             from_string, mailto,
                                             cc, bcc, subject, body, NULL,
-                                            NULL);
+                                            NULL, 0);
        if (modest_mail_operation_get_status (mail_operation) == 
            MODEST_MAIL_OPERATION_STATUS_FAILED) {
                retval = MODEST_ERR_SEND;