]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QSearch.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QSearch.C
1 /**
2  * \file QSearch.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "debug.h"
14 #include "ControlSearch.h"
15
16 #include "QSearch.h"
17 #include "QSearchDialog.h"
18 #include "Qt2BC.h"
19
20 #include <qpushbutton.h>
21 #include <qcombobox.h>
22
23 using std::string;
24
25
26 typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
27
28
29 QSearch::QSearch()
30         : base_class(_("LyX: Find and Replace"))
31 {
32 }
33
34
35 void QSearch::build_dialog()
36 {
37         dialog_.reset(new QSearchDialog(this));
38
39         bcview().setCancel(dialog_->closePB);
40         bcview().addReadOnly(dialog_->replaceCO);
41         bcview().addReadOnly(dialog_->replacePB);
42         bcview().addReadOnly(dialog_->replaceallPB);
43
44         dialog_->replacePB->setEnabled(false);
45         dialog_->replaceallPB->setEnabled(false);
46 }
47
48
49 void QSearch::find(string const & str, bool casesens,
50                    bool words, bool backwards)
51 {
52         controller().find(str, casesens, words, !backwards);
53 }
54
55
56 void QSearch::replace(string const & findstr, string const & replacestr,
57         bool casesens, bool words, bool backwards, bool all)
58 {
59         controller().replace(findstr, replacestr, casesens, words,
60                              !backwards, all);
61 }