* Added support to reload a msg when the device gets online
[modest] / src / modest-main.c
index 1491d7a..2f85ae8 100644 (file)
@@ -47,9 +47,9 @@
 #include "modest-mail-operation.h"
 
 
-#ifdef MODEST_ENABLE_HILDON /* Hildon includes */
+#if MODEST_PLATFORM_ID==2 
 #include <libosso.h>
-#endif /* MODEST_ENABLE_HILDON */
+#endif /* MODEST_PLATFORM==2 */
 
 /* return values */
 #define MODEST_ERR_NONE    0
@@ -103,7 +103,9 @@ main (int argc, char *argv[])
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
        textdomain (GETTEXT_PACKAGE);
 
-       g_type_init ();
+       g_type_init ();         
+       g_thread_init (NULL);
+       gdk_threads_init ();
 
        context = g_option_context_new (NULL);
        g_option_context_add_main_entries (context, options, NULL);
@@ -180,15 +182,13 @@ start_ui (const gchar* mailto, const gchar *cc, const gchar *bcc,
 /*                                             subject,    /\* subject *\/ */
 /*                                             body,    /\* body *\/ */
 /*                                             NULL);   /\* attachments *\/ */
-       } else
-#ifndef OLD_UI_STUFF
-       win = modest_ui_main_window (modest_ui);
-       gtk_widget_show (win);
-#else
-       modest_ui_show_main_window (modest_ui);
-#endif
-       gtk_main();
+       } else 
+               win = modest_ui_main_window (modest_ui);
        
+       if (win) {
+               gtk_widget_show (win);
+               gtk_main();
+       }       
 cleanup:
        if (modest_ui)
                g_object_unref (modest_ui);
@@ -201,18 +201,17 @@ cleanup:
 static gboolean
 hildon_init ()
 {
-#ifdef MODEST_ENABLE_HILDON
-
+#if MODEST_PLATFORM_ID==2 
+       
        osso_context_t *osso_context =
                osso_initialize(PACKAGE, PACKAGE_VERSION,
                                TRUE, NULL);    
        if (!osso_context) {
-               g_printerr ("modest: failed to aquire osso context, exiting\n");
-
+               g_printerr ("modest: failed to acquire osso context\n");
                return FALSE;
-               
        }
-#endif /* MODEST_ENABLE_HILDON */
+       
+#endif /* MODEST_PLATFORM_ID==2 */
 
        return TRUE;
 }
@@ -251,9 +250,10 @@ send_mail (const gchar* mailto, const gchar *cc, const gchar *bcc,
 
        account = TNY_TRANSPORT_ACCOUNT (tny_iterator_get_current(iter));
 
-       mail_operation = modest_mail_operation_new (TNY_ACCOUNT (account));
+       mail_operation = modest_mail_operation_new ();
 
        modest_mail_operation_send_new_mail (mail_operation,
+                                            account,
                                             "djcb@djcbsoftware.nl", mailto, cc, bcc, 
                                             subject, body, NULL);