names cleanup: reslist
This commit is contained in:
parent
9ba0a3f0cd
commit
c732caf339
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.34 2006-09-21 12:56:57 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.35 2006-09-22 07:29:34 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -58,7 +58,7 @@ using std::pair;
|
|||||||
#include "sortseq.h"
|
#include "sortseq.h"
|
||||||
#include "uiprefs.h"
|
#include "uiprefs.h"
|
||||||
#include "guiutils.h"
|
#include "guiutils.h"
|
||||||
#include "rclreslist.h"
|
#include "reslist.h"
|
||||||
#include "transcode.h"
|
#include "transcode.h"
|
||||||
|
|
||||||
#include "rclmain.h"
|
#include "rclmain.h"
|
||||||
@ -560,7 +560,7 @@ void RclMain::previewExposed(int sid, int docnum)
|
|||||||
// out of the reslist will typically look like
|
// out of the reslist will typically look like
|
||||||
// <!-- Fragment -->sometext
|
// <!-- Fragment -->sometext
|
||||||
// It would probably be better to cleanup in preview.ui.h and
|
// It would probably be better to cleanup in preview.ui.h and
|
||||||
// rclreslist.cpp and do the proper html stuff in the latter case
|
// reslist.cpp and do the proper html stuff in the latter case
|
||||||
// (which is different because it's format is explicit richtext
|
// (which is different because it's format is explicit richtext
|
||||||
// instead of auto as for preview, needed because it's built by
|
// instead of auto as for preview, needed because it's built by
|
||||||
// fragments?).
|
// fragments?).
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="RclResList">
|
<widget class="ResList">
|
||||||
<property name="name">
|
<property name="name">
|
||||||
<cstring>resList</cstring>
|
<cstring>resList</cstring>
|
||||||
</property>
|
</property>
|
||||||
@ -136,8 +136,8 @@
|
|||||||
<signal>startSearch(Rcl::AdvSearchData)</signal>
|
<signal>startSearch(Rcl::AdvSearchData)</signal>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>RclResList</class>
|
<class>ResList</class>
|
||||||
<header location="local">rclreslist.h</header>
|
<header location="local">reslist.h</header>
|
||||||
<sizehint>
|
<sizehint>
|
||||||
<width>300</width>
|
<width>300</width>
|
||||||
<height>200</height>
|
<height>200</height>
|
||||||
@ -299,11 +299,11 @@
|
|||||||
</actions>
|
</actions>
|
||||||
<includes>
|
<includes>
|
||||||
<include location="local" impldecl="in declaration">ssearch_w.h</include>
|
<include location="local" impldecl="in declaration">ssearch_w.h</include>
|
||||||
<include location="local" impldecl="in declaration">rclreslist.h</include>
|
<include location="local" impldecl="in declaration">reslist.h</include>
|
||||||
</includes>
|
</includes>
|
||||||
<pixmapinproject/>
|
<pixmapinproject/>
|
||||||
<layoutdefaults spacing="6" margin="11"/>
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
<includehints>
|
<includehints>
|
||||||
<includehint>rclreslist.h</includehint>
|
<includehint>reslist.h</includehint>
|
||||||
</includehints>
|
</includehints>
|
||||||
</UI>
|
</UI>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclreslist.cpp,v 1.21 2006-09-22 07:22:07 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.1 2006-09-22 07:29:34 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -24,18 +24,18 @@ static char rcsid[] = "@(#$Id: rclreslist.cpp,v 1.21 2006-09-22 07:22:07 dockes
|
|||||||
#include "mimehandler.h"
|
#include "mimehandler.h"
|
||||||
#include "plaintorich.h"
|
#include "plaintorich.h"
|
||||||
|
|
||||||
#include "rclreslist.h"
|
#include "reslist.h"
|
||||||
#include "moc_rclreslist.cpp"
|
#include "moc_reslist.cpp"
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
#define MIN(A,B) ((A) < (B) ? (A) : (B))
|
#define MIN(A,B) ((A) < (B) ? (A) : (B))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RclResList::RclResList(QWidget* parent, const char* name)
|
ResList::ResList(QWidget* parent, const char* name)
|
||||||
: QTextBrowser(parent, name)
|
: QTextBrowser(parent, name)
|
||||||
{
|
{
|
||||||
if (!name)
|
if (!name)
|
||||||
setName("rclResList");
|
setName("resList");
|
||||||
setTextFormat(Qt::RichText);
|
setTextFormat(Qt::RichText);
|
||||||
setReadOnly(TRUE);
|
setReadOnly(TRUE);
|
||||||
setUndoRedoEnabled(FALSE);
|
setUndoRedoEnabled(FALSE);
|
||||||
@ -57,19 +57,19 @@ RclResList::RclResList(QWidget* parent, const char* name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RclResList::~RclResList()
|
ResList::~ResList()
|
||||||
{
|
{
|
||||||
if (m_docsource)
|
if (m_docsource)
|
||||||
delete m_docsource;
|
delete m_docsource;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RclResList::languageChange()
|
void ResList::languageChange()
|
||||||
{
|
{
|
||||||
setCaption(tr("Result list"));
|
setCaption(tr("Result list"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Acquire new docsource
|
// Acquire new docsource
|
||||||
void RclResList::setDocSource(DocSequence *docsource, Rcl::AdvSearchData& sdt)
|
void ResList::setDocSource(DocSequence *docsource, Rcl::AdvSearchData& sdt)
|
||||||
{
|
{
|
||||||
if (m_docsource)
|
if (m_docsource)
|
||||||
delete m_docsource;
|
delete m_docsource;
|
||||||
@ -79,7 +79,7 @@ void RclResList::setDocSource(DocSequence *docsource, Rcl::AdvSearchData& sdt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get document number from paragraph number
|
// Get document number from paragraph number
|
||||||
int RclResList::docnumfromparnum(int par)
|
int ResList::docnumfromparnum(int par)
|
||||||
{
|
{
|
||||||
if (m_winfirst == -1)
|
if (m_winfirst == -1)
|
||||||
return -1;
|
return -1;
|
||||||
@ -94,7 +94,7 @@ int RclResList::docnumfromparnum(int par)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get paragraph number from document number
|
// Get paragraph number from document number
|
||||||
int RclResList::parnumfromdocnum(int docnum)
|
int ResList::parnumfromdocnum(int docnum)
|
||||||
{
|
{
|
||||||
if (m_winfirst == -1 || docnum - m_winfirst < 0)
|
if (m_winfirst == -1 || docnum - m_winfirst < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -108,7 +108,7 @@ int RclResList::parnumfromdocnum(int docnum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return doc from current or adjacent result pages
|
// Return doc from current or adjacent result pages
|
||||||
bool RclResList::getDoc(int docnum, Rcl::Doc &doc)
|
bool ResList::getDoc(int docnum, Rcl::Doc &doc)
|
||||||
{
|
{
|
||||||
if (docnum < 0)
|
if (docnum < 0)
|
||||||
return false;
|
return false;
|
||||||
@ -138,7 +138,7 @@ bool RclResList::getDoc(int docnum, Rcl::Doc &doc)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RclResList::keyPressEvent(QKeyEvent * e)
|
void ResList::keyPressEvent(QKeyEvent * e)
|
||||||
{
|
{
|
||||||
if (e->key() == Key_Q && (e->state() & ControlButton)) {
|
if (e->key() == Key_Q && (e->state() & ControlButton)) {
|
||||||
recollNeedsExit = 1;
|
recollNeedsExit = 1;
|
||||||
@ -153,7 +153,7 @@ void RclResList::keyPressEvent(QKeyEvent * e)
|
|||||||
QTextBrowser::keyPressEvent(e);
|
QTextBrowser::keyPressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RclResList::contentsMouseReleaseEvent(QMouseEvent *e)
|
void ResList::contentsMouseReleaseEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
m_lstClckMod = 0;
|
m_lstClckMod = 0;
|
||||||
if (e->state() & ControlButton) {
|
if (e->state() & ControlButton) {
|
||||||
@ -166,7 +166,7 @@ void RclResList::contentsMouseReleaseEvent(QMouseEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return total result list count
|
// Return total result list count
|
||||||
int RclResList::getResCnt()
|
int ResList::getResCnt()
|
||||||
{
|
{
|
||||||
if (!m_docsource)
|
if (!m_docsource)
|
||||||
return -1;
|
return -1;
|
||||||
@ -176,7 +176,7 @@ int RclResList::getResCnt()
|
|||||||
// Page Up/Down: we don't try to check if current paragraph is last or
|
// Page Up/Down: we don't try to check if current paragraph is last or
|
||||||
// first. We just page up/down and check if viewport moved. If it did,
|
// first. We just page up/down and check if viewport moved. If it did,
|
||||||
// fair enough, else we go to next/previous result page.
|
// fair enough, else we go to next/previous result page.
|
||||||
void RclResList::resPageUpOrBack()
|
void ResList::resPageUpOrBack()
|
||||||
{
|
{
|
||||||
int vpos = contentsY();
|
int vpos = contentsY();
|
||||||
moveCursor(QTextEdit::MovePgUp, false);
|
moveCursor(QTextEdit::MovePgUp, false);
|
||||||
@ -184,11 +184,11 @@ void RclResList::resPageUpOrBack()
|
|||||||
resultPageBack();
|
resultPageBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RclResList::resPageDownOrNext()
|
void ResList::resPageDownOrNext()
|
||||||
{
|
{
|
||||||
int vpos = contentsY();
|
int vpos = contentsY();
|
||||||
moveCursor(QTextEdit::MovePgDown, false);
|
moveCursor(QTextEdit::MovePgDown, false);
|
||||||
LOGDEB(("RclResList::resPageDownOrNext: vpos before %d, after %d\n",
|
LOGDEB(("ResList::resPageDownOrNext: vpos before %d, after %d\n",
|
||||||
vpos, contentsY()));
|
vpos, contentsY()));
|
||||||
if (vpos == contentsY())
|
if (vpos == contentsY())
|
||||||
resultPageNext();
|
resultPageNext();
|
||||||
@ -196,7 +196,7 @@ void RclResList::resPageDownOrNext()
|
|||||||
|
|
||||||
// Show previous page of results. We just set the current number back
|
// Show previous page of results. We just set the current number back
|
||||||
// 2 pages and show next page.
|
// 2 pages and show next page.
|
||||||
void RclResList::resultPageBack()
|
void ResList::resultPageBack()
|
||||||
{
|
{
|
||||||
if (m_winfirst <= 0)
|
if (m_winfirst <= 0)
|
||||||
return;
|
return;
|
||||||
@ -222,7 +222,7 @@ static string displayableBytes(long size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fill up result list window with next screen of hits
|
// Fill up result list window with next screen of hits
|
||||||
void RclResList::resultPageNext()
|
void ResList::resultPageNext()
|
||||||
{
|
{
|
||||||
if (!m_docsource)
|
if (!m_docsource)
|
||||||
return;
|
return;
|
||||||
@ -466,9 +466,9 @@ void RclResList::resultPageNext()
|
|||||||
|
|
||||||
// Single click in result list use this for document selection, if no
|
// Single click in result list use this for document selection, if no
|
||||||
// text selection active:
|
// text selection active:
|
||||||
void RclResList::clicked(int par, int)
|
void ResList::clicked(int par, int)
|
||||||
{
|
{
|
||||||
LOGDEB2(("RclResList::clicked\n"));
|
LOGDEB2(("ResList::clicked\n"));
|
||||||
|
|
||||||
// It's very ennoying, textBrowser always has selected text. This
|
// It's very ennoying, textBrowser always has selected text. This
|
||||||
// is bound to change with qt releases!
|
// is bound to change with qt releases!
|
||||||
@ -484,9 +484,9 @@ void RclResList::clicked(int par, int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Color paragraph (if any) of currently visible preview
|
// Color paragraph (if any) of currently visible preview
|
||||||
void RclResList::previewExposed(int docnum)
|
void ResList::previewExposed(int docnum)
|
||||||
{
|
{
|
||||||
LOGDEB(("RclResList::previewExposed: doc %d\n", docnum));
|
LOGDEB(("ResList::previewExposed: doc %d\n", docnum));
|
||||||
|
|
||||||
// Possibly erase old one to white
|
// Possibly erase old one to white
|
||||||
int par;
|
int par;
|
||||||
@ -510,15 +510,15 @@ void RclResList::previewExposed(int docnum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Double click in res list: add selection to simple search
|
// Double click in res list: add selection to simple search
|
||||||
void RclResList::doubleClicked(int, int)
|
void ResList::doubleClicked(int, int)
|
||||||
{
|
{
|
||||||
if (hasSelectedText())
|
if (hasSelectedText())
|
||||||
emit(wordSelect(selectedText()));
|
emit(wordSelect(selectedText()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RclResList::linkWasClicked(const QString &s)
|
void ResList::linkWasClicked(const QString &s)
|
||||||
{
|
{
|
||||||
LOGDEB(("RclResList::linkClicked: [%s]\n", s.ascii()));
|
LOGDEB(("ResList::linkClicked: [%s]\n", s.ascii()));
|
||||||
int i = atoi(s.ascii()+1);
|
int i = atoi(s.ascii()+1);
|
||||||
int what = s.ascii()[0];
|
int what = s.ascii()[0];
|
||||||
switch (what) {
|
switch (what) {
|
||||||
@ -541,7 +541,7 @@ void RclResList::linkWasClicked(const QString &s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPopupMenu *RclResList::createPopupMenu(const QPoint& pos)
|
QPopupMenu *ResList::createPopupMenu(const QPoint& pos)
|
||||||
{
|
{
|
||||||
int para = paragraphAt(pos);
|
int para = paragraphAt(pos);
|
||||||
clicked(para, 0);
|
clicked(para, 0);
|
||||||
@ -555,15 +555,15 @@ QPopupMenu *RclResList::createPopupMenu(const QPoint& pos)
|
|||||||
return popup;
|
return popup;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RclResList::menuPreview()
|
void ResList::menuPreview()
|
||||||
{
|
{
|
||||||
emit docPreviewClicked(m_popDoc);
|
emit docPreviewClicked(m_popDoc);
|
||||||
}
|
}
|
||||||
void RclResList::menuEdit()
|
void ResList::menuEdit()
|
||||||
{
|
{
|
||||||
emit docEditClicked(m_popDoc);
|
emit docEditClicked(m_popDoc);
|
||||||
}
|
}
|
||||||
void RclResList::menuCopyFN()
|
void ResList::menuCopyFN()
|
||||||
{
|
{
|
||||||
Rcl::Doc doc;
|
Rcl::Doc doc;
|
||||||
if (getDoc(m_popDoc, doc)) {
|
if (getDoc(m_popDoc, doc)) {
|
||||||
@ -572,7 +572,7 @@ void RclResList::menuCopyFN()
|
|||||||
QClipboard::Selection);
|
QClipboard::Selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void RclResList::menuCopyURL()
|
void ResList::menuCopyURL()
|
||||||
{
|
{
|
||||||
Rcl::Doc doc;
|
Rcl::Doc doc;
|
||||||
if (getDoc(m_popDoc, doc)) {
|
if (getDoc(m_popDoc, doc)) {
|
||||||
@ -581,7 +581,7 @@ void RclResList::menuCopyURL()
|
|||||||
QClipboard::Selection);
|
QClipboard::Selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void RclResList::menuExpand()
|
void ResList::menuExpand()
|
||||||
{
|
{
|
||||||
Rcl::Doc doc;
|
Rcl::Doc doc;
|
||||||
if (rcldb && getDoc(m_popDoc, doc)) {
|
if (rcldb && getDoc(m_popDoc, doc)) {
|
||||||
@ -589,13 +589,13 @@ void RclResList::menuExpand()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString RclResList::getDescription()
|
QString ResList::getDescription()
|
||||||
{
|
{
|
||||||
return QString::fromUtf8(m_queryData.description.c_str());
|
return QString::fromUtf8(m_queryData.description.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Show detailed expansion of a query */
|
/** Show detailed expansion of a query */
|
||||||
void RclResList::showQueryDetails()
|
void ResList::showQueryDetails()
|
||||||
{
|
{
|
||||||
// Break query into lines of reasonable length, avoid cutting words,
|
// Break query into lines of reasonable length, avoid cutting words,
|
||||||
// Also limit the total number of lines.
|
// Also limit the total number of lines.
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#ifndef _RCLRESLIST_H_INCLUDED_
|
#ifndef _RESLIST_H_INCLUDED_
|
||||||
#define _RCLRESLIST_H_INCLUDED_
|
#define _RESLIST_H_INCLUDED_
|
||||||
/* @(#$Id: rclreslist.h,v 1.11 2006-09-22 07:22:07 dockes Exp $ (C) 2005 J.F.Dockes */
|
/* @(#$Id: reslist.h,v 1.1 2006-09-22 07:29:34 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@ -15,13 +15,13 @@ using std::list;
|
|||||||
#include "docseq.h"
|
#include "docseq.h"
|
||||||
#include "searchdata.h"
|
#include "searchdata.h"
|
||||||
|
|
||||||
class RclResList : public QTextBrowser
|
class ResList : public QTextBrowser
|
||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RclResList(QWidget* parent = 0, const char* name = 0);
|
ResList(QWidget* parent = 0, const char* name = 0);
|
||||||
virtual ~RclResList();
|
virtual ~ResList();
|
||||||
|
|
||||||
// Return document for given docnum. We act as an intermediary to
|
// Return document for given docnum. We act as an intermediary to
|
||||||
// the docseq here. This has also the side-effect of making the
|
// the docseq here. This has also the side-effect of making the
|
||||||
@ -88,4 +88,4 @@ class RclResList : public QTextBrowser
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* _RCLRESLIST_H_INCLUDED_ */
|
#endif /* _RESLIST_H_INCLUDED_ */
|
||||||
Loading…
x
Reference in New Issue
Block a user