2003-05-13 21:15:48 +00:00
|
|
|
/**
|
|
|
|
* \file QErrorList.C
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Alfredo Braunstein
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-05-13 21:15:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "QErrorList.h"
|
|
|
|
#include "QErrorListDialog.h"
|
|
|
|
#include "Qt2BC.h"
|
2004-05-20 09:36:28 +00:00
|
|
|
#include "qt_helpers.h"
|
|
|
|
|
|
|
|
#include "controllers/ControlErrorList.h"
|
2003-05-13 21:15:48 +00:00
|
|
|
|
|
|
|
#include <qlistbox.h>
|
|
|
|
#include <qtextbrowser.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2003-05-13 21:15:48 +00:00
|
|
|
typedef QController<ControlErrorList, QView<QErrorListDialog> > base_class;
|
|
|
|
|
|
|
|
QErrorList::QErrorList(Dialog & parent)
|
2003-05-20 16:51:31 +00:00
|
|
|
: base_class(parent, "")
|
2003-05-13 21:15:48 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
void QErrorList::build_dialog()
|
|
|
|
{
|
|
|
|
dialog_.reset(new QErrorListDialog(this));
|
|
|
|
bcview().setCancel(dialog_->closePB);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QErrorList::select(int item)
|
|
|
|
{
|
|
|
|
controller().goTo(item);
|
2003-05-20 16:51:31 +00:00
|
|
|
dialog_->descriptionTB->setText(toqstr(controller().errorList()[item].description));
|
2003-05-13 21:15:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QErrorList::update_contents()
|
|
|
|
{
|
2003-05-22 15:42:50 +00:00
|
|
|
setTitle(controller().name());
|
2003-05-13 21:15:48 +00:00
|
|
|
dialog_->errorsLB->clear();
|
2003-05-20 16:51:31 +00:00
|
|
|
dialog_->descriptionTB->setText(QString());
|
2003-05-13 21:15:48 +00:00
|
|
|
|
2003-05-20 16:51:31 +00:00
|
|
|
ErrorList::const_iterator it = controller().errorList().begin();
|
|
|
|
ErrorList::const_iterator end = controller().errorList().end();
|
2003-05-13 21:15:48 +00:00
|
|
|
for(; it != end; ++it) {
|
2003-05-20 16:51:31 +00:00
|
|
|
new QListBoxText(dialog_->errorsLB, toqstr(it->error));
|
2003-05-13 21:15:48 +00:00
|
|
|
}
|
|
|
|
|
2003-05-20 16:51:31 +00:00
|
|
|
dialog_->errorsLB->setSelected(0, true);
|
2003-05-13 21:15:48 +00:00
|
|
|
}
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|