Added to folder view a reference to folder to move for hiding on move.
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 19 Feb 2009 06:46:00 +0000 (06:46 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 19 Feb 2009 06:46:00 +0000 (06:46 +0000)
pmo-trunk-r7573

src/widgets/modest-folder-view.c
src/widgets/modest-folder-view.h

index 2a956e2..4276dd7 100644 (file)
@@ -235,6 +235,7 @@ struct _ModestFolderViewPrivate {
 
        gboolean  reselect; /* we use this to force a reselection of the INBOX */
        gboolean  show_non_move;
+       TnyList   *list_to_move;
        gboolean  reexpand; /* next time we expose, we'll expand all root folders */
 
        GtkCellRenderer *messages_renderer;
@@ -1148,6 +1149,7 @@ modest_folder_view_init (ModestFolderView *obj)
        priv->filter = MODEST_FOLDER_VIEW_FILTER_NONE;
        priv->reselect = FALSE;
        priv->show_non_move = TRUE;
+       priv->list_to_move = NULL;
 
        /* Build treeview */
        add_columns (GTK_WIDGET (obj));
@@ -1261,6 +1263,11 @@ modest_folder_view_finalize (GObject *obj)
                priv->cur_folder_store = NULL;
        }
 
+       if (priv->list_to_move) {
+               g_object_unref (priv->list_to_move);
+               priv->list_to_move = NULL;
+       }
+
        /* Clear hidding array created by cut operation */
        _clear_hidding_filter (MODEST_FOLDER_VIEW (obj));
 
@@ -3668,3 +3675,21 @@ modest_folder_view_any_folder_fulfils_rules (ModestFolderView *self,
 
        return fulfil;
 }
+
+void 
+modest_folder_view_set_list_to_move (ModestFolderView *self,
+                                    TnyList *list)
+{
+       ModestFolderViewPrivate *priv;
+
+       g_return_if_fail (MODEST_IS_FOLDER_VIEW (self));
+       priv = MODEST_FOLDER_VIEW_GET_PRIVATE (self);
+
+       if (priv->list_to_move)
+               g_object_unref (priv->list_to_move);
+
+       if (list)
+               g_object_ref (list);
+
+       priv->list_to_move = list;
+}
index 5ecd1ad..cada9fc 100644 (file)
@@ -297,6 +297,17 @@ void modest_folder_view_unset_filter (ModestFolderView *self,
 gboolean modest_folder_view_any_folder_fulfils_rules (ModestFolderView *self,
                                                      ModestTnyFolderRules rules);
 
+/**
+ * modest_folder_view_set_list_to_move:
+ * @self: a #ModestFolderView
+ * @list: a #TnyList, or %NULL for unsetting the current list.
+ * 
+ * list of folders or messages we're moving. This has some effects on 
+ * "show_non_move_to".
+ */
+void modest_folder_view_set_list_to_move (ModestFolderView *self,
+                                         TnyList *list);
+
 G_END_DECLS
 
 #endif /* __MODEST_FOLDER_VIEW_H__ */