aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-popup.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2005-08-18 19:20:23 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-08-18 19:20:23 +0800
commit4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64 (patch)
treefca0bbade652c437cc8aedf4d3b12ad11ae457ec /calendar/gui/e-cal-popup.c
parent38909705f4d3f23febcee4f16114f9dc07d38f06 (diff)
downloadgsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar
gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar.gz
gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar.bz2
gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar.lz
gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar.xz
gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar.zst
gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.zip
Show the attachment bar menu items when needed.
svn path=/trunk/; revision=30157
Diffstat (limited to 'calendar/gui/e-cal-popup.c')
-rw-r--r--calendar/gui/e-cal-popup.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c
index 909b668f6e..1aafb58cad 100644
--- a/calendar/gui/e-cal-popup.c
+++ b/calendar/gui/e-cal-popup.c
@@ -347,11 +347,26 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector)
* Return value:
**/
ECalPopupTargetAttachments *
-e_cal_popup_target_new_attachments(ECalPopup *ecp, GSList *attachments)
+e_cal_popup_target_new_attachments(ECalPopup *ecp, CompEditor *editor, GSList *attachments)
{
ECalPopupTargetAttachments *t = e_popup_target_new(&ecp->popup, E_CAL_POPUP_TARGET_ATTACHMENTS, sizeof(*t));
guint32 mask = ~0;
int len = g_slist_length(attachments);
+ ECal *client = comp_editor_get_e_cal (editor);
+ CompEditorFlags flags = comp_editor_get_flags (editor);
+ gboolean read_only = FALSE;
+ GError *error = NULL;
+
+ if (!e_cal_is_read_only (client, &read_only, &error)) {
+ if (error->code != E_CALENDAR_STATUS_BUSY)
+ read_only = TRUE;
+ g_error_free (error);
+ }
+
+ if (!read_only && (!(flags & COMP_EDITOR_MEETING) ||
+ (flags & COMP_EDITOR_NEW_ITEM) ||
+ (flags & COMP_EDITOR_USER_ORG)))
+ mask &= ~ E_CAL_POPUP_ATTACHMENTS_MODIFY;
t->attachments = attachments;
if (len > 0)
@@ -423,6 +438,7 @@ static const EPopupHookTargetMask ecalph_source_masks[] = {
static const EPopupHookTargetMask ecalph_attachments_masks[] = {
{ "one", E_CAL_POPUP_ATTACHMENTS_ONE },
{ "many", E_CAL_POPUP_ATTACHMENTS_MANY },
+ { "modify", E_CAL_POPUP_ATTACHMENTS_MODIFY },
{ 0 }
};