Do not hardcode launching of lyxpaperview script.

This commit is contained in:
Pavel Sanda 2020-08-24 15:10:14 +02:00
parent 71332820d1
commit 44ede7ef4b
2 changed files with 6 additions and 2 deletions

View File

@ -245,7 +245,7 @@ public:
/// command to run chktex incl. options
std::string chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
// Name of external script, which searches for file corresponding to a
// given citation. At this moment only script "lyxpaperview" is supported
// given citation. At this moment only script lyxpaperview[.py] is supported
// (search for pdf based on author+year), but we can generalize if requested.
// Citation context menu item "Open Citation Content" will be always enabled
// if the name of this script in nonempty (last resort when citation entry

View File

@ -24,6 +24,7 @@
#include "FuncRequest.h"
#include "Language.h"
#include "LyX.h"
#include "LyXRC.h"
#include "LyXAction.h"
#include "TextClass.h"
@ -300,9 +301,12 @@ void showDirectory(FileName const & directory)
void showTarget(string const & target){
LYXERR(Debug::INSETS, "Showtarget:" << target << "\n");
if (prefixIs(target,"EXTERNAL ")) {
if (lyxrc.citation_search_view.empty())
return;
string tmp,tar;
tar = split(target, tmp, ' ');
FuncRequest cmd = FuncRequest(LFUN_VC_COMMAND,"U . \"lyxpaperview " + tar + "\"");
FuncRequest cmd = FuncRequest(LFUN_VC_COMMAND,"U . \"" +
lyxrc.citation_search_view + " " + tar + "\"");
lyx::dispatch(cmd);
return;
}