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>
20 QSearchDialog::QSearchDialog(QSearch * form)
21 : QSearchDialogBase(0, 0, false, 0),
24 connect(closePB, SIGNAL(clicked()),
25 form_, SLOT(slotClose()));
26 findCO->setDuplicatesEnabled(false);
27 findCO->setInsertionPolicy(QComboBox::AtTop);
28 replaceCO->setDuplicatesEnabled(false);
29 replaceCO->setInsertionPolicy(QComboBox::AtTop);
33 void QSearchDialog::closeEvent(QCloseEvent * e)
40 void QSearchDialog::findChanged()
42 if (findCO->currentText().isEmpty()) {
43 findPB->setEnabled(false);
44 replacePB->setEnabled(false);
45 replaceallPB->setEnabled(false);
47 findPB->setEnabled(true);
48 replacePB->setEnabled(!form_->readOnly());
49 replaceallPB->setEnabled(!form_->readOnly());
54 void QSearchDialog::findClicked()
56 string const find(findCO->currentText().latin1());
60 backwardsCB->isChecked());
61 findCO->insertItem(findCO->currentText());
65 void QSearchDialog::replaceClicked()
67 string const find(findCO->currentText().latin1());
68 string const replace(replaceCO->currentText().latin1());
69 form_->replace(find, replace,
73 replaceCO->insertItem(replaceCO->currentText());
77 void QSearchDialog::replaceallClicked()
79 form_->replace(findCO->currentText().latin1(),
80 replaceCO->currentText().latin1(),