]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlThesaurus.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlThesaurus.C
index bbfe6fd38e45f6983dc0850d66aca2201c45a6fc..457931c5ad2a5214c606d9957c0379d65c45ecb2 100644 (file)
@@ -1,6 +1,7 @@
 /**
  * \file ControlThesaurus.C
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author John Levon
  *
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "ControlThesaurus.h"
 
 #include "gettext.h"
 #include "lyxfind.h"
 
-#include "frontends/Liason.h"
+#include "frontends/LyXView.h"
 
-
-using Liason::setMinibuffer;
+ControlThesaurus::ControlThesaurus(Dialog & parent)
+       : Dialog::Controller(parent)
+{}
 
 
-ControlThesaurus::ControlThesaurus(LyXView & lv, Dialogs & d)
-       : ControlDialogBD(lv, d)
-{}
+bool ControlThesaurus::initialiseParams(string const & data)
+{
+       oldstr_ = data;
+       return true;
+}
 
 
-void ControlThesaurus::showEntry(string const & entry)
+void ControlThesaurus::clearParams()
 {
-       oldstr_ = entry;
-       show();
+       oldstr_.erase();
 }
 
 
@@ -43,19 +43,20 @@ void ControlThesaurus::replace(string const & newstr)
         * deletion/change !
         */
        int const replace_count =
-               lyxfind::LyXReplace(bufferview(), oldstr_, newstr,
+               lyxfind::LyXReplace(kernel().bufferview(), oldstr_, newstr,
                                    true, true, true, false, true);
 
        oldstr_ = newstr;
 
        if (replace_count == 0)
-               setMinibuffer(&lv_, _("String not found!"));
+               kernel().lyxview().message(_("String not found!"));
        else
-               setMinibuffer(&lv_, _("String has been replaced."));
+               kernel().lyxview().message(_("String has been replaced."));
 }
 
 
-Thesaurus::Meanings const & ControlThesaurus::getMeanings(string const & str)
+Thesaurus::Meanings const &
+ControlThesaurus::getMeanings(string const & str)
 {
        if (str != laststr_)
                meanings_ = thesaurus.lookup(str);