use restable instead of reslist for "show subdocs"
This commit is contained in:
parent
656d0a1395
commit
ceef5aebd0
@ -279,6 +279,8 @@ void RclMain::init()
|
|||||||
reslist, SLOT(showQueryDetails()));
|
reslist, SLOT(showQueryDetails()));
|
||||||
connect(periodictimer, SIGNAL(timeout()),
|
connect(periodictimer, SIGNAL(timeout()),
|
||||||
this, SLOT(periodic100()));
|
this, SLOT(periodic100()));
|
||||||
|
|
||||||
|
restable->setRclMain(this, true);
|
||||||
connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
|
connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
|
||||||
restable, SLOT(setDocSource(RefCntr<DocSequence>)));
|
restable, SLOT(setDocSource(RefCntr<DocSequence>)));
|
||||||
connect(this, SIGNAL(searchReset()),
|
connect(this, SIGNAL(searchReset()),
|
||||||
@ -290,8 +292,7 @@ void RclMain::init()
|
|||||||
|
|
||||||
connect(restable->getModel(), SIGNAL(sortDataChanged(DocSeqSortSpec)),
|
connect(restable->getModel(), SIGNAL(sortDataChanged(DocSeqSortSpec)),
|
||||||
this, SLOT(onSortDataChanged(DocSeqSortSpec)));
|
this, SLOT(onSortDataChanged(DocSeqSortSpec)));
|
||||||
connect(restable, SIGNAL(docEditClicked(Rcl::Doc)),
|
|
||||||
this, SLOT(startNativeViewer(Rcl::Doc)));
|
|
||||||
connect(restable, SIGNAL(docPreviewClicked(int, Rcl::Doc, int)),
|
connect(restable, SIGNAL(docPreviewClicked(int, Rcl::Doc, int)),
|
||||||
this, SLOT(startPreview(int, Rcl::Doc, int)));
|
this, SLOT(startPreview(int, Rcl::Doc, int)));
|
||||||
connect(restable, SIGNAL(docExpand(Rcl::Doc)),
|
connect(restable, SIGNAL(docExpand(Rcl::Doc)),
|
||||||
@ -305,7 +306,7 @@ void RclMain::init()
|
|||||||
connect(restable, SIGNAL(docSaveToFileClicked(Rcl::Doc)),
|
connect(restable, SIGNAL(docSaveToFileClicked(Rcl::Doc)),
|
||||||
this, SLOT(saveDocToFile(Rcl::Doc)));
|
this, SLOT(saveDocToFile(Rcl::Doc)));
|
||||||
|
|
||||||
reslist->setRclMain(this);
|
reslist->setRclMain(this, true);
|
||||||
connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
|
connect(this, SIGNAL(docSourceChanged(RefCntr<DocSequence>)),
|
||||||
reslist, SLOT(setDocSource(RefCntr<DocSequence>)));
|
reslist, SLOT(setDocSource(RefCntr<DocSequence>)));
|
||||||
connect(firstPageAction, SIGNAL(activated()),
|
connect(firstPageAction, SIGNAL(activated()),
|
||||||
@ -321,8 +322,6 @@ void RclMain::init()
|
|||||||
|
|
||||||
connect(reslist, SIGNAL(hasResults(int)),
|
connect(reslist, SIGNAL(hasResults(int)),
|
||||||
this, SLOT(resultCount(int)));
|
this, SLOT(resultCount(int)));
|
||||||
connect(reslist, SIGNAL(docExpand(Rcl::Doc)),
|
|
||||||
this, SLOT(docExpand(Rcl::Doc)));
|
|
||||||
connect(reslist, SIGNAL(wordSelect(QString)),
|
connect(reslist, SIGNAL(wordSelect(QString)),
|
||||||
sSearch, SLOT(addTerm(QString)));
|
sSearch, SLOT(addTerm(QString)));
|
||||||
connect(reslist, SIGNAL(wordReplace(const QString&, const QString&)),
|
connect(reslist, SIGNAL(wordReplace(const QString&, const QString&)),
|
||||||
@ -331,8 +330,9 @@ void RclMain::init()
|
|||||||
this, SLOT(enableNextPage(bool)));
|
this, SLOT(enableNextPage(bool)));
|
||||||
connect(reslist, SIGNAL(prevPageAvailable(bool)),
|
connect(reslist, SIGNAL(prevPageAvailable(bool)),
|
||||||
this, SLOT(enablePrevPage(bool)));
|
this, SLOT(enablePrevPage(bool)));
|
||||||
connect(reslist, SIGNAL(docEditClicked(Rcl::Doc)),
|
|
||||||
this, SLOT(startNativeViewer(Rcl::Doc)));
|
connect(reslist, SIGNAL(docExpand(Rcl::Doc)),
|
||||||
|
this, SLOT(docExpand(Rcl::Doc)));
|
||||||
connect(reslist, SIGNAL(showSnippets(Rcl::Doc)),
|
connect(reslist, SIGNAL(showSnippets(Rcl::Doc)),
|
||||||
this, SLOT(showSnippets(Rcl::Doc)));
|
this, SLOT(showSnippets(Rcl::Doc)));
|
||||||
connect(reslist, SIGNAL(showSubDocs(Rcl::Doc)),
|
connect(reslist, SIGNAL(showSubDocs(Rcl::Doc)),
|
||||||
@ -1579,9 +1579,9 @@ void RclMain::showSubDocs(Rcl::Doc doc)
|
|||||||
RefCntr<DocSequence>
|
RefCntr<DocSequence>
|
||||||
source(new DocSource(theconfig, RefCntr<DocSequence>(src)));
|
source(new DocSource(theconfig, RefCntr<DocSequence>(src)));
|
||||||
|
|
||||||
ResList *res = new ResList();
|
ResTable *res = new ResTable();
|
||||||
res->setRclMain(this);
|
// ResList *res = new ResList();
|
||||||
res->setIsMainList(0);
|
res->setRclMain(this, false);
|
||||||
res->setDocSource(source);
|
res->setDocSource(source);
|
||||||
res->readDocSource();
|
res->readDocSource();
|
||||||
res->show();
|
res->show();
|
||||||
|
|||||||
@ -43,6 +43,7 @@ SOURCES += \
|
|||||||
crontool.cpp \
|
crontool.cpp \
|
||||||
guiutils.cpp \
|
guiutils.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
multisave.cpp \
|
||||||
preview_w.cpp \
|
preview_w.cpp \
|
||||||
ptrans_w.cpp \
|
ptrans_w.cpp \
|
||||||
rclhelp.cpp \
|
rclhelp.cpp \
|
||||||
@ -67,6 +68,7 @@ FORMS = \
|
|||||||
firstidx.ui \
|
firstidx.ui \
|
||||||
idxsched.ui \
|
idxsched.ui \
|
||||||
listdialog.ui \
|
listdialog.ui \
|
||||||
|
multisave.ui \
|
||||||
ptrans.ui \
|
ptrans.ui \
|
||||||
rclmain.ui \
|
rclmain.ui \
|
||||||
restable.ui \
|
restable.ui \
|
||||||
|
|||||||
@ -277,7 +277,7 @@ static PlainToRichQtReslist g_hiliter;
|
|||||||
|
|
||||||
ResList::ResList(QWidget* parent, const char* name)
|
ResList::ResList(QWidget* parent, const char* name)
|
||||||
: RESLIST_PARENTCLASS(parent), m_curPvDoc(-1), m_lstClckMod(0),
|
: RESLIST_PARENTCLASS(parent), m_curPvDoc(-1), m_lstClckMod(0),
|
||||||
m_listId(0), m_rclmain(0), m_ismainlist(true), m_coninit(false)
|
m_listId(0), m_rclmain(0), m_ismainres(true)
|
||||||
{
|
{
|
||||||
if (!name)
|
if (!name)
|
||||||
setObjectName("resList");
|
setObjectName("resList");
|
||||||
@ -344,6 +344,24 @@ ResList::~ResList()
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResList::setRclMain(RclMain *m, bool ismain)
|
||||||
|
{
|
||||||
|
m_rclmain = m;
|
||||||
|
m_ismainres = ismain;
|
||||||
|
if (!m_ismainres) {
|
||||||
|
connect(new QShortcut(closeKeySeq, this), SIGNAL (activated()),
|
||||||
|
this, SLOT (close()));
|
||||||
|
connect(new QShortcut(quitKeySeq, this), SIGNAL (activated()),
|
||||||
|
m_rclmain, SLOT (fileExit()));
|
||||||
|
connect(this, SIGNAL(previewRequested(Rcl::Doc)),
|
||||||
|
m_rclmain, SLOT(startPreview(Rcl::Doc)));
|
||||||
|
connect(this, SIGNAL(docSaveToFileClicked(Rcl::Doc)),
|
||||||
|
m_rclmain, SLOT(saveDocToFile(Rcl::Doc)));
|
||||||
|
connect(this, SIGNAL(editRequested(Rcl::Doc)),
|
||||||
|
m_rclmain, SLOT(startNativeViewer(Rcl::Doc)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ResList::setFont()
|
void ResList::setFont()
|
||||||
{
|
{
|
||||||
#ifdef RESLIST_TEXTBROWSER
|
#ifdef RESLIST_TEXTBROWSER
|
||||||
@ -379,21 +397,6 @@ void ResList::setDocSource(RefCntr<DocSequence> nsource)
|
|||||||
{
|
{
|
||||||
LOGDEB(("ResList::setDocSource()\n"));
|
LOGDEB(("ResList::setDocSource()\n"));
|
||||||
m_source = RefCntr<DocSequence>(new DocSource(theconfig, nsource));
|
m_source = RefCntr<DocSequence>(new DocSource(theconfig, nsource));
|
||||||
if (!m_ismainlist && !m_coninit) {
|
|
||||||
m_coninit = true;
|
|
||||||
connect(new QShortcut(closeKeySeq, this), SIGNAL (activated()),
|
|
||||||
this, SLOT (close()));
|
|
||||||
connect(new QShortcut(quitKeySeq, this), SIGNAL (activated()),
|
|
||||||
m_rclmain, SLOT (fileExit()));
|
|
||||||
connect(this, SIGNAL(previewRequested(Rcl::Doc)),
|
|
||||||
m_rclmain, SLOT(startPreview(Rcl::Doc)));
|
|
||||||
connect(this, SIGNAL(docEditClicked(Rcl::Doc)),
|
|
||||||
m_rclmain, SLOT(startNativeViewer(Rcl::Doc)));
|
|
||||||
connect(this, SIGNAL(docSaveToFileClicked(Rcl::Doc)),
|
|
||||||
m_rclmain, SLOT(saveDocToFile(Rcl::Doc)));
|
|
||||||
connect(this, SIGNAL(editRequested(Rcl::Doc)),
|
|
||||||
m_rclmain, SLOT(startNativeViewer(Rcl::Doc)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// A query was executed, or the filtering/sorting parameters changed,
|
// A query was executed, or the filtering/sorting parameters changed,
|
||||||
@ -912,13 +915,13 @@ void ResList::linkWasClicked(const QUrl &url)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (what == 'P') {
|
if (what == 'P') {
|
||||||
if (m_ismainlist) {
|
if (m_ismainres) {
|
||||||
emit docPreviewClicked(i, doc, m_lstClckMod);
|
emit docPreviewClicked(i, doc, m_lstClckMod);
|
||||||
} else {
|
} else {
|
||||||
emit previewRequested(doc);
|
emit previewRequested(doc);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emit docEditClicked(doc);
|
emit editRequested(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -979,8 +982,8 @@ void ResList::createPopupMenu(const QPoint& pos)
|
|||||||
if (!getDoc(m_popDoc, doc))
|
if (!getDoc(m_popDoc, doc))
|
||||||
return;
|
return;
|
||||||
int options = 0;
|
int options = 0;
|
||||||
if (m_ismainlist)
|
if (m_ismainres)
|
||||||
options |= ResultPopup::showExpand;
|
options |= ResultPopup::isMain;
|
||||||
QMenu *popup = ResultPopup::create(this, options, m_source, doc);
|
QMenu *popup = ResultPopup::create(this, options, m_source, doc);
|
||||||
popup->popup(mapToGlobal(pos));
|
popup->popup(mapToGlobal(pos));
|
||||||
}
|
}
|
||||||
@ -989,7 +992,7 @@ void ResList::menuPreview()
|
|||||||
{
|
{
|
||||||
Rcl::Doc doc;
|
Rcl::Doc doc;
|
||||||
if (getDoc(m_popDoc, doc)) {
|
if (getDoc(m_popDoc, doc)) {
|
||||||
if (m_ismainlist) {
|
if (m_ismainres) {
|
||||||
emit docPreviewClicked(m_popDoc, doc, 0);
|
emit docPreviewClicked(m_popDoc, doc, 0);
|
||||||
} else {
|
} else {
|
||||||
emit previewRequested(doc);
|
emit previewRequested(doc);
|
||||||
@ -1042,7 +1045,7 @@ void ResList::menuEdit()
|
|||||||
{
|
{
|
||||||
Rcl::Doc doc;
|
Rcl::Doc doc;
|
||||||
if (getDoc(m_popDoc, doc))
|
if (getDoc(m_popDoc, doc))
|
||||||
emit docEditClicked(doc);
|
emit editRequested(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResList::menuCopyFN()
|
void ResList::menuCopyFN()
|
||||||
|
|||||||
@ -67,14 +67,8 @@ class ResList : public RESLIST_PARENTCLASS
|
|||||||
int listId() const {return m_listId;}
|
int listId() const {return m_listId;}
|
||||||
int pageFirstDocNum();
|
int pageFirstDocNum();
|
||||||
void setFont();
|
void setFont();
|
||||||
void setRclMain(RclMain *m)
|
void setRclMain(RclMain *m, bool ismain);
|
||||||
{
|
|
||||||
m_rclmain = m;
|
|
||||||
}
|
|
||||||
void setIsMainList(bool onoff)
|
|
||||||
{
|
|
||||||
m_ismainlist = onoff;
|
|
||||||
}
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void setDocSource(RefCntr<DocSequence> nsource);
|
virtual void setDocSource(RefCntr<DocSequence> nsource);
|
||||||
virtual void resetList(); // Erase current list
|
virtual void resetList(); // Erase current list
|
||||||
@ -104,7 +98,6 @@ class ResList : public RESLIST_PARENTCLASS
|
|||||||
signals:
|
signals:
|
||||||
void nextPageAvailable(bool);
|
void nextPageAvailable(bool);
|
||||||
void prevPageAvailable(bool);
|
void prevPageAvailable(bool);
|
||||||
void docEditClicked(Rcl::Doc);
|
|
||||||
void docPreviewClicked(int, Rcl::Doc, int);
|
void docPreviewClicked(int, Rcl::Doc, int);
|
||||||
void docSaveToFileClicked(Rcl::Doc);
|
void docSaveToFileClicked(Rcl::Doc);
|
||||||
void previewRequested(Rcl::Doc);
|
void previewRequested(Rcl::Doc);
|
||||||
@ -145,8 +138,7 @@ class ResList : public RESLIST_PARENTCLASS
|
|||||||
QString m_text;
|
QString m_text;
|
||||||
#endif
|
#endif
|
||||||
RclMain *m_rclmain;
|
RclMain *m_rclmain;
|
||||||
bool m_ismainlist;
|
bool m_ismainres;
|
||||||
bool m_coninit;
|
|
||||||
|
|
||||||
virtual void displayPage(); // Display current page
|
virtual void displayPage(); // Display current page
|
||||||
static int newListId();
|
static int newListId();
|
||||||
|
|||||||
@ -53,11 +53,11 @@ QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
|
|||||||
if (opts & showExpand)
|
if (opts & showExpand)
|
||||||
popup->addAction(me->tr("Find &similar documents"),
|
popup->addAction(me->tr("Find &similar documents"),
|
||||||
me, SLOT(menuExpand()));
|
me, SLOT(menuExpand()));
|
||||||
if (doc.haspages && source->snippetsCapable())
|
if (doc.haspages && source.isNotNull() && source->snippetsCapable())
|
||||||
popup->addAction(me->tr("Open &Snippets window"),
|
popup->addAction(me->tr("Open &Snippets window"),
|
||||||
me, SLOT(menuOpenSnippets()));
|
me, SLOT(menuOpenSnippets()));
|
||||||
|
|
||||||
if (rcldb && rcldb->hasSubDocs(doc))
|
if ((opts & showSubs) && rcldb && rcldb->hasSubDocs(doc))
|
||||||
popup->addAction(me->tr("Show subdocuments / attachments"),
|
popup->addAction(me->tr("Show subdocuments / attachments"),
|
||||||
me, SLOT(menuShowSubDocs()));
|
me, SLOT(menuShowSubDocs()));
|
||||||
return popup;
|
return popup;
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
#define _RESPOPUP_H_INCLUDED_
|
#define _RESPOPUP_H_INCLUDED_
|
||||||
|
|
||||||
namespace ResultPopup {
|
namespace ResultPopup {
|
||||||
enum Options {showExpand = 0x1};
|
enum Options {showExpand = 0x1, showSubs = 0x2, isMain = 0x3};
|
||||||
extern QMenu *create(QWidget *me, int opts,
|
extern QMenu *create(QWidget *me, int opts,
|
||||||
RefCntr<DocSequence> source,
|
RefCntr<DocSequence> source,
|
||||||
Rcl::Doc& doc);
|
Rcl::Doc& doc);
|
||||||
|
|||||||
@ -46,6 +46,10 @@
|
|||||||
#include "plaintorich.h"
|
#include "plaintorich.h"
|
||||||
#include "indexer.h"
|
#include "indexer.h"
|
||||||
#include "respopup.h"
|
#include "respopup.h"
|
||||||
|
#include "rclmain_w.h"
|
||||||
|
|
||||||
|
static const QKeySequence quitKeySeq("Ctrl+q");
|
||||||
|
static const QKeySequence closeKeySeq("Ctrl+w");
|
||||||
|
|
||||||
// Compensate for the default and somewhat bizarre vertical placement
|
// Compensate for the default and somewhat bizarre vertical placement
|
||||||
// of text in cells
|
// of text in cells
|
||||||
@ -133,14 +137,14 @@ ResTableDetailArea::ResTableDetailArea(ResTable* parent)
|
|||||||
|
|
||||||
void ResTableDetailArea::createPopupMenu(const QPoint& pos)
|
void ResTableDetailArea::createPopupMenu(const QPoint& pos)
|
||||||
{
|
{
|
||||||
if (!m_table || m_table->m_detaildocnum < 0) {
|
if (m_table && m_table->m_model && m_table->m_detaildocnum >= 0) {
|
||||||
LOGDEB(("ResTableDetailArea::createPopupMenu: no table/detaildoc\n"));
|
QMenu *popup =
|
||||||
return;
|
ResultPopup::create(m_table, m_table->m_ismainres ?
|
||||||
|
ResultPopup::showExpand : 0,
|
||||||
|
m_table->m_model->getDocSource(),
|
||||||
|
m_table->m_detaildoc);
|
||||||
|
popup->popup(mapToGlobal(pos));
|
||||||
}
|
}
|
||||||
QMenu *popup = ResultPopup::create(m_table, ResultPopup::showExpand,
|
|
||||||
m_table->m_model->getDocSource(),
|
|
||||||
m_table->m_detaildoc);
|
|
||||||
popup->popup(mapToGlobal(pos));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@ -478,7 +482,7 @@ void ResTable::init()
|
|||||||
tableView->setModel(m_model);
|
tableView->setModel(m_model);
|
||||||
tableView->setMouseTracking(true);
|
tableView->setMouseTracking(true);
|
||||||
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
tableView->setSelectionMode(QAbstractItemView::SingleSelection);
|
tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);
|
||||||
tableView->setItemDelegate(new ResTableDelegate(this));
|
tableView->setItemDelegate(new ResTableDelegate(this));
|
||||||
tableView->setContextMenuPolicy(Qt::CustomContextMenu);
|
tableView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(tableView, SIGNAL(customContextMenuRequested(const QPoint&)),
|
connect(tableView, SIGNAL(customContextMenuRequested(const QPoint&)),
|
||||||
@ -512,7 +516,8 @@ void ResTable::init()
|
|||||||
QShortcut *sc = new QShortcut(seq, this);
|
QShortcut *sc = new QShortcut(seq, this);
|
||||||
connect(sc, SIGNAL (activated()),
|
connect(sc, SIGNAL (activated()),
|
||||||
tableView->selectionModel(), SLOT (clear()));
|
tableView->selectionModel(), SLOT (clear()));
|
||||||
connect(tableView->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex &)),
|
connect(tableView->selectionModel(),
|
||||||
|
SIGNAL(currentChanged(const QModelIndex&, const QModelIndex &)),
|
||||||
this, SLOT(onTableView_currentChanged(const QModelIndex&)));
|
this, SLOT(onTableView_currentChanged(const QModelIndex&)));
|
||||||
|
|
||||||
m_pager = new ResTablePager(this);
|
m_pager = new ResTablePager(this);
|
||||||
@ -539,6 +544,24 @@ void ResTable::init()
|
|||||||
splitter->setOrientation(Qt::Vertical);
|
splitter->setOrientation(Qt::Vertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResTable::setRclMain(RclMain *m, bool ismain)
|
||||||
|
{
|
||||||
|
m_rclmain = m;
|
||||||
|
m_ismainres = ismain;
|
||||||
|
if (!m_ismainres) {
|
||||||
|
connect(new QShortcut(closeKeySeq, this), SIGNAL (activated()),
|
||||||
|
this, SLOT (close()));
|
||||||
|
connect(new QShortcut(quitKeySeq, this), SIGNAL (activated()),
|
||||||
|
m_rclmain, SLOT (fileExit()));
|
||||||
|
connect(this, SIGNAL(previewRequested(Rcl::Doc)),
|
||||||
|
m_rclmain, SLOT(startPreview(Rcl::Doc)));
|
||||||
|
connect(this, SIGNAL(docSaveToFileClicked(Rcl::Doc)),
|
||||||
|
m_rclmain, SLOT(saveDocToFile(Rcl::Doc)));
|
||||||
|
connect(this, SIGNAL(editRequested(Rcl::Doc)),
|
||||||
|
m_rclmain, SLOT(startNativeViewer(Rcl::Doc)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int ResTable::getDetailDocNumOrTopRow()
|
int ResTable::getDetailDocNumOrTopRow()
|
||||||
{
|
{
|
||||||
if (m_detaildocnum >= 0)
|
if (m_detaildocnum >= 0)
|
||||||
@ -560,6 +583,8 @@ void ResTable::makeRowVisible(int row)
|
|||||||
// This is called by rclmain_w prior to exiting
|
// This is called by rclmain_w prior to exiting
|
||||||
void ResTable::saveColState()
|
void ResTable::saveColState()
|
||||||
{
|
{
|
||||||
|
if (!m_ismainres)
|
||||||
|
return;
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.setValue("resTableSplitterSizes", splitter->saveState());
|
settings.setValue("resTableSplitterSizes", splitter->saveState());
|
||||||
|
|
||||||
@ -718,7 +743,7 @@ void ResTable::linkWasClicked(const QUrl &url)
|
|||||||
if (what == 'P')
|
if (what == 'P')
|
||||||
emit docPreviewClicked(i, m_detaildoc, 0);
|
emit docPreviewClicked(i, m_detaildoc, 0);
|
||||||
else
|
else
|
||||||
emit docEditClicked(m_detaildoc);
|
emit editRequested(m_detaildoc);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -730,19 +755,23 @@ void ResTable::linkWasClicked(const QUrl &url)
|
|||||||
void ResTable::createPopupMenu(const QPoint& pos)
|
void ResTable::createPopupMenu(const QPoint& pos)
|
||||||
{
|
{
|
||||||
LOGDEB(("ResTable::createPopupMenu: m_detaildocnum %d\n", m_detaildocnum));
|
LOGDEB(("ResTable::createPopupMenu: m_detaildocnum %d\n", m_detaildocnum));
|
||||||
if (m_detaildocnum < 0)
|
if (m_detaildocnum >= 0 && m_model) {
|
||||||
return;
|
QMenu *popup =
|
||||||
QMenu *popup = ResultPopup::create(this, ResultPopup::showExpand,
|
ResultPopup::create(this, m_ismainres? ResultPopup::isMain : 0,
|
||||||
m_model->getDocSource(),
|
m_model->getDocSource(), m_detaildoc);
|
||||||
m_detaildoc);
|
popup->popup(mapToGlobal(pos));
|
||||||
popup->popup(mapToGlobal(pos));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResTable::menuPreview()
|
void ResTable::menuPreview()
|
||||||
{
|
{
|
||||||
if (m_detaildocnum < 0)
|
if (m_detaildocnum >= 0) {
|
||||||
return;
|
if (m_ismainres) {
|
||||||
emit docPreviewClicked(m_detaildocnum, m_detaildoc, 0);
|
emit docPreviewClicked(m_detaildocnum, m_detaildoc, 0);
|
||||||
|
} else {
|
||||||
|
emit previewRequested(m_detaildoc);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResTable::menuSaveToFile()
|
void ResTable::menuSaveToFile()
|
||||||
@ -775,7 +804,7 @@ void ResTable::menuOpenParent()
|
|||||||
void ResTable::menuEdit()
|
void ResTable::menuEdit()
|
||||||
{
|
{
|
||||||
if (m_detaildocnum >= 0)
|
if (m_detaildocnum >= 0)
|
||||||
emit docEditClicked(m_detaildoc);
|
emit editRequested(m_detaildoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResTable::menuCopyFN()
|
void ResTable::menuCopyFN()
|
||||||
@ -850,10 +879,7 @@ void ResTable::addColumn()
|
|||||||
if (!m_model)
|
if (!m_model)
|
||||||
return;
|
return;
|
||||||
QAction *action = (QAction *)sender();
|
QAction *action = (QAction *)sender();
|
||||||
LOGDEB(("addColumn: text %s, data %s\n",
|
LOGDEB(("addColumn: text %s, data %s\n", qs2utf8s(action->text()).c_str(),
|
||||||
(const char *)action->text().toUtf8(),
|
qs2utf8s(action->data().toString()).c_str()));
|
||||||
(const char *)action->data().toString().toUtf8()
|
m_model->addColumn(m_popcolumn, qs2utf8s(action->data().toString()));
|
||||||
));
|
|
||||||
string field((const char *)action->data().toString().toUtf8());
|
|
||||||
m_model->addColumn(m_popcolumn, field);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,6 +100,7 @@ private:
|
|||||||
|
|
||||||
class ResTablePager;
|
class ResTablePager;
|
||||||
class QUrl;
|
class QUrl;
|
||||||
|
class RclMain;
|
||||||
|
|
||||||
class ResTable : public QWidget, public Ui::ResTable
|
class ResTable : public QWidget, public Ui::ResTable
|
||||||
{
|
{
|
||||||
@ -108,7 +109,8 @@ class ResTable : public QWidget, public Ui::ResTable
|
|||||||
public:
|
public:
|
||||||
ResTable(QWidget* parent = 0)
|
ResTable(QWidget* parent = 0)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
m_model(0), m_pager(0), m_detail(0), m_detaildocnum(-1)
|
m_model(0), m_pager(0), m_detail(0), m_detaildocnum(-1),
|
||||||
|
m_rclmain(0), m_ismainres(true)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
init();
|
init();
|
||||||
@ -119,6 +121,8 @@ public:
|
|||||||
virtual ResTableDetailArea* getDetailArea() {return m_detail;}
|
virtual ResTableDetailArea* getDetailArea() {return m_detail;}
|
||||||
virtual int getDetailDocNumOrTopRow();
|
virtual int getDetailDocNumOrTopRow();
|
||||||
|
|
||||||
|
void setRclMain(RclMain *m, bool ismain);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void onTableView_currentChanged(const QModelIndex&);
|
virtual void onTableView_currentChanged(const QModelIndex&);
|
||||||
virtual void on_tableView_entered(const QModelIndex& index);
|
virtual void on_tableView_entered(const QModelIndex& index);
|
||||||
@ -147,7 +151,6 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void docPreviewClicked(int, Rcl::Doc, int);
|
void docPreviewClicked(int, Rcl::Doc, int);
|
||||||
void docEditClicked(Rcl::Doc);
|
|
||||||
void docSaveToFileClicked(Rcl::Doc);
|
void docSaveToFileClicked(Rcl::Doc);
|
||||||
void previewRequested(Rcl::Doc);
|
void previewRequested(Rcl::Doc);
|
||||||
void editRequested(Rcl::Doc);
|
void editRequested(Rcl::Doc);
|
||||||
@ -165,6 +168,8 @@ private:
|
|||||||
int m_detaildocnum;
|
int m_detaildocnum;
|
||||||
Rcl::Doc m_detaildoc;
|
Rcl::Doc m_detaildoc;
|
||||||
int m_popcolumn;
|
int m_popcolumn;
|
||||||
|
RclMain *m_rclmain;
|
||||||
|
bool m_ismainres;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user