aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-12 08:17:17 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-12 08:17:17 +0800
commit8324d0e39d9036ee2fb9fed89764c70b97141564 (patch)
tree2d66c536bf85cf44622a738fc5dfc3d684d4cffc /mail/em-folder-tree.c
parent4a8c4a32525bc239c6ee237aacb3b98439fa4c0f (diff)
downloadgsoc2013-evolution-8324d0e39d9036ee2fb9fed89764c70b97141564.tar.gz
gsoc2013-evolution-8324d0e39d9036ee2fb9fed89764c70b97141564.tar.zst
gsoc2013-evolution-8324d0e39d9036ee2fb9fed89764c70b97141564.zip
add total + unread counts to properties page.
2004-01-09 Not Zed <NotZed@Ximian.com> * em-folder-tree.c (emft_popup_properties_got_folder): add total + unread counts to properties page. svn path=/trunk/; revision=24158
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index ed24396fdf..45e8b3f48f 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1361,12 +1361,14 @@ emft_popup_properties_got_folder (char *uri, CamelFolder *folder, void *data)
GSList *list, *l;
gint32 count, i;
char *name;
- int row = 1;
+ char countstr[16];
+ int row = 0, total=0, unread=0;
if (folder == NULL)
return;
- camel_object_get (folder, NULL, CAMEL_FOLDER_PROPERTIES, &list, CAMEL_FOLDER_NAME, &name, NULL);
+ camel_object_get (folder, NULL, CAMEL_FOLDER_PROPERTIES, &list, CAMEL_FOLDER_NAME, &name,
+ CAMEL_FOLDER_TOTAL, &total, CAMEL_FOLDER_UNREAD, &unread, NULL);
dialog = gtk_dialog_new_with_buttons (_("Folder properties"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1378,20 +1380,46 @@ emft_popup_properties_got_folder (char *uri, CamelFolder *folder, void *data)
gtk_widget_show (w);
gtk_box_pack_start ((GtkBox *) ((GtkDialog *) dialog)->vbox, w, TRUE, TRUE, 6);
- table = gtk_table_new (g_slist_length (list) + 1, 2, FALSE);
+ table = gtk_table_new (g_slist_length (list) + 3, 2, FALSE);
gtk_widget_show (table);
gtk_container_add ((GtkContainer *) w, table);
-
+
+ /* TODO: can this be done in a loop? */
label = gtk_label_new (_("Folder Name"));
gtk_widget_show (label);
gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 0, 1, 0, 1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
label = gtk_label_new (name);
gtk_widget_show (label);
gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ row++;
+
+ label = gtk_label_new (_("Total messages"));
+ gtk_widget_show (label);
+ gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5);
+ gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+
+ sprintf(countstr, "%d", total);
+ label = gtk_label_new (countstr);
+ gtk_widget_show (label);
+ gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
+ gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ row++;
+
+ label = gtk_label_new (_("Unread messages"));
+ gtk_widget_show (label);
+ gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5);
+ gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ sprintf(countstr, "%d", unread);
+ label = gtk_label_new (countstr);
+ gtk_widget_show (label);
+ gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
+ gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ row++;
+
/* build an arggetv/argv to retrieve/store the results */
count = g_slist_length (list);
arggetv = g_malloc0 (sizeof (*arggetv) + (count - CAMEL_ARGV_MAX) * sizeof (arggetv->argv[0]));