]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/searchdlgimpl.C
Add an updateParagraph signal, take the opportunity to make a couple of
[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  
26 SearchDlgImpl::~SearchDlgImpl()
27 {
28 }
29
30
31 void SearchDlgImpl::closeEvent(QCloseEvent * e)
32 {
33         form_->close();
34         e->accept();
35 }
36
37
38 void SearchDlgImpl::setReadOnly(bool readonly)
39 {
40         replace->setEnabled(!readonly);
41         replaceLabel->setEnabled(!readonly);
42         replacePB->setEnabled(!readonly);
43         replaceAllPB->setEnabled(!readonly);
44 }
45
46
47 void SearchDlgImpl::Find()
48 {
49         form_->find(tostr(find->currentText()).c_str(),
50                          caseSensitive->isChecked(),
51                          matchWord->isChecked(),
52                          !searchBack->isChecked());
53 }
54
55
56 void SearchDlgImpl::Replace(bool replaceall)
57 {
58         form_->replace(tostr(find->currentText()).c_str(),
59                   tostr(replace->currentText()).c_str(),
60                   caseSensitive->isChecked(),
61                   matchWord->isChecked(),
62                   !searchBack->isChecked(),
63                   replaceall);
64 }