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>
28 QSearchDialog::QSearchDialog(QSearch * form)
29 : QSearchDialogBase(0, 0, false, 0),
32 connect(closePB, SIGNAL(clicked()),
33 form_, SLOT(slotClose()));
37 void QSearchDialog::show()
39 QSearchDialogBase::show();
41 findCO->lineEdit()->setSelection(0, findCO->lineEdit()->text().length());
45 void QSearchDialog::closeEvent(QCloseEvent * e)
52 void QSearchDialog::findChanged()
54 if (findCO->currentText().isEmpty()) {
55 findPB->setEnabled(false);
56 replacePB->setEnabled(false);
57 replaceallPB->setEnabled(false);
59 findPB->setEnabled(true);
60 replacePB->setEnabled(!form_->readOnly());
61 replaceallPB->setEnabled(!form_->readOnly());
66 void QSearchDialog::findClicked()
68 string const find(findCO->currentText().latin1());
72 backwardsCB->isChecked());
73 findCO->insertItem(findCO->currentText());
77 void QSearchDialog::replaceClicked()
79 string const find(findCO->currentText().latin1());
80 string const replace(replaceCO->currentText().latin1());
81 form_->replace(find, replace,
85 replaceCO->insertItem(replaceCO->currentText());
89 void QSearchDialog::replaceallClicked()
91 form_->replace(findCO->currentText().latin1(),
92 replaceCO->currentText().latin1(),