From 44ede7ef4b1603c70c74c02ab784c17e5d7053e2 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Mon, 24 Aug 2020 15:10:14 +0200 Subject: [PATCH] Do not hardcode launching of lyxpaperview script. --- src/LyXRC.h | 2 +- src/frontends/qt/qt_helpers.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/LyXRC.h b/src/LyXRC.h index 1f32fef496..d795d345ec 100644 --- a/src/LyXRC.h +++ b/src/LyXRC.h @@ -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 diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp index 176267af8f..92ee029372 100644 --- a/src/frontends/qt/qt_helpers.cpp +++ b/src/frontends/qt/qt_helpers.cpp @@ -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; }