[evolution] Make it possible to disable Reminders for Tasks



commit 70e02fb0de6df343afa1b0c7a0e57daf1d5c7a70
Author: Milan Crha <mcrha redhat com>
Date:   Fri Mar 16 12:51:29 2018 +0100

    Make it possible to disable Reminders for Tasks

 src/calendar/gui/e-comp-editor-page-reminders.c |    9 +++++++++
 src/calendar/gui/e-comp-editor-task.c           |    6 ++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/calendar/gui/e-comp-editor-page-reminders.c b/src/calendar/gui/e-comp-editor-page-reminders.c
index ad9a8df..5a2933b 100644
--- a/src/calendar/gui/e-comp-editor-page-reminders.c
+++ b/src/calendar/gui/e-comp-editor-page-reminders.c
@@ -1556,6 +1556,7 @@ ecep_reminders_setup_ui (ECompEditorPageReminders *page_reminders)
        ECompEditor *comp_editor;
        GtkUIManager *ui_manager;
        GtkActionGroup *action_group;
+       GtkAction *action;
        GError *error = NULL;
 
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_REMINDERS (page_reminders));
@@ -1569,6 +1570,14 @@ ecep_reminders_setup_ui (ECompEditorPageReminders *page_reminders)
 
        gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, &error);
 
+       action = gtk_action_group_get_action (action_group, "page-reminders");
+       if (action) {
+               e_binding_bind_property (
+                       page_reminders, "visible",
+                       action, "visible",
+                       G_BINDING_SYNC_CREATE);
+       }
+
        g_clear_object (&comp_editor);
 
        if (error) {
diff --git a/src/calendar/gui/e-comp-editor-task.c b/src/calendar/gui/e-comp-editor-task.c
index 46e69e9..11076da 100644
--- a/src/calendar/gui/e-comp-editor-task.c
+++ b/src/calendar/gui/e-comp-editor-task.c
@@ -38,6 +38,7 @@
 struct _ECompEditorTaskPrivate {
        ECompEditorPage *page_general;
        ECompEditorPage *recurrence_page;
+       ECompEditorPage *reminders_page;
        ECompEditorPropertyPart *categories;
        ECompEditorPropertyPart *dtstart;
        ECompEditorPropertyPart *due_date;
@@ -171,6 +172,7 @@ ece_task_notify_target_client_cb (GObject *object,
        gboolean date_only;
        gboolean was_allday;
        gboolean can_recur;
+       gboolean can_reminders;
 
        g_return_if_fail (E_IS_COMP_EDITOR_TASK (object));
 
@@ -201,6 +203,9 @@ ece_task_notify_target_client_cb (GObject *object,
                gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
        }
 
+       can_reminders = !cal_client || !e_client_check_capability (E_CLIENT (cal_client), 
CAL_STATIC_CAPABILITY_TASK_NO_ALARM);
+       gtk_widget_set_visible (GTK_WIDGET (task_editor->priv->reminders_page), can_reminders);
+
        can_recur = !cal_client || e_client_check_capability (E_CLIENT (cal_client), 
CAL_STATIC_CAPABILITY_TASK_CAN_RECUR);
        gtk_widget_set_visible (GTK_WIDGET (task_editor->priv->recurrence_page), can_recur);
 }
@@ -822,6 +827,7 @@ e_comp_editor_task_constructed (GObject *object)
 
        page = e_comp_editor_page_reminders_new (comp_editor);
        e_comp_editor_add_page (comp_editor, C_("ECompEditorPage", "Reminders"), page);
+       task_editor->priv->reminders_page = page;
 
        page = e_comp_editor_page_recurrence_new (comp_editor);
        e_comp_editor_add_page (comp_editor, C_("ECompEditorPage", "Recurrence"), page);


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