3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alfredo Braunstein
8 * Full author contact details are available in file CREDITS.
14 #include "qt_helpers.h"
16 #include "ControlErrorList.h"
17 #include "QErrorList.h"
18 #include "QErrorListDialog.h"
22 #include <qtextbrowser.h>
23 #include <qpushbutton.h>
25 typedef QController<ControlErrorList, QView<QErrorListDialog> > base_class;
27 QErrorList::QErrorList(Dialog & parent)
28 : base_class(parent, "")
32 void QErrorList::build_dialog()
34 dialog_.reset(new QErrorListDialog(this));
35 bcview().setCancel(dialog_->closePB);
39 void QErrorList::select(int item)
41 controller().goTo(item);
42 dialog_->descriptionTB->setText(toqstr(controller().errorList()[item].description));
46 void QErrorList::update_contents()
48 setTitle(controller().name());
49 dialog_->errorsLB->clear();
50 dialog_->descriptionTB->setText(QString());
52 ErrorList::const_iterator it = controller().errorList().begin();
53 ErrorList::const_iterator end = controller().errorList().end();
54 for(; it != end; ++it) {
55 new QListBoxText(dialog_->errorsLB, toqstr(it->error));
58 dialog_->errorsLB->setSelected(0, true);