16 #include <QDesktopServices>
17 #include <QDialogButtonBox>
20 #include <QTextBrowser>
21 #include <QVBoxLayout>
22 #include "../../util/btconnect.h"
23 #include "../messagedialog.h"
35 QVBoxLayout *l =
new QVBoxLayout;
39 font.setPointSize(font.pointSize()+2);
43 [
this](QUrl
const & url) {
44 if (url.scheme().isEmpty()) {
45 if (auto fragment = url.fragment(); !fragment.isEmpty())
46 m_textBrowser->scrollToAnchor(std::move(fragment));
48 QDesktopServices::openUrl(url);
53 m_buttons =
new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal,
this);
63 QString theTitle(tr(
"Search Syntax Help"));
64 setWindowTitle(theTitle);
68 "<html><head><title>%1</title>"
69 "<style type=\"text/css\">"
71 "background-color:%2;"
77 "text-decoration:underline"
86 "border-collapse:collapse"
88 "padding:0.2em 0.3em;"
89 "border:3px solid %6;"
91 "background-color:%8;"
93 "list-style-type:none"
95 "</style></head><body>"
98 "<li><a href='#allsome'>%10</a></li>"
99 "<li><a href='#grouping'>%11</a></li>"
100 "<li><a href='#wildcards'>%12</a></li>"
101 "<li><a href='#fields'>%13</a></li>"
102 "<li><a href='#lucene'>%14</a></li>"
104 "<h1><a name='allsome'>%15</a></h1>"
107 "<tr><td><code>%17</code></td><td>%18</td></tr>"
108 "<tr><td><code>%19</code></td><td>%20</td></tr>"
109 "<tr><td><code>%21</code></td><td>%22</td></tr>"
110 "<tr><td><code>%23</code></td><td>%24</td></tr>"
112 "<h1><a name='grouping'>%25</a></h1>"
115 "<tr><td><code>%27</code></td><td>%28</td></tr>"
116 "<tr><td><code>%29</code></td><td>%30</td></tr>"
117 "<tr><td><code>%31</code></td><td>%32</td></tr>"
119 "<h1><a name='wildcards'>%33</a></h1>"
122 "<tr><td><code>%35</code></td><td>%36</td></tr>"
123 "<tr><td><code>%37</code></td><td>%38</td></tr>"
124 "<tr><td><code>%39</code></td><td>%40</td></tr>"
125 "<tr><td><code>%41</code></td><td>%42</td></tr>"
127 "<h1><a name='fields'>%43</a></h1>"
131 "<tr><td><code>heading:</code></td><td>%45</td></tr>"
132 "<tr><td><code>footnote:</code></td><td>%46</td></tr>"
133 "<tr><td><code>strong:</code></td><td>%47</td></tr>"
134 "<tr><td><code>morph:</code></td><td>%48</td></tr>"
140 "<tr><td><code>%50</code></td><td>%51</td></tr>"
141 "<tr><td><code>%52</code></td><td>%53</td></tr>"
142 "<tr><td><code>%54</code></td><td>%55</td></tr>"
143 "<tr><td><code>%56</code></td><td>%57</td></tr>"
146 "<h1><a name='lucene'>%58</a></h1>"
151 palette().color(QPalette::Window).name(),
152 palette().color(QPalette::WindowText).name(),
153 palette().color(QPalette::Link).name(),
154 palette().color(QPalette::LinkVisited).name(),
155 palette().color(QPalette::WindowText).name(),
157 palette().color(QPalette::Base).name(),
158 tr(
"This help is mainly for 'Full syntax' option. 'All words' and "
159 "'Some words' options have more limited syntax; "
160 "<a href=\"#%1\">wildcards</a> and <a href=\"#%2\">text "
161 "fields</a> are supported for them. Some other syntax features "
162 "may give strange or wrong results with All words/Some words.")
163 .arg(QStringLiteral(
"wildcards"), QStringLiteral(
"fields")),
164 tr(
"Which words to find"),
165 tr(
"Grouping and order"),
166 tr(
"Wildcards (partial words)"),
167 tr(
"Text fields (different parts of text)"),
168 tr(
"Other syntax features"),
169 tr(
"Which words to find"),
170 tr(
"Search terms are separated by spaces. <code>AND</code> "
171 "(all words), <code>OR</code> (some words) and "
172 "<code>NOT</code> (not the following word) can be added "
173 "between the words. If none is added explicitly "
174 "<code>OR</code> is used automatically. <code>+word</code> "
175 "means the word must be in the results, <code>-word</code> "
176 "means it must not be in the results.",
177 "Do not translate \"AND\", \"OR\" or \"NOT\"."),
178 tr(
"jesus AND god",
"Do not translate \"AND\"."),
179 tr(
"Finds verses with both 'Jesus' and 'God'"),
180 tr(
"jesus OR god",
"Do not translate \"OR\"."),
181 tr(
"Finds verses with 'Jesus' or 'God' or both"),
182 tr(
"jesus NOT god",
"Do not translate \"NOT\"."),
183 tr(
"Finds verses with 'Jesus' but with no 'God'"),
185 tr(
"Finds verses with 'Jesus' but with no 'God'"),
186 tr(
"Grouping and order"),
187 tr(
"Words can be grouped with <strong>parenthesis</strong>. Strict"
188 " word order can be defined with <strong>quotes</strong>."),
189 tr(
"(a AND b) OR c",
"Do not translate \"AND\" or \"OR\"."),
190 tr(
"Finds verses with both 'a' AND 'b', and verses with 'c'"),
192 tr(
"Finds e.g. '...Isaiah says, \"Lord...' but not '...says the "
194 tr(
"\"says the lord\""),
195 tr(
"Finds all verses with 'says the LORD'"),
196 tr(
"Wildcards (partial words)"),
197 tr(
"<code>*</code> matches any sequence of 0 or more "
198 "characters, while <code>?</code> matches any single "
199 "character. A wildcard can not be used in the beginning of a "
202 tr(
"All words beginning with 'a'"),
204 tr(
"'Assyria', 'aroma', 'abba' etc."),
208 tr(
"'abba', 'area', 'Asia' etc."),
209 tr(
"Text fields (different parts of text)"),
210 tr(
"Available text fields:" ),
211 tr(
"Searches headings"),
212 tr(
"Searches footnotes"),
213 tr(
"Searches Strong's numbers"),
214 tr(
"Searches morphology codes"),
216 tr(
"heading:Jesus",
"Do not translate \"heading:\"."),
217 tr(
"Finds headings with 'Jesus'"),
218 tr(
"footnote:Jesus AND footnote:said",
219 "Do not translate \"footnote:\" or \"AND\"."),
220 tr(
"Finds footnotes with 'Jesus' and 'said'"),
221 tr(
"strong:G846",
"Do not translate \"strong:\"."),
222 tr(
"Finds verses with Strong's Greek number 846"),
223 tr(
"morph:\"N-NSF\"",
"Do not translate \"morph:\"."),
224 tr(
"Finds verses with morphology code 'N-NSF'"),
225 tr(
"Other syntax features"),
226 tr(
"BibleTime uses the CLucene search engine. You can read more "
227 "on the <a href=\"%1\">lucene syntax web page</a> (in external "
229 .arg(QStringLiteral(
"http://lucene.apache.org/java/1_4_3/"
230 "queryparsersyntax.html"))
QTextBrowser * m_textBrowser
BtSearchSyntaxHelpDialog(QWidget *parent=nullptr, Qt::WindowFlags wflags=Qt::Dialog)
QDialogButtonBox * m_buttons
void prepareDialogBox(QDialogButtonBox *box)