[evolution] Calendar: Ignore event drag&drop in read-only calendars in Year View
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Calendar: Ignore event drag&drop in read-only calendars in Year View
- Date: Thu, 9 Jun 2022 15:58:25 +0000 (UTC)
commit 4c98376684002647f48206e3c3210659cc9afac1
Author: Milan Crha <mcrha redhat com>
Date: Thu Jun 9 17:45:18 2022 +0200
Calendar: Ignore event drag&drop in read-only calendars in Year View
src/calendar/gui/comp-util.c | 4 ++++
src/calendar/gui/e-year-view.c | 12 ++++++++++++
2 files changed, 16 insertions(+)
---
diff --git a/src/calendar/gui/comp-util.c b/src/calendar/gui/comp-util.c
index 0708e96dbd..b61361e6ef 100644
--- a/src/calendar/gui/comp-util.c
+++ b/src/calendar/gui/comp-util.c
@@ -2557,6 +2557,10 @@ cal_comp_util_move_component_by_days (GtkWindow *parent,
g_return_val_if_fail (E_IS_CAL_COMPONENT (in_comp), FALSE);
g_return_val_if_fail (days != 0, FALSE);
+ /* Silently skip requests for read-only clients */
+ if (e_client_is_readonly (E_CLIENT (client)))
+ return TRUE;
+
registry = e_cal_model_get_registry (model);
if (e_cal_component_has_attendees (in_comp) &&
diff --git a/src/calendar/gui/e-year-view.c b/src/calendar/gui/e-year-view.c
index 27b099f01e..a55c51e476 100644
--- a/src/calendar/gui/e-year-view.c
+++ b/src/calendar/gui/e-year-view.c
@@ -1438,6 +1438,18 @@ year_view_month_drag_motion_cb (GtkWidget *widget,
month != self->priv->drag_month ||
year != self->priv->drag_year);
+ if (can_drop) {
+ GSList *link;
+
+ can_drop = FALSE;
+
+ for (link = self->priv->drag_data; link && !can_drop; link = g_slist_next (link)) {
+ DragData *dd = link->data;
+
+ can_drop = !e_client_is_readonly (E_CLIENT (dd->client));
+ }
+ }
+
gdk_drag_status (context,
can_drop ? gdk_drag_context_get_selected_action (context) : 0, time);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]