]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QErrorList.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QErrorList.C
1 /**
2  * \file QErrorList.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alfredo Braunstein
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "debug.h"
14 #include "qt_helpers.h"
15
16 #include "ControlErrorList.h"
17 #include "QErrorList.h"
18 #include "QErrorListDialog.h"
19 #include "Qt2BC.h"
20
21 #include <qlistbox.h>
22 #include <qtextbrowser.h>
23 #include <qpushbutton.h>
24
25 typedef QController<ControlErrorList, QView<QErrorListDialog> > base_class;
26
27 QErrorList::QErrorList(Dialog & parent)
28         : base_class(parent, "")
29 {}
30
31
32 void QErrorList::build_dialog()
33 {
34         dialog_.reset(new QErrorListDialog(this));
35         bcview().setCancel(dialog_->closePB);
36 }
37
38
39 void QErrorList::select(int item)
40 {
41         controller().goTo(item);
42         dialog_->descriptionTB->setText(toqstr(controller().errorList()[item].description));
43 }
44
45
46 void QErrorList::update_contents()
47 {
48         setTitle(controller().name());
49         dialog_->errorsLB->clear();
50         dialog_->descriptionTB->setText(QString());
51
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));
56         }
57
58         dialog_->errorsLB->setSelected(0, true);
59 }