]> git.lyx.org Git - features.git/commitdiff
Give feedback if TeXFiles.py fails
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 19 Jul 2006 16:25:54 +0000 (16:25 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 19 Jul 2006 16:25:54 +0000 (16:25 +0000)
* 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
src/frontends/controllers/tex_helpers.h

index 143f7d6f295f3adfb5bfcbe9a020eb6f7da7eac0..2441403e73729fcdcd1aec4727f4550be2089b37 100644 (file)
@@ -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));
 }
 
 
index 18655617831efd90c1a9df131ae57f897f9704fc..7c73328196262898cd9176d13fb571cdbc61fee1 100644 (file)
@@ -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