diff options
author | Milan Crha <mcrha@redhat.com> | 2009-11-26 23:04:54 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-11-26 23:04:54 +0800 |
commit | 00e1de6f7d333da5177548cc45be669b1e4e2195 (patch) | |
tree | 3a6748fe2ea9a38cc5ebfd9b61a60d30e9ec9da4 /modules | |
parent | e2ca6f7753443a37fddd9d3af8360a9da06c4a9f (diff) | |
download | gsoc2013-evolution-00e1de6f7d333da5177548cc45be669b1e4e2195.tar.gz gsoc2013-evolution-00e1de6f7d333da5177548cc45be669b1e4e2195.tar.zst gsoc2013-evolution-00e1de6f7d333da5177548cc45be669b1e4e2195.zip |
Bug #558030 - Convert meeting to appointment popup menu option
Diffstat (limited to 'modules')
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.c | 57 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.h | 2 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view.c | 4 |
3 files changed, 58 insertions, 5 deletions
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index e88fae7eb9..68da6b2643 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -1105,8 +1105,7 @@ exit: } static void -action_event_schedule_cb (GtkAction *action, - ECalShellView *cal_shell_view) +edit_event_as (ECalShellView *cal_shell_view, gboolean as_meeting) { ECalShellContent *cal_shell_content; GnomeCalendarViewType view_type; @@ -1129,13 +1128,50 @@ action_event_schedule_cb (GtkAction *action, client = event->comp_data->client; icalcomp = event->comp_data->icalcomp; + if (!as_meeting && icalcomp) { + /* remove organizer and all attendees */ + icalproperty *prop; + + /* do it on a copy, as user can cancel changes */ + icalcomp = icalcomponent_new_clone (icalcomp); + + #define remove_all(_kind) \ + while (prop = icalcomponent_get_first_property (icalcomp, _kind), prop != NULL) { \ + icalcomponent_remove_property (icalcomp, prop); \ + icalproperty_free (prop); \ + } + + remove_all (ICAL_ATTENDEE_PROPERTY); + remove_all (ICAL_ORGANIZER_PROPERTY); + + #undef remove_all + } + e_calendar_view_edit_appointment ( - calendar_view, client, icalcomp, TRUE); + calendar_view, client, icalcomp, as_meeting); + + if (!as_meeting && icalcomp) { + icalcomponent_free (icalcomp); + } g_list_free (selected); } static void +action_event_schedule_cb (GtkAction *action, + ECalShellView *cal_shell_view) +{ + edit_event_as (cal_shell_view, TRUE); +} + +static void +action_event_schedule_appointment_cb (GtkAction *action, + ECalShellView *cal_shell_view) +{ + edit_event_as (cal_shell_view, FALSE); +} + +static void action_gal_save_custom_view_cb (GtkAction *action, ECalShellView *cal_shell_view) { @@ -1372,9 +1408,16 @@ static GtkActionEntry calendar_entries[] = { NULL, N_("_Schedule Meeting..."), NULL, - NULL, /* XXX Add a tooltip! */ + N_("Converts an appointment to a meeting"), G_CALLBACK (action_event_schedule_cb) }, + { "event-schedule-appointment", + NULL, + N_("Conv_ert to Appointment..."), + NULL, + N_("Converts a meeting to an appointment"), + G_CALLBACK (action_event_schedule_appointment_cb) }, + /*** Menus ***/ { "calendar-actions-menu", @@ -1481,7 +1524,11 @@ static EPopupActionEntry calendar_popup_entries[] = { { "event-popup-schedule", NULL, - "event-schedule" } + "event-schedule" }, + + { "event-popup-schedule-appointment", + NULL, + "event-schedule-appointment" } }; static GtkRadioActionEntry calendar_view_entries[] = { diff --git a/modules/calendar/e-cal-shell-view-actions.h b/modules/calendar/e-cal-shell-view-actions.h index 840985b03a..94ad66cbc1 100644 --- a/modules/calendar/e-cal-shell-view-actions.h +++ b/modules/calendar/e-cal-shell-view-actions.h @@ -85,6 +85,8 @@ E_SHELL_WINDOW_ACTION ((window), "event-print") #define E_SHELL_WINDOW_ACTION_EVENT_SCHEDULE(window) \ E_SHELL_WINDOW_ACTION ((window), "event-schedule") +#define E_SHELL_WINDOW_ACTION_EVENT_SCHEDULE_APPOINTMENT(window) \ + E_SHELL_WINDOW_ACTION ((window), "event-schedule-appointment") #define E_SHELL_WINDOW_ACTION_EVENT_REPLY(window) \ E_SHELL_WINDOW_ACTION ((window), "event-reply") #define E_SHELL_WINDOW_ACTION_EVENT_REPLY_ALL(window) \ diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index f767f92ec6..396cdec62e 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -436,6 +436,10 @@ cal_shell_view_update_actions (EShellView *shell_view) sensitive = (n_selected == 1) && editable && !is_meeting; gtk_action_set_sensitive (action, sensitive); + action = ACTION (EVENT_SCHEDULE_APPOINTMENT); + sensitive = (n_selected == 1) && editable && is_meeting; + gtk_action_set_sensitive (action, sensitive); + action = ACTION (EVENT_REPLY); sensitive = (n_selected == 1) && is_meeting; gtk_action_set_sensitive (action, sensitive); |