* src/widgets/modest-header-view.c:
[modest] / src / widgets / modest-header-view.c
index 4499008..9e04043 100644 (file)
@@ -32,6 +32,7 @@
 #include <tny-simple-list.h>
 #include <tny-folder-monitor.h>
 #include <tny-folder-change.h>
+#include <tny-error.h>
 #include <string.h>
 
 #include <modest-header-view.h>
@@ -284,7 +285,7 @@ modest_header_view_class_init (ModestHeaderViewClass *klass)
 static void
 tny_folder_observer_init (TnyFolderObserverIface *klass)
 {
-       klass->update_func = folder_monitor_update;
+       klass->update = folder_monitor_update;
 }
 
 static GtkTreeViewColumn*
@@ -388,12 +389,15 @@ modest_header_view_set_columns (ModestHeaderView *self, const GList *columns, Tn
        g_object_set (G_OBJECT (renderer_subject),
                      "ellipsize", PANGO_ELLIPSIZE_END, "yalign", 1.0,
                      NULL);
+       gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer_subject), 1);
        g_object_set (G_OBJECT (renderer_recpt),
                      "ellipsize", PANGO_ELLIPSIZE_END, "yalign", 0.0,
                      NULL);
+       gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer_recpt), 1);
        g_object_set(G_OBJECT(renderer_compact_date_or_status),
                     "xalign", 1.0, "yalign", 0.0,
                     NULL);
+       gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer_compact_date_or_status), 1);
        g_object_set (G_OBJECT (renderer_priority),
                      "yalign", 1.0, NULL);
        g_object_set (G_OBJECT (renderer_attach),
@@ -1184,6 +1188,25 @@ folder_refreshed_cb (ModestMailOperation *mail_op,
        g_free (info);
 }
 
+static void
+refresh_folder_error_handler (ModestMailOperation *mail_op, 
+                             gpointer user_data)
+{
+       const GError *error = modest_mail_operation_get_error (mail_op);
+
+       if (error->code == TNY_SYSTEM_ERROR_MEMORY ||
+           error->code == TNY_IO_ERROR_WRITE ||
+           error->code == TNY_IO_ERROR_READ) {
+               ModestMailOperationStatus st = modest_mail_operation_get_status (mail_op);
+               /* If the mail op has been cancelled then it's not an error: don't show any message */
+               if (st != MODEST_MAIL_OPERATION_STATUS_CANCELED) {
+                       modest_platform_information_banner (NULL, NULL,
+                                                           dgettext("ke-recv",
+                                                                    "cerm_device_memory_full"));
+               }
+       }
+}
+
 void
 modest_header_view_set_folder (ModestHeaderView *self, 
                               TnyFolder *folder,
@@ -1242,7 +1265,9 @@ modest_header_view_set_folder (ModestHeaderView *self,
                info->user_data = user_data;
 
                /* Create the mail operation (source will be the parent widget) */
-               mail_op = modest_mail_operation_new (G_OBJECT(main_win));
+               mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT(main_win),
+                                                                        refresh_folder_error_handler,
+                                                                        NULL, NULL);
                modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
                                                 mail_op);