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 "errorlist.h"
15 #include "qt_helpers.h"
16 #include "support/lstrings.h"
19 #include "ControlErrorList.h"
20 #include "QErrorList.h"
21 #include "QErrorListDialog.h"
25 #include <qtextbrowser.h>
26 #include <qpushbutton.h>
28 typedef QController<ControlErrorList, QView<QErrorListDialog> > base_class;
30 QErrorList::QErrorList(Dialog & parent)
31 : base_class(parent, "")
35 void QErrorList::build_dialog()
37 dialog_.reset(new QErrorListDialog(this));
38 bcview().setCancel(dialog_->closePB);
42 void QErrorList::select(int item)
44 controller().goTo(item);
45 dialog_->descriptionTB->setText(toqstr(controller().errorList()[item].description));
49 void QErrorList::update_contents()
51 setTitle(controller().name());
52 dialog_->errorsLB->clear();
53 dialog_->descriptionTB->setText(QString());
55 ErrorList::const_iterator it = controller().errorList().begin();
56 ErrorList::const_iterator end = controller().errorList().end();
57 for(; it != end; ++it) {
58 new QListBoxText(dialog_->errorsLB, toqstr(it->error));
61 dialog_->errorsLB->setSelected(0, true);