]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QSearch.C
ws change
[lyx.git] / src / frontends / qt2 / QSearch.C
1 /**
2  * \file QSearch.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 #include <config.h>
10 #include <fstream>
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include <qpushbutton.h>
17 #include <qcheckbox.h>
18 #include <qcombobox.h>
19
20 #include "QSearchDialog.h"
21 #include "QSearch.h"
22 #include "Qt2BC.h"
23 #include "gettext.h"
24
25 #include "QtLyXView.h"
26 #include "ControlSearch.h"
27
28 typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
29
30 QSearch::QSearch(ControlSearch & c)
31         : base_class(c, _("Search"))
32 {
33 }
34
35
36 void QSearch::build_dialog()
37 {
38         dialog_.reset(new QSearchDialog(this));
39
40         bc().setCancel(dialog_->closePB);
41         bc().addReadOnly(dialog_->replaceCO);
42         bc().addReadOnly(dialog_->replacePB);
43         bc().addReadOnly(dialog_->replaceallPB);
44         bc().addReadOnly(dialog_->caseCB);
45         bc().addReadOnly(dialog_->wordsCB);
46         bc().addReadOnly(dialog_->backwardsCB);
47
48         dialog_->replacePB->setEnabled(false);
49         dialog_->replaceallPB->setEnabled(false);
50 }
51
52
53 void QSearch::find(string const & str, bool casesens, bool words, bool backwards)
54 {
55         controller().find(str, casesens, words, !backwards);
56 }
57
58
59 void QSearch::replace(string const & findstr, string const & replacestr,
60         bool casesens, bool words, bool all)
61 {
62         controller().replace(findstr, replacestr, casesens, words, all);
63 }