]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QSearchDialog.C
The big renaming. Yowser.
[lyx.git] / src / frontends / qt2 / QSearchDialog.C
1 /**
2  * \file QSearchDialog.C
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Edwin Leuven
7  */
8
9 #include <config.h>
10
11 #include "QSearchDialog.h"
12
13 #include <qpushbutton.h>
14 #include <qcombobox.h>
15 #include <qcheckbox.h>
16 #include <qlabel.h>
17
18 QSearchDialog::QSearchDialog(QSearch * form, QWidget * parent,  const char * name, bool modal, WFlags fl)
19         : QSearchDialogBase(parent, name, modal, fl),
20         form_(form)
21 {
22         setCaption(name);
23 }
24
25  
26 QSearchDialog::~QSearchDialog()
27 {
28 }
29
30
31 void QSearchDialog::closeEvent(QCloseEvent * e)
32 {
33         form_->close();
34         e->accept();
35 }
36
37
38 void QSearchDialog::setReadOnly(bool readonly)
39 {
40         replace->setEnabled(!readonly);
41         replaceLabel->setEnabled(!readonly);
42         replacePB->setEnabled(!readonly);
43         replaceAllPB->setEnabled(!readonly);
44 }
45
46
47 void QSearchDialog::Find()
48 {
49         form_->find(tostr(find->currentText()).c_str(),
50                          caseSensitive->isChecked(),
51                          matchWord->isChecked(),
52                          !searchBack->isChecked());
53 }
54
55
56 void QSearchDialog::Replace(bool replaceall)
57 {
58         form_->replace(tostr(find->currentText()).c_str(),
59                   tostr(replace->currentText()).c_str(),
60                   caseSensitive->isChecked(),
61                   matchWord->isChecked(),
62                   !searchBack->isChecked(),
63                   replaceall);
64 }