|
a/src/qtgui/guiutils.cpp |
|
b/src/qtgui/guiutils.cpp |
|
... |
|
... |
37 |
|
37 |
|
38 |
// The table should not be necessary, but I found no css way to get
|
38 |
// The table should not be necessary, but I found no css way to get
|
39 |
// qt 4.6 qtextedit to clear the margins after the float img without
|
39 |
// qt 4.6 qtextedit to clear the margins after the float img without
|
40 |
// introducing blank space.
|
40 |
// introducing blank space.
|
41 |
const char *PrefsPack::dfltResListFormat =
|
41 |
const char *PrefsPack::dfltResListFormat =
|
42 |
#if 1
|
|
|
43 |
"<table><tr><td><a href='%U'><img src='%I' width='64'></a></td>"
|
42 |
"<table><tr><td><a href='%U'><img src='%I' width='64'></a></td>"
|
44 |
"<td>%R %S %L <b>%T</b><br>"
|
43 |
"<td>%S %L <b>%T</b><br>"
|
45 |
"%M %D <i>%U</i> %i<br>"
|
44 |
"%M %D <i>%U</i> %i<br>"
|
46 |
"%A %K</td></tr></table>"
|
45 |
"%A %K</td></tr></table>"
|
47 |
#elif 0
|
|
|
48 |
"<img src='%I' align='left'>"
|
|
|
49 |
"%R %S %L <b>%T</b><br>"
|
|
|
50 |
"%M %D <i>%U</i><br>"
|
|
|
51 |
"%A %K"
|
|
|
52 |
#endif
|
|
|
53 |
;
|
46 |
;
|
54 |
|
|
|
55 |
const char* v162reslistformat="<table><tr><td><img src='%I'></td>"
|
|
|
56 |
"<td>%R %S %L <b>%T</b><br>"
|
|
|
57 |
"%M %D <i>%U</i><br>"
|
|
|
58 |
"%A %K</td></tr></table>";
|
|
|
59 |
|
|
|
60 |
|
47 |
|
61 |
// The global preferences structure
|
48 |
// The global preferences structure
|
62 |
PrefsPack prefs;
|
49 |
PrefsPack prefs;
|
63 |
|
50 |
|
64 |
// Using the same macro to read/write a setting. insurance against typing
|
51 |
// Using the same macro to read/write a setting. insurance against typing
|
|
... |
|
... |
143 |
String," %Y-%m-%d %H:%M:%S %z");
|
130 |
String," %Y-%m-%d %H:%M:%S %z");
|
144 |
if (!writing && prefs.reslistdateformat == "")
|
131 |
if (!writing && prefs.reslistdateformat == "")
|
145 |
prefs.reslistdateformat = " %Y-%m-%d %H:%M:%S %z";
|
132 |
prefs.reslistdateformat = " %Y-%m-%d %H:%M:%S %z";
|
146 |
prefs.creslistdateformat = (const char*)prefs.reslistdateformat.toUtf8();
|
133 |
prefs.creslistdateformat = (const char*)prefs.reslistdateformat.toUtf8();
|
147 |
|
134 |
|
148 |
SETTING_RW(prefs.reslistfontfamily, "/Recoll/prefs/reslist/fontFamily", String,
|
135 |
SETTING_RW(prefs.reslistfontfamily, "/Recoll/prefs/reslist/fontFamily",
|
149 |
"");
|
136 |
String, "");
|
150 |
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Int,
|
137 |
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Int,
|
151 |
10);
|
138 |
10);
|
|
|
139 |
|
152 |
QString rlfDflt = QString::fromAscii(prefs.dfltResListFormat);
|
140 |
QString rlfDflt = QString::fromAscii(prefs.dfltResListFormat);
|
153 |
SETTING_RW(prefs.reslistformat, "/Recoll/prefs/reslist/format", String, rlfDflt);
|
|
|
154 |
prefs.creslistformat = (const char*)prefs.reslistformat.toUtf8();
|
|
|
155 |
if (!writing) {
|
141 |
if (writing) {
|
156 |
// If the current value of the format is the default for the
|
|
|
157 |
// previous version, replace it with the new default. We
|
|
|
158 |
// should have a flag to say if it was changed instead
|
|
|
159 |
if (!prefs.creslistformat.compare(v162reslistformat)) {
|
142 |
if (prefs.reslistformat.compare(rlfDflt)) {
|
160 |
LOGDEB(("Replacing old default format\n"));
|
143 |
settings.setValue("/Recoll/prefs/reslist/format",
|
|
|
144 |
prefs.reslistformat);
|
|
|
145 |
} else {
|
|
|
146 |
settings.remove("/Recoll/prefs/reslist/format");
|
|
|
147 |
}
|
|
|
148 |
} else {
|
161 |
prefs.reslistformat = rlfDflt;
|
149 |
prefs.reslistformat =
|
162 |
prefs.creslistformat = (const char*)prefs.reslistformat.toUtf8();
|
150 |
settings.value("/Recoll/prefs/reslist/format", rlfDflt).toString();
|
163 |
}
|
151 |
prefs.creslistformat = qs2utf8s(prefs.reslistformat);
|
164 |
}
|
152 |
}
|
|
|
153 |
|
165 |
SETTING_RW(prefs.reslistheadertext, "/Recoll/prefs/reslist/headertext", String, "");
|
154 |
SETTING_RW(prefs.reslistheadertext, "/Recoll/prefs/reslist/headertext",
|
|
|
155 |
String, "");
|
166 |
SETTING_RW(prefs.stylesheetFile, "/Recoll/prefs/stylesheet", String, "");
|
156 |
SETTING_RW(prefs.stylesheetFile, "/Recoll/prefs/stylesheet", String, "");
|
167 |
SETTING_RW(prefs.queryStemLang, "/Recoll/prefs/query/stemLang", String,
|
157 |
SETTING_RW(prefs.queryStemLang, "/Recoll/prefs/query/stemLang", String,
|
168 |
"english");
|
158 |
"english");
|
169 |
SETTING_RW(prefs.useDesktopOpen,
|
159 |
SETTING_RW(prefs.useDesktopOpen, "/Recoll/prefs/useDesktopOpen",
|
170 |
"/Recoll/prefs/useDesktopOpen", Bool, true);
|
160 |
Bool, true);
|
171 |
|
161 |
|
172 |
SETTING_RW(prefs.keepSort,
|
162 |
SETTING_RW(prefs.keepSort,
|
173 |
"/Recoll/prefs/keepSort", Bool, false);
|
163 |
"/Recoll/prefs/keepSort", Bool, false);
|
174 |
SETTING_RW(prefs.sortField, "/Recoll/prefs/sortField", String, "");
|
164 |
SETTING_RW(prefs.sortField, "/Recoll/prefs/sortField", String, "");
|
175 |
SETTING_RW(prefs.sortActive,
|
165 |
SETTING_RW(prefs.sortActive,
|
|
... |
|
... |
197 |
|
187 |
|
198 |
SETTING_RW(prefs.termMatchType, "/Recoll/prefs/query/termMatchType",
|
188 |
SETTING_RW(prefs.termMatchType, "/Recoll/prefs/query/termMatchType",
|
199 |
Int, 0);
|
189 |
Int, 0);
|
200 |
// This is not really the current program version, just a value to
|
190 |
// This is not really the current program version, just a value to
|
201 |
// be used in case we have incompatible changes one day
|
191 |
// be used in case we have incompatible changes one day
|
202 |
SETTING_RW(prefs.rclVersion, "/Recoll/prefs/rclVersion",
|
192 |
SETTING_RW(prefs.rclVersion, "/Recoll/prefs/rclVersion", Int, 1009);
|
203 |
Int, 1009);
|
|
|
204 |
|
193 |
|
205 |
// Ssearch combobox history list
|
194 |
// Ssearch combobox history list
|
206 |
if (writing) {
|
195 |
if (writing) {
|
207 |
settings.setValue("/Recoll/prefs/query/ssearchHistory",
|
196 |
settings.setValue("/Recoll/prefs/query/ssearchHistory",
|
208 |
prefs.ssearchHistory);
|
197 |
prefs.ssearchHistory);
|