diff options
author | Sarfraaz Ahmed <asarfraaz@novell.com> | 2005-07-25 16:40:00 +0800 |
---|---|---|
committer | Ahmed Sarfraaz <sarfraaz@src.gnome.org> | 2005-07-25 16:40:00 +0800 |
commit | 88f3cfaa05579162f1e7a7b3d06954a16f2e7acd (patch) | |
tree | 8dbffd34cda2b3fed9e94464b3565fa036c07f47 /plugins/exchange-operations/exchange-contacts.c | |
parent | abee01230b62448ce5e021d4af98f92a9681eaa2 (diff) | |
download | gsoc2013-evolution-88f3cfaa05579162f1e7a7b3d06954a16f2e7acd.tar.gz gsoc2013-evolution-88f3cfaa05579162f1e7a7b3d06954a16f2e7acd.tar.zst gsoc2013-evolution-88f3cfaa05579162f1e7a7b3d06954a16f2e7acd.zip |
Add the size label only if the calendar exists. Add the size label only if
2005-07-25 Sarfraaz Ahmed <asarfraaz@novell.com>
* exchange-calendar.c (e_exchange_calendar_pcalendar) : Add the size
label only if the calendar exists.
* exchange-contacts.c (e_exchange_contacts_pcontacts) : Add the size
label only if the addressbook exists.
svn path=/trunk/; revision=29884
Diffstat (limited to 'plugins/exchange-operations/exchange-contacts.c')
-rw-r--r-- | plugins/exchange-operations/exchange-contacts.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/plugins/exchange-operations/exchange-contacts.c b/plugins/exchange-operations/exchange-contacts.c index 3f2d5d3de2..a08df5798e 100644 --- a/plugins/exchange-operations/exchange-contacts.c +++ b/plugins/exchange-operations/exchange-contacts.c @@ -161,27 +161,32 @@ 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"); - + hbx_size = NULL; + if (contacts_src_exists) { + 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"); + + /* 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); + g_free (folder_size); + } 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); + if (hbx_size) + 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); @@ -245,7 +250,6 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data) } g_ptr_array_free (conlist, TRUE); - g_free (folder_size); return vb_pcontacts; } |