2 * \file QSearchDialog.C
3 * Copyright 2001 The LyX Team.
4 * See the file COPYING.
11 #include "ControlSearch.h"
12 #include "QSearchDialog.h"
15 #include <qpushbutton.h>
16 #include <qcombobox.h>
17 #include <qcheckbox.h>
18 #include <qlineedit.h>
21 QSearchDialog::QSearchDialog(QSearch * form)
22 : QSearchDialogBase(0, 0, false, 0),
25 connect(closePB, SIGNAL(clicked()),
26 form_, SLOT(slotClose()));
30 void QSearchDialog::show()
32 QSearchDialogBase::show();
34 findCO->lineEdit()->setSelection(0, findCO->lineEdit()->text().length());
38 void QSearchDialog::closeEvent(QCloseEvent * e)
45 void QSearchDialog::findChanged()
47 if (findCO->currentText().isEmpty()) {
48 findPB->setEnabled(false);
49 replacePB->setEnabled(false);
50 replaceallPB->setEnabled(false);
52 findPB->setEnabled(true);
53 replacePB->setEnabled(!form_->readOnly());
54 replaceallPB->setEnabled(!form_->readOnly());
59 void QSearchDialog::findClicked()
61 string const find(findCO->currentText().latin1());
65 backwardsCB->isChecked());
66 findCO->insertItem(findCO->currentText());
70 void QSearchDialog::replaceClicked()
72 string const find(findCO->currentText().latin1());
73 string const replace(replaceCO->currentText().latin1());
74 form_->replace(find, replace,
78 replaceCO->insertItem(replaceCO->currentText());
82 void QSearchDialog::replaceallClicked()
84 form_->replace(findCO->currentText().latin1(),
85 replaceCO->currentText().latin1(),