preliminary implementation for the snippets "open to page" popup window
This commit is contained in:
parent
ab85754757
commit
c2dab20d7e
15 changed files with 349 additions and 35 deletions
|
@ -50,6 +50,7 @@
|
|||
#include "refcntr.h"
|
||||
#include "internfile.h"
|
||||
#include "indexer.h"
|
||||
#include "snippets_w.h"
|
||||
|
||||
#include "reslist.h"
|
||||
#include "moc_reslist.cpp"
|
||||
|
@ -272,7 +273,7 @@ static PlainToRichQtReslist g_hiliter;
|
|||
/////////////////////////////////////
|
||||
|
||||
ResList::ResList(QWidget* parent, const char* name)
|
||||
: RESLIST_PARENTCLASS(parent)
|
||||
: RESLIST_PARENTCLASS(parent), m_parent(0)
|
||||
{
|
||||
if (!name)
|
||||
setObjectName("resList");
|
||||
|
@ -892,6 +893,8 @@ void ResList::createPopupMenu(const QPoint& pos)
|
|||
this, SLOT(menuPreviewParent()));
|
||||
popup->addAction(tr("&Open Parent document/folder"),
|
||||
this, SLOT(menuOpenParent()));
|
||||
popup->addAction(tr("Open &Snippets window"),
|
||||
this, SLOT(menuOpenSnippets()));
|
||||
popup->popup(mapToGlobal(pos));
|
||||
}
|
||||
|
||||
|
@ -943,6 +946,20 @@ void ResList::menuOpenParent()
|
|||
}
|
||||
}
|
||||
|
||||
void ResList::menuOpenSnippets()
|
||||
{
|
||||
Rcl::Doc doc;
|
||||
if (!getDoc(m_popDoc, doc) || m_source.isNull())
|
||||
return;
|
||||
SnippetsW *sp = new SnippetsW(doc, m_source);
|
||||
if (m_parent) {
|
||||
connect(sp, SIGNAL(startNativeViewer(Rcl::Doc, int)),
|
||||
m_parent, SLOT(startNativeViewer(Rcl::Doc, int)));
|
||||
}
|
||||
|
||||
sp->show();
|
||||
}
|
||||
|
||||
void ResList::menuEdit()
|
||||
{
|
||||
Rcl::Doc doc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue