[evolution] I#858 - Add an option to show uncompleted tasks



commit 69344983baa4ca93d53177f3efcd4ed57a42fd45
Author: RALOVICH, Kristof <tade60 freemail hu>
Date:   Sat Jun 20 12:02:32 2020 +0200

    I#858 - Add an option to show uncompleted tasks
    
    Currently "Active Tasks" shows tasks due in the next 365
    days. A common use-case is that one creates a task (e.g. on
    a mobile device) and does not set an explicit due date.
    Such tasks would not be listed under "Active Tasks". Thus
    create a new filter "Uncompleted Tasks" that picks up
    uncompleted tasks irrespective of the existence of a due
    date.
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/858

 src/modules/calendar/e-task-shell-view-actions.c | 7 +++++++
 src/modules/calendar/e-task-shell-view-private.h | 5 +++--
 src/modules/calendar/e-task-shell-view.c         | 7 +++++++
 3 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/modules/calendar/e-task-shell-view-actions.c 
b/src/modules/calendar/e-task-shell-view-actions.c
index 7fbc6077b7..e212438609 100644
--- a/src/modules/calendar/e-task-shell-view-actions.c
+++ b/src/modules/calendar/e-task-shell-view-actions.c
@@ -972,6 +972,13 @@ static GtkRadioActionEntry task_filter_entries[] = {
          NULL,  /* XXX Add a tooltip! */
          TASK_FILTER_COMPLETED_TASKS },
 
+       { "task-filter-uncompleted-tasks",
+         NULL,
+         N_("Uncompleted Tasks"),
+         NULL,
+         NULL,  /* XXX Add a tooltip! */
+         TASK_FILTER_UNCOMPLETED_TASKS },
+
        { "task-filter-next-7-days-tasks",
          NULL,
          N_("Next 7 Days’ Tasks"),
diff --git a/src/modules/calendar/e-task-shell-view-private.h 
b/src/modules/calendar/e-task-shell-view-private.h
index 4cc4f0232b..3e385cd3af 100644
--- a/src/modules/calendar/e-task-shell-view-private.h
+++ b/src/modules/calendar/e-task-shell-view-private.h
@@ -56,8 +56,9 @@ G_BEGIN_DECLS
 /* Filter items are displayed in ascending order.
  * Non-negative values are reserved for categories. */
 enum {
-       TASK_FILTER_ANY_CATEGORY = -8,
-       TASK_FILTER_UNMATCHED = -7,
+       TASK_FILTER_ANY_CATEGORY = -9,
+       TASK_FILTER_UNMATCHED = -8,
+       TASK_FILTER_UNCOMPLETED_TASKS = -7,
        TASK_FILTER_NEXT_7_DAYS_TASKS = -6,
        TASK_FILTER_ACTIVE_TASKS = -5,
        TASK_FILTER_OVERDUE_TASKS = -4,
diff --git a/src/modules/calendar/e-task-shell-view.c b/src/modules/calendar/e-task-shell-view.c
index 7be2909701..a8c1966ad5 100644
--- a/src/modules/calendar/e-task-shell-view.c
+++ b/src/modules/calendar/e-task-shell-view.c
@@ -135,6 +135,13 @@ task_shell_view_execute_search (EShellView *shell_view)
                        query = temp;
                        break;
 
+               case TASK_FILTER_UNCOMPLETED_TASKS:
+                       temp = g_strdup_printf (
+                               "(not (is-completed?) %s)", query);
+                       g_free (query);
+                       query = temp;
+                       break;
+
                case TASK_FILTER_NEXT_7_DAYS_TASKS:
                        start_range = now_time;
                        end_range = time_day_end (time_add_day (start_range, 7));


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