GUI: restable: the dups and snippets links did not work
This commit is contained in:
parent
b6e646680f
commit
aed4c43d52
@ -1554,6 +1554,32 @@ static bool lookForHtmlBrowser(string &exefile)
|
||||
return false;
|
||||
}
|
||||
|
||||
void RclMain::newDupsW(const Rcl::Doc, const vector<Rcl::Doc> dups)
|
||||
{
|
||||
ListDialog dialog;
|
||||
dialog.setWindowTitle(tr("Duplicate documents"));
|
||||
|
||||
dialog.groupBox->setTitle(tr("These Urls ( | ipath) share the same"
|
||||
" content:"));
|
||||
// We replace the list with an editor so that the user can copy/paste
|
||||
delete dialog.listWidget;
|
||||
QTextEdit *editor = new QTextEdit(dialog.groupBox);
|
||||
editor->setReadOnly(TRUE);
|
||||
dialog.horizontalLayout->addWidget(editor);
|
||||
|
||||
for (vector<Rcl::Doc>::const_iterator it = dups.begin();
|
||||
it != dups.end(); it++) {
|
||||
if (it->ipath.empty())
|
||||
editor->append(QString::fromLocal8Bit(it->url.c_str()));
|
||||
else
|
||||
editor->append(QString::fromLocal8Bit(it->url.c_str()) + " | " +
|
||||
QString::fromUtf8(it->ipath.c_str()));
|
||||
}
|
||||
editor->moveCursor(QTextCursor::Start);
|
||||
editor->ensureCursorVisible();
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void RclMain::showSnippets(Rcl::Doc doc)
|
||||
{
|
||||
SnippetsW *sp = new SnippetsW(doc, m_source);
|
||||
|
||||
@ -93,6 +93,9 @@ public:
|
||||
return m_searchIsSimple;
|
||||
}
|
||||
|
||||
// Takes copies of the args instead of refs. Lazy and safe.
|
||||
void newDupsW(const Rcl::Doc doc, const std::vector<Rcl::Doc> dups);
|
||||
|
||||
public slots:
|
||||
virtual bool close();
|
||||
virtual void fileExit();
|
||||
|
||||
@ -823,32 +823,6 @@ void ResList::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
#endif
|
||||
}
|
||||
|
||||
void ResList::newDupsW(const Rcl::Doc&, const vector<Rcl::Doc>& dups)
|
||||
{
|
||||
ListDialog dialog;
|
||||
dialog.setWindowTitle(tr("Duplicate documents"));
|
||||
|
||||
dialog.groupBox->setTitle(tr("These Urls ( | ipath) share the same"
|
||||
" content:"));
|
||||
// We replace the list with an editor so that the user can copy/paste
|
||||
delete dialog.listWidget;
|
||||
QTextEdit *editor = new QTextEdit(dialog.groupBox);
|
||||
editor->setReadOnly(TRUE);
|
||||
dialog.horizontalLayout->addWidget(editor);
|
||||
|
||||
for (vector<Rcl::Doc>::const_iterator it = dups.begin();
|
||||
it != dups.end(); it++) {
|
||||
if (it->ipath.empty())
|
||||
editor->append(QString::fromLocal8Bit(it->url.c_str()));
|
||||
else
|
||||
editor->append(QString::fromLocal8Bit(it->url.c_str()) + " | " +
|
||||
QString::fromUtf8(it->ipath.c_str()));
|
||||
}
|
||||
editor->moveCursor(QTextCursor::Start);
|
||||
editor->ensureCursorVisible();
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void ResList::showQueryDetails()
|
||||
{
|
||||
if (m_source.isNull())
|
||||
@ -896,8 +870,8 @@ void ResList::linkWasClicked(const QUrl &url)
|
||||
return;
|
||||
}
|
||||
vector<Rcl::Doc> dups;
|
||||
if (m_source->docDups(doc, dups)) {
|
||||
newDupsW(doc, dups);
|
||||
if (m_source->docDups(doc, dups) && m_rclmain) {
|
||||
m_rclmain->newDupsW(doc, dups);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -146,8 +146,7 @@ class ResList : public RESLIST_PARENTCLASS
|
||||
bool scrollIsAtTop();
|
||||
bool scrollIsAtBottom();
|
||||
void setupArrows();
|
||||
void newDupsW(const Rcl::Doc& doc, const std::vector<Rcl::Doc>& dups);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif /* _RESLIST_H_INCLUDED_ */
|
||||
|
||||
@ -749,6 +749,19 @@ void ResTable::linkWasClicked(const QUrl &url)
|
||||
int i = atoi(ascurl+1) -1;
|
||||
int what = ascurl[0];
|
||||
switch (what) {
|
||||
// Open abstract/snippets window
|
||||
case 'A':
|
||||
if (m_detaildocnum >= 0)
|
||||
emit(showSnippets(m_detaildoc));
|
||||
break;
|
||||
case 'D':
|
||||
{
|
||||
vector<Rcl::Doc> dups;
|
||||
if (m_detaildocnum >= 0 && m_rclmain &&
|
||||
m_model->getDocSource()->docDups(m_detaildoc, dups)) {
|
||||
m_rclmain->newDupsW(m_detaildoc, dups);
|
||||
}
|
||||
}
|
||||
case 'P':
|
||||
case 'E':
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user