]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QTocDialog.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QTocDialog.C
1 /**
2  * \file QTocDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13
14 #include "QToc.h"
15 #include "QTocDialog.h"
16 #include "qt_helpers.h"
17
18 #include <qlistview.h>
19 #include <qpushbutton.h>
20
21
22 QTocDialog::QTocDialog(QToc * form)
23         : QTocDialogBase(0, 0, false, 0),
24         form_(form)
25 {
26         // disable sorting
27         tocLV->setSorting(-1);
28
29         // hide the pointless QHeader
30         QWidget * w = static_cast<QWidget*>(tocLV->child("list view header"));
31         if (w)
32                 w->hide();
33
34         connect(closePB, SIGNAL(clicked()),
35                 form, SLOT(slotClose()));
36 }
37
38
39 QTocDialog::~QTocDialog()
40 {
41 }
42
43
44 void QTocDialog::activate_adaptor(int)
45 {
46         form_->updateToc(form_->depth_);
47 }
48
49
50 void QTocDialog::depth_adaptor(int depth)
51 {
52         form_->set_depth(depth);
53 }
54
55
56 void QTocDialog::select_adaptor(QListViewItem * item)
57 {
58         form_->select(fromqstr(item->text(0)));
59 }
60
61
62 void QTocDialog::update_adaptor()
63 {
64         form_->update();
65 }
66
67
68 void QTocDialog::closeEvent(QCloseEvent * e)
69 {
70         form_->slotWMHide();
71         e->accept();
72 }