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 ***************************************************************************/
16 #include "formtocdialog.h"
18 FormTocDialog::FormTocDialog(FormToc *form, QWidget *parent, const char *name, bool, WFlags)
19 : QDialog(parent,name,false), form_(form)
26 menu = new QComboBox(this);
27 menu->insertItem(_("Table of Contents"));
28 menu->insertItem(_("List of Figures"));
29 menu->insertItem(_("List of Tables"));
30 menu->insertItem(_("List of Algorithms"));
31 menu->setMinimumSize(menu->sizeHint());
33 tree = new QListView(this);
34 tree->setMinimumHeight(200);
35 tree->setRootIsDecorated(true);
37 tree->addColumn("Table of Contents");
39 buttonUpdate = new QPushButton(this);
40 buttonUpdate->setMinimumSize(buttonUpdate->sizeHint());
41 buttonUpdate->setMaximumSize(buttonUpdate->sizeHint());
42 buttonUpdate->setText(_("&Update"));
44 buttonClose = new QPushButton(this);
45 buttonClose->setMinimumSize(buttonClose->sizeHint());
46 buttonClose->setMaximumSize(buttonClose->sizeHint());
47 buttonClose->setText(_("&Close"));
48 buttonClose->setDefault(true);
50 depth = new QSlider(0, 5, 1, 1, QSlider::Horizontal, this);
51 depth->setMinimumSize(depth->sizeHint());
52 depth->setTickInterval(1);
53 depth->setTracking(true);
55 depthlabel = new QLabel(this);
56 depthlabel->setText(_("Depth"));
57 depthlabel->setMinimumSize(depthlabel->sizeHint());
58 depthlabel->setMaximumSize(depthlabel->sizeHint());
62 topLayout = new QHBoxLayout(this,10);
64 layout = new QVBoxLayout();
65 topLayout->addLayout(layout);
66 layout->addSpacing(10);
68 layout->addWidget(menu,0);
69 layout->addWidget(tree,1);
70 layout->addWidget(depthlabel,0,AlignLeft);
71 layout->addWidget(depth,0);
73 buttonLayout = new QHBoxLayout();
75 layout->addLayout(buttonLayout);
76 buttonLayout->addStretch(1);
77 buttonLayout->addWidget(buttonUpdate, 1);
78 buttonLayout->addStretch(2);
79 buttonLayout->addWidget(buttonClose, 1);
80 buttonLayout->addStretch(1);
84 connect(tree, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(select_adaptor(QListViewItem *)));
85 connect(menu, SIGNAL(activated(int)), this, SLOT(activate_adaptor(int)));
86 connect(buttonUpdate, SIGNAL(clicked()), this, SLOT(update_adaptor()));
87 connect(buttonClose, SIGNAL(clicked()), this, SLOT(close_adaptor()));
88 connect(depth, SIGNAL(valueChanged(int)), this, SLOT(depth_adaptor(int)));
91 void FormTocDialog::closeEvent(QCloseEvent *e)
97 FormTocDialog::~FormTocDialog()