From e41cb58950a0b2deccbfeb7b33e07e3e44cae096 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 10 Aug 2017 16:42:51 +0200 Subject: [PATCH] Implemented "last default" to restrict quick filter display by default on the last n days --- doc/config.html | 8 ++++++++ src/elogd.c | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/config.html b/doc/config.html index 8f5d8e43..a8379f3b 100755 --- a/doc/config.html +++ b/doc/config.html @@ -1475,6 +1475,14 @@ Subst on edit author = $full_name can be displayed. The Subtext filter works on the entry body text. + +
  • + Last default = <n>
    + Some logbooks are very big ans searching through all entries with + quick filter can be time consuming. This option sets a default value + for the Date quick filter, so that by default + only the <n> days are displayed. +
  • Format <attribute> = <flags>,<css_class_name>,<css_class_value>,<width>,<size>
    diff --git a/src/elogd.c b/src/elogd.c index 388f5f34..ff94ccf9 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -19169,6 +19169,11 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands, if (strieq(list[index], "Date")) { i = isparam("last") ? atoi(getparam("last")) : 0; + + if (i == 0 && getcfg(lbs->name, "Last default", str, sizeof(str))) { + i = atoi(str); + setparam("last", str); + } rsprintf("