diff --git a/src/frontends/qt/FindAndReplace.cpp b/src/frontends/qt/FindAndReplace.cpp index b378f46c9b..9cfdfcf157 100644 --- a/src/frontends/qt/FindAndReplace.cpp +++ b/src/frontends/qt/FindAndReplace.cpp @@ -530,6 +530,12 @@ void FindAndReplaceWidget::on_replaceallPB_clicked() } +void FindAndReplaceWidget::on_searchbackCB_clicked() +{ + updateButtons(); +} + + // Copy selected elements from bv's BufferParams to the dest_bv's static void copy_params(BufferView const & bv, BufferView & dest_bv) { Buffer const & doc_buf = bv.buffer(); @@ -577,6 +583,7 @@ bool FindAndReplaceWidget::initialiseParams(std::string const & /*params*/) void FindAndReplace::updateView() { widget_->updateGUI(); + widget_->updateButtons(); } @@ -633,6 +640,22 @@ void FindAndReplaceWidget::updateGUI() } +void FindAndReplaceWidget::updateButtons() +{ + if (searchbackCB->isChecked()) { + findNextPB->setText(qt_("&< Find")); + findNextPB->setToolTip(qt_("Find previous occurrence (Shift+Enter, forwards: Enter)")); + replacePB->setText(qt_("< Rep&lace")); + replacePB->setToolTip(qt_("Replace and find previous occurrence (Shift+Enter, forwards: Enter)")); + } else { + findNextPB->setText(qt_("Find &>")); + findNextPB->setToolTip(qt_("Find next occurrence (Enter, backwards: Shift+Enter)")); + replacePB->setText(qt_("Rep&lace >")); + replacePB->setToolTip(qt_("Replace and find next occurrence (Enter, backwards: Shift+Enter)")); + } +} + + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt/FindAndReplace.h b/src/frontends/qt/FindAndReplace.h index 565db5afa6..0ffc39d458 100644 --- a/src/frontends/qt/FindAndReplace.h +++ b/src/frontends/qt/FindAndReplace.h @@ -33,6 +33,7 @@ public: FindAndReplaceWidget(GuiView & view); bool initialiseParams(std::string const & params); void updateGUI(); + void updateButtons(); public Q_SLOTS: /// @@ -69,6 +70,7 @@ protected Q_SLOTS: void on_findNextPB_clicked(); void on_replacePB_clicked(); void on_replaceallPB_clicked(); + void on_searchbackCB_clicked(); };