aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/e-cal-model.c4
-rw-r--r--calendar/gui/e-meeting-list-view.c91
-rw-r--r--calendar/gui/gnome-cal.c3
4 files changed, 106 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 4a6ca816dd..712d5f0e09 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-19 JP Rosevear <jpr@ximian.com>
+
+ Fixes #55716
+
+ * gui/e-cal-model.c (remove_client): unset the default if the
+ client removed was the default
+
2004-03-19 Rodrigo Moya <rodrigo@ximian.com>
* gui/calendar-component.c (update_uris_for_selection): if
@@ -6,6 +13,8 @@
2004-03-19 JP Rosevear <jpr@ximian.com>
+ Fixes #55723
+
* gui/e-day-view.c (process_component): compare ecalcomponents,
not icalcomponents (the compare func is borked), check recurrence
changes better
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index d2ae13f9dc..c794b18859 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1400,6 +1400,10 @@ remove_client (ECalModel *model, ECalModelClient *client_data)
e_table_model_row_deleted (E_TABLE_MODEL (model), i);
}
}
+
+ /* If this was the default client, unset it */
+ if (model->priv->default_client == client_data->client)
+ model->priv->default_client = NULL;
/* free all remaining memory */
g_object_unref (client_data->client);
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index 55d73a7f80..90b36e9bdb 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -85,7 +85,95 @@ start_addressbook_server (EMeetingListView *view)
return;
}
}
+#if 0
+static void
+popup_delete_cb (GtkWidget *widget, gpointer data)
+{
+ EMeetingListView *emlv = data;
+ EMeetingListViewPrivate *priv;
+ EMeetingAttendee *ia;
+ int pos = 0;
+
+ priv = emlv->priv;
+
+ ia = e_meeting_store_find_attendee_at_row (priv->store, priv->row);
+
+ /* If the user deletes the attendee explicitly, assume they no
+ longer want the organizer showing up */
+ if (ia == priv->ia) {
+ g_object_unref (priv->ia);
+ priv->ia = NULL;
+ }
+
+ /* If this was a delegatee, no longer delegate */
+ if (e_meeting_attendee_is_set_delfrom (ia)) {
+ EMeetingAttendee *ib;
+
+ ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delfrom (ia), &pos);
+ if (ib != NULL) {
+ e_meeting_attendee_set_delto (ib, NULL);
+ e_meeting_attendee_set_edit_level (ib, E_MEETING_ATTENDEE_EDIT_FULL);
+ }
+ }
+
+ /* Handle deleting all attendees in the delegation chain */
+ while (ia != NULL) {
+ EMeetingAttendee *ib = NULL;
+
+ g_object_ref (ia);
+ g_ptr_array_add (priv->deleted_attendees, ia);
+ e_meeting_store_remove_attendee (priv->model, ia);
+
+ if (e_meeting_attendee_get_delto (ia) != NULL)
+ ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delto (ia), NULL);
+ ia = ib;
+ }
+}
+enum {
+ CAN_DELEGATE = 2,
+ CAN_DELETE = 4
+};
+
+static gboolean
+button_press_event (GtkWidget *widget, GdkEventButton *event, EMeetingListView *emlv)
+{
+ EMeetingListViewPrivate *priv;
+ GtkWidget *menu;
+ GtkTreePath *path;
+ ESource *source = NULL;
+
+ /* only process right-clicks */
+ if (event->button != 3 || event->type != GDK_BUTTON_PRESS)
+ return FALSE;
+
+ priv = emlv->priv;
+
+ /* create the menu */
+ menu = gtk_menu_new ();
+
+ view_row = e_table_model_to_view_row (etable, row);
+ priv->row = e_meeting_model_etable_view_to_model_row (etable, priv->model, view_row);
+
+ ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
+ if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
+ disable_mask = CAN_DELETE;
+
+ /* FIXME: if you enable Delegate, then change index to '1'.
+ * (This has now been enabled). */
+ /* context_menu[1].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH); */
+ context_menu[1].pixmap_widget =
+ gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
+
+ menu = e_popup_menu_create (context_menu, disable_mask, hide_mask, data);
+ e_auto_kill_popup_menu_on_selection_done (menu);
+
+ /* popup the menu */
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time);
+
+ return TRUE;
+}
+#endif
static void
emlv_finalize (GObject *obj)
{
@@ -129,9 +217,12 @@ emlv_init (EMeetingListView *view)
priv->corba_select_names = CORBA_OBJECT_NIL;
start_addressbook_server (view);
+
+// g_signal_connect (G_OBJECT (view), "button_press_event", G_CALLBACK (button_press_event), selector);
}
E_MAKE_TYPE (e_meeting_list_view, "EMeetingListView", EMeetingListView, emlv_class_init, emlv_init, GTK_TYPE_TREE_VIEW);
+
static GList *
get_type_strings ()
{
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 4b1bb840aa..853a60b297 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1732,7 +1732,8 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
e_calendar_view_set_status_message (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)), NULL);
- if (status == E_CALENDAR_STATUS_OK) {
+ if (0) {
+// if (status == E_CALENDAR_STATUS_OK) {
if (ecal == priv->task_pad_client) {
msg = g_strdup_printf (_("Loading tasks at %s"), e_cal_get_uri (ecal));
e_calendar_view_set_status_message (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)), msg);