4 * John Levon, moz@compsoc.man.ac.uk
7 /***************************************************************************
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
14 ***************************************************************************/
19 #include "dlg/helpers.h"
21 #ifdef CXX_WORKING_NAMESPACES
22 using kde_helpers::setSizeHint;
25 TocDialog::TocDialog(FormToc *form, QWidget *parent, const char *name, bool, WFlags)
26 : QWidget(parent,name,0), form_(form)
33 menu = new QComboBox(this);
34 menu->insertItem(_("Table of Contents"));
35 menu->insertItem(_("List of Figures"));
36 menu->insertItem(_("List of Tables"));
37 menu->insertItem(_("List of Algorithms"));
40 tree = new QListView(this);
41 tree->setMinimumHeight(200);
42 tree->setRootIsDecorated(true);
44 tree->addColumn("Table of Contents");
46 buttonUpdate = new QPushButton(this);
47 setSizeHint(buttonUpdate);
48 buttonUpdate->setMaximumSize(buttonUpdate->sizeHint());
49 buttonUpdate->setText(_("&Update"));
51 buttonClose = new QPushButton(this);
52 setSizeHint(buttonClose);
53 buttonClose->setMaximumSize(buttonClose->sizeHint());
54 buttonClose->setText(_("&Close"));
55 buttonClose->setDefault(true);
57 depth = new QSlider(0, 5, 1, 1, QSlider::Horizontal, this);
59 depth->setTickInterval(1);
60 depth->setTracking(true);
62 depthlabel = new QLabel(this);
63 depthlabel->setText(_("Depth"));
64 setSizeHint(depthlabel);
65 depthlabel->setMaximumSize(depthlabel->sizeHint());
69 topLayout = new QHBoxLayout(this,10);
71 layout = new QVBoxLayout();
72 topLayout->addLayout(layout);
73 layout->addSpacing(10);
75 layout->addWidget(menu,0);
76 layout->addWidget(tree,1);
77 layout->addWidget(depthlabel,0,AlignLeft);
78 layout->addWidget(depth,0);
80 buttonLayout = new QHBoxLayout();
82 layout->addLayout(buttonLayout);
83 buttonLayout->addStretch(1);
84 buttonLayout->addWidget(buttonUpdate, 1);
85 buttonLayout->addStretch(2);
86 buttonLayout->addWidget(buttonClose, 1);
87 buttonLayout->addStretch(1);
91 connect(tree, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(select_adaptor(QListViewItem *)));
92 connect(menu, SIGNAL(activated(int)), this, SLOT(activate_adaptor(int)));
93 connect(buttonUpdate, SIGNAL(clicked()), this, SLOT(update_adaptor()));
94 connect(buttonClose, SIGNAL(clicked()), this, SLOT(close_adaptor()));
95 connect(depth, SIGNAL(valueChanged(int)), this, SLOT(depth_adaptor(int)));
100 void TocDialog::closeEvent(QCloseEvent *e)
106 TocDialog::~TocDialog()