From af5a86798293fb79b99c053c7eb060c738d32cf6 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Wed, 19 Jul 2006 16:25:54 +0000 Subject: [PATCH] Give feedback if TeXFiles.py fails * src/frontends/controllers/tex_helpers.h: doxyfy comment * src/frontends/controllers/tex_helpers.C (rescanTexStyles): Pop up a message box when TeXFiles.py fails git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14488 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/tex_helpers.C | 15 +++++++++++---- src/frontends/controllers/tex_helpers.h | 5 +++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/frontends/controllers/tex_helpers.C b/src/frontends/controllers/tex_helpers.C index 143f7d6f29..2441403e73 100644 --- a/src/frontends/controllers/tex_helpers.C +++ b/src/frontends/controllers/tex_helpers.C @@ -13,6 +13,9 @@ #include "tex_helpers.h" #include "debug.h" +#include "gettext.h" + +#include "frontends/Alert.h" #include "support/filetools.h" #include "support/lstrings.h" @@ -30,6 +33,7 @@ using std::endl; namespace lyx { +using support::bformat; using support::contains; using support::getExtension; using support::getFileContents; @@ -45,16 +49,19 @@ using support::token; namespace frontend { -// build filelists of all availabe bst/cls/sty-files. done through -// kpsewhich and an external script, saved in *Files.lst void rescanTexStyles() { // Run rescan in user lyx directory Path p(package().user_support()); + string const command = libFileSearch("scripts", "TeXFiles.py"); Systemcall one; - one.startscript(Systemcall::Wait, + int const status = one.startscript(Systemcall::Wait, lyx::support::os::python() + ' ' + - quoteName(libFileSearch("scripts", "TeXFiles.py"))); + quoteName(command)); + if (status == 0) + return; + Alert::error(_("Could not update TeX information"), + bformat(_("The script `%s' failed."), command)); } diff --git a/src/frontends/controllers/tex_helpers.h b/src/frontends/controllers/tex_helpers.h index 1865561783..7c73328196 100644 --- a/src/frontends/controllers/tex_helpers.h +++ b/src/frontends/controllers/tex_helpers.h @@ -18,8 +18,9 @@ namespace lyx { namespace frontend { -// build filelists of all availabe bst/cls/sty-files. done through -// kpsewhich and an external script, saved in *Files.lst +/** Build filelists of all availabe bst/cls/sty-files. Done through + * kpsewhich and an external script, saved in *Files.lst. + */ void rescanTexStyles(); /// rebuild the textree -- 2.39.2