Get the result table detail area to use the reslist HTML style (e.g. for dark mode)
This commit is contained in:
@@ -462,8 +462,37 @@ void ResListPager::displayPage(RclConfig *config)
|
||||
chunk << "</p>" << endl;
|
||||
chunk << "</body></html>" << endl;
|
||||
append(chunk.rdbuf()->str());
|
||||
flush();
|
||||
}
|
||||
|
||||
void ResListPager::displaySingleDoc(RclConfig *config, int idx,
|
||||
Rcl::Doc& doc,
|
||||
const HighlightData& hdata)
|
||||
{
|
||||
ostringstream chunk;
|
||||
|
||||
// Header
|
||||
// Note: have to append text in chunks that make sense
|
||||
// html-wise. If we break things up too much, the editor
|
||||
// gets confused.
|
||||
string bdtag("<body ");
|
||||
bdtag += bodyAttrs();
|
||||
rtrimstring(bdtag, " ");
|
||||
bdtag += ">";
|
||||
chunk << "<html><head>\n"
|
||||
<< "<meta http-equiv=\"content-type\""
|
||||
<< " content=\"text/html; charset=utf-8\">\n"
|
||||
<< headerContent()
|
||||
<< "</head>\n" << bdtag << "\n";
|
||||
append(chunk.rdbuf()->str());
|
||||
// Document
|
||||
displayDoc(config, idx, doc, hdata, string());
|
||||
// Footer
|
||||
append("</body></html>\n");
|
||||
flush();
|
||||
}
|
||||
|
||||
|
||||
// Default implementations for things that should be implemented by
|
||||
// specializations
|
||||
string ResListPager::nextUrl()
|
||||
|
||||
@@ -79,9 +79,16 @@ public:
|
||||
}
|
||||
void resultPageNext();
|
||||
void resultPageFor(int docnum);
|
||||
|
||||
/* Display page of results */
|
||||
void displayPage(RclConfig *);
|
||||
/* Display page with single document */
|
||||
void displaySingleDoc(RclConfig *config, int idx,
|
||||
Rcl::Doc& doc, const HighlightData& hdata);
|
||||
/* Generate HTML for single document inside page */
|
||||
void displayDoc(RclConfig *, int idx, Rcl::Doc& doc,
|
||||
const HighlightData& hdata, const string& sh = "");
|
||||
|
||||
bool pageEmpty() {return m_respage.size() == 0;}
|
||||
|
||||
string queryDescription() {
|
||||
@@ -95,6 +102,9 @@ public:
|
||||
virtual bool append(const string& data, int, const Rcl::Doc&) {
|
||||
return append(data);
|
||||
}
|
||||
/* Implementing this allows accumulating the text and setting the HTML
|
||||
at once */
|
||||
virtual bool flush() {return true;}
|
||||
// Translation function. This is reimplemented in the qt reslist
|
||||
// object For this to work, the strings must be duplicated inside
|
||||
// reslist.cpp (see the QT_TR_NOOP in there). Very very unwieldy.
|
||||
|
||||
Reference in New Issue
Block a user