]> git.lyx.org Git - features.git/commitdiff
* src/Thesaurus.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Thu, 7 Jun 2007 17:27:10 +0000 (17:27 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Thu, 7 Jun 2007 17:27:10 +0000 (17:27 +0000)
- check for aiksaurus errors (fix bug 2691)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18699 a592a061-630c-0410-9148-cb99ea01b6c8

src/Thesaurus.cpp

index 14c82f61d3c68605a8ad56393dfc1307b21a32bc..91aa9f649ad1315a5625532c41f757e284824913 100644 (file)
 
 #include "Thesaurus.h"
 
+#include "gettext.h"
+
 #include "support/lstrings.h"
 
+#include "frontends/alert.h"
+
 #include <algorithm>
 
 
 namespace lyx {
 
 #ifdef HAVE_LIBAIKSAURUS
+using support::bformat;
 
 using std::sort;
 using std::string;
@@ -49,6 +54,18 @@ Thesaurus::Meanings Thesaurus::lookup(docstring const & t)
                return meanings;
 
        string const text = to_ascii(t);
+
+       docstring error = from_ascii(aik_->error());
+       if (!error.empty()) {
+               static bool sent_error = false;
+               if (!sent_error) {
+                       frontend::Alert::error(_("Thesaurus failure"),
+                                    bformat(_("Aiksaurus returned the following error:\n\n%1$s."),
+                                            error));
+                       sent_error = true;
+               }
+               return meanings;
+       }
        if (!aik_->find(text.c_str()))
                return meanings;