]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiThesaurus.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiThesaurus.cpp
index c28fdf113e9f1ab5960df05d1b68b7ed174d3826..c3e7c95829532b0f5994f89ef652434cac7aa624 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <QAbstractItemModel>
 #include <QCompleter>
+#include <QDialogButtonBox>
 #include <QHeaderView>
 #include <QLineEdit>
 #include <QPushButton>
@@ -51,8 +52,8 @@ GuiThesaurus::GuiThesaurus(GuiView & lv)
        meaningsTV->setColumnCount(1);
        meaningsTV->header()->hide();
 
-       connect(closePB, SIGNAL(clicked()),
-               this, SLOT(slotClose()));
+       connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+               this, SLOT(slotButtonBox(QAbstractButton *)));
        connect(replaceED, SIGNAL(returnPressed()),
                this, SLOT(replaceClicked()));
        connect(replaceED, SIGNAL(textChanged(QString)),
@@ -85,8 +86,8 @@ GuiThesaurus::GuiThesaurus(GuiView & lv)
        if (entryCO->completer())
                entryCO->completer()->setCompletionMode(QCompleter::PopupCompletion);
 
-       bc().setCancel(closePB);
-       bc().setApply(replacePB);
+       bc().setCancel(buttonBox->button(QDialogButtonBox::Close));
+       bc().setApply(replacePB, true);
        bc().addReadOnly(replaceED);
        bc().addReadOnly(replacePB);
        bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
@@ -101,7 +102,7 @@ void GuiThesaurus::checkStatus()
        }
        updateView();
 }
-       
+
 void GuiThesaurus::change_adaptor()
 {
        changed();
@@ -237,15 +238,15 @@ void GuiThesaurus::replaceClicked()
 }
 
 
-bool GuiThesaurus::initialiseParams(string const & data)
+bool GuiThesaurus::initialiseParams(string const & sdata)
 {
        string arg;
-       string const lang = rsplit(data, arg, ' ');
+       string const lang = rsplit(sdata, arg, ' ');
        if (prefixIs(lang, "lang=")) {
                lang_ = from_utf8(split(lang, '='));
                text_ = from_utf8(arg);
        } else {
-               text_ = from_utf8(data);
+               text_ = from_utf8(sdata);
                if (bufferview())
                        lang_ = from_ascii(
                                bufferview()->buffer().params().language->lang());
@@ -267,13 +268,13 @@ void GuiThesaurus::replace(docstring const & newstr)
         * on a particular charpos in a paragraph that is broken on
         * deletion/change !
         */
-       docstring const data =
+       docstring const sdata =
                replace2string(newstr, text_,
                                     true,  // case sensitive
                                     true,  // match word
                                     false, // all words
                                     true); // forward
-       dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
+       dispatch(FuncRequest(LFUN_WORD_REPLACE, sdata));
 }