[evolution] Bug #632619 - Recurring events can clutter month view



commit f8e6c60b2facac19916b72323ce78dbfa137d00c
Author: Milan Crha <mcrha redhat com>
Date:   Thu Sep 29 14:43:28 2011 +0200

    Bug #632619 - Recurring events can clutter month view

 calendar/gui/caltypes.xml                   |   19 +++++++++++++++++++
 modules/calendar/e-cal-shell-view-actions.c |    9 ++++++++-
 modules/calendar/e-cal-shell-view-actions.h |    2 ++
 modules/calendar/e-cal-shell-view-private.h |    9 +++++----
 modules/calendar/e-cal-shell-view.c         |    6 ++++++
 5 files changed, 40 insertions(+), 5 deletions(-)
---
diff --git a/calendar/gui/caltypes.xml b/calendar/gui/caltypes.xml
index c1997a4..964b623 100644
--- a/calendar/gui/caltypes.xml
+++ b/calendar/gui/caltypes.xml
@@ -168,6 +168,25 @@
   	 </option>
  	 </input>
  	</part>
+
+   <part name="count-occurrences">
+      <_title>Occurs</_title>
+      <input type="optionlist" name="match-type">
+         <option value="less-than">
+            <_title>Less Than</_title>
+            <code>((or (= (occurrences-count?) (- 1)) (&lt; (occurrences-count?) ${count}))</code>
+         </option>
+         <option value="exactly">
+            <_title>Exactly</_title>
+            <code>((or (= (occurrences-count?) (- 1)) (= (occurrences-count?) ${count}))</code>
+         </option>
+         <option value="more-than">
+            <_title>More Than</_title>
+            <code>((or (= (occurrences-count?) (- 1)) (&gt; (occurrences-count?) ${count}))</code>
+         </option>
+      </input>
+      <input type="integer" name="count"/>
+   </part>
   </partset>
 
 <ruleset>
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index 2147245..aa5738e 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -1705,6 +1705,13 @@ static GtkRadioActionEntry calendar_filter_entries[] = {
 	  NULL,  /* XXX Add a tooltip! */
 	  CALENDAR_FILTER_NEXT_7_DAYS_APPOINTMENTS },
 
+	{ "calendar-filter-occurs-less-than-5-times",
+	  NULL,
+	  N_("Occurs Less Than 5 Times"),
+	  NULL,
+	  NULL,  /* XXX Add a tooltip! */
+	  CALENDAR_FILTER_OCCURS_LESS_THAN_5_TIMES },
+
 	{ "calendar-filter-unmatched",
 	  NULL,
 	  N_("Unmatched"),
@@ -1972,7 +1979,7 @@ e_cal_shell_view_update_search_filter (ECalShellView *cal_shell_view)
 		ii = CALENDAR_FILTER_UNMATCHED;
 		e_action_combo_box_add_separator_after (combo_box, ii);
 
-		ii = CALENDAR_FILTER_NEXT_7_DAYS_APPOINTMENTS;
+		ii = CALENDAR_FILTER_OCCURS_LESS_THAN_5_TIMES;
 		e_action_combo_box_add_separator_after (combo_box, ii);
 
 		e_shell_view_unblock_execute_search (shell_view);
diff --git a/modules/calendar/e-cal-shell-view-actions.h b/modules/calendar/e-cal-shell-view-actions.h
index b79bc6b..fcc77ea 100644
--- a/modules/calendar/e-cal-shell-view-actions.h
+++ b/modules/calendar/e-cal-shell-view-actions.h
@@ -133,6 +133,8 @@
 	E_SHELL_WINDOW_ACTION ((window), "calendar-filter-any-category")
 #define E_SHELL_WINDOW_ACTION_CALENDAR_FILTER_NEXT_7_DAYS_APPOINTMENTS(window) \
 	E_SHELL_WINDOW_ACTION ((window), "calendar-filter-next-7-days-appointments")
+#define E_SHELL_WINDOW_ACTION_CALENDAR_FILTER_OCCURS_LESS_THAN_5_TIMES(window) \
+	E_SHELL_WINDOW_ACTION ((window), "calendar-filter-occurs-less-than-5-times")
 #define E_SHELL_WINDOW_ACTION_CALENDAR_FILTER_UNMATCHED(window) \
 	E_SHELL_WINDOW_ACTION ((window), "calendar-filter-unmatched")
 #define E_SHELL_WINDOW_ACTION_CALENDAR_SEARCH_ADVANCED_HIDDEN(window) \
diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h
index 7c78130..6653632 100644
--- a/modules/calendar/e-cal-shell-view-private.h
+++ b/modules/calendar/e-cal-shell-view-private.h
@@ -85,10 +85,11 @@ G_BEGIN_DECLS
 /* Filter items are displayed in ascending order.
  * Non-negative values are reserved for categories. */
 enum {
-	CALENDAR_FILTER_ANY_CATEGORY			= -4,
-	CALENDAR_FILTER_UNMATCHED			= -3,
-	CALENDAR_FILTER_ACTIVE_APPOINTMENTS		= -2,
-	CALENDAR_FILTER_NEXT_7_DAYS_APPOINTMENTS	= -1
+	CALENDAR_FILTER_ANY_CATEGORY			= -5,
+	CALENDAR_FILTER_UNMATCHED			= -4,
+	CALENDAR_FILTER_ACTIVE_APPOINTMENTS		= -3,
+	CALENDAR_FILTER_NEXT_7_DAYS_APPOINTMENTS	= -2,
+	CALENDAR_FILTER_OCCURS_LESS_THAN_5_TIMES	= -1
 };
 
 /* Search items are displayed in ascending order. */
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 0a9b770..f644402 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -194,6 +194,12 @@ cal_shell_view_execute_search (EShellView *shell_view)
 			range_search = TRUE;
 			break;
 
+		case CALENDAR_FILTER_OCCURS_LESS_THAN_5_TIMES:
+			temp = g_strdup_printf ("(and %s (< (occurrences-count?) 5))", query);
+			g_free (query);
+			query = temp;
+			break;
+
 		default:
 		{
 			GList *categories;



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