3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "QTocDialog.h"
15 #include "qt_helpers.h"
17 #include <qlistview.h>
18 #include <qpushbutton.h>
23 QTocDialog::QTocDialog(QToc * form)
24 : QTocDialogBase(0, 0, false, 0),
28 tocLV->setSorting(-1);
30 // hide the pointless QHeader
31 QWidget * w = static_cast<QWidget*>(tocLV->child("list view header"));
35 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
36 connect(moveupPB, SIGNAL(clicked()), this, SLOT(moveup_adaptor()));
37 connect(movednPB, SIGNAL(clicked()), this, SLOT(movedn_adaptor()));
38 connect(moveinPB, SIGNAL(clicked()), this, SLOT(movein_adaptor()));
39 connect(moveoutPB, SIGNAL(clicked()), this, SLOT(moveout_adaptor()));
43 QTocDialog::~QTocDialog()
48 void QTocDialog::activate_adaptor(int)
50 form_->updateToc(form_->depth_);
54 void QTocDialog::depth_adaptor(int depth)
56 form_->set_depth(depth);
60 void QTocDialog::select_adaptor(QListViewItem * item)
62 form_->select(fromqstr(item->text(0)));
66 void QTocDialog::enableButtons(bool enable)
68 updatePB->setEnabled(enable);
70 if (!form_->canOutline())
73 moveupPB->setEnabled(enable);
74 movednPB->setEnabled(enable);
75 moveinPB->setEnabled(enable);
76 moveoutPB->setEnabled(enable);
80 void QTocDialog::update_adaptor()
86 void QTocDialog::moveup_adaptor()
92 void QTocDialog::movedn_adaptor()
98 void QTocDialog::movein_adaptor()
104 void QTocDialog::moveout_adaptor()
110 void QTocDialog::closeEvent(QCloseEvent * e)
116 } // namespace frontend