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 ***************************************************************************/
18 UrlDialog::UrlDialog(FormUrl *form, QWidget *parent, const char *name, bool, WFlags)
19 : QDialog(parent,name,false), form_(form)
25 url = new QLineEdit(this);
26 url->setMinimumSize(url->sizeHint());
28 urlname = new QLineEdit(this);
29 urlname->setMinimumSize(urlname->sizeHint());
31 labelurl = new QLabel(this);
32 labelurl->setText(_("Url :"));
33 labelurl->setMargin(5);
34 labelurl->setMinimumSize(labelurl->sizeHint());
35 labelurl->setMaximumSize(labelurl->sizeHint());
37 labelurlname = new QLabel(this);
38 labelurlname->setText(_("Name :"));
39 labelurlname->setMargin(5);
40 labelurlname->setMinimumSize(labelurlname->sizeHint());
41 labelurlname->setMaximumSize(labelurlname->sizeHint());
43 htmlurl = new QCheckBox(this);
44 htmlurl->setText(_("Generate hyperlink"));
45 htmlurl->setMinimumSize(htmlurl->sizeHint());
46 htmlurl->setMaximumSize(htmlurl->sizeHint());
48 buttonOk = new QPushButton(this);
49 buttonOk->setMinimumSize(buttonOk->sizeHint());
50 buttonOk->setMaximumSize(buttonOk->sizeHint());
51 buttonOk->setText(_("&OK"));
52 buttonOk->setDefault(true);
54 buttonCancel = new QPushButton(this);
55 buttonCancel->setMinimumSize(buttonCancel->sizeHint());
56 buttonCancel->setMaximumSize(buttonCancel->sizeHint());
57 buttonCancel->setText(_("&Cancel"));
61 QToolTip::add(labelurl,_("URL"));
62 QToolTip::add(url,_("URL"));
63 QToolTip::add(labelurlname,_("Name associated with the URL"));
64 QToolTip::add(urlname,_("Name associated with the URL"));
65 QToolTip::add(htmlurl,_("Output as a hyperlink ?"));
69 topLayout = new QHBoxLayout(this,10);
71 layout = new QVBoxLayout();
72 topLayout->addLayout(layout);
73 layout->addSpacing(10);
75 urlLayout = new QHBoxLayout();
76 layout->addLayout(urlLayout);
77 urlLayout->addWidget(labelurl, 0);
78 urlLayout->addWidget(url, 1);
80 urlnameLayout = new QHBoxLayout();
81 layout->addLayout(urlnameLayout);
82 urlnameLayout->addWidget(labelurlname, 0);
83 urlnameLayout->addWidget(urlname, 1);
85 htmlurlLayout = new QHBoxLayout();
86 layout->addStretch(1);
87 layout->addLayout(htmlurlLayout);
88 layout->addStretch(1);
89 htmlurlLayout->addWidget(htmlurl);
90 htmlurlLayout->addStretch(1);
92 buttonLayout = new QHBoxLayout();
93 layout->addLayout(buttonLayout);
94 buttonLayout->addStretch(1);
95 buttonLayout->addWidget(buttonOk, 1);
96 buttonLayout->addStretch(2);
97 buttonLayout->addWidget(buttonCancel, 1);
98 buttonLayout->addStretch(1);
102 connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply_adaptor()));
103 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close_adaptor()));
106 UrlDialog::~UrlDialog()
110 void UrlDialog::closeEvent(QCloseEvent *e)