reslist menu openParent opens containing folder if not a subdoc
This commit is contained in:
parent
a0bb7a2eee
commit
4bcc29c6e1
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.19 2007-01-08 07:02:25 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.20 2007-01-08 10:01:55 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
|
||||||
@ -122,9 +122,11 @@ void RclMain::init()
|
|||||||
this, SLOT(enablePrevPage(bool)));
|
this, SLOT(enablePrevPage(bool)));
|
||||||
connect(resList, SIGNAL(docEditClicked(int)),
|
connect(resList, SIGNAL(docEditClicked(int)),
|
||||||
this, SLOT(startNativeViewer(int)));
|
this, SLOT(startNativeViewer(int)));
|
||||||
|
connect(resList, SIGNAL(editRequested(Rcl::Doc)),
|
||||||
|
this, SLOT(startNativeViewer(Rcl::Doc)));
|
||||||
|
|
||||||
connect(resList, SIGNAL(docPreviewClicked(int, int)),
|
connect(resList, SIGNAL(docPreviewClicked(int, int)),
|
||||||
this, SLOT(startPreview(int, int)));
|
this, SLOT(startPreview(int, int)));
|
||||||
|
|
||||||
connect(resList, SIGNAL(previewRequested(Rcl::Doc)),
|
connect(resList, SIGNAL(previewRequested(Rcl::Doc)),
|
||||||
this, SLOT(startPreview(Rcl::Doc)));
|
this, SLOT(startPreview(Rcl::Doc)));
|
||||||
|
|
||||||
@ -700,7 +702,11 @@ void RclMain::startNativeViewer(int docnum)
|
|||||||
" from database"));
|
" from database"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
startNativeViewer(doc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RclMain::startNativeViewer(Rcl::Doc doc)
|
||||||
|
{
|
||||||
// Look for appropriate viewer
|
// Look for appropriate viewer
|
||||||
string cmd = rclconfig->getMimeViewerDef(doc.mimetype);
|
string cmd = rclconfig->getMimeViewerDef(doc.mimetype);
|
||||||
if (cmd.length() == 0) {
|
if (cmd.length() == 0) {
|
||||||
|
|||||||
@ -90,6 +90,7 @@ public slots:
|
|||||||
virtual void startPreview(int docnum, int);
|
virtual void startPreview(int docnum, int);
|
||||||
virtual void startPreview(Rcl::Doc doc);
|
virtual void startPreview(Rcl::Doc doc);
|
||||||
virtual void startNativeViewer(int docnum);
|
virtual void startNativeViewer(int docnum);
|
||||||
|
virtual void startNativeViewer(Rcl::Doc doc);
|
||||||
virtual void previewNextInTab(int sid, int docnum);
|
virtual void previewNextInTab(int sid, int docnum);
|
||||||
virtual void previewPrevInTab(int sid, int docnum);
|
virtual void previewPrevInTab(int sid, int docnum);
|
||||||
virtual void previewExposed(int sid, int docnum);
|
virtual void previewExposed(int sid, int docnum);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.17 2007-01-08 07:01:39 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.18 2007-01-08 10:01:55 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -610,12 +610,8 @@ RCLPOPUP *ResList::createPopupMenu(const QPoint& pos)
|
|||||||
popup->insertItem(tr("Copy &File Name"), this, SLOT(menuCopyFN()));
|
popup->insertItem(tr("Copy &File Name"), this, SLOT(menuCopyFN()));
|
||||||
popup->insertItem(tr("Copy &Url"), this, SLOT(menuCopyURL()));
|
popup->insertItem(tr("Copy &Url"), this, SLOT(menuCopyURL()));
|
||||||
popup->insertItem(tr("Find &similar documents"), this, SLOT(menuExpand()));
|
popup->insertItem(tr("Find &similar documents"), this, SLOT(menuExpand()));
|
||||||
Rcl::Doc doc;
|
popup->insertItem(tr("P&arent document/folder"),
|
||||||
if (getDoc(m_popDoc, doc)) {
|
this, SLOT(menuSeeParent()));
|
||||||
if (!doc.ipath.empty())
|
|
||||||
popup->insertItem(tr("P&arent document"),
|
|
||||||
this, SLOT(menuSeeParent()));
|
|
||||||
}
|
|
||||||
return popup;
|
return popup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,31 +619,39 @@ void ResList::menuPreview()
|
|||||||
{
|
{
|
||||||
emit docPreviewClicked(m_popDoc, 0);
|
emit docPreviewClicked(m_popDoc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResList::menuSeeParent()
|
void ResList::menuSeeParent()
|
||||||
{
|
{
|
||||||
Rcl::Doc doc;
|
Rcl::Doc doc;
|
||||||
if (getDoc(m_popDoc, doc)) {
|
if (getDoc(m_popDoc, doc)) {
|
||||||
if (doc.ipath.empty())
|
|
||||||
return;
|
|
||||||
Rcl::Doc doc1;
|
Rcl::Doc doc1;
|
||||||
doc1.url = doc.url;
|
if (doc.ipath.empty()) {
|
||||||
doc1.ipath = doc.ipath;
|
// No parent doc: show enclosing folder with app configured for
|
||||||
string::size_type colon;
|
// directories
|
||||||
LOGDEB(("Ipath: [%s]\n", doc1.ipath.c_str()));
|
doc1.url = path_getfather(doc.url);
|
||||||
if ((colon=doc1.ipath.find_last_of(":")) != string::npos) {
|
doc1.mimetype = "application/x-fsdirectory";
|
||||||
doc1.ipath.erase(colon);
|
emit editRequested(doc1);
|
||||||
} else {
|
} else {
|
||||||
doc1.ipath.erase();
|
doc1.url = doc.url;
|
||||||
}
|
doc1.ipath = doc.ipath;
|
||||||
LOGDEB(("Ipath after: [%s]\n", doc1.ipath.c_str()));
|
string::size_type colon;
|
||||||
|
LOGDEB(("Ipath: [%s]\n", doc1.ipath.c_str()));
|
||||||
|
if ((colon=doc1.ipath.find_last_of(":")) != string::npos) {
|
||||||
|
doc1.ipath.erase(colon);
|
||||||
|
} else {
|
||||||
|
doc1.ipath.erase();
|
||||||
|
}
|
||||||
|
LOGDEB(("Ipath after: [%s]\n", doc1.ipath.c_str()));
|
||||||
|
|
||||||
list<string> lipath;
|
list<string> lipath;
|
||||||
stringToTokens(doc.ipath, lipath, ":");
|
stringToTokens(doc.ipath, lipath, ":");
|
||||||
if (lipath.size() >= 1)
|
if (lipath.size() >= 1)
|
||||||
lipath.pop_back();
|
lipath.pop_back();
|
||||||
emit previewRequested(doc1);
|
emit previewRequested(doc1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResList::menuEdit()
|
void ResList::menuEdit()
|
||||||
{
|
{
|
||||||
emit docEditClicked(m_popDoc);
|
emit docEditClicked(m_popDoc);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#ifndef _RESLIST_H_INCLUDED_
|
#ifndef _RESLIST_H_INCLUDED_
|
||||||
#define _RESLIST_H_INCLUDED_
|
#define _RESLIST_H_INCLUDED_
|
||||||
/* @(#$Id: reslist.h,v 1.7 2006-12-20 13:55:46 dockes Exp $ (C) 2005 J.F.Dockes */
|
/* @(#$Id: reslist.h,v 1.8 2007-01-08 10:01:55 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@ -69,6 +69,7 @@ class ResList : public QTEXTBROWSER
|
|||||||
void docEditClicked(int);
|
void docEditClicked(int);
|
||||||
void docPreviewClicked(int, int);
|
void docPreviewClicked(int, int);
|
||||||
void previewRequested(Rcl::Doc);
|
void previewRequested(Rcl::Doc);
|
||||||
|
void editRequested(Rcl::Doc);
|
||||||
void headerClicked();
|
void headerClicked();
|
||||||
void docExpand(int);
|
void docExpand(int);
|
||||||
void wordSelect(QString);
|
void wordSelect(QString);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user