[evolution/gnome-3-28] Bug 791244 - Cannot copy text/click links in read-only events



commit a980227b92174e32768639acb1c9146bb8ffe2a1
Author: Milan Crha <mcrha redhat com>
Date:   Mon Mar 26 17:00:15 2018 +0200

    Bug 791244 - Cannot copy text/click links in read-only events

 src/calendar/gui/e-comp-editor-event.c |   11 +++++++++--
 src/calendar/gui/e-comp-editor-memo.c  |    9 +++++++++
 src/calendar/gui/e-comp-editor-task.c  |    9 +++++++++
 3 files changed, 27 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/gui/e-comp-editor-event.c b/src/calendar/gui/e-comp-editor-event.c
index 40546a9..e3a87b2 100644
--- a/src/calendar/gui/e-comp-editor-event.c
+++ b/src/calendar/gui/e-comp-editor-event.c
@@ -43,6 +43,7 @@ struct _ECompEditorEventPrivate {
        ECompEditorPropertyPart *categories;
        ECompEditorPropertyPart *timezone;
        ECompEditorPropertyPart *transparency;
+       ECompEditorPropertyPart *description;
        GtkWidget *all_day_check;
 
        gpointer in_the_past_alert;
@@ -152,6 +153,7 @@ ece_event_sensitize_widgets (ECompEditor *comp_editor,
        ECompEditorEvent *event_editor;
        gboolean is_organizer;
        GtkAction *action;
+       GtkWidget *widget;
        guint32 flags;
 
        g_return_if_fail (E_IS_COMP_EDITOR_EVENT (comp_editor));
@@ -165,8 +167,6 @@ ece_event_sensitize_widgets (ECompEditor *comp_editor,
        gtk_widget_set_sensitive (event_editor->priv->all_day_check, !force_insensitive && is_organizer);
 
        #define sensitize_part(x) G_STMT_START { \
-               GtkWidget *widget; \
-               \
                widget = e_comp_editor_property_part_get_label_widget (x); \
                if (widget) \
                        gtk_widget_set_sensitive (widget, !force_insensitive && is_organizer); \
@@ -182,6 +182,12 @@ ece_event_sensitize_widgets (ECompEditor *comp_editor,
 
        #undef sensitize_part
 
+       /* Make the Description read-only, not completely insensitive,
+          thus it can be read and scrolled through and so on */
+       widget = e_comp_editor_property_part_get_edit_widget (event_editor->priv->description);
+       gtk_text_view_set_editable (GTK_TEXT_VIEW (gtk_bin_get_child (GTK_BIN (widget))), 
gtk_widget_get_sensitive (widget));
+       gtk_widget_set_sensitive (widget, TRUE);
+
        action = e_comp_editor_get_action (comp_editor, "all-day-event");
        gtk_action_set_sensitive (action, !force_insensitive && is_organizer);
 
@@ -773,6 +779,7 @@ e_comp_editor_event_constructed (GObject *object)
 
        part = e_comp_editor_property_part_description_new (focus_tracker);
        e_comp_editor_page_add_property_part (page, part, 0, 8, 3, 1);
+       event_editor->priv->description = part;
 
        widget = e_comp_editor_property_part_get_edit_widget (event_editor->priv->timezone);
        e_comp_editor_property_part_datetime_attach_timezone_entry (
diff --git a/src/calendar/gui/e-comp-editor-memo.c b/src/calendar/gui/e-comp-editor-memo.c
index 85a7218..b68d378 100644
--- a/src/calendar/gui/e-comp-editor-memo.c
+++ b/src/calendar/gui/e-comp-editor-memo.c
@@ -33,6 +33,7 @@
 struct _ECompEditorMemoPrivate {
        ECompEditorPropertyPart *dtstart;
        ECompEditorPropertyPart *categories;
+       ECompEditorPropertyPart *description;
 
        gpointer insensitive_info_alert;
 };
@@ -65,6 +66,7 @@ ece_memo_sensitize_widgets (ECompEditor *comp_editor,
                            gboolean force_insensitive)
 {
        ECompEditorMemo *memo_editor;
+       GtkWidget *widget;
        gboolean is_organizer;
        guint32 flags;
 
@@ -76,6 +78,12 @@ ece_memo_sensitize_widgets (ECompEditor *comp_editor,
        is_organizer = (flags & (E_COMP_EDITOR_FLAG_IS_NEW | E_COMP_EDITOR_FLAG_ORGANIZER_IS_USER)) != 0;
        memo_editor = E_COMP_EDITOR_MEMO (comp_editor);
 
+       /* Make the Description read-only, not completely insensitive,
+          thus it can be read and scrolled through and so on */
+       widget = e_comp_editor_property_part_get_edit_widget (memo_editor->priv->description);
+       gtk_text_view_set_editable (GTK_TEXT_VIEW (gtk_bin_get_child (GTK_BIN (widget))), 
gtk_widget_get_sensitive (widget));
+       gtk_widget_set_sensitive (widget, TRUE);
+
        if (memo_editor->priv->insensitive_info_alert)
                e_alert_response (memo_editor->priv->insensitive_info_alert, GTK_RESPONSE_OK);
 
@@ -209,6 +217,7 @@ e_comp_editor_memo_constructed (GObject *object)
 
        part = e_comp_editor_property_part_description_new (focus_tracker);
        e_comp_editor_page_add_property_part (page, part, 0, 6, 2, 1);
+       memo_editor->priv->description = part;
 
        e_comp_editor_add_page (comp_editor, C_("ECompEditorPage", "General"), page);
 
diff --git a/src/calendar/gui/e-comp-editor-task.c b/src/calendar/gui/e-comp-editor-task.c
index 86c1dca..81c1272 100644
--- a/src/calendar/gui/e-comp-editor-task.c
+++ b/src/calendar/gui/e-comp-editor-task.c
@@ -43,6 +43,7 @@ struct _ECompEditorTaskPrivate {
        ECompEditorPropertyPart *percentcomplete;
        ECompEditorPropertyPart *status;
        ECompEditorPropertyPart *timezone;
+       ECompEditorPropertyPart *description;
 
        gpointer in_the_past_alert;
        gpointer insensitive_info_alert;
@@ -435,6 +436,7 @@ ece_task_sensitize_widgets (ECompEditor *comp_editor,
 {
        ECompEditorTask *task_editor;
        GtkAction *action;
+       GtkWidget *widget;
        gboolean is_organizer;
        guint32 flags;
 
@@ -446,6 +448,12 @@ ece_task_sensitize_widgets (ECompEditor *comp_editor,
        is_organizer = (flags & (E_COMP_EDITOR_FLAG_IS_NEW | E_COMP_EDITOR_FLAG_ORGANIZER_IS_USER)) != 0;
        task_editor = E_COMP_EDITOR_TASK (comp_editor);
 
+       /* Make the Description read-only, not completely insensitive,
+          thus it can be read and scrolled through and so on */
+       widget = e_comp_editor_property_part_get_edit_widget (task_editor->priv->description);
+       gtk_text_view_set_editable (GTK_TEXT_VIEW (gtk_bin_get_child (GTK_BIN (widget))), 
gtk_widget_get_sensitive (widget));
+       gtk_widget_set_sensitive (widget, TRUE);
+
        action = e_comp_editor_get_action (comp_editor, "all-day-task");
        gtk_action_set_sensitive (action, !force_insensitive && is_organizer);
 
@@ -761,6 +769,7 @@ e_comp_editor_task_constructed (GObject *object)
 
        part = e_comp_editor_property_part_description_new (focus_tracker);
        e_comp_editor_page_add_property_part (page, part, 0, 9, 4, 1);
+       task_editor->priv->description = part;
 
        e_comp_editor_add_page (comp_editor, C_("ECompEditorPage", "General"), page);
        task_editor->priv->page_general = page;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]