Changeset 27572
- Timestamp:
- 11/16/08 19:48:25 (2 months ago)
- Files:
-
- lyx-devel/trunk/configure.ac (modified) (2 diffs)
- lyx-devel/trunk/src/LyXAction.cpp (modified) (1 diff)
- lyx-devel/trunk/src/LyXFunc.cpp (modified) (2 diffs)
- lyx-devel/trunk/src/LyXRC.cpp (modified) (4 diffs)
- lyx-devel/trunk/src/LyXRC.h (modified) (2 diffs)
- lyx-devel/trunk/src/Text3.cpp (modified) (1 diff)
- lyx-devel/trunk/src/Thesaurus.cpp (modified) (9 diffs)
- lyx-devel/trunk/src/Thesaurus.h (modified) (3 diffs)
- lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp (modified) (5 diffs)
- lyx-devel/trunk/src/frontends/qt4/GuiPrefs.h (modified) (1 diff)
- lyx-devel/trunk/src/frontends/qt4/GuiThesaurus.cpp (modified) (12 diffs)
- lyx-devel/trunk/src/frontends/qt4/GuiThesaurus.h (modified) (2 diffs)
- lyx-devel/trunk/src/frontends/qt4/ui/PrefPathsUi.ui (modified) (3 diffs)
- lyx-devel/trunk/src/frontends/qt4/ui/ThesaurusUi.ui (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lyx-devel/trunk/configure.ac
r27469 r27572 113 113 AC_SUBST(LIBSHLWAPI) 114 114 AC_CHECK_LIB(gdi32, main) 115 116 AC_ARG_WITH(mythes, 117 [ --without-mythes do not use the MyThes library], 118 [lyx_use_mythes=$withval]) 119 if test x$lyx_use_mythes != xno; then 120 AC_CHECK_LIB(mythes, main, 121 [AC_DEFINE(HAVE_LIBMYTHES,1,[Define this if you have the MyThes library]) 122 MYTHES_LIBS="-lmythes" 123 lyx_flags="mythes $lyx_flags" 124 ]) 125 AC_CHECK_HEADER(mythes.hxx,[ 126 ac_cv_header_mythes_h=yes 127 lyx_cv_mythes_h_location="<mythes.hxx>"]) 128 AC_CHECK_HEADER(mythes/mythes.hxx,[ 129 ac_cv_header_mythes_h=yes 130 lyx_cv_mythes_h_location="<mythes/mythes.hxx>"]) 131 AC_DEFINE_UNQUOTED(MYTHES_H_LOCATION,$lyx_cv_mythes_h_location,[Location of mythes.hxx]) 132 fi 133 AC_SUBST(MYTHES_LIBS) 115 134 116 135 AC_ARG_WITH(aiksaurus, … … 132 151 fi 133 152 AC_SUBST(AIKSAURUS_LIBS) 153 154 AC_DEFINE(HAVE_THESAURUS, (HAVE_LIBMYTHES || HAVE_LIBAIKSAURUS),[Define this if you have a supported thesaurus library]) 134 155 135 156 LYX_USE_INCLUDED_BOOST lyx-devel/trunk/src/LyXAction.cpp
r27527 r27572 962 962 * \var lyx::FuncCode lyx::LFUN_THESAURUS_ENTRY 963 963 * \li Action: Look up thesaurus entries with respect to the word under the cursor. 964 * \li Syntax: thesaurus-entry 964 * \li Syntax: thesaurus-entry [<STRING>] [lang=<LANG>] 965 * \li Params: <STRING>: word to look up 966 <LANG>: language (see file languages) 965 967 * \li Origin: Levon, 20 Jul 2001 966 968 * \endvar lyx-devel/trunk/src/LyXFunc.cpp
r27565 r27572 396 396 switch (cmd.action) { 397 397 case LFUN_UNKNOWN_ACTION: 398 #ifndef HAVE_ LIBAIKSAURUS398 #ifndef HAVE_THESAURUS 399 399 case LFUN_THESAURUS_ENTRY: 400 400 #endif … … 1944 1944 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths); 1945 1945 } 1946 case LyXRC::RC_THESAURUSDIRPATH: 1946 1947 case LyXRC::RC_UIFILE: 1947 1948 case LyXRC::RC_USER_EMAIL: lyx-devel/trunk/src/LyXRC.cpp
r27547 r27572 166 166 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES }, 167 167 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS }, 168 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH }, 168 169 { "\\ui_file", LyXRC::RC_UIFILE }, 169 170 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG }, … … 671 672 break; 672 673 674 case RC_THESAURUSDIRPATH: 675 if (lexrc.next()) { 676 thesaurusdir_path = os::internal_path(lexrc.getString()); 677 thesaurusdir_path = expandPath(thesaurusdir_path); 678 } 679 break; 680 673 681 case RC_USETEMPDIR: 674 682 if (lexrc.next()) … … 2040 2048 if (tag != RC_LAST) 2041 2049 break; 2050 case RC_THESAURUSDIRPATH: 2051 if (ignore_system_lyxrc || 2052 thesaurusdir_path != system_lyxrc.thesaurusdir_path) { 2053 string const path = os::external_path(thesaurusdir_path); 2054 os << "\\thesaurusdir_path \"" << path << "\"\n"; 2055 } 2056 if (tag != RC_LAST) 2057 break; 2042 2058 case RC_USETEMPDIR: 2043 2059 if (tag != RC_LAST) … … 2792 2808 break; 2793 2809 2810 case RC_THESAURUSDIRPATH: 2811 str = _("This is the place where the files of the thesaurus library reside."); 2812 break; 2813 2794 2814 case RC_TEMPLATEPATH: 2795 2815 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from."); lyx-devel/trunk/src/LyXRC.h
r27531 r27572 150 150 RC_TEX_ALLOWS_SPACES, 151 151 RC_TEX_EXPECTS_WINDOWS_PATHS, 152 RC_THESAURUSDIRPATH, 152 153 RC_UIFILE, 153 154 RC_USELASTFILEPOS, … … 258 259 /// 259 260 std::string tempdir_path; 261 /// 262 std::string thesaurusdir_path; 260 263 /// 261 264 bool auto_region_delete; lyx-devel/trunk/src/Text3.cpp
r27567 r27572 1799 1799 selectWordWhenUnderCursor(cur, WHOLE_WORD); 1800 1800 arg = cur.selectionAsString(false); 1801 arg += " lang=" + from_ascii(cur.getFont().language()->lang()); 1801 1802 } 1802 1803 } lyx-devel/trunk/src/Thesaurus.cpp
r22097 r27572 5 5 * 6 6 * \author John Levon 7 * \author JÃŒrgen SpitzmÃŒller 7 8 * 8 9 * Full author contact details are available in file CREDITS. … … 13 14 #include "Thesaurus.h" 14 15 16 #include "support/debug.h" 15 17 #include "support/gettext.h" 16 18 #include "LyXRC.h" 19 20 #include "support/FileNameList.h" 21 #include "support/filetools.h" 17 22 #include "support/lstrings.h" 23 #include "support/os.h" 24 #include "support/unicode.h" 18 25 19 26 #include "frontends/alert.h" 20 27 21 28 #include <algorithm> 29 #include <cstring> 22 30 23 31 using namespace std; 32 using namespace lyx::support; 33 using namespace lyx::support::os; 24 34 25 35 namespace lyx { 26 36 37 #ifndef HAVE_LIBMYTHES 27 38 #ifdef HAVE_LIBAIKSAURUS 28 using support::bformat;29 39 30 40 31 41 Thesaurus::Thesaurus() 32 : aik_(new Aiksaurus)42 : thes_(new Aiksaurus) 33 43 {} 34 44 … … 36 46 Thesaurus::~Thesaurus() 37 47 { 38 delete aik_;39 } 40 41 42 Thesaurus::Meanings Thesaurus::lookup(docstring const & t )48 delete thes_; 49 } 50 51 52 Thesaurus::Meanings Thesaurus::lookup(docstring const & t, docstring const &) 43 53 { 44 54 Meanings meanings; … … 54 64 string const text = to_ascii(t); 55 65 56 docstring error = from_ascii( aik_->error());66 docstring error = from_ascii(thes_->error()); 57 67 if (!error.empty()) { 58 68 static bool sent_error = false; … … 65 75 return meanings; 66 76 } 67 if (! aik_->find(text.c_str()))77 if (!thes_->find(text.c_str())) 68 78 return meanings; 69 79 … … 75 85 76 86 // correct, returns "" at the end 77 string ret = aik_->next(cur_meaning);87 string ret = thes_->next(cur_meaning); 78 88 79 89 while (!ret.empty()) { 80 90 if (cur_meaning != prev_meaning) { 81 91 meaning = from_ascii(ret); 82 ret = aik_->next(cur_meaning);92 ret = thes_->next(cur_meaning); 83 93 prev_meaning = cur_meaning; 84 94 } else { … … 87 97 } 88 98 89 ret = aik_->next(cur_meaning);99 ret = thes_->next(cur_meaning); 90 100 } 91 101 … … 97 107 } 98 108 109 110 bool Thesaurus::thesaurusAvailable(docstring const & lang) const 111 { 112 // we support English only 113 return (prefixIs(lang, "en_")); 114 } 115 116 #endif // HAVE_LIBAIKSAURUS 117 #endif // !HAVE_LIBMYTHES 118 119 120 #ifdef HAVE_LIBMYTHES 121 122 namespace { 123 124 string const to_iconv_encoding(docstring const & s, string const & encoding) 125 { 126 std::vector<char> const encoded = 127 ucs4_to_eightbit(s.data(), s.length(), encoding); 128 return string(encoded.begin(), encoded.end()); 129 } 130 131 132 docstring const from_iconv_encoding(string const & s, string const & encoding) 133 { 134 std::vector<char_type> const ucs4 = 135 eightbit_to_ucs4(s.data(), s.length(), encoding); 136 return docstring(ucs4.begin(), ucs4.end()); 137 } 138 139 } // namespace anon 140 141 142 Thesaurus::Thesaurus() 143 {} 144 145 146 Thesaurus::~Thesaurus() 147 { 148 for (Thesauri::iterator it = thes_.begin(); 149 it != thes_.end(); ++it) { 150 delete it->second; 151 } 152 } 153 154 155 bool Thesaurus::addThesaurus(docstring const & lang) 156 { 157 string const thes_path = external_path(lyxrc.thesaurusdir_path); 158 LYXERR(Debug::FILES, "thesaurus path: " << thes_path); 159 if (thes_path.empty()) 160 return false; 161 162 if (thesaurusAvailable(lang)) 163 return true; 164 165 FileNameList const idx_files = FileName(thes_path).dirList("idx"); 166 FileNameList const data_files = FileName(thes_path).dirList("dat"); 167 string idx; 168 string data; 169 170 for (FileNameList::const_iterator it = idx_files.begin(); 171 it != idx_files.end(); ++it) { 172 LYXERR(Debug::FILES, "found thesaurus idx file: " << it->onlyFileName()); 173 if (contains(it->onlyFileName(), to_ascii(lang))) { 174 idx = it->absFilename(); 175 LYXERR(Debug::FILES, "selected thesaurus idx file: " << idx); 176 break; 177 } 178 } 179 180 for (support::FileNameList::const_iterator it = data_files.begin(); 181 it != data_files.end(); ++it) { 182 LYXERR(Debug::FILES, "found thesaurus data file: " << it->onlyFileName()); 183 if (contains(it->onlyFileName(), to_ascii(lang))) { 184 data = it->absFilename(); 185 LYXERR(Debug::FILES, "selected thesaurus data file: " << data); 186 break; 187 } 188 } 189 190 if (idx.empty() || data.empty()) 191 return false; 192 193 char const * af = idx.c_str(); 194 char const * df = data.c_str(); 195 thes_[lang] = new MyThes(af, df); 196 return true; 197 } 198 199 200 bool Thesaurus::thesaurusAvailable(docstring const & lang) const 201 { 202 for (Thesauri::const_iterator it = thes_.begin(); 203 it != thes_.end(); ++it) { 204 if (it->first == lang) 205 if (it->second) 206 return true; 207 } 208 209 return false; 210 } 211 212 213 Thesaurus::Meanings Thesaurus::lookup(docstring const & t, docstring const & lang) 214 { 215 Meanings meanings; 216 MyThes * mythes = 0; 217 218 if (!addThesaurus(lang)) 219 return meanings; 220 221 for (Thesauri::const_iterator it = thes_.begin(); 222 it != thes_.end(); ++it) { 223 if (it->first == lang) { 224 mythes = it->second; 225 break; 226 } 227 } 228 229 if (!mythes) 230 return meanings; 231 232 string const encoding = mythes->get_th_encoding(); 233 234 mentry * pmean; 235 string const text = to_iconv_encoding(support::lowercase(t), encoding); 236 int len = strlen(text.c_str()); 237 int count = mythes->Lookup(text.c_str(), len, &pmean); 238 if (!count) 239 return meanings; 240 241 // don't change value of pmean or count 242 // they are needed for the CleanUpAfterLookup routine 243 mentry * pm = pmean; 244 docstring meaning; 245 docstring ret; 246 for (int i = 0; i < count; i++) { 247 meaning = from_iconv_encoding(string(pm->defn), encoding); 248 // remove silly item 249 if (support::prefixIs(meaning, '-')) 250 meaning = support::ltrim(meaning, "- "); 251 for (int j = 0; j < pm->count; j++) { 252 ret = from_iconv_encoding(string(pm->psyns[j]), encoding); 253 } 254 meanings[meaning].push_back(ret); 255 pm++; 256 } 257 // now clean up all allocated memory 258 mythes->CleanUpAfterLookup(&pmean, count); 259 260 for (Meanings::iterator it = meanings.begin(); 261 it != meanings.end(); ++it) 262 sort(it->second.begin(), it->second.end()); 263 264 return meanings; 265 } 266 99 267 #else 100 268 … … 114 282 } 115 283 116 #endif // HAVE_LIB AIKSAURUS284 #endif // HAVE_LIBMYTHES 117 285 118 286 // Global instance lyx-devel/trunk/src/Thesaurus.h
r18539 r27572 6 6 * 7 7 * \author John Levon 8 * \author JÃŒrgen SpitzmÃŒller 8 9 * 9 10 * Full author contact details are available in file CREDITS. … … 17 18 #include <vector> 18 19 #include <map> 20 #include <string> 19 21 22 #ifdef HAVE_LIBMYTHES 23 #include MYTHES_H_LOCATION 24 #else 20 25 #ifdef HAVE_LIBAIKSAURUS 21 26 #include AIKSAURUS_H_LOCATION 22 #endif 27 #endif // HAVE_LIBAIKSAURUS 28 #endif // !HAVE_LIBMYTHES 23 29 24 30 namespace lyx { … … 40 46 * look up some text in the thesaurus 41 47 */ 42 Meanings lookup(docstring const & text); 48 Meanings lookup(docstring const & text, docstring const & lang); 49 /// check if a thesaurus for a given language \p lang is available 50 bool thesaurusAvailable(docstring const & lang) const; 43 51 44 52 private: 53 #ifdef HAVE_LIBMYTHES 54 /// add a thesaurus to the list 55 bool addThesaurus(docstring const & lang); 56 57 typedef std::map<docstring, MyThes *> Thesauri; 58 /// the thesauri 59 Thesauri thes_; 60 #else 45 61 #ifdef HAVE_LIBAIKSAURUS 46 Aiksaurus * aik_; 47 #endif 62 Aiksaurus * thes_; 63 #endif // HAVE_LIBAIKSAURUS 64 #endif // !HAVE_LIBMYTHES 48 65 }; 49 66 lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp
r27531 r27572 927 927 connect(workingDirPB, SIGNAL(clicked()), this, SLOT(select_workingdir())); 928 928 connect(lyxserverDirPB, SIGNAL(clicked()), this, SLOT(select_lyxpipe())); 929 connect(thesaurusDirPB, SIGNAL(clicked()), this, SLOT(select_thesaurusdir())); 929 930 connect(workingDirED, SIGNAL(textChanged(QString)), 930 931 this, SIGNAL(changed())); … … 938 939 this, SIGNAL(changed())); 939 940 connect(lyxserverDirED, SIGNAL(textChanged(QString)), 941 this, SIGNAL(changed())); 942 connect(thesaurusDirED, SIGNAL(textChanged(QString)), 940 943 this, SIGNAL(changed())); 941 944 connect(pathPrefixED, SIGNAL(textChanged(QString)), … … 951 954 rc.backupdir_path = internal_path(fromqstr(backupDirED->text())); 952 955 rc.tempdir_path = internal_path(fromqstr(tempDirED->text())); 956 rc.thesaurusdir_path = internal_path(fromqstr(thesaurusDirED->text())); 953 957 rc.path_prefix = internal_path_list(fromqstr(pathPrefixED->text())); 954 958 // FIXME: should be a checkbox only … … 964 968 backupDirED->setText(toqstr(external_path(rc.backupdir_path))); 965 969 tempDirED->setText(toqstr(external_path(rc.tempdir_path))); 970 thesaurusDirED->setText(toqstr(external_path(rc.thesaurusdir_path))); 966 971 pathPrefixED->setText(toqstr(external_path_list(rc.path_prefix))); 967 972 // FIXME: should be a checkbox only … … 1012 1017 if (!file.isEmpty()) 1013 1018 workingDirED->setText(file); 1019 } 1020 1021 1022 void PrefPaths::select_thesaurusdir() 1023 { 1024 QString file = browseDir(internalPath(thesaurusDirED->text()), 1025 qt_("Set the path to the thesaurus dictionaries")); 1026 if (!file.isEmpty()) 1027 thesaurusDirED->setText(file); 1014 1028 } 1015 1029 lyx-devel/trunk/src/frontends/qt4/GuiPrefs.h
r26503 r27572 284 284 void select_backupdir(); 285 285 void select_workingdir(); 286 void select_thesaurusdir(); 286 287 void select_lyxpipe(); 287 288 lyx-devel/trunk/src/frontends/qt4/GuiThesaurus.cpp
r27420 r27572 5 5 * 6 6 * \author John Levon 7 * \author JÃŒrgen SpitzmÃŒller 7 8 * 8 9 * Full author contact details are available in file CREDITS. … … 12 13 13 14 #include "GuiThesaurus.h" 15 #include "GuiApplication.h" 14 16 15 17 #include "qt_helpers.h" 16 18 19 #include "Buffer.h" 20 #include "BufferParams.h" 21 #include "BufferView.h" 17 22 #include "FuncRequest.h" 23 #include "Language.h" 18 24 #include "lyxfind.h" 19 25 20 26 #include "support/debug.h" 21 27 #include "support/gettext.h" 22 28 #include "support/lstrings.h" 29 30 #include <QAbstractItemModel> 23 31 #include <QHeaderView> 24 32 #include <QLineEdit> … … 28 36 29 37 38 using namespace lyx::support; 30 39 using namespace std; 31 40 … … 47 56 connect(replaceED, SIGNAL(textChanged(QString)), 48 57 this, SLOT(change_adaptor())); 49 connect(entryED, SIGNAL(returnPressed()), 58 connect(entryCO, SIGNAL(editTextChanged(const QString &)), 59 this, SLOT(entryChanged())); 60 connect(entryCO, SIGNAL(activated(int)), 61 this, SLOT(entryChanged())); 62 connect(lookupPB, SIGNAL(clicked()), 50 63 this, SLOT(entryChanged())); 51 64 connect(replacePB, SIGNAL(clicked()), 52 65 this, SLOT(replaceClicked())); 66 connect(languageCO, SIGNAL(activated(int)), 67 this, SLOT(entryChanged())); 53 68 connect(meaningsTV, SIGNAL(itemClicked(QTreeWidgetItem *, int)), 54 69 this, SLOT(itemClicked(QTreeWidgetItem *, int))); 55 70 connect(meaningsTV, SIGNAL(itemSelectionChanged()), 56 71 this, SLOT(selectionChanged())); 57 connect(meaningsTV, SIGNAL(item Activated(QTreeWidgetItem *, int)),72 connect(meaningsTV, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), 58 73 this, SLOT(selectionClicked(QTreeWidgetItem *, int))); 74 75 // language 76 QAbstractItemModel * language_model = guiApp->languageModel(); 77 // FIXME: it would be nice if sorting was enabled/disabled via a checkbox. 78 language_model->sort(0); 79 languageCO->setModel(language_model); 59 80 60 81 bc().setCancel(closePB); … … 84 105 return; 85 106 86 replaceED->setText(meaningsTV->currentItem()->text(col)); 107 QString item = meaningsTV->currentItem()->text(col); 108 // cut out the classification in brackets 109 // (as in "hominid (generic term)") 110 // FIXME: not ideal yet. We need to cut off classifications 111 // at the beginning as well 112 // (as in "(noun) man" and "(noun) male (generic term)") 113 QRegExp re("^([^\\(\\)]+)\\b\\(?.*\\)?.*$"); 114 int pos = re.indexIn(item); 115 if (pos > -1) 116 item = re.cap(1).trimmed(); 117 replaceED->setText(item); 87 118 replacePB->setEnabled(true); 88 119 changed(); … … 98 129 void GuiThesaurus::selectionClicked(QTreeWidgetItem * item, int col) 99 130 { 100 entryED->setText(item->text(col)); 131 QString str = item->text(col); 132 // cut out the classification in brackets 133 // (as in "hominid (generic term)") 134 // FIXME: not ideal yet. We need to cut off classifications 135 // at the beginning as well 136 // (as in "(noun) man" and "(noun) male (generic term)") 137 QRegExp re("^([^\\(\\)]+)\\b\\(?.*\\)?.*$"); 138 int pos = re.indexIn(str); 139 if (pos > -1) 140 str = re.cap(1).trimmed(); 141 entryCO->insertItem(0, str); 142 entryCO->setCurrentIndex(0); 143 101 144 selectionChanged(); 102 145 updateLists(); … … 109 152 meaningsTV->setUpdatesEnabled(false); 110 153 111 Thesaurus::Meanings meanings = getMeanings(qstring_to_ucs4(entryED->text())); 154 QString const lang = languageCO->itemData( 155 languageCO->currentIndex()).toString(); 156 docstring const lang_code = 157 from_ascii(lyx::languages.getLanguage(fromqstr(lang))->code()); 158 159 Thesaurus::Meanings meanings = 160 getMeanings(qstring_to_ucs4(entryCO->currentText()), lang_code); 112 161 113 162 for (Thesaurus::Meanings::const_iterator cit = meanings.begin(); … … 121 170 i2->setText(0, toqstr(*cit2)); 122 171 } 172 meaningsTV->setEnabled(true); 173 lookupPB->setEnabled(true); 174 replaceED->setEnabled(true); 175 replacePB->setEnabled(true); 176 } 177 178 if (meanings.empty()) { 179 if (!thesaurus.thesaurusAvailable(lang_code)) { 180 QTreeWidgetItem * i = new QTreeWidgetItem(meaningsTV); 181 i->setText(0, qt_("No thesaurus available for this language!")); 182 meaningsTV->setEnabled(false); 183 lookupPB->setEnabled(false); 184 replaceED->setEnabled(false); 185 replacePB->setEnabled(false); 186 } 123 187 } 124 188 … … 130 194 void GuiThesaurus::updateContents() 131 195 { 132 entryED->setText(toqstr(text_)); 196 entryCO->clear(); 197 entryCO->addItem(toqstr(text_)); 198 entryCO->setCurrentIndex(0); 133 199 replaceED->setText(""); 200 int const pos = languageCO->findData(toqstr(lang_)); 201 if (pos != -1) 202 languageCO->setCurrentIndex(pos); 134 203 updateLists(); 135 204 } … … 144 213 bool GuiThesaurus::initialiseParams(string const & data) 145 214 { 146 text_ = from_utf8(data); 215 string arg; 216 string const lang = rsplit(data, arg, ' '); 217 if (prefixIs(lang, "lang=")) { 218 lang_ = from_utf8(split(lang, '=')); 219 text_ = from_utf8(arg); 220 } else { 221 text_ = from_utf8(data); 222 if (bufferview()) 223 lang_ = from_ascii( 224 bufferview()->buffer().params().language->lang()); 225 } 147 226 return true; 148 227 } … … 152 231 { 153 232 text_.erase(); 233 lang_.erase(); 154 234 } 155 235 … … 171 251 172 252 173 Thesaurus::Meanings const & GuiThesaurus::getMeanings(docstring const & str) 253 Thesaurus::Meanings const & GuiThesaurus::getMeanings(docstring const & str, 254 docstring const & lang) 174 255 { 175 256 if (str != laststr_) 176 meanings_ = thesaurus.lookup(str );257 meanings_ = thesaurus.lookup(str, lang); 177 258 return meanings_; 178 259 } lyx-devel/trunk/src/frontends/qt4/GuiThesaurus.h
r23045 r27572 55 55 56 56 /// get meanings 57 Thesaurus::Meanings const & getMeanings(docstring const & str); 57 Thesaurus::Meanings const & getMeanings(docstring const & str, 58 docstring const & lang); 58 59 59 60 private: … … 67 68 docstring text_; 68 69 70 /// language 71 docstring lang_; 72 69 73 /// not needed. 70 74 void apply() {} lyx-devel/trunk/src/frontends/qt4/ui/PrefPathsUi.ui
r24389 r27572 7 7 <y>0</y> 8 8 <width>347</width> 9 <height> 259</height>9 <height>311</height> 10 10 </rect> 11 11 </property> … … 14 14 </property> 15 15 <layout class="QGridLayout" > 16 <item row="0" column="0" > 17 <widget class="QLabel" name="workingDirLA" > 18 <property name="text" > 19 <string>&Working directory:</string> 20 </property> 21 <property name="buddy" > 22 <cstring>workingDirED</cstring> 23 </property> 24 </widget> 25 </item> 26 <item row="0" column="1" > 27 <widget class="QLineEdit" name="workingDirED" /> 28 </item> 29 <item row="0" column="2" > 30 <widget class="QPushButton" name="workingDirPB" > 31 <property name="text" > 32 <string>Browse...</string> 33 </property> 34 <property name="autoDefault" > 35 <bool>false</bool> 36 </property> 37 </widget> 38 </item> 39 <item row="1" column="0" > 40 <widget class="QLabel" name="templateDirLA" > 41 <property name="text" > 42 <string>&Document templates:</string> 43 </property> 44 <property name="buddy" > 45 <cstring>templateDirED</cstring> 46 </property> 47 </widget> 48 </item> 49 <item row="1" column="1" > 50 <widget class="QLineEdit" name="templateDirED" /> 51 </item> 52 <item row="1" column="2" > 53 <widget class="QPushButton" name="templateDirPB" > 54 <property name="text" > 55 <string>Browse...</string> 56 </property> 57 <property name="autoDefault" > 58 <bool>false</bool> 59 </property> 60 </widget> 61 </item> 62 <item row="2" column="0" > 63 <widget class="QLabel" name="exampleDirLA" > 64 <property name="text" > 65 <string>&Example files:</string> 66 </property> 67 <property name="buddy" > 68 <cstring>templateDirED</cstring> 69 </property> 70 </widget> 71 </item> 72 <item row="2" column="1" > 73 <widget class="QLineEdit" name="exampleDirED" /> 74 </item> 75 <item row="2" column="2" > 76 <widget class="QPushButton" name="exampleDirPB" > 77 <property name="text" > 78 <string>Browse...</string> 79 </property> 80 <property name="autoDefault" > 81 <bool>false</bool> 82 </property> 83 </widget> 84 </item> 85 <item row="3" column="0" > 86 <widget class="QLabel" name="backupDirLA" > 87 <property name="text" > 88 <string>&Backup directory:</string> 89 </property> 90 <property name="buddy" > 91 <cstring>backupDirED</cstring> 92 </property> 93 </widget> 94 </item> 95 <item row="3" column="1" > 96 <widget class="QLineEdit" name="backupDirED" /> 97 </item> 98 <item row="3" column="2" > 99 <widget class="QPushButton" name="backupDirPB" > 100 <property name="text" > 101 <string>Browse...</string> 102 </property> 103 <property name="autoDefault" > 104 <bool>false</bool> 105 </property> 106 </widget> 107 </item> 108 <item row="4" column="0" > 109 <widget class="QLabel" name="lyxserverDirLA" > 110 <property name="text" > 111 <string>Ly&XServer pipe:</string> 112 </property> 113 <property name="buddy" > 114 <cstring>lyxserverDirED</cstring> 115 </property> 116 </widget> 117 </item> 118 <item row="4" column="1" > 119 <widget class="QLineEdit" name="lyxserverDirED" /> 120 </item> 121 <item row="4" column="2" > 122 <widget class="QPushButton" name="lyxserverDirPB" > 123 <property name="text" > 124 <string>Browse...</string> 125 </property> 126 <property name="autoDefault" > 127 <bool>false</bool> 128 </property> 129 </widget> 130 </item> 131 <item row="5" column="0" > 132 <widget class="QLabel" name="tempDirLA" > 133 <property name="text" > 134 <string>&Temporary directory:</string> 135 </property> 136 <property name="buddy" > 137 <cstring>tempDirED</cstring> 138 </property> 139 </widget> 140 </item> 141 <item row="5" column="1" > 142 <widget class="QLineEdit" name="tempDirED" /> 143 </item> 144 <item row="5" column="2" > 145 <widget class="QPushButton" name="tempDirPB" > 146 <property name="text" > 147 <string>Browse...</string> 148 </property> 149 <property name="autoDefault" > 150 <bool>false</bool> 151 </property> 152 </widget> 153 </item> 154 <item row="6" column="0" > 155 <widget class="QLabel" name="pathPrefixLA" > 156 <property name="text" > 157 <string>&PATH prefix:</string> 158 </property> 159 <property name="buddy" > 160 <cstring>pathPrefixED</cstring> 161 </property> 162 </widget> 163 </item> 164 <item row="6" column="1" colspan="2" > 165 <widget class="QLineEdit" name="pathPrefixED" /> 166 </item> 167 <item row="7" column="0" colspan="3" > 16 <property name="margin" > 17 <number>9</number> 18 </property> 19 <property name="spacing" > 20 <number>6</number> 21 </property> 22 <item row="8" column="0" colspan="3" > 168 23 <spacer> 169 24 <property name="orientation" > … … 175 30 <property name="sizeHint" > 176 31 <size> 177 <width> 20</width>178 <height> 20</height>32 <width>329</width> 33 <height>16</height> 179 34 </size> 180 35 </property> 181 36 </spacer> 37 </item> 38 <item row="7" column="0" > 39 <widget class="QLabel" name="pathPrefixLA" > 40 <property name="text" > 41 <string>&PATH prefix:</string> 42 </property> 43 <property name="buddy" > 44 <cstring>pathPrefixED</cstring> 45 </property> 46 </widget> 47 </item> 48 <item row="7" column="1" colspan="2" > 49 <widget class="QLineEdit" name="pathPrefixED" /> 50 </item> 51 <item row="6" column="2" > 52 <widget class="QPushButton" name="thesaurusDirPB" > 53 <property name="text" > 54 <string>Browse...</string> 55 </property> 56 <property name="autoDefault" > 57 <bool>false</bool> 58 </property> 59 </widget> 60 </item> 61 <item row="6" column="0" > 62 <widget class="QLabel" name="thesaurusDirLA" > 63 <property name="text" > 64 <string>T&hesaurus dictionaries:</string> 65 </property> 66 <property name="buddy" > 67 <cstring>thesaurusDirED</cstring> 68 </property> 69 </widget> 70 </item> 71 <item row="6" column="1" > 72 <widget class="QLineEdit" name="thesaurusDirED" /> 73 </item> 74 <item row="5" column="2" > 75 <widget class="QPushButton" name="tempDirPB" > 76 <property name="text" > 77 <string>Browse...</string> 78 </property> 79 <property name="autoDefault" > 80 <bool>false</bool> 81 </property> 82 </widget> 83 </item> 84 <item row="5" column="1" > 85 <widget class="QLineEdit" name="tempDirED" /> 86 </item> 87 <item row="5" column="0" > 88 <widget class="QLabel" name="tempDirLA" > 89 <property name="text" > 90 <string>&Temporary directory:</string> 91 </property> 92 <property name="buddy" > 93 <cstring>tempDirED</cstring> 94 </property> 95 </widget> 96 </item> 97 <item row="4" column="2" > 98 <widget class="QPushButton" name="lyxserverDirPB" > 99 <property name="text" > 100 <string>Browse...</string> 101 </property> 102 <property name="autoDefault" > 103 <bool>false</bool> 104 </property> 105 </widget> 106 </item> 107 <item row="4" column="1" > 108 <widget class="QLineEdit" name="lyxserverDirED" /> 109 </item> 110 <item row="4" column="0" > 111 <widget class="QLabel" name="lyxserverDirLA" > 112 <property name="text" > 113 <string>Ly&XSe
