aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view.c
diff options
context:
space:
mode:
author7 <jpr@ximian.com>2002-07-18 01:23:49 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-07-18 01:23:49 +0800
commit1ea6884e825cb2e30787f6f6d0c7911647473945 (patch)
tree7b31a4699adb7dae215d1eb03bef4e89f6d235c3 /calendar/gui/e-week-view.c
parent6dee50394a99a1d1e2e95309764bfedbcd95275d (diff)
downloadgsoc2013-evolution-1ea6884e825cb2e30787f6f6d0c7911647473945.tar
gsoc2013-evolution-1ea6884e825cb2e30787f6f6d0c7911647473945.tar.gz
gsoc2013-evolution-1ea6884e825cb2e30787f6f6d0c7911647473945.tar.bz2
gsoc2013-evolution-1ea6884e825cb2e30787f6f6d0c7911647473945.tar.lz
gsoc2013-evolution-1ea6884e825cb2e30787f6f6d0c7911647473945.tar.xz
gsoc2013-evolution-1ea6884e825cb2e30787f6f6d0c7911647473945.tar.zst
gsoc2013-evolution-1ea6884e825cb2e30787f6f6d0c7911647473945.zip
use util function to see if the user is the organizer
2002-07-17 <jpr@ximian.com> * gui/calendar-model.c (calendar_model_value_at): use util function to see if the user is the organizer * gui/dialogs/cancel-comp.c (cancel_component_dialog): add deleting proto to indicate whether cancelling or deleting is the primary operation * gui/dialogs/cancel-comp.h: update proto * gui/dialogs/comp-editor.c (delete_cmd): offer to cancel * gui/dialogs/task-editor.c (cancel_task_cmd): call cancel_component_dialog with new param * gui/dialogs/event-editor.c (cancel_meeting_cmd): ditto * gui/e-week-view.c (e_week_view_on_editing_stopped): only update request if user is organizer (e_week_view_show_popup_menu): disable the meeting and meeting organizer mask if appropriate (e_week_view_delete_event_internal): offer to cancel the meeting (e_week_view_on_cut): ditto (selection_received): send request if its a meeting * gui/e-day-view.h: add meeting icon/mask * gui/e-day-view.c (e_day_view_on_event_right_click): disable the meeting and meeting organizer mask if appropriate (e_day_view_delete_event_internal): offer to cancel meeting (e_day_view_on_cut): ditto (e_day_view_finish_long_event_resize): only update request if user is organizer (e_day_view_reshape_long_event): add meeting icon to count (e_day_view_reshape_day_event): ditto (e_day_view_on_top_canvas_drag_data_received): only update request if user is organizer (e_day_view_on_main_canvas_drag_data_received): ditto (selection_received): offer to send meeting info * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event): draw meeting icon if appropriate (using dummy icon atm) svn path=/trunk/; revision=17491
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r--calendar/gui/e-week-view.c50
1 files changed, 41 insertions, 9 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 22b4623f13..1f6768c4cb 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -53,6 +53,7 @@
#include <e-util/e-dialog-utils.h>
#include "dialogs/delete-comp.h"
#include "dialogs/send-comp.h"
+#include "dialogs/cancel-comp.h"
#include "comp-util.h"
#include "itip-utils.h"
#include "cal-util/timeutil.h"
@@ -3225,7 +3226,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view,
cal_component_set_summary (event->comp, &summary);
if (cal_client_update_object (week_view->client, event->comp) == CAL_CLIENT_RESULT_SUCCESS) {
- if (cal_component_has_attendees (event->comp) && send_component_dialog (event->comp, FALSE))
+ if (itip_organizer_is_user (event->comp) && send_component_dialog (event->comp, FALSE))
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, event->comp,
week_view->client, NULL);
} else {
@@ -3439,7 +3440,19 @@ enum {
* in another window and we want to disable the event
* from being edited twice
*/
- MASK_EDITING = 8
+ MASK_EDITING = 8,
+
+ /*
+ * This is used to when an event is already a meeting and
+ * we want to disable the schedule meeting command
+ */
+ MASK_MEETING = 16,
+
+ /*
+ * To disable cut and copy for meetings the user is not the
+ * organizer of
+ */
+ MASK_MEETING_ORGANIZER = 32
};
static EPopupMenu main_items [] = {
@@ -3477,24 +3490,24 @@ static EPopupMenu main_items [] = {
static EPopupMenu child_items [] = {
E_POPUP_ITEM (N_("_Open"), e_week_view_on_edit_appointment, MASK_EDITABLE | MASK_EDITING),
- E_POPUP_ITEM (N_("_Save As..."), e_week_view_on_save_as, MASK_EDITABLE | MASK_EDITING),
- E_POPUP_ITEM (N_("_Print..."), e_week_view_on_print_event, MASK_EDITABLE | MASK_EDITING),
+ E_POPUP_ITEM (N_("_Save As..."), e_week_view_on_save_as, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Print..."), e_week_view_on_print_event, MASK_EDITING),
/* Only show this separator if one of the above is shown. */
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("C_ut"), e_week_view_on_cut, MASK_EDITING | MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Copy"), e_week_view_on_copy, MASK_EDITING | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("C_ut"), e_week_view_on_cut, MASK_EDITING | MASK_EDITABLE | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Copy"), e_week_view_on_copy, MASK_EDITING | MASK_MEETING_ORGANIZER),
E_POPUP_ITEM (N_("_Paste"), e_week_view_on_paste, 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Schedule Meeting..."), e_week_view_on_meeting, MASK_EDITABLE | MASK_EDITING),
- E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_week_view_on_forward, MASK_EDITABLE | MASK_EDITING),
+ E_POPUP_ITEM (N_("_Schedule Meeting..."), e_week_view_on_meeting, MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
+ E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_week_view_on_forward, MASK_EDITING),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete this Appointment"), e_week_view_on_delete_appointment, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
+ E_POPUP_ITEM (N_("_Delete"), e_week_view_on_delete_appointment, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
E_POPUP_ITEM (N_("Make this Occurrence _Movable"), e_week_view_on_unrecur_appointment, MASK_RECURRING | MASK_EDITING),
E_POPUP_ITEM (N_("Delete this _Occurrence"), e_week_view_on_delete_occurrence, MASK_RECURRING | MASK_EDITING),
E_POPUP_ITEM (N_("Delete _All Occurrences"), e_week_view_on_delete_appointment, MASK_RECURRING | MASK_EDITING),
@@ -3544,10 +3557,18 @@ e_week_view_show_popup_menu (EWeekView *week_view,
context_menu = child_items;
event = &g_array_index (week_view->events,
EWeekViewEvent, event_num);
+
if (cal_component_has_recurrences (event->comp))
hide_mask |= MASK_SINGLE;
else
hide_mask |= MASK_RECURRING;
+
+ if (cal_component_has_organizer (event->comp)) {
+ disable_mask |= MASK_MEETING;
+
+ if (!itip_organizer_is_user (event->comp))
+ disable_mask |= MASK_MEETING_ORGANIZER;
+ }
}
if (being_edited)
@@ -3900,6 +3921,10 @@ e_week_view_delete_event_internal (EWeekView *week_view, gint event_num)
GTK_WIDGET (week_view))) {
const char *uid;
+ if (itip_organizer_is_user (event->comp)
+ && cancel_component_dialog (event->comp, TRUE))
+ itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, event->comp, week_view->client, NULL);
+
cal_component_get_uid (event->comp, &uid);
/* We don't check the return value; FALSE can mean the object
@@ -3955,6 +3980,10 @@ e_week_view_on_cut (GtkWidget *widget, gpointer data)
event = &g_array_index (week_view->events, EWeekViewEvent,
week_view->popup_event_num);
+ if (itip_organizer_is_user (event->comp)
+ && cancel_component_dialog (event->comp, TRUE))
+ itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, event->comp, week_view->client, NULL);
+
cal_component_get_uid (event->comp, &uid);
cal_client_remove_object (week_view->client, uid);
}
@@ -4285,6 +4314,9 @@ selection_received (GtkWidget *invisible,
cal_client_update_object (week_view->client, comp);
+ if (itip_organizer_is_user (comp) && send_component_dialog (comp, TRUE))
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, week_view->client, NULL);
+
g_free (uid);
gtk_object_unref (GTK_OBJECT (comp));
}