]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QSearch.C
Lots and lots of little trivial bits.
[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 #include <fstream>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "LyXView.h"
19 #include "ControlSearch.h"
20 #include "gettext.h"
21
22 #include "QSearch.h"
23 #include "QSearchDialog.h"
24 #include "Qt2BC.h"
25
26 #include <qpushbutton.h>
27 #include <qcheckbox.h>
28 #include <qcombobox.h>
29
30 typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
31
32 QSearch::QSearch()
33         : base_class(_("Search"))
34 {
35 }
36
37
38 void QSearch::build_dialog()
39 {
40         dialog_.reset(new QSearchDialog(this));
41
42         bc().setCancel(dialog_->closePB);
43         bc().addReadOnly(dialog_->replaceCO);
44         bc().addReadOnly(dialog_->replacePB);
45         bc().addReadOnly(dialog_->replaceallPB);
46         bc().addReadOnly(dialog_->caseCB);
47         bc().addReadOnly(dialog_->wordsCB);
48         bc().addReadOnly(dialog_->backwardsCB);
49
50         dialog_->replacePB->setEnabled(false);
51         dialog_->replaceallPB->setEnabled(false);
52 }
53
54
55 void QSearch::find(string const & str, bool casesens, bool words, bool backwards)
56 {
57         controller().find(str, casesens, words, !backwards);
58 }
59
60
61 void QSearch::replace(string const & findstr, string const & replacestr,
62         bool casesens, bool words, bool all)
63 {
64         controller().replace(findstr, replacestr, casesens, words, all);
65 }