3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
14 #include "QSearchDialog.h"
17 #include "controllers/ControlSearch.h"
19 #include <qpushbutton.h>
26 typedef QController<ControlSearch, QView<QSearchDialog> > search_base_class;
29 QSearch::QSearch(Dialog & parent)
30 : search_base_class(parent, _("Find and Replace"))
35 void QSearch::build_dialog()
37 dialog_.reset(new QSearchDialog(this));
39 bcview().setCancel(dialog_->closePB);
40 bcview().addReadOnly(dialog_->replaceCO);
41 bcview().addReadOnly(dialog_->replacePB);
42 bcview().addReadOnly(dialog_->replaceallPB);
44 dialog_->replacePB->setEnabled(false);
45 dialog_->replaceallPB->setEnabled(false);
49 void QSearch::find(docstring const & str, bool casesens,
50 bool words, bool backwards)
52 controller().find(str, casesens, words, !backwards);
56 void QSearch::replace(docstring const & findstr, docstring const & replacestr,
57 bool casesens, bool words, bool backwards, bool all)
59 controller().replace(findstr, replacestr, casesens, words,
63 } // namespace frontend