aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-commands.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-04-23 02:06:38 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-04-23 02:06:38 +0800
commit95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b (patch)
treebb270c7030c3dad20de98b0f9d68455e65fda34b /calendar/gui/calendar-commands.c
parent4167920c363eb3ff08268ffe250c4786fe72b0ac (diff)
downloadgsoc2013-evolution-95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b.tar
gsoc2013-evolution-95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b.tar.gz
gsoc2013-evolution-95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b.tar.bz2
gsoc2013-evolution-95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b.tar.lz
gsoc2013-evolution-95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b.tar.xz
gsoc2013-evolution-95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b.tar.zst
gsoc2013-evolution-95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b.zip
Fixes #22444
2003-04-21 Rodrigo Moya <rodrigo@ximian.com> Fixes #22444 * gui/calendar-commands.c: added new verbs for occurrence-related menu items. (delete_occurrence_cmd): added callback for "Delete this occurrence" menu item. "Delete all occurrences" is just the same as "Delete". (sensitize_calendar_commands): sensitive ocurrence-related menu items. * gui/gnome-cal.[ch] (gnome_calendar_delete_selected_occurrence): new function. (gnome_calendar_get_current_view_widget): made this public. * gui/e-week-view.[ch] (e_week_view_get_selected_event): (e_week_view_delete_occurrence): new functions. (e_week_view_delete_occurrence_internal): real implementation of the 'Delete Occurrence' logic. (e_week_view_on_delete_occurrence): call delete_instance_internal. * gui/e-day-view.[ch] (e_day_view_get_selected_event): (e_day_view_delete_occurrence): new functions. (e_week_view_delete_occurrence_internal): real implementation of the 'Delete Occurrence' logic. (e_week_view_on_delete_occurrence): call delete_occurrence_internal. svn path=/trunk/; revision=20917
Diffstat (limited to 'calendar/gui/calendar-commands.c')
-rw-r--r--calendar/gui/calendar-commands.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 23109d50a7..6dac8ec8a5 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -49,6 +49,8 @@
#include "shell/Evolution.h"
#include "calendar-commands.h"
#include "calendar-config.h"
+#include "e-day-view.h"
+#include "e-week-view.h"
#include "gnome-cal.h"
#include "goto.h"
#include "print.h"
@@ -293,6 +295,18 @@ delete_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
}
static void
+delete_occurrence_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
+{
+ GnomeCalendar *gcal;
+
+ gcal = GNOME_CALENDAR (data);
+
+ set_clock_cursor (gcal);
+ gnome_calendar_delete_selected_occurrence (gcal);
+ set_normal_cursor (gcal);
+}
+
+static void
publish_freebusy_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
{
GnomeCalendar *gcal;
@@ -505,7 +519,7 @@ sensitize_calendar_commands (GnomeCalendar *gcal, BonoboControl *control, gboole
{
BonoboUIComponent *uic;
int n_selected;
- gboolean read_only;
+ gboolean read_only, has_recurrences;
uic = bonobo_control_get_ui_component (control);
g_assert (uic != NULL);
@@ -525,6 +539,33 @@ sensitize_calendar_commands (GnomeCalendar *gcal, BonoboControl *control, gboole
bonobo_ui_component_set_prop (uic, "/commands/Delete", "sensitive",
n_selected == 0 || read_only ? "0" : "1",
NULL);
+
+ /* occurrence-related menu items */
+ has_recurrences = FALSE;
+ if (n_selected > 0 && !read_only) {
+ CalComponent *comp;
+ GtkWidget *view;
+
+ view = gnome_calendar_get_current_view_widget (gcal);
+ if (E_IS_DAY_VIEW (view))
+ comp = e_day_view_get_selected_event (E_DAY_VIEW (view));
+ else if (E_IS_WEEK_VIEW (view))
+ comp = e_week_view_get_selected_event (E_WEEK_VIEW (view));
+ else
+ comp = NULL;
+
+ if (comp) {
+ if (cal_component_has_recurrences (comp))
+ has_recurrences = TRUE;
+ }
+ }
+
+ bonobo_ui_component_set_prop (uic, "/commands/DeleteOccurrence", "sensitive",
+ has_recurrences ? "1" : "0",
+ NULL);
+ bonobo_ui_component_set_prop (uic, "/commands/DeleteAllOccurrences", "sensitive",
+ has_recurrences ? "1" : "0",
+ NULL);
}
/* Sensitizes the UI Component menu/toolbar tasks commands based on the number
@@ -659,6 +700,8 @@ static BonoboUIVerb verbs [] = {
BONOBO_UI_VERB ("Copy", copy_cmd),
BONOBO_UI_VERB ("Paste", paste_cmd),
BONOBO_UI_VERB ("Delete", delete_cmd),
+ BONOBO_UI_VERB ("DeleteOccurrence", delete_occurrence_cmd),
+ BONOBO_UI_VERB ("DeleteAllOccurrences", delete_cmd),
BONOBO_UI_VERB ("CalendarPrev", previous_clicked),
BONOBO_UI_VERB ("CalendarToday", today_clicked),
@@ -681,6 +724,8 @@ static EPixmap pixmaps [] =
E_PIXMAP ("/menu/EditPlaceholder/Edit/Copy", "16_copy.png"),
E_PIXMAP ("/menu/EditPlaceholder/Edit/Paste", "16_paste.png"),
E_PIXMAP ("/menu/EditPlaceholder/Edit/Delete", "evolution-trash-mini.png"),
+ E_PIXMAP ("/menu/EditPlaceholder/Edit/DeleteOccurrence", "evolution-trash-mini.png"),
+ E_PIXMAP ("/menu/EditPlaceholder/Edit/DeleteAllOccurrences", "evolution-trash-mini.png"),
E_PIXMAP ("/menu/File/Print/Print", "print.xpm"),
E_PIXMAP ("/menu/File/Print/PrintPreview", "print-preview.xpm"),
E_PIXMAP ("/menu/View/ViewBegin/Goto", "goto-16.png"),