aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations/exchange-calendar.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-calendar.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-calendar.c')
-rw-r--r--plugins/exchange-operations/exchange-calendar.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/plugins/exchange-operations/exchange-calendar.c b/plugins/exchange-operations/exchange-calendar.c
index fb7603cf34..8c9efa8af2 100644
--- a/plugins/exchange-operations/exchange-calendar.c
+++ b/plugins/exchange-operations/exchange-calendar.c
@@ -36,6 +36,7 @@
#include "e-util/e-error.h"
#include "exchange-operations.h"
+#include "exchange-folder-size-display.h"
enum {
CALENDARNAME_COL,
@@ -132,19 +133,23 @@ e_exchange_calendar_pcalendar_on_change (GtkTreeView *treeview, ESource *source)
GtkWidget *
e_exchange_calendar_pcalendar (EPlugin *epl, EConfigHookItemFactoryData *data)
{
- static GtkWidget *lbl_pcalendar, *scrw_pcalendar, *tv_pcalendar;
+ static GtkWidget *lbl_pcalendar, *scrw_pcalendar, *tv_pcalendar, *lbl_size, *lbl_size_val;
static GtkWidget *hidden = NULL;
GtkWidget *parent;
GtkTreeStore *ts_pcalendar;
GtkCellRenderer *cr_calendar;
GtkTreeViewColumn *tvc_calendar;
+ GtkListStore *model;
GPtrArray *callist;
ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target;
+ ESource *source = t->source;
EUri *uri;
ExchangeAccount *account;
gchar *ruri;
gchar *account_name;
gchar *uri_text;
+ gchar *cal_name;
+ char *folder_size;
int row, i;
if (!hidden)
@@ -184,12 +189,27 @@ e_exchange_calendar_pcalendar (EPlugin *epl, EConfigHookItemFactoryData *data)
/* REVIEW: Should this handle be freed? - Attn: surf */
account = exchange_operations_get_exchange_account ();
account_name = account->account_name;
+ cal_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, cal_name));
+ else
+ folder_size = g_strdup ("0 KB");
/* FIXME: Take care of i18n */
+ lbl_size = gtk_label_new_with_mnemonic (_("Size:"));
+ lbl_size_val = gtk_label_new_with_mnemonic (_(folder_size));
+ 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_table_attach (GTK_TABLE (parent), lbl_size, 0, 2, row, row+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (parent), lbl_size_val, 1, 3, row, row+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
+
lbl_pcalendar = gtk_label_new_with_mnemonic (_("_Location:"));
gtk_widget_show (lbl_pcalendar);
gtk_misc_set_alignment (GTK_MISC (lbl_pcalendar), 0.0, 0.5);
- gtk_table_attach (GTK_TABLE (parent), lbl_pcalendar, 0, 2, row, row+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (parent), lbl_pcalendar, 0, 2, row+1, row+2, GTK_FILL|GTK_EXPAND, 0, 0, 0);
ts_pcalendar = gtk_tree_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_STRING);
@@ -215,7 +235,7 @@ e_exchange_calendar_pcalendar (EPlugin *epl, EConfigHookItemFactoryData *data)
gtk_label_set_mnemonic_widget (GTK_LABEL (lbl_pcalendar), tv_pcalendar);
g_signal_connect (G_OBJECT (tv_pcalendar), "cursor-changed", G_CALLBACK (e_exchange_calendar_pcalendar_on_change), t->source);
- gtk_table_attach (GTK_TABLE (parent), scrw_pcalendar, 0, 2, row+1, row+2, GTK_EXPAND|GTK_FILL, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (parent), scrw_pcalendar, 0, 2, row+2, row+3, GTK_EXPAND|GTK_FILL, 0, 0, 0);
gtk_widget_show_all (scrw_pcalendar);
if (calendar_src_exists) {
@@ -243,6 +263,7 @@ e_exchange_calendar_pcalendar (EPlugin *epl, EConfigHookItemFactoryData *data)
}
g_ptr_array_free (callist, TRUE);
+ g_free (folder_size);
return tv_pcalendar;
}