]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/formindexdialog.C
Applied John's KDE patch
[lyx.git] / src / frontends / kde / formindexdialog.C
1 /*
2  * formindexdialog.C
3  * (C) 2000 LyX Team
4  * John Levon, moz@compsoc.man.ac.uk
5  */
6
7 /***************************************************************************
8  *                                                                         *
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.                                   *
13  *                                                                         *
14  ***************************************************************************/
15
16 #include "formindexdialog.h"
17
18 FormIndexDialog::FormIndexDialog(FormIndex *form, QWidget *parent, const char *name, bool, WFlags)
19         : QDialog(parent,name,false), form_(form)
20 {
21         setCaption(name);
22
23         // widgets
24
25         index = new QLineEdit(this);
26         index->setMinimumSize(index->sizeHint());
27
28         labelindex = new QLabel(this);
29         labelindex->setText(_("Keyword :"));
30         labelindex->setMargin(5);
31         labelindex->setMinimumSize(labelindex->sizeHint());
32         labelindex->setMaximumSize(labelindex->sizeHint());
33
34         buttonOk = new QPushButton(this);
35         buttonOk->setMinimumSize(buttonOk->sizeHint());
36         buttonOk->setMaximumSize(buttonOk->sizeHint());
37         buttonOk->setText(_("&OK"));
38         buttonOk->setDefault(true);
39
40         buttonCancel = new QPushButton(this);
41         buttonCancel->setMinimumSize(buttonCancel->sizeHint());
42         buttonCancel->setMaximumSize(buttonCancel->sizeHint());
43         buttonCancel->setText(_("&Cancel"));
44
45         // tooltips
46
47         QToolTip::add(labelindex,_("Index entry"));
48         QToolTip::add(index,_("Index entry"));
49
50         // layouts
51
52         topLayout = new QHBoxLayout(this,10);
53
54         layout = new QVBoxLayout();
55         topLayout->addLayout(layout);
56         layout->addSpacing(10);
57
58         indexLayout = new QHBoxLayout();
59         layout->addLayout(indexLayout);
60         indexLayout->addWidget(labelindex, 0);
61         indexLayout->addWidget(index, 1);
62
63         layout->addStretch(1);
64
65         buttonLayout = new QHBoxLayout();
66
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);
73  
74         // connections
75
76         connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply_adaptor()));
77         connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close_adaptor()));
78 }
79
80 void FormIndexDialog::closeEvent(QCloseEvent *e)
81 {
82         form_->close();
83         e->accept();
84 }
85
86 FormIndexDialog::~FormIndexDialog()
87 {
88 }