|
a/src/qtgui/rclmain.cpp |
|
b/src/qtgui/rclmain.cpp |
|
... |
|
... |
86 |
// Set result list font according to user preferences.
|
86 |
// Set result list font according to user preferences.
|
87 |
if (prefs_reslistfontfamily.length()) {
|
87 |
if (prefs_reslistfontfamily.length()) {
|
88 |
QFont nfont(prefs_reslistfontfamily, prefs_reslistfontsize);
|
88 |
QFont nfont(prefs_reslistfontfamily, prefs_reslistfontsize);
|
89 |
reslistTE->setFont(nfont);
|
89 |
reslistTE->setFont(nfont);
|
90 |
}
|
90 |
}
|
|
|
91 |
string historyfile = path_cat(rclconfig->getConfDir(), "history");
|
|
|
92 |
m_history = new RclDHistory(historyfile);
|
91 |
}
|
93 |
}
|
92 |
|
94 |
|
93 |
// We also want to get rid of the advanced search form and previews
|
95 |
// We also want to get rid of the advanced search form and previews
|
94 |
// when we exit (not our children so that it's not systematically
|
96 |
// when we exit (not our children so that it's not systematically
|
95 |
// created over the main form).
|
97 |
// created over the main form).
|
|
... |
|
... |
515 |
}
|
517 |
}
|
516 |
|
518 |
|
517 |
gotone = true;
|
519 |
gotone = true;
|
518 |
|
520 |
|
519 |
// Result list entry display: this must be exactly one paragraph
|
521 |
// Result list entry display: this must be exactly one paragraph
|
520 |
// TOBEDONE
|
522 |
// We should probably display the size too - size ?
|
521 |
// - move abstract/keywords to Detail window ?
|
|
|
522 |
// - keywords matched ?
|
|
|
523 |
// - language ?
|
|
|
524 |
// - size ?
|
|
|
525 |
|
523 |
|
526 |
string result;
|
524 |
string result;
|
527 |
if (!sh.empty())
|
525 |
if (!sh.empty())
|
528 |
result += string("<p><b>") + sh + "</p>\n<p>";
|
526 |
result += string("<p><b>") + sh + "</p>\n<p>";
|
529 |
else
|
527 |
else
|
530 |
result = "<p>";
|
528 |
result = "<p>";
|
531 |
|
529 |
|
532 |
string img_name;
|
530 |
string img_name;
|
533 |
if (prefs_showicons) {
|
531 |
if (prefs_showicons) {
|
|
|
532 |
string iconpath;
|
534 |
string iconname = rclconfig->getMimeIconName(doc.mimetype);
|
533 |
string iconname = rclconfig->getMimeIconName(doc.mimetype,
|
535 |
if (iconname.empty())
|
534 |
&iconpath);
|
536 |
iconname = "document";
|
|
|
537 |
string imgfile = iconsdir + "/" + iconname + ".png";
|
|
|
538 |
|
|
|
539 |
LOGDEB1(("Img file; %s\n", imgfile.c_str()));
|
535 |
LOGDEB1(("Img file; %s\n", iconpath.c_str()));
|
540 |
QImage image(imgfile.c_str());
|
536 |
QImage image(iconpath.c_str());
|
541 |
if (!image.isNull()) {
|
537 |
if (!image.isNull()) {
|
542 |
img_name = string("img_") + iconname;
|
538 |
img_name = string("img_") + iconname;
|
543 |
QMimeSourceFactory::defaultFactory()->
|
539 |
QMimeSourceFactory::defaultFactory()->
|
544 |
setImage(img_name.c_str(), image);
|
540 |
setImage(img_name.c_str(), image);
|
545 |
}
|
541 |
}
|
|
... |
|
... |
724 |
// Already there
|
720 |
// Already there
|
725 |
return;
|
721 |
return;
|
726 |
}
|
722 |
}
|
727 |
(void)curPreview->addEditorTab();
|
723 |
(void)curPreview->addEditorTab();
|
728 |
}
|
724 |
}
|
729 |
history->enterDocument(fn, doc.ipath);
|
725 |
m_history->enterDocument(fn, doc.ipath);
|
730 |
curPreview->loadFileInCurrentTab(fn, st.st_size, doc);
|
726 |
curPreview->loadFileInCurrentTab(fn, st.st_size, doc);
|
731 |
}
|
727 |
}
|
732 |
|
728 |
|
733 |
void RclMain::startNativeViewer(int docnum)
|
729 |
void RclMain::startNativeViewer(int docnum)
|
734 |
{
|
730 |
{
|
|
... |
|
... |
777 |
QString msg = tr("Executing: [") + ncmd.c_str() + "]";
|
773 |
QString msg = tr("Executing: [") + ncmd.c_str() + "]";
|
778 |
stb->message(msg, 5000);
|
774 |
stb->message(msg, 5000);
|
779 |
stb->repaint(false);
|
775 |
stb->repaint(false);
|
780 |
XFlush(qt_xdisplay());
|
776 |
XFlush(qt_xdisplay());
|
781 |
}
|
777 |
}
|
782 |
history->enterDocument(fn, doc.ipath);
|
778 |
m_history->enterDocument(fn, doc.ipath);
|
783 |
system(ncmd.c_str());
|
779 |
system(ncmd.c_str());
|
784 |
}
|
780 |
}
|
785 |
|
781 |
|
786 |
|
782 |
|
787 |
void RclMain::showAboutDialog()
|
783 |
void RclMain::showAboutDialog()
|
|
... |
|
... |
803 |
curPreview = 0;
|
799 |
curPreview = 0;
|
804 |
if (docsource)
|
800 |
if (docsource)
|
805 |
delete docsource;
|
801 |
delete docsource;
|
806 |
|
802 |
|
807 |
if (sortwidth > 0) {
|
803 |
if (sortwidth > 0) {
|
808 |
DocSequenceHistory myseq(rcldb, history, tr("Document history"));
|
804 |
DocSequenceHistory myseq(rcldb, m_history, tr("Document history"));
|
809 |
docsource = new DocSeqSorted(myseq, sortwidth, sortspecs,
|
805 |
docsource = new DocSeqSorted(myseq, sortwidth, sortspecs,
|
810 |
tr("Document history (sorted)"));
|
806 |
tr("Document history (sorted)"));
|
811 |
} else {
|
807 |
} else {
|
812 |
docsource = new DocSequenceHistory(rcldb, history,
|
808 |
docsource = new DocSequenceHistory(rcldb, m_history,
|
813 |
tr("Document history"));
|
809 |
tr("Document history"));
|
814 |
}
|
810 |
}
|
815 |
currentQueryData.erase();
|
811 |
currentQueryData.erase();
|
816 |
currentQueryData.description = tr("History data").utf8();
|
812 |
currentQueryData.description = tr("History data").utf8();
|
817 |
showResultPage();
|
813 |
showResultPage();
|