[LyX/master] Do not hardcode launching of lyxpaperview script.
Pavel Sanda
sanda at lyx.org
Mon Aug 24 12:45:51 UTC 2020
commit 44ede7ef4b1603c70c74c02ab784c17e5d7053e2
Author: Pavel Sanda <sanda at lyx.org>
Date: Mon Aug 24 15:10:14 2020 +0200
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 1f32fef..d795d34 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 176267a..92ee029 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;
}
More information about the lyx-cvs
mailing list