2 * \file ControlThesaurus.C
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
12 #pragma implementation
16 #include "ButtonControllerBase.h"
17 #include "ControlThesaurus.h"
25 #include "BufferView.h"
27 using Liason::setMinibuffer;
30 ControlThesaurus::ControlThesaurus(LyXView & lv, Dialogs & d)
31 : ControlDialog<ControlConnectBD>(lv, d)
33 d_.showThesaurus.connect(SigC::slot(this, &ControlThesaurus::showEntry));
37 void ControlThesaurus::showEntry(string const & entry)
44 void ControlThesaurus::replace(string const & newstr)
46 /* FIXME: this is not suitable ! We need to have a "lock"
47 * on a particular charpos in a paragraph that is broken on
50 int const replace_count = LyXReplace(lv_.view(), oldstr_, newstr,
51 true, true, true, false, true);
55 if (replace_count == 0)
56 setMinibuffer(&lv_, _("String not found!"));
58 setMinibuffer(&lv_, _("String has been replaced."));
62 Thesaurus::Meanings const & ControlThesaurus::getMeanings(string const & str)
65 meanings_ = thesaurus.lookup(str);