aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/caltypes.xml19
-rw-r--r--modules/calendar/e-cal-shell-view-actions.c9
-rw-r--r--modules/calendar/e-cal-shell-view-actions.h2
-rw-r--r--modules/calendar/e-cal-shell-view-private.h9
-rw-r--r--modules/calendar/e-cal-shell-view.c6
5 files changed, 40 insertions, 5 deletions
diff --git a/calendar/gui/caltypes.xml b/calendar/gui/caltypes.xml
index c1997a4fb0..964b623a3e 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 21472453ef..aa5738e27e 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 b79bc6baaf..fcc77ea011 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 7c78130fc3..6653632662 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 0a9b7701f8..f644402080 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;