X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-init.c;h=71770653936327d756b20aeb730437d1a64958f3;hp=b2e91e9ca341bc42b733a29873666c42c8e24cc1;hb=6b24cf2ddb800333882cc7b6056554895db31ee9;hpb=95e01c8b9da1ac88ed37bc7bc09331dbbff42d52 diff --git a/src/modest-init.c b/src/modest-init.c index b2e91e9..7177065 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -36,6 +36,7 @@ #include #include #include +#include "modest-address-book.h" #include #include #include @@ -186,7 +187,7 @@ force_ke_recv_load (void) { if (strcmp ("cerm_device_memory_full", _KR("cerm_device_memory_full")) == 0) { - g_warning ("%s: cannot get translation for cerm_device_memory_full", + g_debug ("%s: cannot get translation for cerm_device_memory_full", __FUNCTION__); return FALSE; } @@ -245,6 +246,9 @@ modest_init (int argc, char *argv[]) return FALSE; } + /* Initialize addressbook */ + modest_address_book_init (); + reset = modest_runtime_get_debug_flags () & MODEST_RUNTIME_DEBUG_FACTORY_SETTINGS; if (!init_header_columns(modest_runtime_get_conf(), reset)) { modest_init_uninit (); @@ -281,7 +285,7 @@ init_ui (gint argc, gchar** argv) { /* Set application name */ g_set_application_name (modest_platform_get_app_name()); - /* g_message (modest_platform_get_app_name()); */ + /* g_debug (modest_platform_get_app_name()); */ /* Init stock icons */ init_stock_icons (); @@ -564,11 +568,29 @@ init_debug_g_type (void) g_type_init_with_debug_flags (gflags); } +#ifndef DEBUG +static void +null_log(const gchar* dom, + GLogLevelFlags l, + const gchar* m, + gpointer d) +{ + return; +}; +#endif + static void init_debug_logging (void) { ModestRuntimeDebugFlags mflags; mflags = modest_runtime_get_debug_flags (); + +#ifndef DEBUG + if (! (mflags & MODEST_RUNTIME_DEBUG_CODE)) { + g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, null_log, NULL); + } +#endif + if (mflags & MODEST_RUNTIME_DEBUG_ABORT_ON_WARNING) g_log_set_always_fatal (G_LOG_LEVEL_ERROR | @@ -580,22 +602,14 @@ init_debug_logging (void) static void init_i18n (void) { - /* little trick make en_GB the fallback language, instead - * of the logical IDs - * we need the ugly ifdefs, because modest_platform_init is - * too late. - */ - const gchar *lc_messages = getenv ("LC_MESSAGES"); + const gchar *lc_messages = setlocale (LC_MESSAGES, NULL); if (!lc_messages) { setenv ("LANGUAGE", "en_GB", 1); setenv ("LC_MESSAGES", "en_GB", 1); } else { - gchar *language = g_strdup_printf ("%s:en_GB", lc_messages); - setenv ("LC_MESSAGES", language, 1); - g_free (language); + setenv ("LC_MESSAGES", lc_messages, 1); } - /* end of little trick */ bindtextdomain (GETTEXT_PACKAGE, MODEST_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -690,7 +704,7 @@ init_stock_icons (void) g_object_unref (pixbuf); } else - g_warning ("Modest: %s: failed to load %s icon", __FUNCTION__, items_names[i]); + g_warning ("%s: failed to load %s icon", __FUNCTION__, items_names[i]); } /* Drop our reference to the factory, GTK will hold a reference. */ g_object_unref (factory); @@ -727,6 +741,14 @@ 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); + /* File chooser keys */ + if (!modest_conf_key_exists (conf, MODEST_CONF_LATEST_ATTACH_FILE_PATH, NULL)) + modest_conf_set_string (conf, MODEST_CONF_LATEST_ATTACH_FILE_PATH, "", NULL); + if (!modest_conf_key_exists (conf, MODEST_CONF_LATEST_INSERT_IMAGE_PATH, NULL)) + modest_conf_set_string (conf, MODEST_CONF_LATEST_INSERT_IMAGE_PATH, "", NULL); + if (!modest_conf_key_exists (conf, MODEST_CONF_LATEST_SAVE_ATTACHMENT_PATH, NULL)) + modest_conf_set_string (conf, MODEST_CONF_LATEST_SAVE_ATTACHMENT_PATH, "", NULL); + /* Global settings */ if (!modest_conf_key_exists (conf, MODEST_CONF_AUTO_UPDATE, NULL)) modest_conf_set_bool (conf, MODEST_CONF_AUTO_UPDATE, TRUE, NULL); @@ -735,16 +757,21 @@ init_default_settings (ModestConf *conf) modest_conf_set_int (conf, MODEST_CONF_UPDATE_WHEN_CONNECTED_BY, MODEST_CONNECTED_VIA_WLAN_OR_WIMAX, NULL); if (!modest_conf_key_exists (conf, MODEST_CONF_UPDATE_INTERVAL, NULL)) - modest_conf_set_int (conf, MODEST_CONF_UPDATE_INTERVAL, MODEST_UPDATE_INTERVAL_15_MIN, NULL); + modest_conf_set_int (conf, MODEST_CONF_UPDATE_INTERVAL, MODEST_UPDATE_INTERVAL_30_MIN, NULL); if (!modest_conf_key_exists (conf, MODEST_CONF_MSG_SIZE_LIMIT, NULL)) - modest_conf_set_int (conf, MODEST_CONF_MSG_SIZE_LIMIT, 1000, NULL); + modest_conf_set_int (conf, MODEST_CONF_MSG_SIZE_LIMIT, 100, NULL); if (!modest_conf_key_exists (conf, MODEST_CONF_PLAY_SOUND_MSG_ARRIVE, NULL)) modest_conf_set_bool (conf, MODEST_CONF_PLAY_SOUND_MSG_ARRIVE, FALSE, NULL); +#ifdef MODEST_TOOLKIT_GTK + /* In Gnome port, we only allow editting plain text */ + modest_conf_set_bool (conf, MODEST_CONF_PREFER_FORMATTED_TEXT, FALSE, NULL); +#else if (!modest_conf_key_exists (conf, MODEST_CONF_PREFER_FORMATTED_TEXT, NULL)) modest_conf_set_bool (conf, MODEST_CONF_PREFER_FORMATTED_TEXT, TRUE, NULL); +#endif if (!modest_conf_key_exists (conf, MODEST_CONF_REPLY_TYPE, NULL)) modest_conf_set_int (conf, MODEST_CONF_REPLY_TYPE, MODEST_TNY_MSG_REPLY_TYPE_QUOTE, NULL);