X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodest-main.c;h=62d2e698dad9c4c948986a227fe4fe8d91f6f61f;hb=5c10a6a7b752651d4700639f7ee3139a2476dbe0;hp=f84edf3af02287fb1ba2861c1ae5bfa5e9e17081;hpb=e374da56f67092cecb1572dd4bee2ca34e0bc04c;p=modest diff --git a/src/modest-main.c b/src/modest-main.c index f84edf3..62d2e69 100644 --- a/src/modest-main.c +++ b/src/modest-main.c @@ -36,6 +36,13 @@ #include "modest-platform.h" #include "modest-ui-actions.h" +static gboolean show_ui = FALSE; +static GOptionEntry option_entries [] = +{ + { "show-ui", 's', 0, G_OPTION_ARG_NONE, &show_ui, "Show UI immediately, so no wait for DBUS activation", NULL }, + { NULL } +}; + typedef struct { gulong queue_handler; gulong window_list_handler; @@ -116,12 +123,22 @@ main (int argc, char *argv[]) gboolean show_ui_without_top_application_method = FALSE; int retval = 0; MainSignalHandlers *handlers; + ModestTnyAccountStore *acc_store; - if (argc >= 2) { - if (strcmp (argv[1], "showui") == 0) - show_ui_without_top_application_method = TRUE; + GError *error; + GOptionContext *context; + + 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); + exit (1); } + + show_ui_without_top_application_method = show_ui; + if (!show_ui_without_top_application_method) { g_print ("modest: use 'modest showui' to start from cmdline with UI\n"); } @@ -150,6 +167,11 @@ main (int argc, char *argv[]) goto cleanup; } + + /* Create the account store & launch send queues */ + acc_store = modest_runtime_get_account_store (); + modest_tny_account_store_start_send_queues (acc_store); + handlers = g_malloc0 (sizeof (MainSignalHandlers)); /* Connect to the "queue-emtpy" signal */ handlers->queue_handler = @@ -167,7 +189,7 @@ main (int argc, char *argv[]) /* Connect to the "password-requested" signal */ handlers->get_password_handler = - g_signal_connect (modest_runtime_get_account_store (), + g_signal_connect (acc_store, "password_requested", G_CALLBACK (modest_ui_actions_on_password_requested), NULL);