From 8a9fe576a23ac57de5378c8074ac7e638ab183f1 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 3 Oct 2019 11:03:47 +0200 Subject: [PATCH] Modified the query language help tooltip to table form, hopefully improved --- src/qtgui/ssearch_w.cpp | 51 ++++++++++++++++++++++++--------- src/qtgui/sshelp/README.txt | 2 ++ src/qtgui/sshelp/helphtmltoc.sh | 7 +++++ src/qtgui/sshelp/qhelp.html | 33 +++++++++++++++++++++ 4 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 src/qtgui/sshelp/README.txt create mode 100644 src/qtgui/sshelp/helphtmltoc.sh create mode 100644 src/qtgui/sshelp/qhelp.html diff --git a/src/qtgui/ssearch_w.cpp b/src/qtgui/ssearch_w.cpp index 9b401b6c..9544815d 100644 --- a/src/qtgui/ssearch_w.cpp +++ b/src/qtgui/ssearch_w.cpp @@ -298,20 +298,43 @@ void SSearch::searchTypeChanged(int typ) switch (typ) { case SST_LANG: queryText->setToolTip( - tr( -"Enter query language expression. Cheat sheet:
\n" -"term1 term2 : 'term1' and 'term2' in any field.
\n" -"field:term1 : 'term1' in field 'field'.
\n" -" Standard field names/synonyms:
\n" -" title/subject/caption, author/from, recipient/to, filename, ext.
\n" -" Pseudo-fields: dir, mime/format, type/rclcat, date, size.
\n" -" Two date interval exemples: 2009-03-01/2009-05-20 2009-03-01/P2M.
\n" -"term1 term2 OR term3 : term1 AND (term2 OR term3).
\n" -" You can use parentheses to make things clearer.
\n" -"\"term1 term2\" : phrase (must occur exactly). Possible modifiers:
\n" -"\"term1 term2\"p : unordered proximity search with default distance.
\n" -"Use Show Query link when in doubt about result and see manual (<F1>) for more detail.\n" - )); + // Do not modify the text here, test with the + // sshelp/qhelp.html file and a browser, then use + // sshelp/helphtmltoc.sh to turn to code and insert here +tr("") + +tr("

Query language cheat-sheet. In doubt: click Show Query. ") + +tr("You should really look at the manual (F1)

") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("") + +tr("
WhatExamples
Andone two   one AND two   one && two
Orone OR two   one || two
Complex boolean. OR has priority, use parentheses ") + +tr("where needed(one AND two) OR three
Not-term
Phrase\"pride and prejudice\"
Ordered proximity (slack=1)\"pride prejudice\"o1
Unordered proximity (slack=1)\"prejudice pride\"po1
Unordered prox. (default slack=10)\"prejudice pride\"p
No stem expansion: capitalizeFloor
Field-specificauthor:austen  title:prejudice
AND inside field (no order)author:jane,austen
OR inside fieldauthor:austen/bronte
Field namestitle/subject/caption  author/from
recipient/to  filename  ext
Directory path filterdir:/home/me  dir:doc
MIME type filtermime:text/plain mime:video/*
Date intervalsdate:2018-01-01/2018-31-12
") + +tr("date:2018  date:2018-01-01/P12M
Sizesize>100k size<1M
") + ); break; case SST_FNM: queryText->setToolTip(tr("Enter file name wildcard expression.")); diff --git a/src/qtgui/sshelp/README.txt b/src/qtgui/sshelp/README.txt new file mode 100644 index 00000000..a371394c --- /dev/null +++ b/src/qtgui/sshelp/README.txt @@ -0,0 +1,2 @@ +Simple search query language tooltip. Try it out in the html file, then +use helphtmltoc.sh to turn it into code. diff --git a/src/qtgui/sshelp/helphtmltoc.sh b/src/qtgui/sshelp/helphtmltoc.sh new file mode 100644 index 00000000..6058c335 --- /dev/null +++ b/src/qtgui/sshelp/helphtmltoc.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +fn=qhelp.html +while read line; do + line=`echo $line| sed -e 's/"/\\\\"/g'` + echo 'tr('"\"$line\""')' + +done < $fn diff --git a/src/qtgui/sshelp/qhelp.html b/src/qtgui/sshelp/qhelp.html new file mode 100644 index 00000000..a3579b19 --- /dev/null +++ b/src/qtgui/sshelp/qhelp.html @@ -0,0 +1,33 @@ + +

Query language cheat-sheet. In doubt: click Show Query.  + You should really look at the manual (F1)

+ + + + + + + + + + + + + + + + + + + +
WhatExamples
Andone two   one AND two   one && two
Orone OR two   one || two
Complex boolean. OR has priority, use parentheses  + where needed(one AND two) OR three
Not-term
Phrase"pride and prejudice"
Ordered proximity (slack=1)"pride prejudice"o1
Unordered proximity (slack=1)"prejudice pride"po1
Unordered prox. (default slack=10)"prejudice pride"p
No stem expansion: capitalizeFloor
Field-specificauthor:austen  title:prejudice
AND inside field (no order)author:jane,austen
OR inside fieldauthor:austen/bronte
Field namestitle/subject/caption  author/from
recipient/to  filename  ext
Directory path filterdir:/home/me  dir:doc
MIME type filtermime:text/plain mime:video/*
Date intervalsdate:2018-01-01/2018-31-12
+ date:2018  date:2018-01-01/P12M
Sizesize>100k size<1M