2 * \file QSearchDialog.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
14 #pragma implementation
17 #include "ControlSearch.h"
18 #include "QSearchDialog.h"
22 #include <qpushbutton.h>
23 #include <qcombobox.h>
24 #include <qcheckbox.h>
25 #include <qlineedit.h>
29 QSearchDialog::QSearchDialog(QSearch * form)
30 : QSearchDialogBase(0, 0, false, 0),
33 connect(closePB, SIGNAL(clicked()),
34 form_, SLOT(slotClose()));
38 void QSearchDialog::show()
40 QSearchDialogBase::show();
42 findCO->lineEdit()->setSelection(0, findCO->lineEdit()->text().length());
46 void QSearchDialog::closeEvent(QCloseEvent * e)
53 void QSearchDialog::findChanged()
55 if (findCO->currentText().isEmpty()) {
56 findPB->setEnabled(false);
57 replacePB->setEnabled(false);
58 replaceallPB->setEnabled(false);
60 findPB->setEnabled(true);
61 replacePB->setEnabled(!form_->readOnly());
62 replaceallPB->setEnabled(!form_->readOnly());
67 void QSearchDialog::findClicked()
69 string const find(findCO->currentText().latin1());
73 backwardsCB->isChecked());
74 findCO->insertItem(findCO->currentText());
78 void QSearchDialog::replaceClicked()
80 string const find(findCO->currentText().latin1());
81 string const replace(replaceCO->currentText().latin1());
82 form_->replace(find, replace,
86 replaceCO->insertItem(replaceCO->currentText());
90 void QSearchDialog::replaceallClicked()
92 form_->replace(findCO->currentText().latin1(),
93 replaceCO->currentText().latin1(),