aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ui-tests
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>2000-02-10 05:52:48 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-02-10 05:52:48 +0800
commit5319c1eb5b62e76ba4417d309b366b8af78d21d3 (patch)
tree4d7dabd1dc80124e206834c57d8bc3545f1306bf /tests/ui-tests
parent61dc2c8700c2c47111847358d11f182678e0887f (diff)
downloadgsoc2013-evolution-5319c1eb5b62e76ba4417d309b366b8af78d21d3.tar
gsoc2013-evolution-5319c1eb5b62e76ba4417d309b366b8af78d21d3.tar.gz
gsoc2013-evolution-5319c1eb5b62e76ba4417d309b366b8af78d21d3.tar.bz2
gsoc2013-evolution-5319c1eb5b62e76ba4417d309b366b8af78d21d3.tar.lz
gsoc2013-evolution-5319c1eb5b62e76ba4417d309b366b8af78d21d3.tar.xz
gsoc2013-evolution-5319c1eb5b62e76ba4417d309b366b8af78d21d3.tar.zst
gsoc2013-evolution-5319c1eb5b62e76ba4417d309b366b8af78d21d3.zip
show the containers and the containees (get_message_tree_ctrl): call
2000-02-09 bertrand <Bertrand.Guiheneuf@aful.org> * tests/ui-tests/message-browser.c (handle_tree_item): show the containers and the containees (get_message_tree_ctrl): call handle_tree_item on the message itself svn path=/trunk/; revision=1714
Diffstat (limited to 'tests/ui-tests')
-rw-r--r--tests/ui-tests/message-browser.c72
1 files changed, 47 insertions, 25 deletions
diff --git a/tests/ui-tests/message-browser.c b/tests/ui-tests/message-browser.c
index 75cd7f9e2c..07bb52700b 100644
--- a/tests/ui-tests/message-browser.c
+++ b/tests/ui-tests/message-browser.c
@@ -30,36 +30,58 @@ handle_tree_item (CamelDataWrapper* object, GtkWidget* tree_ctrl)
{
GtkWidget* tree_item;
gchar* label = gmime_content_field_get_mime_type (object->mime_type);
-
+
+ CamelDataWrapper* containee;
+ GtkWidget* containee_tree_item;
+ gchar* containee_label;
+
+ GtkWidget* subtree = NULL;
+
+
tree_item = gtk_tree_item_new_with_label (label);
gtk_tree_append (GTK_TREE (tree_ctrl), tree_item);
- if (CAMEL_IS_MULTIPART (object))
- {
- CamelMultipart* multipart = CAMEL_MULTIPART (object);
- GtkWidget* subtree = NULL;
- int max_multiparts = camel_multipart_get_number (multipart);
- int i;
+ gtk_widget_show(tree_item);
- g_print ("found a multipart w/ %d parts\n", max_multiparts);
+ containee =
+ camel_medium_get_content_object (CAMEL_MEDIUM (object));
+
+ if (containee) {
+ containee_label = camel_data_wrapper_get_mime_type (containee);
+
+ subtree = gtk_tree_new();
+ containee_tree_item = gtk_tree_item_new_with_label (containee_label);
+ gtk_tree_append (GTK_TREE (subtree), containee_tree_item);
+
+ gtk_tree_item_set_subtree (GTK_TREE_ITEM(tree_item),
+ GTK_WIDGET (subtree));
+ gtk_widget_show(containee_tree_item);
+
+ if (CAMEL_IS_MULTIPART (containee))
+ {
+ CamelMultipart* multipart = CAMEL_MULTIPART (containee);
+ int max_multiparts = camel_multipart_get_number (multipart);
+ int i;
+
+ g_print ("found a multipart w/ %d parts\n", max_multiparts);
+
+ if (max_multiparts > 0) {
+ subtree = gtk_tree_new();
+ gtk_tree_item_set_subtree (GTK_TREE_ITEM(containee_tree_item),
+ GTK_WIDGET (subtree));
+ }
+
+ for (i = 0; i < max_multiparts; i++) {
+ CamelMimeBodyPart* body_part =
+ camel_multipart_get_part (multipart, i);
- if (max_multiparts > 0) {
- subtree = gtk_tree_new();
- gtk_tree_item_set_subtree (GTK_TREE_ITEM(tree_item),
- GTK_WIDGET (subtree));
- }
-
- for (i = 0; i < max_multiparts; i++) {
- CamelMimeBodyPart* body_part =
- camel_multipart_get_part (multipart, i);
-
- g_print ("handling part %d\n", i);
- handle_tree_item (CAMEL_DATA_WRAPPER (body_part),
- GTK_WIDGET (subtree));
- }
+ g_print ("handling part %d\n", i);
+ handle_tree_item (CAMEL_DATA_WRAPPER (body_part),
+ GTK_WIDGET (subtree));
+ }
+ }
}
-
- gtk_widget_show(tree_item);
+
}
@@ -81,7 +103,7 @@ get_message_tree_ctrl (CamelMimeMessage* message)
/*
* Recursively insert tree items in the tree
*/
- handle_tree_item (message_contents, tree_ctrl);
+ handle_tree_item (CAMEL_DATA_WRAPPER (message), tree_ctrl);
return scroll_wnd;
}