- GOptionContext *context = NULL;
- ModestConf *modest_conf = NULL;
-
- GError *err = NULL;
- int retval = MODEST_ERR_NONE;
-
- static gboolean debug=FALSE, batch=FALSE;
- static gchar *mailto, *subject, *bcc, *cc, *body;
-
- static GOptionEntry options[] = {
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug,
- "Run in debug mode" },
- { "mailto", 'm', 0, G_OPTION_ARG_STRING, &mailto,
- "New email to <addresses> (comma-separated)"},
- { "subject", 's', 0, G_OPTION_ARG_STRING, &subject,
- "Subject for a new mail"},
- { "body", 'b', 0, G_OPTION_ARG_STRING, &body,
- "Body for a new email"},
- { "cc", 'c', 0, G_OPTION_ARG_STRING, &cc,
- "Cc: addresses for a new mail (comma-separated)"},
- { "bcc", 'x', 0, G_OPTION_ARG_STRING, &bcc,
- "Bcc: addresses for a new mail (comma-separated)"},
- { "batch", 'y', 0, G_OPTION_ARG_NONE, &batch,
- "Run in batch mode (don't show UI)"},
- { NULL }
- };
-
- g_type_init ();
-
- context = g_option_context_new (NULL);
- g_option_context_add_main_entries (context, options, NULL);
-
- if (!g_option_context_parse (context, &argc, &argv, &err)) {
- g_printerr ("modest: error in command line parameter(s): '%s', exiting\n",
- err ? err->message : "");
- g_error_free (err);
- retval = MODEST_ERR_OPTIONS;
- goto cleanup;
+ /* Usually we don't show the application at first,
+ * because we wait for the top_application D-Bus method to
+ * be called. But that's annoying when starting from the
+ * command line.: */
+ gboolean show_ui_without_top_application_method = FALSE;
+ int retval = 0;
+ MainSignalHandlers *handlers;
+ ModestTnyAccountStore *acc_store;
+
+ GError *error = NULL;
+ GOptionContext *context;
+
+ ModestWindowMgr *mgr;
+
+ context = g_option_context_new ("- Modest email client");
+ g_option_context_add_main_entries (context, option_entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, gtk_get_option_group (TRUE));
+ if (!g_option_context_parse (context, &argc, &argv, &error)) {
+ g_print ("option parsing failed: %s\n", error->message);
+ g_option_context_free (context);
+ exit (1);