2001-08-27 02:54:27 +00:00
|
|
|
/**
|
|
|
|
* \file QThesaurus.C
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-08-27 02:54:27 +00:00
|
|
|
*
|
2002-10-20 01:48:28 +00:00
|
|
|
* \author John Levon
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-08-27 02:54:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "QThesaurus.h"
|
2004-05-20 09:36:28 +00:00
|
|
|
#include "QThesaurusDialog.h"
|
2001-08-27 02:54:27 +00:00
|
|
|
#include "Qt2BC.h"
|
2002-12-17 20:37:13 +00:00
|
|
|
#include "qt_helpers.h"
|
2001-08-27 02:54:27 +00:00
|
|
|
|
2004-05-20 09:36:28 +00:00
|
|
|
#include "controllers/ControlThesaurus.h"
|
|
|
|
|
2001-08-27 02:54:27 +00:00
|
|
|
#include <qlineedit.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
typedef QController<ControlThesaurus, QView<QThesaurusDialog> > base_class;
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2003-03-26 12:17:20 +00:00
|
|
|
QThesaurus::QThesaurus(Dialog & parent)
|
2005-05-12 23:12:43 +00:00
|
|
|
: base_class(parent, _("Thesaurus"))
|
2001-08-27 02:54:27 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QThesaurus::build_dialog()
|
|
|
|
{
|
|
|
|
dialog_.reset(new QThesaurusDialog(this));
|
|
|
|
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().setCancel(dialog_->closePB);
|
|
|
|
bcview().setApply(dialog_->replacePB);
|
|
|
|
bcview().addReadOnly(dialog_->replaceED);
|
|
|
|
bcview().addReadOnly(dialog_->replacePB);
|
2001-08-27 02:54:27 +00:00
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 02:54:27 +00:00
|
|
|
void QThesaurus::update_contents()
|
|
|
|
{
|
2002-12-17 20:37:13 +00:00
|
|
|
dialog_->entryED->setText(toqstr(controller().text()));
|
2001-08-28 01:27:35 +00:00
|
|
|
dialog_->replaceED->setText("");
|
2002-03-21 21:21:28 +00:00
|
|
|
dialog_->updateLists();
|
2001-08-27 02:54:27 +00:00
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-27 02:54:27 +00:00
|
|
|
void QThesaurus::replace()
|
|
|
|
{
|
2002-12-17 20:37:13 +00:00
|
|
|
controller().replace(fromqstr(dialog_->replaceED->text()));
|
2001-08-27 02:54:27 +00:00
|
|
|
}
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|