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 "formindexdialog.h"
18 FormIndexDialog::FormIndexDialog(FormIndex *form, QWidget *parent, const char *name, bool, WFlags)
19 : QDialog(parent,name,false), form_(form)
25 index = new QLineEdit(this);
26 index->setMinimumSize(index->sizeHint());
28 labelindex = new QLabel(this);
29 labelindex->setText(_("Keyword :"));
30 labelindex->setMargin(5);
31 labelindex->setMinimumSize(labelindex->sizeHint());
32 labelindex->setMaximumSize(labelindex->sizeHint());
34 buttonOk = new QPushButton(this);
35 buttonOk->setMinimumSize(buttonOk->sizeHint());
36 buttonOk->setMaximumSize(buttonOk->sizeHint());
37 buttonOk->setText(_("&OK"));
38 buttonOk->setDefault(true);
40 buttonCancel = new QPushButton(this);
41 buttonCancel->setMinimumSize(buttonCancel->sizeHint());
42 buttonCancel->setMaximumSize(buttonCancel->sizeHint());
43 buttonCancel->setText(_("&Cancel"));
47 QToolTip::add(labelindex,_("Index entry"));
48 QToolTip::add(index,_("Index entry"));
52 topLayout = new QHBoxLayout(this,10);
54 layout = new QVBoxLayout();
55 topLayout->addLayout(layout);
56 layout->addSpacing(10);
58 indexLayout = new QHBoxLayout();
59 layout->addLayout(indexLayout);
60 indexLayout->addWidget(labelindex, 0);
61 indexLayout->addWidget(index, 1);
63 layout->addStretch(1);
65 buttonLayout = new QHBoxLayout();
67 layout->addLayout(buttonLayout);
68 buttonLayout->addStretch(1);
69 buttonLayout->addWidget(buttonOk, 1);
70 buttonLayout->addStretch(2);
71 buttonLayout->addWidget(buttonCancel, 1);
72 buttonLayout->addStretch(1);
76 connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply_adaptor()));
77 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close_adaptor()));
80 void FormIndexDialog::closeEvent(QCloseEvent *e)
86 FormIndexDialog::~FormIndexDialog()