2001-03-26 19:34:45 +00:00
|
|
|
/**
|
2001-08-19 13:25:15 +00:00
|
|
|
* \file QSearchDialog.C
|
2001-03-06 14:23:02 +00:00
|
|
|
* 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-08-19 13:25:15 +00:00
|
|
|
#include "QSearchDialog.h"
|
2001-03-06 14:23:02 +00:00
|
|
|
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <qcheckbox.h>
|
|
|
|
#include <qlabel.h>
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
QSearchDialog::QSearchDialog(QSearch * form, QWidget * parent, const char * name, bool modal, WFlags fl)
|
|
|
|
: QSearchDialogBase(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-08-19 13:25:15 +00:00
|
|
|
QSearchDialog::~QSearchDialog()
|
2001-03-06 14:23:02 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
void QSearchDialog::closeEvent(QCloseEvent * e)
|
2001-03-06 14:23:02 +00:00
|
|
|
{
|
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-08-19 13:25:15 +00:00
|
|
|
void QSearchDialog::setReadOnly(bool readonly)
|
2001-03-06 14:23:02 +00:00
|
|
|
{
|
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-08-19 13:25:15 +00:00
|
|
|
void QSearchDialog::Find()
|
2001-03-06 14:23:02 +00:00
|
|
|
{
|
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
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
void QSearchDialog::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);
|
|
|
|
}
|