aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations/exchange-contacts.c
diff options
context:
space:
mode:
authorSarfraaz Ahmed <asarfraaz@novell.com>2005-07-25 15:13:47 +0800
committerAhmed Sarfraaz <sarfraaz@src.gnome.org>2005-07-25 15:13:47 +0800
commitfacdb640ee5024dfd5e68ed1956279356b9b0222 (patch)
tree8e40a537ccae43a13ec440a90397a59423fe857a /plugins/exchange-operations/exchange-contacts.c
parent361a4ff8955acfa250dc4a804b1ee5a8628d6260 (diff)
downloadgsoc2013-evolution-facdb640ee5024dfd5e68ed1956279356b9b0222.tar
gsoc2013-evolution-facdb640ee5024dfd5e68ed1956279356b9b0222.tar.gz
gsoc2013-evolution-facdb640ee5024dfd5e68ed1956279356b9b0222.tar.bz2
gsoc2013-evolution-facdb640ee5024dfd5e68ed1956279356b9b0222.tar.lz
gsoc2013-evolution-facdb640ee5024dfd5e68ed1956279356b9b0222.tar.xz
gsoc2013-evolution-facdb640ee5024dfd5e68ed1956279356b9b0222.tar.zst
gsoc2013-evolution-facdb640ee5024dfd5e68ed1956279356b9b0222.zip
Takes care of displaying the folder size for mail folders. Now also adds
2005-07-25 Sarfraaz Ahmed <asarfraaz@novell.com> * exchange-account-setup.c (org_gnome_exchange_show_folder_size_factory): Takes care of displaying the folder size for mail folders. * exchange-calendar.c (e_exchange_calendar_pcalendar): Now also adds the calendar size in the properties page * exchange-contacts.c (e_exchange_contacts_pcontacts): Now also adds the addressbook size in the properties page. * exchange-folder-size-display.c (exchange_folder_size_get_val) : Fetch the folder size of a particular exchange folder. * exchange-folder-size-display.h : Similar * org-gnome-exchange-operations.eplug.in : Added the hook for the mail properties page. svn path=/trunk/; revision=29878
Diffstat (limited to 'plugins/exchange-operations/exchange-contacts.c')
-rw-r--r--plugins/exchange-operations/exchange-contacts.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/plugins/exchange-operations/exchange-contacts.c b/plugins/exchange-operations/exchange-contacts.c
index 0dc53bf30f..3f2d5d3de2 100644
--- a/plugins/exchange-operations/exchange-contacts.c
+++ b/plugins/exchange-operations/exchange-contacts.c
@@ -38,6 +38,7 @@
#include "e-util/e-error.h"
#include "exchange-operations.h"
+#include "exchange-folder-size-display.h"
enum {
CONTACTSNAME_COL,
@@ -119,15 +120,17 @@ e_exchange_contacts_pcontacts_on_change (GtkTreeView *treeview, ESource *source)
GtkWidget *
e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
{
- static GtkWidget *lbl_pcontacts, *scrw_pcontacts, *tv_pcontacts, *vb_pcontacts;
+ static GtkWidget *lbl_pcontacts, *scrw_pcontacts, *tv_pcontacts, *vb_pcontacts, *lbl_size, *lbl_size_val, *hbx_size;
GtkTreeStore *ts_pcontacts;
GtkCellRenderer *cr_contacts;
GtkTreeViewColumn *tvc_contacts;
+ GtkListStore *model;
GPtrArray *conlist;
gchar *ruri, *account_name, *uri_text;
ExchangeAccount *account;
int i;
+ char *folder_size, *abook_name;
EABConfigTargetSource *t = (EABConfigTargetSource *) data->target;
ESource *source = t->source;
@@ -144,7 +147,9 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
g_free (uri_text);
- if (strcmp (e_source_peek_relative_uri (source), e_source_peek_uid (source))) {
+ if (e_source_peek_relative_uri (source) &&
+ e_source_peek_uid (source) &&
+ (strcmp (e_source_peek_relative_uri (source), e_source_peek_uid (source)))) {
contacts_src_exists = TRUE;
g_free (contacts_old_src_uri);
contacts_old_src_uri = g_strdup (e_source_peek_relative_uri (source));
@@ -156,11 +161,28 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
account = exchange_operations_get_exchange_account ();
account_name = account->account_name;
+ abook_name = e_source_peek_name (source);
+ model = exchange_account_folder_size_get_model (account);
+ if (model)
+ folder_size = g_strdup_printf ("%s KB", exchange_folder_size_get_val (model, abook_name));
+ else
+ folder_size = g_strdup_printf ("0 KB");
vb_pcontacts = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (data->parent), vb_pcontacts);
/* FIXME: Take care of i18n */
+ lbl_size = gtk_label_new_with_mnemonic (_("Size:"));
+ lbl_size_val = gtk_label_new_with_mnemonic (_(folder_size));
+ hbx_size = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (hbx_size, lbl_size, FALSE, TRUE, 0);
+ gtk_box_pack_start (hbx_size, lbl_size_val, FALSE, TRUE, 10);
+ gtk_widget_show (lbl_size);
+ gtk_widget_show (lbl_size_val);
+ gtk_misc_set_alignment (GTK_MISC (lbl_size), 0.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (lbl_size_val), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vb_pcontacts), hbx_size, FALSE, FALSE, 0);
+
lbl_pcontacts = gtk_label_new_with_mnemonic (_("_Location:"));
gtk_widget_show (lbl_pcontacts);
gtk_misc_set_alignment (GTK_MISC (lbl_pcontacts), 0.0, 0.5);
@@ -223,6 +245,7 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
}
g_ptr_array_free (conlist, TRUE);
+ g_free (folder_size);
return vb_pcontacts;
}