]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/searchdlgimpl.C
Fixed connections. There is still a bug somewhere.
[lyx.git] / src / frontends / qt2 / searchdlgimpl.C
1 /**
2  * \file searchdlgimpl.h
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 "searchdlgimpl.h"
12
13 #include <qpushbutton.h>
14 #include <qcombobox.h>
15 #include <qcheckbox.h>
16 #include <qlabel.h>
17
18
19 SearchDlgImpl::SearchDlgImpl(FormSearch* form, QWidget* parent,  const char* name, bool modal, WFlags fl )
20     : SearchDlg( parent, name, modal, fl ), form_(form)
21 {
22    setCaption(name);
23 }
24
25 SearchDlgImpl::~SearchDlgImpl()
26 {
27 }
28
29 void SearchDlgImpl::closeEvent(QCloseEvent * e)
30 {
31    form_->close();
32    e->accept();
33 }
34
35 void SearchDlgImpl::setReadOnly(bool readonly)
36 {
37    replace->setEnabled(!readonly);
38    replaceLabel->setEnabled(!readonly);
39    replacePB->setEnabled(!readonly);
40    replaceAllPB->setEnabled(!readonly);
41 }
42
43 void SearchDlgImpl::Find()
44 {
45    form_->find(tostr(find->currentText()).c_str(),
46                caseSensitive->isChecked(),
47                matchWord->isChecked(),
48                !searchBack->isChecked());
49 }
50
51 void SearchDlgImpl::Replace(bool replaceall = false)
52 {
53    form_->replace(tostr(find->currentText()).c_str(),
54                   tostr(replace->currentText()).c_str(),
55                   caseSensitive->isChecked(),
56                   matchWord->isChecked(),
57                   !searchBack->isChecked(),
58                   replaceall);
59 }
60
61