2001-03-26 19:34:45 +00:00
|
|
|
/**
|
2001-03-06 14:23:02 +00:00
|
|
|
* \file searchdlgimpl.h
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
* See the file COPYING.
|
2001-03-26 19:34:45 +00:00
|
|
|
*
|
2001-03-06 14:23:02 +00:00
|
|
|
* \author Edwin Leuven
|
|
|
|
*/
|
|
|
|
|
2001-03-26 19:34:45 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-03-06 14:23:02 +00:00
|
|
|
#include "searchdlgimpl.h"
|
|
|
|
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <qcheckbox.h>
|
|
|
|
#include <qlabel.h>
|
|
|
|
|
|
|
|
|
|
|
|
SearchDlgImpl::SearchDlgImpl(FormSearch* form, QWidget* parent, const char* name, bool modal, WFlags fl )
|
2001-06-05 17:05:51 +00:00
|
|
|
: SearchDlg( parent, name, modal, fl ), form_(form)
|
2001-03-06 14:23:02 +00:00
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
setCaption(name);
|
2001-03-06 14:23:02 +00:00
|
|
|
}
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2001-03-06 14:23:02 +00:00
|
|
|
SearchDlgImpl::~SearchDlgImpl()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2001-03-06 14:23:02 +00:00
|
|
|
void SearchDlgImpl::closeEvent(QCloseEvent * e)
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
form_->close();
|
|
|
|
e->accept();
|
2001-03-06 14:23:02 +00:00
|
|
|
}
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2001-03-06 14:23:02 +00:00
|
|
|
void SearchDlgImpl::setReadOnly(bool readonly)
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
replace->setEnabled(!readonly);
|
|
|
|
replaceLabel->setEnabled(!readonly);
|
|
|
|
replacePB->setEnabled(!readonly);
|
|
|
|
replaceAllPB->setEnabled(!readonly);
|
2001-03-06 14:23:02 +00:00
|
|
|
}
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2001-03-06 14:23:02 +00:00
|
|
|
void SearchDlgImpl::Find()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
form_->find(tostr(find->currentText()).c_str(),
|
|
|
|
caseSensitive->isChecked(),
|
|
|
|
matchWord->isChecked(),
|
|
|
|
!searchBack->isChecked());
|
2001-03-06 14:23:02 +00:00
|
|
|
}
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
|
|
|
void SearchDlgImpl::Replace(bool replaceall)
|
2001-03-06 14:23:02 +00:00
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
form_->replace(tostr(find->currentText()).c_str(),
|
2001-03-06 14:23:02 +00:00
|
|
|
tostr(replace->currentText()).c_str(),
|
|
|
|
caseSensitive->isChecked(),
|
|
|
|
matchWord->isChecked(),
|
|
|
|
!searchBack->isChecked(),
|
|
|
|
replaceall);
|
|
|
|
}
|