- ModestHeaderView *header_view;
- TnyList *header_list;
- TnyIterator *iter;
- GtkTreeModel *model;
-
- priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
-
- header_view = modest_widget_factory_get_header_view (priv->widget_factory);
- header_list = modest_header_view_get_selected_headers (header_view);
-
- if (header_list) {
- iter = tny_list_create_iterator (header_list);
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (header_view));
- if (GTK_IS_TREE_MODEL_SORT (model))
- model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model));
- do {
- TnyHeader *header;
- ModestMailOperation *mail_op;
-
- header = TNY_HEADER (tny_iterator_get_current (iter));
- /* TODO: thick grain mail operation involving
- a list of objects. Composite pattern ??? */
- mail_op = modest_mail_operation_new ();
-
- /* Move to trash */
- modest_mail_operation_remove_msg (mail_op, header, TRUE);
-
- /* Remove from tree model */
- tny_list_remove (TNY_LIST (model), G_OBJECT (header));
-
- g_object_unref (G_OBJECT (mail_op));
- g_object_unref (header);
- tny_iterator_next (iter);
-
- } while (!tny_iterator_is_done (iter));
- }
-}
-
-
-/* Our menu, an array of GtkItemFactoryEntry structures that defines each menu item */
-static GtkItemFactoryEntry menu_items[] = {
- { "/_File", NULL, NULL, 0, "<Branch>", NULL },
- { "/File/_New", "<control>N", NULL, 0, "<StockItem>", GTK_STOCK_NEW },
- { "/File/_Open", "<control>O", NULL, 0, "<StockItem>", GTK_STOCK_OPEN },
- { "/File/_Save", "<control>S", NULL, 0, "<StockItem>", GTK_STOCK_SAVE },
- { "/File/Save _As", NULL, NULL, 0, "<Item>", NULL },
- { "/File/sep1", NULL, NULL, 0, "<Separator>", NULL },
- { "/File/_Quit", "<CTRL>Q", on_menu_quit, 0, "<StockItem>", GTK_STOCK_QUIT },
-
- { "/_Edit", NULL, NULL, 0, "<Branch>", NULL },
- { "/Edit/_Undo", "<CTRL>Z", NULL, 0, "<StockItem>", GTK_STOCK_UNDO },
- { "/Edit/_Redo", "<shift><CTRL>Z", NULL, 0, "<StockItem>", GTK_STOCK_REDO },
- { "/File/sep1", NULL, NULL, 0, "<Separator>", NULL },
- { "/Edit/Cut", "<control>X", NULL, 0, "<StockItem>", GTK_STOCK_CUT },
- { "/Edit/Copy", "<CTRL>C", NULL, 0, "<StockItem>", GTK_STOCK_COPY },
- { "/Edit/Paste", NULL, NULL, 0, "<StockItem>", GTK_STOCK_PASTE},
- { "/Edit/sep1", NULL, NULL, 0, "<Separator>", NULL },
- { "/Edit/Delete", "<CTRL>Q", NULL, 0, "<Item>" ,NULL},
- { "/Edit/Select all", "<CTRL>A", NULL, 0, "<Item>" ,NULL},
- { "/Edit/Deelect all", "<Shift><CTRL>A", NULL, 0, "<Item>" ,NULL},
-
- { "/_Actions", NULL, NULL, 0, "<Branch>" ,NULL},
- { "/Actions/_New Message", NULL, on_menu_new_message, 0, "<Item>",NULL },
- { "/Actions/_Reply", NULL, on_menu_reply_forward, 1, "<Item>" ,NULL},
- { "/Actions/_Forward", NULL, on_menu_reply_forward, 3, "<Item>" ,NULL},
- { "/Actions/_Bounce", NULL, NULL, 0, "<Item>",NULL },