3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
15 #include "QTocDialog.h"
17 #include "qt_helpers.h"
21 #include "controllers/ControlToc.h"
32 typedef QController<ControlToc, QView<QTocDialog> > base_class;
34 QToc::QToc(Dialog & parent)
35 : base_class(parent, _("Table of Contents"))
39 void QToc::build_dialog()
41 dialog_.reset(new QTocDialog(this));
43 // Manage the cancel/close button
44 bcview().setCancel(dialog_->closePB);
48 void QToc::update_contents()
50 dialog_->updateType();
55 void QToc::select(string const & text)
57 toc::Toc::const_iterator iter = toclist.begin();
59 for (; iter != toclist.end(); ++iter) {
60 if (iter->str == text)
64 if (iter == toclist.end()) {
65 lyxerr[Debug::GUI] << "Couldn't find highlighted TOC entry: "
70 controller().goTo(*iter);
73 } // namespace frontend