aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-08-15 02:50:46 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-08-15 02:50:46 +0800
commite579dc553cd47efae4c0064c9bad22fbbc11300e (patch)
treedd29ca061e8960b28fb76a7c580fccc23702b129 /tests
parent920be6e190bf0dd0056a71695cf3350625e8318c (diff)
downloadgsoc2013-evolution-e579dc553cd47efae4c0064c9bad22fbbc11300e.tar
gsoc2013-evolution-e579dc553cd47efae4c0064c9bad22fbbc11300e.tar.gz
gsoc2013-evolution-e579dc553cd47efae4c0064c9bad22fbbc11300e.tar.bz2
gsoc2013-evolution-e579dc553cd47efae4c0064c9bad22fbbc11300e.tar.lz
gsoc2013-evolution-e579dc553cd47efae4c0064c9bad22fbbc11300e.tar.xz
gsoc2013-evolution-e579dc553cd47efae4c0064c9bad22fbbc11300e.tar.zst
gsoc2013-evolution-e579dc553cd47efae4c0064c9bad22fbbc11300e.zip
Implemented deletion/expunge mechanism.
1999-08-14 bertrand <Bertrand.Guiheneuf@aful.org> * tests/ui-tests/store_listing.c (delete_selected_messages): (expunge_selected_folders): Implemented deletion/expunge mechanism. * camel/camel-folder.c (_get_message): Added some debug info. * camel/providers/MH/camel-mh-folder.c (_expunge): implemented and tested. * camel/camel-mime-message.c (_set_flag): changed the old braindead implementation. boolean are inserted in the flag hash table casted as gpointers. * camel/camel-mime-message.c: indentation fix svn path=/trunk/; revision=1114
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-tests/store_listing.c72
-rw-r--r--tests/ui-tests/store_listing.glade82
2 files changed, 144 insertions, 10 deletions
diff --git a/tests/ui-tests/store_listing.c b/tests/ui-tests/store_listing.c
index 7b5a6e9133..02a5066164 100644
--- a/tests/ui-tests/store_listing.c
+++ b/tests/ui-tests/store_listing.c
@@ -157,8 +157,64 @@ add_mail_store (const gchar *store_url)
}
+static void
+delete_selected_messages ()
+{
+ GtkWidget *message_clist;
+ gint current_row;
+ GList *selected;
+ gint selected_row;
-/* ----- */
+ CamelMimeMessage *message;
+ message_clist = glade_xml_get_widget (xml, "message-clist");
+ selected = GTK_CLIST (message_clist)->selection;
+ while (selected) {
+ selected_row = GPOINTER_TO_INT (selected->data);
+ message = CAMEL_MIME_MESSAGE (gtk_clist_get_row_data (GTK_CLIST (message_clist), selected_row));
+ camel_mime_message_set_flag (message, "DELETED", TRUE);
+ selected = selected->next;
+ }
+
+}
+
+
+static void
+expunge_selected_folders ()
+{
+ GtkWidget *mailbox_and_store_tree;
+ CamelFolder *folder;
+ GtkCTreeNode* selected_node;
+ GList *selected;
+ const gchar *folder_name;
+
+ mailbox_and_store_tree = glade_xml_get_widget (xml, "store-and-mailbox-tree");
+
+ selected = GTK_CLIST (mailbox_and_store_tree)->selection;
+ while (selected) {
+
+ selected_node= GTK_CTREE_NODE (selected->data);
+ folder = CAMEL_FOLDER (gtk_ctree_node_get_row_data (GTK_CTREE (mailbox_and_store_tree),
+ selected_node));
+ if (folder && IS_CAMEL_FOLDER (folder)) {
+ folder_name = camel_folder_get_name (folder);
+ printf ("folder to expunge : %s\n", folder_name);
+ camel_folder_expunge (folder);
+ /* reshowing the folder this way is uggly
+ but allows to check the message are
+ correctly renoved and the cache works correctly */
+ show_folder_messages (folder);
+
+ } else {
+ printf ("A selected node is a store\n");
+ }
+
+ selected = selected->next;
+ }
+
+
+}
+
+/* ----- libglade callbacks */
void
on_exit_activate (GtkWidget *widget, void *data)
{
@@ -202,8 +258,22 @@ on_new_store_activate (GtkWidget *widget, void *data)
}
+void
+on_expunge_activate (GtkWidget *widget, void *data)
+{
+ expunge_selected_folders ();
+}
+
+
+void
+on_message_delete_activate (GtkWidget *widget, void *data)
+{
+ delete_selected_messages();
+}
+
+/* ----- init */
int
main(int argc, char *argv[])
{
diff --git a/tests/ui-tests/store_listing.glade b/tests/ui-tests/store_listing.glade
index d01d408db4..2a90aa327a 100644
--- a/tests/ui-tests/store_listing.glade
+++ b/tests/ui-tests/store_listing.glade
@@ -79,6 +79,35 @@
<name>file1_menu</name>
<widget>
+ <class>GtkMenuItem</class>
+ <name>separator1</name>
+ <right_justify>False</right_justify>
+ </widget>
+
+ <widget>
+ <class>GtkPixmapMenuItem</class>
+ <name>exit</name>
+ <signal>
+ <name>activate</name>
+ <handler>on_exit_activate</handler>
+ <last_modification_time>Tue, 10 Aug 1999 12:06:35 GMT</last_modification_time>
+ </signal>
+ <stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>store2</name>
+ <label>_Store</label>
+ <right_justify>False</right_justify>
+
+ <widget>
+ <class>GtkMenu</class>
+ <name>store2_menu</name>
+
+ <widget>
<class>GtkPixmapMenuItem</class>
<name>new_store</name>
<signal>
@@ -89,22 +118,60 @@
<stock_item>GNOMEUIINFO_MENU_NEW_ITEM</stock_item>
<label>_New store</label>
</widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>folder1</name>
+ <signal>
+ <name>activate</name>
+ <handler>on_folder1_activate</handler>
+ <last_modification_time>Sat, 14 Aug 1999 17:23:25 GMT</last_modification_time>
+ </signal>
+ <label>Folder</label>
+ <right_justify>False</right_justify>
+
+ <widget>
+ <class>GtkMenu</class>
+ <name>folder1_menu</name>
<widget>
- <class>GtkMenuItem</class>
- <name>separator1</name>
+ <class>GtkPixmapMenuItem</class>
+ <name>expunge</name>
+ <signal>
+ <name>activate</name>
+ <handler>on_expunge_activate</handler>
+ <last_modification_time>Sat, 14 Aug 1999 16:36:03 GMT</last_modification_time>
+ </signal>
+ <label>_Expunge</label>
<right_justify>False</right_justify>
+ <stock_icon>GNOME_STOCK_MENU_CONVERT</stock_icon>
</widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>message_menu</name>
+ <label>_Message</label>
+ <right_justify>False</right_justify>
+
+ <widget>
+ <class>GtkMenu</class>
+ <name>message_menu_menu</name>
<widget>
<class>GtkPixmapMenuItem</class>
- <name>exit</name>
+ <name>message_delete</name>
<signal>
<name>activate</name>
- <handler>on_exit_activate</handler>
- <last_modification_time>Tue, 10 Aug 1999 12:06:35 GMT</last_modification_time>
+ <handler>on_message_delete_activate</handler>
+ <last_modification_time>Sat, 14 Aug 1999 14:54:04 GMT</last_modification_time>
</signal>
- <stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item>
+ <label>_Delete</label>
+ <right_justify>False</right_justify>
+ <stock_icon>GNOME_STOCK_MENU_TRASH</stock_icon>
</widget>
</widget>
</widget>
@@ -337,9 +404,6 @@
<widget>
<class>GtkLabel</class>
<name>new_store_label</name>
- <style>
- <style_font>-adobe-helvetica-bold-r-normal-*-*-140-*-*-p-*-iso8859-1</style_font>
- </style>
<label>Enter complete store URL</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>