separate file and document dates (mainly for email folders). Better check configuration at startup
This commit is contained in:
+6
-3
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.11 2005-10-22 05:35:16 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.12 2005-11-05 14:40:50 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -101,11 +101,14 @@ int main( int argc, char ** argv )
|
||||
w.connect(timer, SIGNAL(timeout()), &w, SLOT(checkExit()));
|
||||
timer->start(100);
|
||||
|
||||
rclconfig = recollinit(recollCleanup, sigcleanup);
|
||||
string reason;
|
||||
rclconfig = recollinit(recollCleanup, sigcleanup, reason);
|
||||
|
||||
if (!rclconfig || !rclconfig->ok()) {
|
||||
string msg = "Configuration problem: ";
|
||||
msg += reason;
|
||||
QMessageBox::critical(0, "Recoll",
|
||||
QString("Could not find configuration"));
|
||||
QString(msg.c_str()));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout9</cstring>
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
@@ -75,7 +75,7 @@
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout7</cstring>
|
||||
<cstring>layout3</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@@ -107,6 +107,9 @@
|
||||
<property name="name">
|
||||
<cstring>nextButton</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Next</string>
|
||||
</property>
|
||||
@@ -118,6 +121,9 @@
|
||||
<property name="name">
|
||||
<cstring>prevButton</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Previous</string>
|
||||
</property>
|
||||
@@ -125,6 +131,17 @@
|
||||
<string>Alt+P</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>clearPB</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>matchCheck</cstring>
|
||||
@@ -161,6 +178,12 @@
|
||||
<receiver>Preview</receiver>
|
||||
<slot>prevPressed()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>clearPB</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>searchTextLine</receiver>
|
||||
<slot>clear()</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<includes>
|
||||
<include location="local" impldecl="in implementation">qapplication.h</include>
|
||||
|
||||
@@ -57,6 +57,7 @@ bool Preview::eventFilter(QObject *target, QEvent *event)
|
||||
e = (QTextEdit *)tw->child("pvEdit");
|
||||
LOGDEB1(("Widget: %p, edit %p, target %p\n", tw, e, target));
|
||||
if (e && target == tw && keyEvent->key() == Key_Slash) {
|
||||
searchTextLine->setFocus();
|
||||
dynSearchActive = true;
|
||||
return true;
|
||||
}
|
||||
@@ -70,8 +71,14 @@ void Preview::searchTextLine_textChanged(const QString & text)
|
||||
LOGDEB1(("search line text changed. text: '%s'\n", text.ascii()));
|
||||
if (text.isEmpty()) {
|
||||
dynSearchActive = false;
|
||||
nextButton->setEnabled(false);
|
||||
prevButton->setEnabled(false);
|
||||
clearPB->setEnabled(false);
|
||||
} else {
|
||||
dynSearchActive = true;
|
||||
nextButton->setEnabled(true);
|
||||
prevButton->setEnabled(true);
|
||||
clearPB->setEnabled(true);
|
||||
doSearch(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,8 +407,9 @@ void RecollMain::listNextPB_clicked()
|
||||
doc.title = path_getsimple(doc.url);
|
||||
char datebuf[100];
|
||||
datebuf[0] = 0;
|
||||
if (!doc.mtime.empty()) {
|
||||
time_t mtime = atol(doc.mtime.c_str());
|
||||
if (!doc.dmtime.empty() || !doc.fmtime.empty()) {
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atol(doc.fmtime.c_str()) : atol(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, "<i>Modified:</i> %F %T", tm);
|
||||
}
|
||||
@@ -417,7 +418,7 @@ void RecollMain::listNextPB_clicked()
|
||||
string result = "<p>" +
|
||||
string(perbuf) + " <b>" + doc.title + "</b><br>" +
|
||||
doc.mimetype + " " +
|
||||
(!doc.mtime.empty() ? string(datebuf) + "<br>" : string("<br>")) +
|
||||
(datebuf[0] ? string(datebuf) + "<br>" : string("<br>")) +
|
||||
(!abst.empty() ? abst + "<br>" : string("")) +
|
||||
(!doc.keywords.empty() ? doc.keywords + "<br>" : string("")) +
|
||||
"<i>" + doc.url + +"</i><br>" +
|
||||
@@ -620,14 +621,14 @@ void RecollMain::startPreview(int docnum)
|
||||
doc.title = path_getsimple(doc.url);
|
||||
char datebuf[100];
|
||||
datebuf[0] = 0;
|
||||
if (!doc.mtime.empty()) {
|
||||
time_t mtime = atol(doc.mtime.c_str());
|
||||
if (!doc.fmtime.empty() || !doc.dmtime.empty()) {
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atol(doc.fmtime.c_str()) : atol(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, "%F %T", tm);
|
||||
}
|
||||
string tiptxt = doc.url + string("\n");
|
||||
tiptxt += doc.mimetype + " "
|
||||
+ (doc.mtime.empty() ? "\n" : string(datebuf) + "\n");
|
||||
tiptxt += doc.mimetype + " " + string(datebuf) + "\n";
|
||||
if (!doc.title.empty())
|
||||
tiptxt += doc.title + "\n";
|
||||
curPreview->pvTab->setTabToolTip(curPreview->pvTab->currentPage(),
|
||||
|
||||
Reference in New Issue
Block a user