* Fixes NB#103682 improved the region selection in the easysetup wizard
[modest] / src / hildon2 / modest-platform.c
index 77695e2..cf29aca 100644 (file)
@@ -125,7 +125,7 @@ on_modest_conf_update_interval_changed (ModestConf* self,
 static gboolean
 check_required_files (void)
 {
-       FILE *mcc_file = modest_maemo_open_mcc_mapping_file ();
+       FILE *mcc_file = modest_maemo_open_mcc_mapping_file (NULL);
        if (!mcc_file) {
                g_printerr ("modest: check for mcc file failed\n");
                return FALSE;
@@ -724,7 +724,11 @@ static gchar *
 folder_store_get_display_name (TnyFolderStore *store)
 {
        if (TNY_IS_ACCOUNT (store)) {
-               return g_strdup (tny_account_get_name (TNY_ACCOUNT (store)));
+               if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (store)))
+                       return modest_conf_get_string (modest_runtime_get_conf(),
+                                                      MODEST_CONF_DEVICE_NAME, NULL);
+               else
+                       return g_strdup (tny_account_get_name (TNY_ACCOUNT (store)));
        } else {
                gchar *fname;
                TnyFolderType type = TNY_FOLDER_TYPE_UNKNOWN;
@@ -1455,7 +1459,7 @@ modest_platform_on_new_headers_received (TnyList *header_list,
                g_warning ("%s: header list is empty", __FUNCTION__);
                return;
        }
-       
+
        if (!show_visual) {
                 modest_platform_push_email_notification ();
                /* We do a return here to avoid indentation with an else */
@@ -1468,8 +1472,8 @@ modest_platform_on_new_headers_received (TnyList *header_list,
        GSList *notifications_list = NULL;
 
        /* Get previous notifications ids */
-       notifications_list = modest_conf_get_list (modest_runtime_get_conf (), 
-                                                  MODEST_CONF_NOTIFICATION_IDS, 
+       notifications_list = modest_conf_get_list (modest_runtime_get_conf (),
+                                                  MODEST_CONF_NOTIFICATION_IDS,
                                                   MODEST_CONF_VALUE_INT, NULL);
 
        iter = tny_list_create_iterator (header_list);
@@ -1510,6 +1514,7 @@ modest_platform_on_new_headers_received (TnyList *header_list,
                /* Play sound if the user wants. Show the LED
                   pattern. Show and play just one */
                if (G_UNLIKELY (first_notification)) {
+                       TnyAccount *account;
 
                        first_notification = FALSE;
 
@@ -1518,7 +1523,16 @@ modest_platform_on_new_headers_received (TnyList *header_list,
                                                            "dialog-type", 4);
                        notify_notification_set_hint_string(NOTIFY_NOTIFICATION (notification),
                                                            "led-pattern",
-                                                           MODEST_NEW_MAIL_LIGHTING_PATTERN);                  
+                                                           MODEST_NEW_MAIL_LIGHTING_PATTERN);
+
+                       /* Set the account of the headers */
+                       account = tny_folder_get_account (folder);
+                       if (account) {
+                               notify_notification_set_hint_string(NOTIFY_NOTIFICATION (notification),
+                                                                   "email-account",
+                                                                   tny_account_get_id (account));
+                               g_object_unref (account);
+                       }
                }
 
                /* Notify. We need to do this in an idle because this function
@@ -1865,7 +1879,7 @@ on_cert_dialog_response (GtkDialog *dialog, gint response_id,  const gchar* cert
                g_signal_stop_emission_by_name (dialog, "response");
 
                msg = g_strdup_printf (_("mcen_ni_view_unknown_certificate"), cert);    
-               note = hildon_note_new_information (GTK_WINDOW(dialog), msg);
+               note = hildon_note_new_information (NULL, msg);
                gtk_dialog_run (GTK_DIALOG(note));
                gtk_widget_destroy (note);
        }
@@ -2382,6 +2396,14 @@ _modest_platform_play_email_tone (void)
        mail_volume = profile_get_value (active_profile, PROFILE_MAIL_VOLUME);
        mail_volume_int = profile_parse_int (mail_volume);
 
+       if (mail_tone && !strstr (mail_tone, "/")) {
+               gchar *tmp;
+
+               tmp = g_strconcat ("/usr/share/sounds", mail_tone, NULL);
+               g_free (mail_tone);
+               mail_tone = tmp;
+       }
+
        if (mail_volume_int > 0) {
 
                if ((ret = ca_context_create(&ca_con)) != CA_SUCCESS) {
@@ -2462,8 +2484,16 @@ move_to_dialog_show_folders (GtkWidget *dialog, TnyFolderStore *folder_store)
 
        account = TNY_ACCOUNT (folder_store);
        if (modest_tny_account_is_virtual_local_folders (account)) {
+               gchar *device_name;
                account_id = tny_account_get_id (account);
-               selection_label_text = g_strconcat (tny_account_get_name (account), "/", NULL);
+               device_name = modest_conf_get_string (modest_runtime_get_conf(),
+                                                     MODEST_CONF_DEVICE_NAME, NULL);
+               if (device_name) {
+                       selection_label_text = g_strconcat (device_name, "/", NULL);
+                       g_free (device_name);
+               } else {
+                       selection_label_text = g_strconcat (tny_account_get_name (account), "/", NULL);
+               }
        } else if (modest_tny_account_is_memory_card_account (account)) {
                account_id = tny_account_get_id (account);
                selection_label_text = g_strconcat (tny_account_get_name (account), "/", NULL);